From f6eaf212aa58dc5af66c91702644f9d65cda56b1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 6 Mar 2023 09:26:41 +0000 Subject: [PATCH] CodeGen from PR 22673 in Azure/azure-rest-api-specs Merge c28b302b55c9f66ddad969b59ad5506804ac992e into 637605c07dabaefda3b1b23dda48ef0682eb1ad3 --- sdk/resourcemanager/sql/armsql/CHANGELOG.md | 398 + ...erated_agent_client.go => agent_client.go} | 33 +- sdk/resourcemanager/sql/armsql/autorest.md | 6 +- ...ackupshorttermretentionpolicies_client.go} | 92 +- ...ities_client.go => capabilities_client.go} | 18 +- ...zz_generated_constants.go => constants.go} | 721 +- ...dvancedthreatprotectionsettings_client.go} | 65 +- ...s_client.go => databaseadvisors_client.go} | 60 +- ...t.go => databaseautomatictuning_client.go} | 43 +- ...=> databaseblobauditingpolicies_client.go} | 61 +- ...ns_client.go => databasecolumns_client.go} | 68 +- .../databaseencryptionprotectors_client.go | 210 + ...client.go => databaseextensions_client.go} | 66 +- ...client.go => databaseoperations_client.go} | 44 +- ...o => databaserecommendedactions_client.go} | 70 +- ...atabases_client.go => databases_client.go} | 421 +- ...as_client.go => databaseschemas_client.go} | 42 +- ...> databasesecurityalertpolicies_client.go} | 65 +- ...vulnerabilityassessmentbaselines_client.go | 284 + ...lnerabilityassessmentexecutescan_client.go | 131 + ...erabilityassessmentrulebaselines_client.go | 366 + ...ulnerabilityassessmentscanresult_client.go | 221 + ...esqlvulnerabilityassessmentscans_client.go | 211 + ...vulnerabilityassessmentssettings_client.go | 201 + ...les_client.go => databasetables_client.go} | 46 +- ...ges_client.go => databaseusages_client.go} | 25 +- ...rabilityassessmentrulebaselines_client.go} | 84 +- ...atabasevulnerabilityassessments_client.go} | 84 +- ...asevulnerabilityassessmentscans_client.go} | 93 +- ...lient.go => datamaskingpolicies_client.go} | 87 +- ...s_client.go => datamaskingrules_client.go} | 94 +- ... => datawarehouseuseractivities_client.go} | 44 +- ...ers_client.go => deletedservers_client.go} | 54 +- ...> distributedavailabilitygroups_client.go} | 176 +- ...ent.go => elasticpooloperations_client.go} | 40 +- ...pools_client.go => elasticpools_client.go} | 276 +- ...ient.go => encryptionprotectors_client.go} | 82 +- ...ient.go => endpointcertificates_client.go} | 40 +- ...deddatabaseblobauditingpolicies_client.go} | 61 +- ...endedserverblobauditingpolicies_client.go} | 58 +- ...ups_client.go => failovergroups_client.go} | 218 +- ...ules_client.go => firewallrules_client.go} | 85 +- ..._client.go => geobackuppolicies_client.go} | 131 +- sdk/resourcemanager/sql/armsql/go.mod | 16 +- sdk/resourcemanager/sql/armsql/go.sum | 24 +- ...nt.go => instancefailovergroups_client.go} | 122 +- ...ools_client.go => instancepools_client.go} | 100 +- ..._client.go => ipv6firewallrules_client.go} | 74 +- ...obagents_client.go => jobagents_client.go} | 97 +- ...als_client.go => jobcredentials_client.go} | 80 +- ...ions_client.go => jobexecutions_client.go} | 136 +- ...enerated_jobs_client.go => jobs_client.go} | 76 +- ..._client.go => jobstepexecutions_client.go} | 54 +- ..._jobsteps_client.go => jobsteps_client.go} | 126 +- ...lient.go => jobtargetexecutions_client.go} | 84 +- ...ps_client.go => jobtargetgroups_client.go} | 80 +- ...rsions_client.go => jobversions_client.go} | 45 +- ...lient.go => ledgerdigestuploads_client.go} | 80 +- ....go => longtermretentionbackups_client.go} | 281 +- ...retentionmanagedinstancebackups_client.go} | 185 +- ...go => longtermretentionpolicies_client.go} | 68 +- ....go => maintenancewindowoptions_client.go} | 26 +- ...client.go => maintenancewindows_client.go} | 43 +- ...ackupshorttermretentionpolicies_client.go} | 92 +- ...advancedthreatprotectionsettings_client.go | 271 + ...nt.go => manageddatabasecolumns_client.go} | 70 +- .../manageddatabasemoveoperations_client.go | 192 + ...nt.go => manageddatabasequeries_client.go} | 42 +- ...aserecommendedsensitivitylabels_client.go} | 24 +- ...> manageddatabaserestoredetails_client.go} | 26 +- ...s_client.go => manageddatabases_client.go} | 353 +- ...nt.go => manageddatabaseschemas_client.go} | 44 +- ...eddatabasesecurityalertpolicies_client.go} | 65 +- ...> manageddatabasesecurityevents_client.go} | 29 +- ...anageddatabasesensitivitylabels_client.go} | 258 +- ...ent.go => manageddatabasetables_client.go} | 48 +- ...tabasetransparentdataencryption_client.go} | 65 +- ...rabilityassessmentrulebaselines_client.go} | 84 +- ...atabasevulnerabilityassessments_client.go} | 84 +- ...asevulnerabilityassessmentscans_client.go} | 93 +- ...> managedinstanceadministrators_client.go} | 76 +- ...advancedthreatprotectionsettings_client.go | 263 + ...tanceazureadonlyauthentications_client.go} | 82 +- .../sql/armsql/managedinstancedtcs_client.go | 262 + ...gedinstanceencryptionprotectors_client.go} | 82 +- ...lient.go => managedinstancekeys_client.go} | 80 +- ...stancelongtermretentionpolicies_client.go} | 144 +- ...go => managedinstanceoperations_client.go} | 53 +- ...tanceprivateendpointconnections_client.go} | 76 +- ...gedinstanceprivatelinkresources_client.go} | 40 +- ...s_client.go => managedinstances_client.go} | 357 +- ... managedinstancetdecertificates_client.go} | 27 +- ...nstancevulnerabilityassessments_client.go} | 76 +- .../managedledgerdigestuploads_client.go | 352 + ...ackupshorttermretentionpolicies_client.go} | 88 +- .../armsql/managedserverdnsaliases_client.go | 399 + ...agedserversecurityalertpolicies_client.go} | 72 +- .../{zz_generated_models.go => models.go} | 2641 +- .../sql/armsql/models_serde.go | 20365 ++++++++++++++++ ...rations_client.go => operations_client.go} | 13 +- ...ent.go => outboundfirewallrules_client.go} | 86 +- ...o => privateendpointconnections_client.go} | 76 +- ...ient.go => privatelinkresources_client.go} | 40 +- ...=> recommendedsensitivitylabels_client.go} | 24 +- ...ient.go => recoverabledatabases_client.go} | 76 +- ... => recoverablemanageddatabases_client.go} | 38 +- ...s_client.go => replicationlinks_client.go} | 148 +- ...ed_response_types.go => response_types.go} | 937 +- ...o => restorabledroppeddatabases_client.go} | 44 +- ...storabledroppedmanageddatabases_client.go} | 38 +- ...ints_client.go => restorepoints_client.go} | 81 +- ..._client.go => sensitivitylabels_client.go} | 256 +- ...dvancedthreatprotectionsettings_client.go} | 62 +- ...ors_client.go => serveradvisors_client.go} | 54 +- ...ent.go => serverautomatictuning_client.go} | 39 +- ... => serverazureadadministrators_client.go} | 82 +- ...erverazureadonlyauthentications_client.go} | 82 +- ...o => serverblobauditingpolicies_client.go} | 58 +- .../serverconfigurationoptions_client.go | 263 + ....go => serverconnectionpolicies_client.go} | 62 +- ...go => serverdevopsauditsettings_client.go} | 74 +- ...s_client.go => serverdnsaliases_client.go} | 98 +- ...verkeys_client.go => serverkeys_client.go} | 83 +- ...s_client.go => serveroperations_client.go} | 23 +- ...ed_servers_client.go => servers_client.go} | 195 +- ... => serversecurityalertpolicies_client.go} | 72 +- ...t.go => servertrustcertificates_client.go} | 82 +- ..._client.go => servertrustgroups_client.go} | 96 +- ...sages_client.go => serverusages_client.go} | 43 +- ... servervulnerabilityassessments_client.go} | 76 +- ...tartstopmanagedinstanceschedules_client.go | 310 + ...client.go => subscriptionusages_client.go} | 30 +- .../armsql/synapselinkworkspaces_client.go | 132 + ...cagents_client.go => syncagents_client.go} | 110 +- ...cgroups_client.go => syncgroups_client.go} | 220 +- ...embers_client.go => syncmembers_client.go} | 164 +- ...es_client.go => tdecertificates_client.go} | 27 +- ...erated_time_rfc3339.go => time_rfc3339.go} | 3 +- ...imezones_client.go => timezones_client.go} | 24 +- ...o => transparentdataencryptions_client.go} | 104 +- ...ated_usages_client.go => usages_client.go} | 23 +- ...rs_client.go => virtualclusters_client.go} | 139 +- ...lient.go => virtualnetworkrules_client.go} | 80 +- .../vulnerabilityassessmentbaseline_client.go | 202 + ...vulnerabilityassessmentbaselines_client.go | 126 + ...lnerabilityassessmentexecutescan_client.go | 127 + ...nerabilityassessmentrulebaseline_client.go | 286 + ...erabilityassessmentrulebaselines_client.go | 120 + .../armsql/vulnerabilityassessments_client.go | 110 + ...ulnerabilityassessmentscanresult_client.go | 213 + .../vulnerabilityassessmentscans_client.go | 202 + ...vulnerabilityassessmentssettings_client.go | 256 + ...lient.go => workloadclassifiers_client.go} | 96 +- ...ups_client.go => workloadgroups_client.go} | 88 +- ...pshorttermretentionpolicies_client_test.go | 137 - ...erated_example_capabilities_client_test.go | 38 - ...cedthreatprotectionsettings_client_test.go | 98 - ...ed_example_databaseadvisors_client_test.go | 94 - ...ple_databaseautomatictuning_client_test.go | 80 - ...atabaseblobauditingpolicies_client_test.go | 97 - ...ted_example_databasecolumns_client_test.go | 111 - ..._example_databaseextensions_client_test.go | 103 - ..._example_databaseoperations_client_test.go | 66 - ..._databaserecommendedactions_client_test.go | 99 - ...generated_example_databases_client_test.go | 476 - ...ted_example_databaseschemas_client_test.go | 68 - ...tabasesecurityalertpolicies_client_test.go | 108 - ...ated_example_databasetables_client_test.go | 70 - ...ated_example_databaseusages_client_test.go | 44 - ...lityassessmentrulebaselines_client_test.go | 115 - ...asevulnerabilityassessments_client_test.go | 129 - ...ulnerabilityassessmentscans_client_test.go | 122 - ...example_datamaskingpolicies_client_test.go | 70 - ...ed_example_datamaskingrules_client_test.go | 79 - ...datawarehouseuseractivities_client_test.go | 68 - ...ated_example_deletedservers_client_test.go | 114 - ...stributedavailabilitygroups_client_test.go | 159 - ...ample_elasticpoolactivities_client_test.go | 44 - ...asticpooldatabaseactivities_client_test.go | 44 - ...ample_elasticpooloperations_client_test.go | 66 - ...erated_example_elasticpools_client_test.go | 240 - ...xample_encryptionprotectors_client_test.go | 126 - ...xample_endpointcertificates_client_test.go | 66 - ...atabaseblobauditingpolicies_client_test.go | 97 - ...dserverblobauditingpolicies_client_test.go | 109 - ...ated_example_failovergroups_client_test.go | 228 - ...rated_example_firewallrules_client_test.go | 149 - ...d_example_geobackuppolicies_client_test.go | 98 - ...mple_instancefailovergroups_client_test.go | 193 - ...rated_example_instancepools_client_test.go | 186 - ...d_example_ipv6firewallrules_client_test.go | 117 - ...generated_example_jobagents_client_test.go | 157 - ...ated_example_jobcredentials_client_test.go | 121 - ...rated_example_jobexecutions_client_test.go | 194 - .../ze_generated_example_jobs_client_test.go | 129 - ...d_example_jobstepexecutions_client_test.go | 79 - ..._generated_example_jobsteps_client_test.go | 203 - ...example_jobtargetexecutions_client_test.go | 117 - ...ted_example_jobtargetgroups_client_test.go | 146 - ...nerated_example_jobversions_client_test.go | 70 - ...example_ledgerdigestuploads_client_test.go | 130 - ...le_longtermretentionbackups_client_test.go | 429 - ...ntionmanagedinstancebackups_client_test.go | 290 - ...e_longtermretentionpolicies_client_test.go | 105 - ...le_maintenancewindowoptions_client_test.go | 41 - ..._example_maintenancewindows_client_test.go | 74 - ...pshorttermretentionpolicies_client_test.go | 135 - ...mple_manageddatabasecolumns_client_test.go | 111 - ...mple_manageddatabasequeries_client_test.go | 72 - ...ecommendedsensitivitylabels_client_test.go | 66 - ...nageddatabaserestoredetails_client_test.go | 41 - ...ed_example_manageddatabases_client_test.go | 216 - ...mple_manageddatabaseschemas_client_test.go | 68 - ...tabasesecurityalertpolicies_client_test.go | 108 - ...nageddatabasesecurityevents_client_test.go | 49 - ...eddatabasesensitivitylabels_client_test.go | 276 - ...ample_manageddatabasetables_client_test.go | 70 - ...setransparentdataencryption_client_test.go | 98 - ...lityassessmentrulebaselines_client_test.go | 115 - ...asevulnerabilityassessments_client_test.go | 128 - ...ulnerabilityassessmentscans_client_test.go | 122 - ...nagedinstanceadministrators_client_test.go | 127 - ...eazureadonlyauthentications_client_test.go | 124 - ...nstanceencryptionprotectors_client_test.go | 126 - ...example_managedinstancekeys_client_test.go | 125 - ...celongtermretentionpolicies_client_test.go | 105 - ...e_managedinstanceoperations_client_test.go | 87 - ...eprivateendpointconnections_client_test.go | 127 - ...nstanceprivatelinkresources_client_test.go | 66 - ...ed_example_managedinstances_client_test.go | 290 - ...agedinstancetdecertificates_client_test.go | 47 - ...ncevulnerabilityassessments_client_test.go | 125 - ...pshorttermretentionpolicies_client_test.go | 135 - ...serversecurityalertpolicies_client_test.go | 108 - ...ample_outboundfirewallrules_client_test.go | 119 - ..._privateendpointconnections_client_test.go | 127 - ...xample_privatelinkresources_client_test.go | 66 - ...ecommendedsensitivitylabels_client_test.go | 66 - ...xample_recoverabledatabases_client_test.go | 66 - ...recoverablemanageddatabases_client_test.go | 66 - ...ed_example_replicationlinks_client_test.go | 172 - ..._restorabledroppeddatabases_client_test.go | 66 - ...abledroppedmanageddatabases_client_test.go | 66 - ...rated_example_restorepoints_client_test.go | 121 - ...d_example_sensitivitylabels_client_test.go | 278 - ...cedthreatprotectionsettings_client_test.go | 99 - ...ated_example_serveradvisors_client_test.go | 91 - ...ample_serverautomatictuning_client_test.go | 78 - ...serverazureadadministrators_client_test.go | 127 - ...razureadonlyauthentications_client_test.go | 124 - ..._serverblobauditingpolicies_client_test.go | 108 - ...le_servercommunicationlinks_client_test.go | 118 - ...le_serverconnectionpolicies_client_test.go | 99 - ...e_serverdevopsauditsettings_client_test.go | 103 - ...ed_example_serverdnsaliases_client_test.go | 149 - ...enerated_example_serverkeys_client_test.go | 125 - ...ed_example_serveroperations_client_test.go | 43 - ...e_generated_example_servers_client_test.go | 252 - ...serversecurityalertpolicies_client_test.go | 108 - ...ple_servertrustcertificates_client_test.go | 124 - ...d_example_servertrustgroups_client_test.go | 159 - ...erated_example_serverusages_client_test.go | 43 - ...vervulnerabilityassessments_client_test.go | 125 - ...d_example_serviceobjectives_client_test.go | 66 - ..._generated_example_sqlagent_client_test.go | 67 - ..._example_subscriptionusages_client_test.go | 64 - ...enerated_example_syncagents_client_test.go | 174 - ...enerated_example_syncgroups_client_test.go | 299 - ...nerated_example_syncmembers_client_test.go | 234 - ...ted_example_tdecertificates_client_test.go | 47 - ...generated_example_timezones_client_test.go | 64 - ..._transparentdataencryptions_client_test.go | 98 - ...ze_generated_example_usages_client_test.go | 44 - ...ted_example_virtualclusters_client_test.go | 144 - ...example_virtualnetworkrules_client_test.go | 125 - ...example_workloadclassifiers_client_test.go | 137 - ...ated_example_workloadgroups_client_test.go | 133 - ..._generated_elasticpoolactivities_client.go | 125 - ...ed_elasticpooldatabaseactivities_client.go | 125 - .../sql/armsql/zz_generated_models_serde.go | 3330 --- ...nerated_servercommunicationlinks_client.go | 306 - .../zz_generated_serviceobjectives_client.go | 182 - 282 files changed, 35441 insertions(+), 24911 deletions(-) rename sdk/resourcemanager/sql/armsql/{zz_generated_agent_client.go => agent_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_backupshorttermretentionpolicies_client.go => backupshorttermretentionpolicies_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_capabilities_client.go => capabilities_client.go} (87%) rename sdk/resourcemanager/sql/armsql/{zz_generated_constants.go => constants.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databaseadvancedthreatprotectionsettings_client.go => databaseadvancedthreatprotectionsettings_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databaseadvisors_client.go => databaseadvisors_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databaseautomatictuning_client.go => databaseautomatictuning_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databaseblobauditingpolicies_client.go => databaseblobauditingpolicies_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databasecolumns_client.go => databasecolumns_client.go} (86%) create mode 100644 sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client.go rename sdk/resourcemanager/sql/armsql/{zz_generated_databaseextensions_client.go => databaseextensions_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databaseoperations_client.go => databaseoperations_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databaserecommendedactions_client.go => databaserecommendedactions_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databases_client.go => databases_client.go} (73%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databaseschemas_client.go => databaseschemas_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databasesecurityalertpolicies_client.go => databasesecurityalertpolicies_client.go} (84%) create mode 100644 sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client.go create mode 100644 sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client.go create mode 100644 sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client.go create mode 100644 sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client.go create mode 100644 sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client.go create mode 100644 sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client.go rename sdk/resourcemanager/sql/armsql/{zz_generated_databasetables_client.go => databasetables_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databaseusages_client.go => databaseusages_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databasevulnerabilityassessmentrulebaselines_client.go => databasevulnerabilityassessmentrulebaselines_client.go} (81%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databasevulnerabilityassessments_client.go => databasevulnerabilityassessments_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_databasevulnerabilityassessmentscans_client.go => databasevulnerabilityassessmentscans_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_datamaskingpolicies_client.go => datamaskingpolicies_client.go} (71%) rename sdk/resourcemanager/sql/armsql/{zz_generated_datamaskingrules_client.go => datamaskingrules_client.go} (70%) rename sdk/resourcemanager/sql/armsql/{zz_generated_datawarehouseuseractivities_client.go => datawarehouseuseractivities_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_deletedservers_client.go => deletedservers_client.go} (87%) rename sdk/resourcemanager/sql/armsql/{zz_generated_distributedavailabilitygroups_client.go => distributedavailabilitygroups_client.go} (71%) rename sdk/resourcemanager/sql/armsql/{zz_generated_elasticpooloperations_client.go => elasticpooloperations_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_elasticpools_client.go => elasticpools_client.go} (63%) rename sdk/resourcemanager/sql/armsql/{zz_generated_encryptionprotectors_client.go => encryptionprotectors_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_endpointcertificates_client.go => endpointcertificates_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_extendeddatabaseblobauditingpolicies_client.go => extendeddatabaseblobauditingpolicies_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_extendedserverblobauditingpolicies_client.go => extendedserverblobauditingpolicies_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_failovergroups_client.go => failovergroups_client.go} (72%) rename sdk/resourcemanager/sql/armsql/{zz_generated_firewallrules_client.go => firewallrules_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_geobackuppolicies_client.go => geobackuppolicies_client.go} (72%) rename sdk/resourcemanager/sql/armsql/{zz_generated_instancefailovergroups_client.go => instancefailovergroups_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_instancepools_client.go => instancepools_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_ipv6firewallrules_client.go => ipv6firewallrules_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_jobagents_client.go => jobagents_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_jobcredentials_client.go => jobcredentials_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_jobexecutions_client.go => jobexecutions_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_jobs_client.go => jobs_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_jobstepexecutions_client.go => jobstepexecutions_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_jobsteps_client.go => jobsteps_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_jobtargetexecutions_client.go => jobtargetexecutions_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_jobtargetgroups_client.go => jobtargetgroups_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_jobversions_client.go => jobversions_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_ledgerdigestuploads_client.go => ledgerdigestuploads_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_longtermretentionbackups_client.go => longtermretentionbackups_client.go} (87%) rename sdk/resourcemanager/sql/armsql/{zz_generated_longtermretentionmanagedinstancebackups_client.go => longtermretentionmanagedinstancebackups_client.go} (87%) rename sdk/resourcemanager/sql/armsql/{zz_generated_longtermretentionpolicies_client.go => longtermretentionpolicies_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_maintenancewindowoptions_client.go => maintenancewindowoptions_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_maintenancewindows_client.go => maintenancewindows_client.go} (83%) rename sdk/resourcemanager/sql/armsql/{zz_generated_managedbackupshorttermretentionpolicies_client.go => managedbackupshorttermretentionpolicies_client.go} (85%) create mode 100644 sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabasecolumns_client.go => manageddatabasecolumns_client.go} (86%) create mode 100644 sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client.go rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabasequeries_client.go => manageddatabasequeries_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabaserecommendedsensitivitylabels_client.go => manageddatabaserecommendedsensitivitylabels_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabaserestoredetails_client.go => manageddatabaserestoredetails_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabases_client.go => manageddatabases_client.go} (60%) rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabaseschemas_client.go => manageddatabaseschemas_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabasesecurityalertpolicies_client.go => manageddatabasesecurityalertpolicies_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabasesecurityevents_client.go => manageddatabasesecurityevents_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabasesensitivitylabels_client.go => manageddatabasesensitivitylabels_client.go} (76%) rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabasetables_client.go => manageddatabasetables_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabasetransparentdataencryption_client.go => manageddatabasetransparentdataencryption_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabasevulnerabilityassessmentrulebaselines_client.go => manageddatabasevulnerabilityassessmentrulebaselines_client.go} (81%) rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabasevulnerabilityassessments_client.go => manageddatabasevulnerabilityassessments_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_manageddatabasevulnerabilityassessmentscans_client.go => manageddatabasevulnerabilityassessmentscans_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_managedinstanceadministrators_client.go => managedinstanceadministrators_client.go} (85%) create mode 100644 sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go rename sdk/resourcemanager/sql/armsql/{zz_generated_managedinstanceazureadonlyauthentications_client.go => managedinstanceazureadonlyauthentications_client.go} (84%) create mode 100644 sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go rename sdk/resourcemanager/sql/armsql/{zz_generated_managedinstanceencryptionprotectors_client.go => managedinstanceencryptionprotectors_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_managedinstancekeys_client.go => managedinstancekeys_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_managedinstancelongtermretentionpolicies_client.go => managedinstancelongtermretentionpolicies_client.go} (66%) rename sdk/resourcemanager/sql/armsql/{zz_generated_managedinstanceoperations_client.go => managedinstanceoperations_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_managedinstanceprivateendpointconnections_client.go => managedinstanceprivateendpointconnections_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_managedinstanceprivatelinkresources_client.go => managedinstanceprivatelinkresources_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_managedinstances_client.go => managedinstances_client.go} (65%) rename sdk/resourcemanager/sql/armsql/{zz_generated_managedinstancetdecertificates_client.go => managedinstancetdecertificates_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_managedinstancevulnerabilityassessments_client.go => managedinstancevulnerabilityassessments_client.go} (84%) create mode 100644 sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client.go rename sdk/resourcemanager/sql/armsql/{zz_generated_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go => managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go} (86%) create mode 100644 sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go rename sdk/resourcemanager/sql/armsql/{zz_generated_managedserversecurityalertpolicies_client.go => managedserversecurityalertpolicies_client.go} (79%) rename sdk/resourcemanager/sql/armsql/{zz_generated_models.go => models.go} (83%) create mode 100644 sdk/resourcemanager/sql/armsql/models_serde.go rename sdk/resourcemanager/sql/armsql/{zz_generated_operations_client.go => operations_client.go} (89%) rename sdk/resourcemanager/sql/armsql/{zz_generated_outboundfirewallrules_client.go => outboundfirewallrules_client.go} (82%) rename sdk/resourcemanager/sql/armsql/{zz_generated_privateendpointconnections_client.go => privateendpointconnections_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_privatelinkresources_client.go => privatelinkresources_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_recommendedsensitivitylabels_client.go => recommendedsensitivitylabels_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_recoverabledatabases_client.go => recoverabledatabases_client.go} (80%) rename sdk/resourcemanager/sql/armsql/{zz_generated_recoverablemanageddatabases_client.go => recoverablemanageddatabases_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_replicationlinks_client.go => replicationlinks_client.go} (80%) rename sdk/resourcemanager/sql/armsql/{zz_generated_response_types.go => response_types.go} (71%) rename sdk/resourcemanager/sql/armsql/{zz_generated_restorabledroppeddatabases_client.go => restorabledroppeddatabases_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_restorabledroppedmanageddatabases_client.go => restorabledroppedmanageddatabases_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_restorepoints_client.go => restorepoints_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_sensitivitylabels_client.go => sensitivitylabels_client.go} (76%) rename sdk/resourcemanager/sql/armsql/{zz_generated_serveradvancedthreatprotectionsettings_client.go => serveradvancedthreatprotectionsettings_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_serveradvisors_client.go => serveradvisors_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_serverautomatictuning_client.go => serverautomatictuning_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_serverazureadadministrators_client.go => serverazureadadministrators_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_serverazureadonlyauthentications_client.go => serverazureadonlyauthentications_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_serverblobauditingpolicies_client.go => serverblobauditingpolicies_client.go} (85%) create mode 100644 sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client.go rename sdk/resourcemanager/sql/armsql/{zz_generated_serverconnectionpolicies_client.go => serverconnectionpolicies_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_serverdevopsauditsettings_client.go => serverdevopsauditsettings_client.go} (78%) rename sdk/resourcemanager/sql/armsql/{zz_generated_serverdnsaliases_client.go => serverdnsaliases_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_serverkeys_client.go => serverkeys_client.go} (82%) rename sdk/resourcemanager/sql/armsql/{zz_generated_serveroperations_client.go => serveroperations_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_servers_client.go => servers_client.go} (76%) rename sdk/resourcemanager/sql/armsql/{zz_generated_serversecurityalertpolicies_client.go => serversecurityalertpolicies_client.go} (78%) rename sdk/resourcemanager/sql/armsql/{zz_generated_servertrustcertificates_client.go => servertrustcertificates_client.go} (85%) rename sdk/resourcemanager/sql/armsql/{zz_generated_servertrustgroups_client.go => servertrustgroups_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_serverusages_client.go => serverusages_client.go} (80%) rename sdk/resourcemanager/sql/armsql/{zz_generated_servervulnerabilityassessments_client.go => servervulnerabilityassessments_client.go} (84%) create mode 100644 sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client.go rename sdk/resourcemanager/sql/armsql/{zz_generated_subscriptionusages_client.go => subscriptionusages_client.go} (88%) create mode 100644 sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client.go rename sdk/resourcemanager/sql/armsql/{zz_generated_syncagents_client.go => syncagents_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_syncgroups_client.go => syncgroups_client.go} (83%) rename sdk/resourcemanager/sql/armsql/{zz_generated_syncmembers_client.go => syncmembers_client.go} (83%) rename sdk/resourcemanager/sql/armsql/{zz_generated_tdecertificates_client.go => tdecertificates_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_time_rfc3339.go => time_rfc3339.go} (96%) rename sdk/resourcemanager/sql/armsql/{zz_generated_timezones_client.go => timezones_client.go} (90%) rename sdk/resourcemanager/sql/armsql/{zz_generated_transparentdataencryptions_client.go => transparentdataencryptions_client.go} (74%) rename sdk/resourcemanager/sql/armsql/{zz_generated_usages_client.go => usages_client.go} (86%) rename sdk/resourcemanager/sql/armsql/{zz_generated_virtualclusters_client.go => virtualclusters_client.go} (79%) rename sdk/resourcemanager/sql/armsql/{zz_generated_virtualnetworkrules_client.go => virtualnetworkrules_client.go} (84%) create mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client.go create mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client.go create mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client.go create mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client.go create mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client.go create mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client.go create mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client.go create mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client.go create mode 100644 sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client.go rename sdk/resourcemanager/sql/armsql/{zz_generated_workloadclassifiers_client.go => workloadclassifiers_client.go} (84%) rename sdk/resourcemanager/sql/armsql/{zz_generated_workloadgroups_client.go => workloadgroups_client.go} (84%) delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_backupshorttermretentionpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_capabilities_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvancedthreatprotectionsettings_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvisors_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databaseautomatictuning_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databaseblobauditingpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databasecolumns_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databaseextensions_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databaseoperations_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databaserecommendedactions_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databases_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databaseschemas_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databasesecurityalertpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databasetables_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databaseusages_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentrulebaselines_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessments_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentscans_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingrules_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_datawarehouseuseractivities_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_deletedservers_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_distributedavailabilitygroups_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpoolactivities_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooldatabaseactivities_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooloperations_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpools_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_encryptionprotectors_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_endpointcertificates_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_extendeddatabaseblobauditingpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_extendedserverblobauditingpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_failovergroups_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_firewallrules_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_geobackuppolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_instancefailovergroups_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_instancepools_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_ipv6firewallrules_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_jobagents_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_jobcredentials_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_jobexecutions_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_jobs_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_jobstepexecutions_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_jobsteps_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetexecutions_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetgroups_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_jobversions_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_ledgerdigestuploads_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionbackups_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionmanagedinstancebackups_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindowoptions_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindows_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedbackupshorttermretentionpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasecolumns_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasequeries_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserecommendedsensitivitylabels_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserestoredetails_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabases_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaseschemas_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityalertpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityevents_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesensitivitylabels_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetables_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetransparentdataencryption_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentrulebaselines_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessments_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentscans_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceadministrators_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceazureadonlyauthentications_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceencryptionprotectors_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancekeys_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancelongtermretentionpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceoperations_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivateendpointconnections_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivatelinkresources_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstances_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancetdecertificates_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancevulnerabilityassessments_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_managedserversecurityalertpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_outboundfirewallrules_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_privateendpointconnections_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_privatelinkresources_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_recommendedsensitivitylabels_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_recoverabledatabases_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_recoverablemanageddatabases_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_replicationlinks_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppeddatabases_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppedmanageddatabases_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_restorepoints_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_sensitivitylabels_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvancedthreatprotectionsettings_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvisors_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serverautomatictuning_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadadministrators_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadonlyauthentications_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serverblobauditingpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_servercommunicationlinks_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serverconnectionpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serverdevopsauditsettings_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serverdnsaliases_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serverkeys_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serveroperations_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_servers_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serversecurityalertpolicies_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustcertificates_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustgroups_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serverusages_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_servervulnerabilityassessments_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_serviceobjectives_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_sqlagent_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_subscriptionusages_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_syncagents_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_syncgroups_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_syncmembers_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_tdecertificates_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_timezones_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_transparentdataencryptions_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_usages_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_virtualclusters_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_virtualnetworkrules_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_workloadclassifiers_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/ze_generated_example_workloadgroups_client_test.go delete mode 100644 sdk/resourcemanager/sql/armsql/zz_generated_elasticpoolactivities_client.go delete mode 100644 sdk/resourcemanager/sql/armsql/zz_generated_elasticpooldatabaseactivities_client.go delete mode 100644 sdk/resourcemanager/sql/armsql/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/sql/armsql/zz_generated_servercommunicationlinks_client.go delete mode 100644 sdk/resourcemanager/sql/armsql/zz_generated_serviceobjectives_client.go diff --git a/sdk/resourcemanager/sql/armsql/CHANGELOG.md b/sdk/resourcemanager/sql/armsql/CHANGELOG.md index af5d3e8e04c0..01e8dd5fdbeb 100644 --- a/sdk/resourcemanager/sql/armsql/CHANGELOG.md +++ b/sdk/resourcemanager/sql/armsql/CHANGELOG.md @@ -1,5 +1,403 @@ # Release History +## 2.0.0-beta.1 (2023-03-06) +### Breaking Changes + +- Function `*DataMaskingPoliciesClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, DataMaskingPolicy, *DataMaskingPoliciesClientCreateOrUpdateOptions)` to `(context.Context, string, string, string, DataMaskingPolicyName, DataMaskingPolicy, *DataMaskingPoliciesClientCreateOrUpdateOptions)` +- Function `*DataMaskingPoliciesClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *DataMaskingPoliciesClientGetOptions)` to `(context.Context, string, string, string, DataMaskingPolicyName, *DataMaskingPoliciesClientGetOptions)` +- Function `*DataMaskingRulesClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, DataMaskingRule, *DataMaskingRulesClientCreateOrUpdateOptions)` to `(context.Context, string, string, string, DataMaskingPolicyName, string, DataMaskingRule, *DataMaskingRulesClientCreateOrUpdateOptions)` +- Function `*DataMaskingRulesClient.NewListByDatabasePager` parameter(s) have been changed from `(string, string, string, *DataMaskingRulesClientListByDatabaseOptions)` to `(string, string, string, DataMaskingPolicyName, *DataMaskingRulesClientListByDatabaseOptions)` +- Function `*ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, SecurityAlertPolicyName, ManagedServerSecurityAlertPolicy, *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, SecurityAlertPolicyNameAutoGenerated, ManagedServerSecurityAlertPolicy, *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions)` +- Function `*ManagedServerSecurityAlertPoliciesClient.Get` parameter(s) have been changed from `(context.Context, string, string, SecurityAlertPolicyName, *ManagedServerSecurityAlertPoliciesClientGetOptions)` to `(context.Context, string, string, SecurityAlertPolicyNameAutoGenerated, *ManagedServerSecurityAlertPoliciesClientGetOptions)` +- Function `*OutboundFirewallRulesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, OutboundFirewallRule, *OutboundFirewallRulesClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, string, *OutboundFirewallRulesClientBeginCreateOrUpdateOptions)` +- Function `*ServerDevOpsAuditSettingsClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, ServerDevOpsAuditingSettings, *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, DevOpsAuditingSettingsName, ServerDevOpsAuditingSettings, *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions)` +- Function `*ServerDevOpsAuditSettingsClient.Get` parameter(s) have been changed from `(context.Context, string, string, string, *ServerDevOpsAuditSettingsClientGetOptions)` to `(context.Context, string, string, DevOpsAuditingSettingsName, *ServerDevOpsAuditSettingsClientGetOptions)` +- Function `*ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, SecurityAlertPolicyName, ServerSecurityAlertPolicy, *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions)` to `(context.Context, string, string, SecurityAlertPolicyNameAutoGenerated, ServerSecurityAlertPolicy, *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions)` +- Function `*ServerSecurityAlertPoliciesClient.Get` parameter(s) have been changed from `(context.Context, string, string, SecurityAlertPolicyName, *ServerSecurityAlertPoliciesClientGetOptions)` to `(context.Context, string, string, SecurityAlertPolicyNameAutoGenerated, *ServerSecurityAlertPoliciesClientGetOptions)` +- Type of `JobExecutionsClientListByAgentOptions.Skip` has been changed from `*int32` to `*int64` +- Type of `JobExecutionsClientListByAgentOptions.Top` has been changed from `*int32` to `*int64` +- Type of `JobExecutionsClientListByJobOptions.Skip` has been changed from `*int32` to `*int64` +- Type of `JobExecutionsClientListByJobOptions.Top` has been changed from `*int32` to `*int64` +- Type of `JobStepExecutionsClientListByJobExecutionOptions.Skip` has been changed from `*int32` to `*int64` +- Type of `JobStepExecutionsClientListByJobExecutionOptions.Top` has been changed from `*int32` to `*int64` +- Type of `JobTargetExecutionsClientListByJobExecutionOptions.Skip` has been changed from `*int32` to `*int64` +- Type of `JobTargetExecutionsClientListByJobExecutionOptions.Top` has been changed from `*int32` to `*int64` +- Type of `JobTargetExecutionsClientListByStepOptions.Skip` has been changed from `*int32` to `*int64` +- Type of `JobTargetExecutionsClientListByStepOptions.Top` has been changed from `*int32` to `*int64` +- Type of `ManagedDatabaseRestoreDetailsProperties.NumberOfFilesDetected` has been changed from `*int64` to `*int32` +- Type of `ManagedDatabaseRestoreDetailsProperties.PercentCompleted` has been changed from `*float64` to `*int32` +- Type of `ManagedDatabaseRestoreDetailsProperties.UnrestorableFiles` has been changed from `[]*string` to `[]*ManagedDatabaseRestoreDetailsUnrestorableFileProperties` +- Type of `ManagedDatabaseSecurityEventsClientListByDatabaseOptions.Skip` has been changed from `*int32` to `*int64` +- Type of `ManagedDatabaseSecurityEventsClientListByDatabaseOptions.Top` has been changed from `*int32` to `*int64` +- Type of `ManagedInstanceOperationSteps.StepsList` has been changed from `[]*UpsertManagedServerOperationStep` to `[]*UpsertManagedServerOperationStepWithEstimatesAndDuration` +- Type of `ServerProperties.PublicNetworkAccess` has been changed from `*ServerNetworkAccessFlag` to `*ServerPublicNetworkAccessFlag` +- Type alias `DNSRefreshConfigurationPropertiesStatus` has been removed +- Type alias `PrimaryAggregationType` has been removed +- Type alias `ServiceObjectiveName` has been removed +- Type alias `UnitDefinitionType` has been removed +- Type alias `UnitType` has been removed +- Type alias `UpsertManagedServerOperationStepStatus` has been removed +- Function `*DatabasesClient.NewListMetricDefinitionsPager` has been removed +- Function `*DatabasesClient.NewListMetricsPager` has been removed +- Function `NewElasticPoolActivitiesClient` has been removed +- Function `*ElasticPoolActivitiesClient.NewListByElasticPoolPager` has been removed +- Function `NewElasticPoolDatabaseActivitiesClient` has been removed +- Function `*ElasticPoolDatabaseActivitiesClient.NewListByElasticPoolPager` has been removed +- Function `*ElasticPoolsClient.NewListMetricDefinitionsPager` has been removed +- Function `*ElasticPoolsClient.NewListMetricsPager` has been removed +- Function `*GeoBackupPoliciesClient.NewListByDatabasePager` has been removed +- Function `NewServerCommunicationLinksClient` has been removed +- Function `*ServerCommunicationLinksClient.BeginCreateOrUpdate` has been removed +- Function `*ServerCommunicationLinksClient.Delete` has been removed +- Function `*ServerCommunicationLinksClient.Get` has been removed +- Function `*ServerCommunicationLinksClient.NewListByServerPager` has been removed +- Function `NewServiceObjectivesClient` has been removed +- Function `*ServiceObjectivesClient.Get` has been removed +- Function `*ServiceObjectivesClient.NewListByServerPager` has been removed +- Operation `*ReplicationLinksClient.Delete` has been changed to LRO, use `*ReplicationLinksClient.BeginDelete` instead. +- Operation `*TransparentDataEncryptionsClient.CreateOrUpdate` has been changed to LRO, use `*TransparentDataEncryptionsClient.BeginCreateOrUpdate` instead. +- Operation `*VirtualClustersClient.UpdateDNSServers` has been changed to LRO, use `*VirtualClustersClient.BeginUpdateDNSServers` instead. +- Struct `DNSRefreshConfigurationProperties` has been removed +- Struct `ElasticPoolActivitiesClient` has been removed +- Struct `ElasticPoolActivity` has been removed +- Struct `ElasticPoolActivityListResult` has been removed +- Struct `ElasticPoolActivityProperties` has been removed +- Struct `ElasticPoolDatabaseActivitiesClient` has been removed +- Struct `ElasticPoolDatabaseActivity` has been removed +- Struct `ElasticPoolDatabaseActivityListResult` has been removed +- Struct `ElasticPoolDatabaseActivityProperties` has been removed +- Struct `Metric` has been removed +- Struct `MetricAvailability` has been removed +- Struct `MetricDefinition` has been removed +- Struct `MetricDefinitionListResult` has been removed +- Struct `MetricListResult` has been removed +- Struct `MetricName` has been removed +- Struct `MetricValue` has been removed +- Struct `OperationImpact` has been removed +- Struct `ServerCommunicationLink` has been removed +- Struct `ServerCommunicationLinkListResult` has been removed +- Struct `ServerCommunicationLinkProperties` has been removed +- Struct `ServerCommunicationLinksClient` has been removed +- Struct `ServiceObjective` has been removed +- Struct `ServiceObjectiveListResult` has been removed +- Struct `ServiceObjectiveProperties` has been removed +- Struct `ServiceObjectivesClient` has been removed +- Struct `SloUsageMetric` has been removed +- Struct `UpdateManagedInstanceDNSServersOperation` has been removed +- Struct `UpsertManagedServerOperationStep` has been removed +- Field `CurrentValue` of struct `ServerUsage` has been removed +- Field `DisplayName` of struct `ServerUsage` has been removed +- Field `Limit` of struct `ServerUsage` has been removed +- Field `NextResetTime` of struct `ServerUsage` has been removed +- Field `ResourceName` of struct `ServerUsage` has been removed +- Field `Unit` of struct `ServerUsage` has been removed +- Field `Family` of struct `VirtualClusterProperties` has been removed +- Field `MaintenanceConfigurationID` of struct `VirtualClusterProperties` has been removed + +### Features Added + +- New value `ManagedDatabaseStatusDbCopying`, `ManagedDatabaseStatusDbMoving`, `ManagedDatabaseStatusStarting`, `ManagedDatabaseStatusStopped`, `ManagedDatabaseStatusStopping` added to type alias `ManagedDatabaseStatus` +- New value `OperationModeExport`, `OperationModeImport` added to type alias `OperationMode` +- New value `ReplicationLinkTypeSTANDBY` added to type alias `ReplicationLinkType` +- New value `SecondaryTypeStandby` added to type alias `SecondaryType` +- New value `StorageCapabilityStorageAccountTypeGZRS` added to type alias `StorageCapabilityStorageAccountType` +- New type alias `AlwaysEncryptedEnclaveType` with values `AlwaysEncryptedEnclaveTypeDefault`, `AlwaysEncryptedEnclaveTypeVBS` +- New type alias `AvailabilityZoneType` with values `AvailabilityZoneTypeNoPreference`, `AvailabilityZoneTypeOne`, `AvailabilityZoneTypeThree`, `AvailabilityZoneTypeTwo` +- New type alias `BaselineName` with values `BaselineNameDefault` +- New type alias `DNSRefreshOperationStatus` with values `DNSRefreshOperationStatusFailed`, `DNSRefreshOperationStatusInProgress`, `DNSRefreshOperationStatusSucceeded` +- New type alias `DataMaskingPolicyName` with values `DataMaskingPolicyNameDefault` +- New type alias `DatabaseKeyType` with values `DatabaseKeyTypeAzureKeyVault` +- New type alias `DevOpsAuditingSettingsName` with values `DevOpsAuditingSettingsNameDefault` +- New type alias `DtcName` with values `DtcNameCurrent` +- New type alias `ExternalGovernanceStatus` with values `ExternalGovernanceStatusDisabled`, `ExternalGovernanceStatusEnabled` +- New type alias `InstanceRole` with values `InstanceRolePrimary`, `InstanceRoleSecondary` +- New type alias `ManagedLedgerDigestUploadsName` with values `ManagedLedgerDigestUploadsNameCurrent` +- New type alias `ManagedLedgerDigestUploadsState` with values `ManagedLedgerDigestUploadsStateDisabled`, `ManagedLedgerDigestUploadsStateEnabled` +- New type alias `MoveOperationMode` with values `MoveOperationModeCopy`, `MoveOperationModeMove` +- New type alias `Phase` with values `PhaseCatchup`, `PhaseCopying`, `PhaseCutoverInProgress`, `PhaseWaitingForCutover` +- New type alias `RoleChangeType` with values `RoleChangeTypeForced`, `RoleChangeTypePlanned` +- New type alias `RuleSeverity` with values `RuleSeverityHigh`, `RuleSeverityInformational`, `RuleSeverityLow`, `RuleSeverityMedium`, `RuleSeverityObsolete` +- New type alias `RuleStatus` with values `RuleStatusFinding`, `RuleStatusInternalError`, `RuleStatusNonFinding` +- New type alias `RuleType` with values `RuleTypeBaselineExpected`, `RuleTypeBinary`, `RuleTypeNegativeList`, `RuleTypePositiveList` +- New type alias `SQLVulnerabilityAssessmentName` with values `SQLVulnerabilityAssessmentNameDefault` +- New type alias `SQLVulnerabilityAssessmentState` with values `SQLVulnerabilityAssessmentStateDisabled`, `SQLVulnerabilityAssessmentStateEnabled` +- New type alias `SecondaryInstanceType` with values `SecondaryInstanceTypeGeo`, `SecondaryInstanceTypeStandby` +- New type alias `SecurityAlertPolicyNameAutoGenerated` with values `SecurityAlertPolicyNameAutoGeneratedDefault` +- New type alias `ServerConfigurationOptionName` with values `ServerConfigurationOptionNameAllowPolybaseExport` +- New type alias `ServerPublicNetworkAccessFlag` with values `ServerPublicNetworkAccessFlagDisabled`, `ServerPublicNetworkAccessFlagEnabled`, `ServerPublicNetworkAccessFlagSecuredByPerimeter` +- New type alias `StartStopScheduleName` with values `StartStopScheduleNameDefault` +- New type alias `Status` with values `StatusCanceled`, `StatusCompleted`, `StatusFailed`, `StatusInProgress`, `StatusNotStarted`, `StatusSlowedDown` +- New function `NewDatabaseEncryptionProtectorsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseEncryptionProtectorsClient, error)` +- New function `*DatabaseEncryptionProtectorsClient.BeginRevalidate(context.Context, string, string, string, EncryptionProtectorName, *DatabaseEncryptionProtectorsClientBeginRevalidateOptions) (*runtime.Poller[DatabaseEncryptionProtectorsClientRevalidateResponse], error)` +- New function `*DatabaseEncryptionProtectorsClient.BeginRevert(context.Context, string, string, string, EncryptionProtectorName, *DatabaseEncryptionProtectorsClientBeginRevertOptions) (*runtime.Poller[DatabaseEncryptionProtectorsClientRevertResponse], error)` +- New function `NewDatabaseSQLVulnerabilityAssessmentBaselinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentBaselinesClient, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentBaselinesClient.CreateOrUpdate(context.Context, string, string, string, VulnerabilityAssessmentName, BaselineName, DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput, *DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions) (DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentBaselinesClient.Get(context.Context, string, string, string, VulnerabilityAssessmentName, BaselineName, *DatabaseSQLVulnerabilityAssessmentBaselinesClientGetOptions) (DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentBaselinesClient.NewListBySQLVulnerabilityAssessmentPager(string, string, string, VulnerabilityAssessmentName, *DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse]` +- New function `NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentExecuteScanClient, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentExecuteScanClient.BeginExecute(context.Context, string, string, string, VulnerabilityAssessmentName, *DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*runtime.Poller[DatabaseSQLVulnerabilityAssessmentExecuteScanClientExecuteResponse], error)` +- New function `NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate(context.Context, string, string, string, VulnerabilityAssessmentName, BaselineName, string, DatabaseSQLVulnerabilityAssessmentRuleBaselineInput, *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Delete(context.Context, string, string, string, VulnerabilityAssessmentName, BaselineName, string, *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Get(context.Context, string, string, string, VulnerabilityAssessmentName, BaselineName, string, *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetOptions) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.NewListByBaselinePager(string, string, string, VulnerabilityAssessmentName, BaselineName, *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse]` +- New function `NewDatabaseSQLVulnerabilityAssessmentScanResultClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentScanResultClient, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentScanResultClient.Get(context.Context, string, string, string, SQLVulnerabilityAssessmentName, string, string, *DatabaseSQLVulnerabilityAssessmentScanResultClientGetOptions) (DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentScanResultClient.NewListByScanPager(string, string, string, SQLVulnerabilityAssessmentName, string, *DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse]` +- New function `NewDatabaseSQLVulnerabilityAssessmentScansClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentScansClient, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentScansClient.Get(context.Context, string, string, string, VulnerabilityAssessmentName, string, *DatabaseSQLVulnerabilityAssessmentScansClientGetOptions) (DatabaseSQLVulnerabilityAssessmentScansClientGetResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager(string, string, string, VulnerabilityAssessmentName, *DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse]` +- New function `NewDatabaseSQLVulnerabilityAssessmentsSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentsSettingsClient, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentsSettingsClient.Get(context.Context, string, string, string, SQLVulnerabilityAssessmentName, *DatabaseSQLVulnerabilityAssessmentsSettingsClientGetOptions) (DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse, error)` +- New function `*DatabaseSQLVulnerabilityAssessmentsSettingsClient.NewListByDatabasePager(string, string, string, *DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse]` +- New function `*DistributedAvailabilityGroupsClient.BeginSetRole(context.Context, string, string, string, DistributedAvailabilityGroupSetRole, *DistributedAvailabilityGroupsClientBeginSetRoleOptions) (*runtime.Poller[DistributedAvailabilityGroupsClientSetRoleResponse], error)` +- New function `*FailoverGroupsClient.BeginTryPlannedBeforeForcedFailover(context.Context, string, string, string, FailoverGroupTryPlannedBeforeForcedFailover, *FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions) (*runtime.Poller[FailoverGroupsClientTryPlannedBeforeForcedFailoverResponse], error)` +- New function `*GeoBackupPoliciesClient.NewListPager(string, string, string, *GeoBackupPoliciesClientListOptions) *runtime.Pager[GeoBackupPoliciesClientListResponse]` +- New function `NewManagedDatabaseAdvancedThreatProtectionSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedDatabaseAdvancedThreatProtectionSettingsClient, error)` +- New function `*ManagedDatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate(context.Context, string, string, string, AdvancedThreatProtectionName, ManagedDatabaseAdvancedThreatProtection, *ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions) (ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse, error)` +- New function `*ManagedDatabaseAdvancedThreatProtectionSettingsClient.Get(context.Context, string, string, string, AdvancedThreatProtectionName, *ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions) (ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse, error)` +- New function `*ManagedDatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager(string, string, string, *ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse]` +- New function `NewManagedDatabaseMoveOperationsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedDatabaseMoveOperationsClient, error)` +- New function `*ManagedDatabaseMoveOperationsClient.Get(context.Context, string, string, string, *ManagedDatabaseMoveOperationsClientGetOptions) (ManagedDatabaseMoveOperationsClientGetResponse, error)` +- New function `*ManagedDatabaseMoveOperationsClient.NewListByLocationPager(string, string, *ManagedDatabaseMoveOperationsClientListByLocationOptions) *runtime.Pager[ManagedDatabaseMoveOperationsClientListByLocationResponse]` +- New function `*ManagedDatabaseSensitivityLabelsClient.NewListByDatabasePager(string, string, string, *ManagedDatabaseSensitivityLabelsClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse]` +- New function `*ManagedDatabasesClient.BeginCancelMove(context.Context, string, string, string, ManagedDatabaseMoveDefinition, *ManagedDatabasesClientBeginCancelMoveOptions) (*runtime.Poller[ManagedDatabasesClientCancelMoveResponse], error)` +- New function `*ManagedDatabasesClient.BeginCompleteMove(context.Context, string, string, string, ManagedDatabaseMoveDefinition, *ManagedDatabasesClientBeginCompleteMoveOptions) (*runtime.Poller[ManagedDatabasesClientCompleteMoveResponse], error)` +- New function `*ManagedDatabasesClient.BeginStartMove(context.Context, string, string, string, ManagedDatabaseStartMoveDefinition, *ManagedDatabasesClientBeginStartMoveOptions) (*runtime.Poller[ManagedDatabasesClientStartMoveResponse], error)` +- New function `NewManagedInstanceAdvancedThreatProtectionSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedInstanceAdvancedThreatProtectionSettingsClient, error)` +- New function `*ManagedInstanceAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate(context.Context, string, string, AdvancedThreatProtectionName, ManagedInstanceAdvancedThreatProtection, *ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse], error)` +- New function `*ManagedInstanceAdvancedThreatProtectionSettingsClient.Get(context.Context, string, string, AdvancedThreatProtectionName, *ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions) (ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse, error)` +- New function `*ManagedInstanceAdvancedThreatProtectionSettingsClient.NewListByInstancePager(string, string, *ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions) *runtime.Pager[ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse]` +- New function `NewManagedInstanceDtcsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedInstanceDtcsClient, error)` +- New function `*ManagedInstanceDtcsClient.BeginCreateOrUpdate(context.Context, string, string, DtcName, ManagedInstanceDtc, *ManagedInstanceDtcsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceDtcsClientCreateOrUpdateResponse], error)` +- New function `*ManagedInstanceDtcsClient.Get(context.Context, string, string, DtcName, *ManagedInstanceDtcsClientGetOptions) (ManagedInstanceDtcsClientGetResponse, error)` +- New function `*ManagedInstanceDtcsClient.NewListByManagedInstancePager(string, string, *ManagedInstanceDtcsClientListByManagedInstanceOptions) *runtime.Pager[ManagedInstanceDtcsClientListByManagedInstanceResponse]` +- New function `*ManagedInstanceLongTermRetentionPoliciesClient.BeginDelete(context.Context, string, string, string, ManagedInstanceLongTermRetentionPolicyName, *ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions) (*runtime.Poller[ManagedInstanceLongTermRetentionPoliciesClientDeleteResponse], error)` +- New function `*ManagedInstancesClient.NewListOutboundNetworkDependenciesByManagedInstancePager(string, string, *ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions) *runtime.Pager[ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse]` +- New function `*ManagedInstancesClient.BeginStart(context.Context, string, string, *ManagedInstancesClientBeginStartOptions) (*runtime.Poller[ManagedInstancesClientStartResponse], error)` +- New function `*ManagedInstancesClient.BeginStop(context.Context, string, string, *ManagedInstancesClientBeginStopOptions) (*runtime.Poller[ManagedInstancesClientStopResponse], error)` +- New function `NewManagedLedgerDigestUploadsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedLedgerDigestUploadsClient, error)` +- New function `*ManagedLedgerDigestUploadsClient.BeginCreateOrUpdate(context.Context, string, string, string, ManagedLedgerDigestUploadsName, ManagedLedgerDigestUploads, *ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedLedgerDigestUploadsClientCreateOrUpdateResponse], error)` +- New function `*ManagedLedgerDigestUploadsClient.BeginDisable(context.Context, string, string, string, ManagedLedgerDigestUploadsName, *ManagedLedgerDigestUploadsClientBeginDisableOptions) (*runtime.Poller[ManagedLedgerDigestUploadsClientDisableResponse], error)` +- New function `*ManagedLedgerDigestUploadsClient.Get(context.Context, string, string, string, ManagedLedgerDigestUploadsName, *ManagedLedgerDigestUploadsClientGetOptions) (ManagedLedgerDigestUploadsClientGetResponse, error)` +- New function `*ManagedLedgerDigestUploadsClient.NewListByDatabasePager(string, string, string, *ManagedLedgerDigestUploadsClientListByDatabaseOptions) *runtime.Pager[ManagedLedgerDigestUploadsClientListByDatabaseResponse]` +- New function `NewManagedServerDNSAliasesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ManagedServerDNSAliasesClient, error)` +- New function `*ManagedServerDNSAliasesClient.BeginAcquire(context.Context, string, string, string, ManagedServerDNSAliasAcquisition, *ManagedServerDNSAliasesClientBeginAcquireOptions) (*runtime.Poller[ManagedServerDNSAliasesClientAcquireResponse], error)` +- New function `*ManagedServerDNSAliasesClient.BeginCreateOrUpdate(context.Context, string, string, string, ManagedServerDNSAliasCreation, *ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedServerDNSAliasesClientCreateOrUpdateResponse], error)` +- New function `*ManagedServerDNSAliasesClient.BeginDelete(context.Context, string, string, string, *ManagedServerDNSAliasesClientBeginDeleteOptions) (*runtime.Poller[ManagedServerDNSAliasesClientDeleteResponse], error)` +- New function `*ManagedServerDNSAliasesClient.Get(context.Context, string, string, string, *ManagedServerDNSAliasesClientGetOptions) (ManagedServerDNSAliasesClientGetResponse, error)` +- New function `*ManagedServerDNSAliasesClient.NewListByManagedInstancePager(string, string, *ManagedServerDNSAliasesClientListByManagedInstanceOptions) *runtime.Pager[ManagedServerDNSAliasesClientListByManagedInstanceResponse]` +- New function `*SensitivityLabelsClient.NewListByDatabasePager(string, string, string, *SensitivityLabelsClientListByDatabaseOptions) *runtime.Pager[SensitivityLabelsClientListByDatabaseResponse]` +- New function `NewServerConfigurationOptionsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ServerConfigurationOptionsClient, error)` +- New function `*ServerConfigurationOptionsClient.BeginCreateOrUpdate(context.Context, string, string, ServerConfigurationOptionName, ServerConfigurationOption, *ServerConfigurationOptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerConfigurationOptionsClientCreateOrUpdateResponse], error)` +- New function `*ServerConfigurationOptionsClient.Get(context.Context, string, string, ServerConfigurationOptionName, *ServerConfigurationOptionsClientGetOptions) (ServerConfigurationOptionsClientGetResponse, error)` +- New function `*ServerConfigurationOptionsClient.NewListByManagedInstancePager(string, string, *ServerConfigurationOptionsClientListByManagedInstanceOptions) *runtime.Pager[ServerConfigurationOptionsClientListByManagedInstanceResponse]` +- New function `*ServersClient.BeginRefreshStatus(context.Context, string, string, *ServersClientBeginRefreshStatusOptions) (*runtime.Poller[ServersClientRefreshStatusResponse], error)` +- New function `NewStartStopManagedInstanceSchedulesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*StartStopManagedInstanceSchedulesClient, error)` +- New function `*StartStopManagedInstanceSchedulesClient.CreateOrUpdate(context.Context, string, string, StartStopScheduleName, StartStopManagedInstanceSchedule, *StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions) (StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse, error)` +- New function `*StartStopManagedInstanceSchedulesClient.Delete(context.Context, string, string, StartStopScheduleName, *StartStopManagedInstanceSchedulesClientDeleteOptions) (StartStopManagedInstanceSchedulesClientDeleteResponse, error)` +- New function `*StartStopManagedInstanceSchedulesClient.Get(context.Context, string, string, StartStopScheduleName, *StartStopManagedInstanceSchedulesClientGetOptions) (StartStopManagedInstanceSchedulesClientGetResponse, error)` +- New function `*StartStopManagedInstanceSchedulesClient.NewListByInstancePager(string, string, *StartStopManagedInstanceSchedulesClientListByInstanceOptions) *runtime.Pager[StartStopManagedInstanceSchedulesClientListByInstanceResponse]` +- New function `NewSynapseLinkWorkspacesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*SynapseLinkWorkspacesClient, error)` +- New function `*SynapseLinkWorkspacesClient.NewListByDatabasePager(string, string, string, *SynapseLinkWorkspacesClientListByDatabaseOptions) *runtime.Pager[SynapseLinkWorkspacesClientListByDatabaseResponse]` +- New function `NewVulnerabilityAssessmentBaselineClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentBaselineClient, error)` +- New function `*VulnerabilityAssessmentBaselineClient.Get(context.Context, string, string, VulnerabilityAssessmentName, BaselineName, *VulnerabilityAssessmentBaselineClientGetOptions) (VulnerabilityAssessmentBaselineClientGetResponse, error)` +- New function `*VulnerabilityAssessmentBaselineClient.NewListBySQLVulnerabilityAssessmentPager(string, string, VulnerabilityAssessmentName, *VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentOptions) *runtime.Pager[VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse]` +- New function `NewVulnerabilityAssessmentBaselinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentBaselinesClient, error)` +- New function `*VulnerabilityAssessmentBaselinesClient.CreateOrUpdate(context.Context, string, string, VulnerabilityAssessmentName, BaselineName, DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput, *VulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions) (VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse, error)` +- New function `NewVulnerabilityAssessmentExecuteScanClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentExecuteScanClient, error)` +- New function `*VulnerabilityAssessmentExecuteScanClient.BeginExecute(context.Context, string, string, VulnerabilityAssessmentName, *VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*runtime.Poller[VulnerabilityAssessmentExecuteScanClientExecuteResponse], error)` +- New function `NewVulnerabilityAssessmentRuleBaselineClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentRuleBaselineClient, error)` +- New function `*VulnerabilityAssessmentRuleBaselineClient.CreateOrUpdate(context.Context, string, string, VulnerabilityAssessmentName, BaselineName, string, DatabaseSQLVulnerabilityAssessmentRuleBaselineInput, *VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateOptions) (VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse, error)` +- New function `*VulnerabilityAssessmentRuleBaselineClient.Get(context.Context, string, string, VulnerabilityAssessmentName, BaselineName, string, *VulnerabilityAssessmentRuleBaselineClientGetOptions) (VulnerabilityAssessmentRuleBaselineClientGetResponse, error)` +- New function `*VulnerabilityAssessmentRuleBaselineClient.NewListByBaselinePager(string, string, VulnerabilityAssessmentName, BaselineName, *VulnerabilityAssessmentRuleBaselineClientListByBaselineOptions) *runtime.Pager[VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse]` +- New function `NewVulnerabilityAssessmentRuleBaselinesClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentRuleBaselinesClient, error)` +- New function `*VulnerabilityAssessmentRuleBaselinesClient.Delete(context.Context, string, string, VulnerabilityAssessmentName, BaselineName, string, *VulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (VulnerabilityAssessmentRuleBaselinesClientDeleteResponse, error)` +- New function `NewVulnerabilityAssessmentScanResultClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentScanResultClient, error)` +- New function `*VulnerabilityAssessmentScanResultClient.Get(context.Context, string, string, SQLVulnerabilityAssessmentName, string, string, *VulnerabilityAssessmentScanResultClientGetOptions) (VulnerabilityAssessmentScanResultClientGetResponse, error)` +- New function `*VulnerabilityAssessmentScanResultClient.NewListByScanPager(string, string, SQLVulnerabilityAssessmentName, string, *VulnerabilityAssessmentScanResultClientListByScanOptions) *runtime.Pager[VulnerabilityAssessmentScanResultClientListByScanResponse]` +- New function `NewVulnerabilityAssessmentScansClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentScansClient, error)` +- New function `*VulnerabilityAssessmentScansClient.Get(context.Context, string, string, VulnerabilityAssessmentName, string, *VulnerabilityAssessmentScansClientGetOptions) (VulnerabilityAssessmentScansClientGetResponse, error)` +- New function `*VulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager(string, string, VulnerabilityAssessmentName, *VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions) *runtime.Pager[VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse]` +- New function `NewVulnerabilityAssessmentsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentsClient, error)` +- New function `*VulnerabilityAssessmentsClient.Delete(context.Context, string, string, VulnerabilityAssessmentName, *VulnerabilityAssessmentsClientDeleteOptions) (VulnerabilityAssessmentsClientDeleteResponse, error)` +- New function `NewVulnerabilityAssessmentsSettingsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*VulnerabilityAssessmentsSettingsClient, error)` +- New function `*VulnerabilityAssessmentsSettingsClient.CreateOrUpdate(context.Context, string, string, VulnerabilityAssessmentName, VulnerabilityAssessment, *VulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions) (VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse, error)` +- New function `*VulnerabilityAssessmentsSettingsClient.Get(context.Context, string, string, SQLVulnerabilityAssessmentName, *VulnerabilityAssessmentsSettingsClientGetOptions) (VulnerabilityAssessmentsSettingsClientGetResponse, error)` +- New function `*VulnerabilityAssessmentsSettingsClient.NewListByServerPager(string, string, *VulnerabilityAssessmentsSettingsClientListByServerOptions) *runtime.Pager[VulnerabilityAssessmentsSettingsClientListByServerResponse]` +- New struct `Baseline` +- New struct `BaselineAdjustedResult` +- New struct `BenchmarkReference` +- New struct `DatabaseEncryptionProtectorsClient` +- New struct `DatabaseKey` +- New struct `DatabaseSQLVulnerabilityAssessmentBaselineSet` +- New struct `DatabaseSQLVulnerabilityAssessmentBaselineSetListResult` +- New struct `DatabaseSQLVulnerabilityAssessmentBaselineSetProperties` +- New struct `DatabaseSQLVulnerabilityAssessmentBaselinesClient` +- New struct `DatabaseSQLVulnerabilityAssessmentExecuteScanClient` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaseline` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselineInput` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties` +- New struct `DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient` +- New struct `DatabaseSQLVulnerabilityAssessmentScanResultClient` +- New struct `DatabaseSQLVulnerabilityAssessmentScansClient` +- New struct `DatabaseSQLVulnerabilityAssessmentsSettingsClient` +- New struct `DistributedAvailabilityGroupSetRole` +- New struct `EndpointDependency` +- New struct `EndpointDetail` +- New struct `FailoverGroupTryPlannedBeforeForcedFailover` +- New struct `ManagedDatabaseAdvancedThreatProtection` +- New struct `ManagedDatabaseAdvancedThreatProtectionListResult` +- New struct `ManagedDatabaseAdvancedThreatProtectionSettingsClient` +- New struct `ManagedDatabaseMoveDefinition` +- New struct `ManagedDatabaseMoveOperationListResult` +- New struct `ManagedDatabaseMoveOperationResult` +- New struct `ManagedDatabaseMoveOperationResultProperties` +- New struct `ManagedDatabaseMoveOperationsClient` +- New struct `ManagedDatabaseRestoreDetailsBackupSetProperties` +- New struct `ManagedDatabaseRestoreDetailsUnrestorableFileProperties` +- New struct `ManagedDatabaseStartMoveDefinition` +- New struct `ManagedInstanceAdvancedThreatProtection` +- New struct `ManagedInstanceAdvancedThreatProtectionListResult` +- New struct `ManagedInstanceAdvancedThreatProtectionSettingsClient` +- New struct `ManagedInstanceDtc` +- New struct `ManagedInstanceDtcListResult` +- New struct `ManagedInstanceDtcProperties` +- New struct `ManagedInstanceDtcSecuritySettings` +- New struct `ManagedInstanceDtcTransactionManagerCommunicationSettings` +- New struct `ManagedInstanceDtcsClient` +- New struct `ManagedLedgerDigestUploads` +- New struct `ManagedLedgerDigestUploadsClient` +- New struct `ManagedLedgerDigestUploadsListResult` +- New struct `ManagedLedgerDigestUploadsProperties` +- New struct `ManagedServerDNSAlias` +- New struct `ManagedServerDNSAliasAcquisition` +- New struct `ManagedServerDNSAliasCreation` +- New struct `ManagedServerDNSAliasListResult` +- New struct `ManagedServerDNSAliasProperties` +- New struct `ManagedServerDNSAliasesClient` +- New struct `OutboundEnvironmentEndpoint` +- New struct `OutboundEnvironmentEndpointCollection` +- New struct `PhaseDetails` +- New struct `QueryCheck` +- New struct `RefreshExternalGovernanceStatusOperationResult` +- New struct `RefreshExternalGovernanceStatusOperationResultProperties` +- New struct `Remediation` +- New struct `ScheduleItem` +- New struct `ServerConfigurationOption` +- New struct `ServerConfigurationOptionListResult` +- New struct `ServerConfigurationOptionProperties` +- New struct `ServerConfigurationOptionsClient` +- New struct `ServerUsageProperties` +- New struct `StartStopManagedInstanceSchedule` +- New struct `StartStopManagedInstanceScheduleListResult` +- New struct `StartStopManagedInstanceScheduleProperties` +- New struct `StartStopManagedInstanceSchedulesClient` +- New struct `SynapseLinkWorkspace` +- New struct `SynapseLinkWorkspaceInfoProperties` +- New struct `SynapseLinkWorkspaceListResult` +- New struct `SynapseLinkWorkspaceProperties` +- New struct `SynapseLinkWorkspacesClient` +- New struct `UpdateVirtualClusterDNSServersOperation` +- New struct `UpsertManagedServerOperationStepWithEstimatesAndDuration` +- New struct `VaRule` +- New struct `VirtualClusterDNSServersProperties` +- New struct `VulnerabilityAssessment` +- New struct `VulnerabilityAssessmentBaselineClient` +- New struct `VulnerabilityAssessmentBaselinesClient` +- New struct `VulnerabilityAssessmentExecuteScanClient` +- New struct `VulnerabilityAssessmentListResult` +- New struct `VulnerabilityAssessmentPolicyProperties` +- New struct `VulnerabilityAssessmentRuleBaselineClient` +- New struct `VulnerabilityAssessmentRuleBaselinesClient` +- New struct `VulnerabilityAssessmentScanForSQLError` +- New struct `VulnerabilityAssessmentScanListResult` +- New struct `VulnerabilityAssessmentScanRecordForSQL` +- New struct `VulnerabilityAssessmentScanRecordForSQLListResult` +- New struct `VulnerabilityAssessmentScanRecordForSQLProperties` +- New struct `VulnerabilityAssessmentScanResultClient` +- New struct `VulnerabilityAssessmentScanResultProperties` +- New struct `VulnerabilityAssessmentScanResults` +- New struct `VulnerabilityAssessmentScansClient` +- New struct `VulnerabilityAssessmentsClient` +- New struct `VulnerabilityAssessmentsSettingsClient` +- New field `NextLink` in struct `DataMaskingRuleListResult` +- New field `AdministratorLogin` in struct `DatabaseExtensionsProperties` +- New field `AdministratorLoginPassword` in struct `DatabaseExtensionsProperties` +- New field `AuthenticationType` in struct `DatabaseExtensionsProperties` +- New field `DatabaseEdition` in struct `DatabaseExtensionsProperties` +- New field `MaxSizeBytes` in struct `DatabaseExtensionsProperties` +- New field `NetworkIsolation` in struct `DatabaseExtensionsProperties` +- New field `ServiceObjectiveName` in struct `DatabaseExtensionsProperties` +- New field `OperationPhaseDetails` in struct `DatabaseOperationProperties` +- New field `AvailabilityZone` in struct `DatabaseProperties` +- New field `EncryptionProtector` in struct `DatabaseProperties` +- New field `Keys` in struct `DatabaseProperties` +- New field `ManualCutover` in struct `DatabaseProperties` +- New field `PerformCutover` in struct `DatabaseProperties` +- New field `PreferredEnclaveType` in struct `DatabaseProperties` +- New field `EncryptionProtector` in struct `DatabaseUpdateProperties` +- New field `Keys` in struct `DatabaseUpdateProperties` +- New field `ManualCutover` in struct `DatabaseUpdateProperties` +- New field `PerformCutover` in struct `DatabaseUpdateProperties` +- New field `PreferredEnclaveType` in struct `DatabaseUpdateProperties` +- New field `Expand` in struct `DatabasesClientGetOptions` +- New field `Filter` in struct `DatabasesClientGetOptions` +- New field `InstanceRole` in struct `DistributedAvailabilityGroupProperties` +- New field `ZonePinning` in struct `EditionCapability` +- New field `ZonePinning` in struct `ElasticPoolEditionCapability` +- New field `AvailabilityZone` in struct `ElasticPoolProperties` +- New field `MinCapacity` in struct `ElasticPoolProperties` +- New field `PreferredEnclaveType` in struct `ElasticPoolProperties` +- New field `AvailabilityZone` in struct `ElasticPoolUpdateProperties` +- New field `MinCapacity` in struct `ElasticPoolUpdateProperties` +- New field `PreferredEnclaveType` in struct `ElasticPoolUpdateProperties` +- New field `NextLink` in struct `GeoBackupPolicyListResult` +- New field `BlobURI` in struct `ImportExportExtensionsOperationResultProperties` +- New field `PrivateEndpointConnections` in struct `ImportExportExtensionsOperationResultProperties` +- New field `QueuedTime` in struct `ImportExportExtensionsOperationResultProperties` +- New field `SecondaryType` in struct `InstanceFailoverGroupProperties` +- New field `CrossSubscriptionRestorableDroppedDatabaseID` in struct `ManagedDatabaseProperties` +- New field `CrossSubscriptionSourceDatabaseID` in struct `ManagedDatabaseProperties` +- New field `CrossSubscriptionTargetManagedInstanceID` in struct `ManagedDatabaseProperties` +- New field `IsLedgerOn` in struct `ManagedDatabaseProperties` +- New field `StorageContainerIdentity` in struct `ManagedDatabaseProperties` +- New field `CurrentBackupType` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `CurrentRestorePlanSizeMB` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `CurrentRestoredSizeMB` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `DiffBackupSets` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `FullBackupSets` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `LogBackupSets` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `NumberOfFilesQueued` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `NumberOfFilesRestored` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `NumberOfFilesRestoring` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `NumberOfFilesSkipped` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `NumberOfFilesUnrestorable` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `Type` in struct `ManagedDatabaseRestoreDetailsProperties` +- New field `RequiredZoneNames` in struct `ManagedInstancePrivateLinkProperties` +- New field `GroupIDs` in struct `PrivateEndpointConnectionProperties` +- New field `NextLink` in struct `RecoverableDatabaseListResult` +- New field `Keys` in struct `RecoverableDatabaseProperties` +- New field `Expand` in struct `RecoverableDatabasesClientGetOptions` +- New field `Filter` in struct `RecoverableDatabasesClientGetOptions` +- New field `PartnerDatabaseID` in struct `ReplicationLinkProperties` +- New field `Keys` in struct `RestorableDroppedDatabaseProperties` +- New field `Expand` in struct `RestorableDroppedDatabasesClientGetOptions` +- New field `Filter` in struct `RestorableDroppedDatabasesClientGetOptions` +- New field `IsManagedIdentityInUse` in struct `ServerDevOpsAuditSettingsProperties` +- New field `ExternalGovernanceStatus` in struct `ServerProperties` +- New field `ID` in struct `ServerUsage` +- New field `Properties` in struct `ServerUsage` +- New field `Type` in struct `ServerUsage` +- New field `NextLink` in struct `ServerUsageListResult` +- New field `ZonePinning` in struct `ServiceObjectiveCapability` +- New field `Version` in struct `VirtualClusterProperties` + + ## 1.0.0 (2022-06-02) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql` is using our [next generation design principles](https://azure.github.io/azure-sdk/general_introduction.html) since version 1.0.0, which contains breaking changes. diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_agent_client.go b/sdk/resourcemanager/sql/armsql/agent_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_agent_client.go rename to sdk/resourcemanager/sql/armsql/agent_client.go index 19822bfd09e6..a9587c621afe 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_agent_client.go +++ b/sdk/resourcemanager/sql/armsql/agent_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 armsql @@ -31,9 +32,9 @@ type AgentClient struct { } // NewAgentClient creates a new instance of AgentClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAgentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AgentClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewAgentClient(subscriptionID string, credential azcore.TokenCredential, op // CreateOrUpdate - Puts new sql agent configuration to instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - AgentClientCreateOrUpdateOptions contains the optional parameters for the AgentClient.CreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - AgentClientCreateOrUpdateOptions contains the optional parameters for the AgentClient.CreateOrUpdate method. func (client *AgentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters AgentConfiguration, options *AgentClientCreateOrUpdateOptions) (AgentClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, parameters, options) if err != nil { @@ -96,7 +98,7 @@ func (client *AgentClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -113,11 +115,12 @@ func (client *AgentClient) createOrUpdateHandleResponse(resp *http.Response) (Ag // Get - Gets current instance sql agent configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - AgentClientGetOptions contains the optional parameters for the AgentClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - AgentClientGetOptions contains the optional parameters for the AgentClient.Get method. func (client *AgentClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, options *AgentClientGetOptions) (AgentClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, options) if err != nil { @@ -153,7 +156,7 @@ func (client *AgentClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/autorest.md b/sdk/resourcemanager/sql/armsql/autorest.md index ee2ef7c1a0e5..b475ff644ea1 100644 --- a/sdk/resourcemanager/sql/armsql/autorest.md +++ b/sdk/resourcemanager/sql/armsql/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/08894fa8d66cb44dc62a73f7a09530f905985fa3/specification/sql/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sql/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/sql/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0-beta.1 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_backupshorttermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_backupshorttermretentionpolicies_client.go rename to sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_client.go index 03b32af136a4..1be268130a2c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_backupshorttermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/backupshorttermretentionpolicies_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 armsql @@ -31,9 +32,9 @@ type BackupShortTermRetentionPoliciesClient struct { } // NewBackupShortTermRetentionPoliciesClient creates a new instance of BackupShortTermRetentionPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupShortTermRetentionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupShortTermRetentionPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewBackupShortTermRetentionPoliciesClient(subscriptionID string, credential // BeginCreateOrUpdate - Updates a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// policyName - The policy name. Should always be "default". -// parameters - The short term retention policy info. -// options - BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - policyName - The policy name. Should always be "default". +// - parameters - The short term retention policy info. +// - options - BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate +// method. func (client *BackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName ShortTermRetentionPolicyName, parameters BackupShortTermRetentionPolicy, options *BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, policyName, parameters, options) @@ -79,7 +81,8 @@ func (client *BackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx co // CreateOrUpdate - Updates a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview +// +// Generated from API version 2022-11-01-preview func (client *BackupShortTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName ShortTermRetentionPolicyName, parameters BackupShortTermRetentionPolicy, options *BackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, parameters, options) if err != nil { @@ -123,7 +126,7 @@ func (client *BackupShortTermRetentionPoliciesClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -131,14 +134,15 @@ func (client *BackupShortTermRetentionPoliciesClient) createOrUpdateCreateReques // Get - Gets a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// policyName - The policy name. Should always be "default". -// options - BackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - policyName - The policy name. Should always be "default". +// - options - BackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.Get +// method. func (client *BackupShortTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName ShortTermRetentionPolicyName, options *BackupShortTermRetentionPoliciesClientGetOptions) (BackupShortTermRetentionPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, options) if err != nil { @@ -182,7 +186,7 @@ func (client *BackupShortTermRetentionPoliciesClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,14 +202,14 @@ func (client *BackupShortTermRetentionPoliciesClient) getHandleResponse(resp *ht } // NewListByDatabasePager - Gets a database's short term retention policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - BackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - BackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.NewListByDatabasePager +// method. func (client *BackupShortTermRetentionPoliciesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *BackupShortTermRetentionPoliciesClientListByDatabaseOptions) *runtime.Pager[BackupShortTermRetentionPoliciesClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[BackupShortTermRetentionPoliciesClientListByDatabaseResponse]{ More: func(page BackupShortTermRetentionPoliciesClientListByDatabaseResponse) bool { @@ -258,7 +262,7 @@ func (client *BackupShortTermRetentionPoliciesClient) listByDatabaseCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,15 +279,16 @@ func (client *BackupShortTermRetentionPoliciesClient) listByDatabaseHandleRespon // BeginUpdate - Updates a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// policyName - The policy name. Should always be "default". -// parameters - The short term retention policy info. -// options - BackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - policyName - The policy name. Should always be "default". +// - parameters - The short term retention policy info. +// - options - BackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.BeginUpdate +// method. func (client *BackupShortTermRetentionPoliciesClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName ShortTermRetentionPolicyName, parameters BackupShortTermRetentionPolicy, options *BackupShortTermRetentionPoliciesClientBeginUpdateOptions) (*runtime.Poller[BackupShortTermRetentionPoliciesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, serverName, databaseName, policyName, parameters, options) @@ -298,7 +303,8 @@ func (client *BackupShortTermRetentionPoliciesClient) BeginUpdate(ctx context.Co // Update - Updates a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview +// +// Generated from API version 2022-11-01-preview func (client *BackupShortTermRetentionPoliciesClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName ShortTermRetentionPolicyName, parameters BackupShortTermRetentionPolicy, options *BackupShortTermRetentionPoliciesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, parameters, options) if err != nil { @@ -342,7 +348,7 @@ func (client *BackupShortTermRetentionPoliciesClient) updateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_capabilities_client.go b/sdk/resourcemanager/sql/armsql/capabilities_client.go similarity index 87% rename from sdk/resourcemanager/sql/armsql/zz_generated_capabilities_client.go rename to sdk/resourcemanager/sql/armsql/capabilities_client.go index a1b2612036cf..5bda784c94ca 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_capabilities_client.go +++ b/sdk/resourcemanager/sql/armsql/capabilities_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 armsql @@ -31,9 +32,9 @@ type CapabilitiesClient struct { } // NewCapabilitiesClient creates a new instance of CapabilitiesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewCapabilitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CapabilitiesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,10 +57,11 @@ func NewCapabilitiesClient(subscriptionID string, credential azcore.TokenCredent // ListByLocation - Gets the subscription capabilities available for the specified location. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// locationName - The location name whose capabilities are retrieved. -// options - CapabilitiesClientListByLocationOptions contains the optional parameters for the CapabilitiesClient.ListByLocation -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location name whose capabilities are retrieved. +// - options - CapabilitiesClientListByLocationOptions contains the optional parameters for the CapabilitiesClient.ListByLocation +// method. func (client *CapabilitiesClient) ListByLocation(ctx context.Context, locationName string, options *CapabilitiesClientListByLocationOptions) (CapabilitiesClientListByLocationResponse, error) { req, err := client.listByLocationCreateRequest(ctx, locationName, options) if err != nil { @@ -94,7 +96,7 @@ func (client *CapabilitiesClient) listByLocationCreateRequest(ctx context.Contex if options != nil && options.Include != nil { reqQP.Set("include", string(*options.Include)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_constants.go b/sdk/resourcemanager/sql/armsql/constants.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_constants.go rename to sdk/resourcemanager/sql/armsql/constants.go index 099a18de7eda..7b4a19c8ccf1 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_constants.go +++ b/sdk/resourcemanager/sql/armsql/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 armsql const ( moduleName = "armsql" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0-beta.1" ) type AdministratorName string @@ -114,6 +115,22 @@ func PossibleAggregationFunctionTypeValues() []AggregationFunctionType { } } +// AlwaysEncryptedEnclaveType - Type of enclave requested on the database i.e. Default or VBS enclaves. +type AlwaysEncryptedEnclaveType string + +const ( + AlwaysEncryptedEnclaveTypeDefault AlwaysEncryptedEnclaveType = "Default" + AlwaysEncryptedEnclaveTypeVBS AlwaysEncryptedEnclaveType = "VBS" +) + +// PossibleAlwaysEncryptedEnclaveTypeValues returns the possible values for the AlwaysEncryptedEnclaveType const type. +func PossibleAlwaysEncryptedEnclaveTypeValues() []AlwaysEncryptedEnclaveType { + return []AlwaysEncryptedEnclaveType{ + AlwaysEncryptedEnclaveTypeDefault, + AlwaysEncryptedEnclaveTypeVBS, + } +} + type AuthenticationName string const ( @@ -286,6 +303,26 @@ func PossibleAutomaticTuningServerReasonValues() []AutomaticTuningServerReason { } } +// AvailabilityZoneType - Specifies the availability zone the database is pinned to. +type AvailabilityZoneType string + +const ( + AvailabilityZoneTypeNoPreference AvailabilityZoneType = "NoPreference" + AvailabilityZoneTypeOne AvailabilityZoneType = "1" + AvailabilityZoneTypeThree AvailabilityZoneType = "3" + AvailabilityZoneTypeTwo AvailabilityZoneType = "2" +) + +// PossibleAvailabilityZoneTypeValues returns the possible values for the AvailabilityZoneType const type. +func PossibleAvailabilityZoneTypeValues() []AvailabilityZoneType { + return []AvailabilityZoneType{ + AvailabilityZoneTypeNoPreference, + AvailabilityZoneTypeOne, + AvailabilityZoneTypeThree, + AvailabilityZoneTypeTwo, + } +} + // BackupStorageRedundancy - The storage account type used to store backups for this database. type BackupStorageRedundancy string @@ -306,6 +343,19 @@ func PossibleBackupStorageRedundancyValues() []BackupStorageRedundancy { } } +type BaselineName string + +const ( + BaselineNameDefault BaselineName = "default" +) + +// PossibleBaselineNameValues returns the possible values for the BaselineName const type. +func PossibleBaselineNameValues() []BaselineName { + return []BaselineName{ + BaselineNameDefault, + } +} + // BlobAuditingPolicyState - Specifies the state of the audit. If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled // are required. type BlobAuditingPolicyState string @@ -560,19 +610,21 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// DNSRefreshConfigurationPropertiesStatus - The status of the DNS refresh operation. -type DNSRefreshConfigurationPropertiesStatus string +// DNSRefreshOperationStatus - The status of the DNS refresh operation. +type DNSRefreshOperationStatus string const ( - DNSRefreshConfigurationPropertiesStatusFailed DNSRefreshConfigurationPropertiesStatus = "Failed" - DNSRefreshConfigurationPropertiesStatusSucceeded DNSRefreshConfigurationPropertiesStatus = "Succeeded" + DNSRefreshOperationStatusFailed DNSRefreshOperationStatus = "Failed" + DNSRefreshOperationStatusInProgress DNSRefreshOperationStatus = "InProgress" + DNSRefreshOperationStatusSucceeded DNSRefreshOperationStatus = "Succeeded" ) -// PossibleDNSRefreshConfigurationPropertiesStatusValues returns the possible values for the DNSRefreshConfigurationPropertiesStatus const type. -func PossibleDNSRefreshConfigurationPropertiesStatusValues() []DNSRefreshConfigurationPropertiesStatus { - return []DNSRefreshConfigurationPropertiesStatus{ - DNSRefreshConfigurationPropertiesStatusFailed, - DNSRefreshConfigurationPropertiesStatusSucceeded, +// PossibleDNSRefreshOperationStatusValues returns the possible values for the DNSRefreshOperationStatus const type. +func PossibleDNSRefreshOperationStatusValues() []DNSRefreshOperationStatus { + return []DNSRefreshOperationStatus{ + DNSRefreshOperationStatusFailed, + DNSRefreshOperationStatusInProgress, + DNSRefreshOperationStatusSucceeded, } } @@ -600,21 +652,34 @@ func PossibleDataMaskingFunctionValues() []DataMaskingFunction { } } +type DataMaskingPolicyName string + +const ( + DataMaskingPolicyNameDefault DataMaskingPolicyName = "Default" +) + +// PossibleDataMaskingPolicyNameValues returns the possible values for the DataMaskingPolicyName const type. +func PossibleDataMaskingPolicyNameValues() []DataMaskingPolicyName { + return []DataMaskingPolicyName{ + DataMaskingPolicyNameDefault, + } +} + // DataMaskingRuleState - The rule state. Used to delete a rule. To delete an existing rule, specify the schemaName, tableName, // columnName, maskingFunction, and specify ruleState as disabled. However, if the rule doesn't // already exist, the rule will be created with ruleState set to enabled, regardless of the provided value of ruleState. type DataMaskingRuleState string const ( - DataMaskingRuleStateDisabled DataMaskingRuleState = "Disabled" DataMaskingRuleStateEnabled DataMaskingRuleState = "Enabled" + DataMaskingRuleStateDisabled DataMaskingRuleState = "Disabled" ) // PossibleDataMaskingRuleStateValues returns the possible values for the DataMaskingRuleState const type. func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState { return []DataMaskingRuleState{ - DataMaskingRuleStateDisabled, DataMaskingRuleStateEnabled, + DataMaskingRuleStateDisabled, } } @@ -622,15 +687,15 @@ func PossibleDataMaskingRuleStateValues() []DataMaskingRuleState { type DataMaskingState string const ( - DataMaskingStateDisabled DataMaskingState = "Disabled" DataMaskingStateEnabled DataMaskingState = "Enabled" + DataMaskingStateDisabled DataMaskingState = "Disabled" ) // PossibleDataMaskingStateValues returns the possible values for the DataMaskingState const type. func PossibleDataMaskingStateValues() []DataMaskingState { return []DataMaskingState{ - DataMaskingStateDisabled, DataMaskingStateEnabled, + DataMaskingStateDisabled, } } @@ -663,6 +728,20 @@ func PossibleDatabaseIdentityTypeValues() []DatabaseIdentityType { } } +// DatabaseKeyType - The database key type. Only supported value is 'AzureKeyVault'. +type DatabaseKeyType string + +const ( + DatabaseKeyTypeAzureKeyVault DatabaseKeyType = "AzureKeyVault" +) + +// PossibleDatabaseKeyTypeValues returns the possible values for the DatabaseKeyType const type. +func PossibleDatabaseKeyTypeValues() []DatabaseKeyType { + return []DatabaseKeyType{ + DatabaseKeyTypeAzureKeyVault, + } +} + // DatabaseLicenseType - The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice // if you have a license and are eligible for the Azure Hybrid Benefit. type DatabaseLicenseType string @@ -801,6 +880,19 @@ func PossibleDayOfWeekValues() []DayOfWeek { } } +type DevOpsAuditingSettingsName string + +const ( + DevOpsAuditingSettingsNameDefault DevOpsAuditingSettingsName = "Default" +) + +// PossibleDevOpsAuditingSettingsNameValues returns the possible values for the DevOpsAuditingSettingsName const type. +func PossibleDevOpsAuditingSettingsNameValues() []DevOpsAuditingSettingsName { + return []DevOpsAuditingSettingsName{ + DevOpsAuditingSettingsNameDefault, + } +} + // DiffBackupIntervalInHours - The differential backup interval in hours. This is how many interval hours between each differential // backup will be supported. This is only applicable to live databases but not dropped databases. type DiffBackupIntervalInHours int32 @@ -818,6 +910,19 @@ func PossibleDiffBackupIntervalInHoursValues() []DiffBackupIntervalInHours { } } +type DtcName string + +const ( + DtcNameCurrent DtcName = "current" +) + +// PossibleDtcNameValues returns the possible values for the DtcName const type. +func PossibleDtcNameValues() []DtcName { + return []DtcName{ + DtcNameCurrent, + } +} + // ElasticPoolLicenseType - The license type to apply for this elastic pool. type ElasticPoolLicenseType string @@ -865,6 +970,22 @@ func PossibleEncryptionProtectorNameValues() []EncryptionProtectorName { } } +// ExternalGovernanceStatus - Status of external governance. +type ExternalGovernanceStatus string + +const ( + ExternalGovernanceStatusDisabled ExternalGovernanceStatus = "Disabled" + ExternalGovernanceStatusEnabled ExternalGovernanceStatus = "Enabled" +) + +// PossibleExternalGovernanceStatusValues returns the possible values for the ExternalGovernanceStatus const type. +func PossibleExternalGovernanceStatusValues() []ExternalGovernanceStatus { + return []ExternalGovernanceStatus{ + ExternalGovernanceStatusDisabled, + ExternalGovernanceStatusEnabled, + } +} + // FailoverGroupReplicationRole - Local replication role of the failover group instance. type FailoverGroupReplicationRole string @@ -898,15 +1019,15 @@ func PossibleGeoBackupPolicyNameValues() []GeoBackupPolicyName { type GeoBackupPolicyState string const ( - GeoBackupPolicyStateDisabled GeoBackupPolicyState = "Disabled" GeoBackupPolicyStateEnabled GeoBackupPolicyState = "Enabled" + GeoBackupPolicyStateDisabled GeoBackupPolicyState = "Disabled" ) // PossibleGeoBackupPolicyStateValues returns the possible values for the GeoBackupPolicyState const type. func PossibleGeoBackupPolicyStateValues() []GeoBackupPolicyState { return []GeoBackupPolicyState{ - GeoBackupPolicyStateDisabled, GeoBackupPolicyStateEnabled, + GeoBackupPolicyStateDisabled, } } @@ -980,6 +1101,22 @@ func PossibleInstancePoolLicenseTypeValues() []InstancePoolLicenseType { } } +// InstanceRole - New role of managed instance in a distributed availability group, can be Primary or Secondary. +type InstanceRole string + +const ( + InstanceRolePrimary InstanceRole = "Primary" + InstanceRoleSecondary InstanceRole = "Secondary" +) + +// PossibleInstanceRoleValues returns the possible values for the InstanceRole const type. +func PossibleInstanceRoleValues() []InstanceRole { + return []InstanceRole{ + InstanceRolePrimary, + InstanceRoleSecondary, + } +} + // IsRetryable - Gets whether the error could be ignored and recommended action could be retried. Possible values are: Yes/No type IsRetryable string @@ -1243,11 +1380,16 @@ type ManagedDatabaseStatus string const ( ManagedDatabaseStatusCreating ManagedDatabaseStatus = "Creating" + ManagedDatabaseStatusDbCopying ManagedDatabaseStatus = "DbCopying" + ManagedDatabaseStatusDbMoving ManagedDatabaseStatus = "DbMoving" ManagedDatabaseStatusInaccessible ManagedDatabaseStatus = "Inaccessible" ManagedDatabaseStatusOffline ManagedDatabaseStatus = "Offline" ManagedDatabaseStatusOnline ManagedDatabaseStatus = "Online" ManagedDatabaseStatusRestoring ManagedDatabaseStatus = "Restoring" ManagedDatabaseStatusShutdown ManagedDatabaseStatus = "Shutdown" + ManagedDatabaseStatusStarting ManagedDatabaseStatus = "Starting" + ManagedDatabaseStatusStopped ManagedDatabaseStatus = "Stopped" + ManagedDatabaseStatusStopping ManagedDatabaseStatus = "Stopping" ManagedDatabaseStatusUpdating ManagedDatabaseStatus = "Updating" ) @@ -1255,11 +1397,16 @@ const ( func PossibleManagedDatabaseStatusValues() []ManagedDatabaseStatus { return []ManagedDatabaseStatus{ ManagedDatabaseStatusCreating, + ManagedDatabaseStatusDbCopying, + ManagedDatabaseStatusDbMoving, ManagedDatabaseStatusInaccessible, ManagedDatabaseStatusOffline, ManagedDatabaseStatusOnline, ManagedDatabaseStatusRestoring, ManagedDatabaseStatusShutdown, + ManagedDatabaseStatusStarting, + ManagedDatabaseStatusStopped, + ManagedDatabaseStatusStopping, ManagedDatabaseStatusUpdating, } } @@ -1367,6 +1514,35 @@ func PossibleManagedInstanceProxyOverrideValues() []ManagedInstanceProxyOverride } } +type ManagedLedgerDigestUploadsName string + +const ( + ManagedLedgerDigestUploadsNameCurrent ManagedLedgerDigestUploadsName = "current" +) + +// PossibleManagedLedgerDigestUploadsNameValues returns the possible values for the ManagedLedgerDigestUploadsName const type. +func PossibleManagedLedgerDigestUploadsNameValues() []ManagedLedgerDigestUploadsName { + return []ManagedLedgerDigestUploadsName{ + ManagedLedgerDigestUploadsNameCurrent, + } +} + +// ManagedLedgerDigestUploadsState - Specifies the state of ledger digest upload. +type ManagedLedgerDigestUploadsState string + +const ( + ManagedLedgerDigestUploadsStateDisabled ManagedLedgerDigestUploadsState = "Disabled" + ManagedLedgerDigestUploadsStateEnabled ManagedLedgerDigestUploadsState = "Enabled" +) + +// PossibleManagedLedgerDigestUploadsStateValues returns the possible values for the ManagedLedgerDigestUploadsState const type. +func PossibleManagedLedgerDigestUploadsStateValues() []ManagedLedgerDigestUploadsState { + return []ManagedLedgerDigestUploadsState{ + ManagedLedgerDigestUploadsStateDisabled, + ManagedLedgerDigestUploadsStateEnabled, + } +} + // ManagedServerCreateMode - Specifies the mode of database creation. // Default: Regular instance creation. // Restore: Creates an instance by restoring a set of backups to specific point in time. RestorePointInTime and SourceManagedInstanceId @@ -1464,16 +1640,36 @@ func PossibleMetricTypeValues() []MetricType { } } -// OperationMode - Operation Mode. +// MoveOperationMode - Operation mode. +type MoveOperationMode string + +const ( + MoveOperationModeCopy MoveOperationMode = "Copy" + MoveOperationModeMove MoveOperationMode = "Move" +) + +// PossibleMoveOperationModeValues returns the possible values for the MoveOperationMode const type. +func PossibleMoveOperationModeValues() []MoveOperationMode { + return []MoveOperationMode{ + MoveOperationModeCopy, + MoveOperationModeMove, + } +} + +// OperationMode - Operation mode of the operation: Import, Export, or PolybaseImport. type OperationMode string const ( + OperationModeExport OperationMode = "Export" + OperationModeImport OperationMode = "Import" OperationModePolybaseImport OperationMode = "PolybaseImport" ) // PossibleOperationModeValues returns the possible values for the OperationMode const type. func PossibleOperationModeValues() []OperationMode { return []OperationMode{ + OperationModeExport, + OperationModeImport, OperationModePolybaseImport, } } @@ -1524,27 +1720,23 @@ func PossiblePerformanceLevelUnitValues() []PerformanceLevelUnit { } } -// PrimaryAggregationType - The primary aggregation type defining how metric values are displayed. -type PrimaryAggregationType string +// Phase - The operation phase. +type Phase string const ( - PrimaryAggregationTypeAverage PrimaryAggregationType = "Average" - PrimaryAggregationTypeCount PrimaryAggregationType = "Count" - PrimaryAggregationTypeMaximum PrimaryAggregationType = "Maximum" - PrimaryAggregationTypeMinimum PrimaryAggregationType = "Minimum" - PrimaryAggregationTypeNone PrimaryAggregationType = "None" - PrimaryAggregationTypeTotal PrimaryAggregationType = "Total" + PhaseCatchup Phase = "Catchup" + PhaseCopying Phase = "Copying" + PhaseCutoverInProgress Phase = "CutoverInProgress" + PhaseWaitingForCutover Phase = "WaitingForCutover" ) -// PossiblePrimaryAggregationTypeValues returns the possible values for the PrimaryAggregationType const type. -func PossiblePrimaryAggregationTypeValues() []PrimaryAggregationType { - return []PrimaryAggregationType{ - PrimaryAggregationTypeAverage, - PrimaryAggregationTypeCount, - PrimaryAggregationTypeMaximum, - PrimaryAggregationTypeMinimum, - PrimaryAggregationTypeNone, - PrimaryAggregationTypeTotal, +// PossiblePhaseValues returns the possible values for the Phase const type. +func PossiblePhaseValues() []Phase { + return []Phase{ + PhaseCatchup, + PhaseCopying, + PhaseCutoverInProgress, + PhaseWaitingForCutover, } } @@ -1807,12 +1999,13 @@ func PossibleReplicaTypeValues() []ReplicaType { } } -// ReplicationLinkType - Link type (GEO, NAMED). +// ReplicationLinkType - Link type (GEO, NAMED, STANDBY). type ReplicationLinkType string const ( - ReplicationLinkTypeGEO ReplicationLinkType = "GEO" - ReplicationLinkTypeNAMED ReplicationLinkType = "NAMED" + ReplicationLinkTypeGEO ReplicationLinkType = "GEO" + ReplicationLinkTypeNAMED ReplicationLinkType = "NAMED" + ReplicationLinkTypeSTANDBY ReplicationLinkType = "STANDBY" ) // PossibleReplicationLinkTypeValues returns the possible values for the ReplicationLinkType const type. @@ -1820,6 +2013,7 @@ func PossibleReplicationLinkTypeValues() []ReplicationLinkType { return []ReplicationLinkType{ ReplicationLinkTypeGEO, ReplicationLinkTypeNAMED, + ReplicationLinkTypeSTANDBY, } } @@ -1910,6 +2104,82 @@ func PossibleRestorePointTypeValues() []RestorePointType { } } +// RoleChangeType - The type of the role change, can be Planned or Forced. +type RoleChangeType string + +const ( + RoleChangeTypeForced RoleChangeType = "Forced" + RoleChangeTypePlanned RoleChangeType = "Planned" +) + +// PossibleRoleChangeTypeValues returns the possible values for the RoleChangeType const type. +func PossibleRoleChangeTypeValues() []RoleChangeType { + return []RoleChangeType{ + RoleChangeTypeForced, + RoleChangeTypePlanned, + } +} + +// RuleSeverity - SQL Vulnerability Assessment rule severity. +type RuleSeverity string + +const ( + RuleSeverityHigh RuleSeverity = "High" + RuleSeverityInformational RuleSeverity = "Informational" + RuleSeverityLow RuleSeverity = "Low" + RuleSeverityMedium RuleSeverity = "Medium" + RuleSeverityObsolete RuleSeverity = "Obsolete" +) + +// PossibleRuleSeverityValues returns the possible values for the RuleSeverity const type. +func PossibleRuleSeverityValues() []RuleSeverity { + return []RuleSeverity{ + RuleSeverityHigh, + RuleSeverityInformational, + RuleSeverityLow, + RuleSeverityMedium, + RuleSeverityObsolete, + } +} + +// RuleStatus - SQL Vulnerability Assessment baseline status +type RuleStatus string + +const ( + RuleStatusFinding RuleStatus = "Finding" + RuleStatusInternalError RuleStatus = "InternalError" + RuleStatusNonFinding RuleStatus = "NonFinding" +) + +// PossibleRuleStatusValues returns the possible values for the RuleStatus const type. +func PossibleRuleStatusValues() []RuleStatus { + return []RuleStatus{ + RuleStatusFinding, + RuleStatusInternalError, + RuleStatusNonFinding, + } +} + +// RuleType - SQL Vulnerability Assessment rule type. +type RuleType string + +const ( + RuleTypeBaselineExpected RuleType = "BaselineExpected" + RuleTypeBinary RuleType = "Binary" + RuleTypeNegativeList RuleType = "NegativeList" + RuleTypePositiveList RuleType = "PositiveList" +) + +// PossibleRuleTypeValues returns the possible values for the RuleType const type. +func PossibleRuleTypeValues() []RuleType { + return []RuleType{ + RuleTypeBaselineExpected, + RuleTypeBinary, + RuleTypeNegativeList, + RuleTypePositiveList, + } +} + // SQLAgentConfigurationPropertiesState - The state of Sql Agent. type SQLAgentConfigurationPropertiesState string @@ -1926,6 +2196,49 @@ func PossibleSQLAgentConfigurationPropertiesStateValues() []SQLAgentConfiguratio } } +type SQLVulnerabilityAssessmentName string + +const ( + SQLVulnerabilityAssessmentNameDefault SQLVulnerabilityAssessmentName = "default" +) + +// PossibleSQLVulnerabilityAssessmentNameValues returns the possible values for the SQLVulnerabilityAssessmentName const type. +func PossibleSQLVulnerabilityAssessmentNameValues() []SQLVulnerabilityAssessmentName { + return []SQLVulnerabilityAssessmentName{ + SQLVulnerabilityAssessmentNameDefault, + } +} + +type SQLVulnerabilityAssessmentName string + +const ( + SQLVulnerabilityAssessmentNameDefault SQLVulnerabilityAssessmentName = "default" +) + +// PossibleSQLVulnerabilityAssessmentNameValues returns the possible values for the SQLVulnerabilityAssessmentName const type. +func PossibleSQLVulnerabilityAssessmentNameValues() []SQLVulnerabilityAssessmentName { + return []SQLVulnerabilityAssessmentName{ + SQLVulnerabilityAssessmentNameDefault, + } +} + +// SQLVulnerabilityAssessmentState - Specifies the state of the SQL Vulnerability Assessment, whether it is enabled or disabled +// or a state has not been applied yet on the specific database or server. +type SQLVulnerabilityAssessmentState string + +const ( + SQLVulnerabilityAssessmentStateEnabled SQLVulnerabilityAssessmentState = "Enabled" + SQLVulnerabilityAssessmentStateDisabled SQLVulnerabilityAssessmentState = "Disabled" +) + +// PossibleSQLVulnerabilityAssessmentStateValues returns the possible values for the SQLVulnerabilityAssessmentState const type. +func PossibleSQLVulnerabilityAssessmentStateValues() []SQLVulnerabilityAssessmentState { + return []SQLVulnerabilityAssessmentState{ + SQLVulnerabilityAssessmentStateEnabled, + SQLVulnerabilityAssessmentStateDisabled, + } +} + // SampleName - The name of the sample schema to apply when creating this database. type SampleName string @@ -1944,12 +2257,29 @@ func PossibleSampleNameValues() []SampleName { } } -// SecondaryType - The secondary type of the database if it is a secondary. Valid values are Geo and Named. +// SecondaryInstanceType - Type of the geo-secondary instance. Set 'Standby' if the instance is used as a DR option only. +type SecondaryInstanceType string + +const ( + SecondaryInstanceTypeGeo SecondaryInstanceType = "Geo" + SecondaryInstanceTypeStandby SecondaryInstanceType = "Standby" +) + +// PossibleSecondaryInstanceTypeValues returns the possible values for the SecondaryInstanceType const type. +func PossibleSecondaryInstanceTypeValues() []SecondaryInstanceType { + return []SecondaryInstanceType{ + SecondaryInstanceTypeGeo, + SecondaryInstanceTypeStandby, + } +} + +// SecondaryType - The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. type SecondaryType string const ( - SecondaryTypeGeo SecondaryType = "Geo" - SecondaryTypeNamed SecondaryType = "Named" + SecondaryTypeGeo SecondaryType = "Geo" + SecondaryTypeNamed SecondaryType = "Named" + SecondaryTypeStandby SecondaryType = "Standby" ) // PossibleSecondaryTypeValues returns the possible values for the SecondaryType const type. @@ -1957,13 +2287,14 @@ func PossibleSecondaryTypeValues() []SecondaryType { return []SecondaryType{ SecondaryTypeGeo, SecondaryTypeNamed, + SecondaryTypeStandby, } } type SecurityAlertPolicyName string const ( - SecurityAlertPolicyNameDefault SecurityAlertPolicyName = "Default" + SecurityAlertPolicyNameDefault SecurityAlertPolicyName = "default" ) // PossibleSecurityAlertPolicyNameValues returns the possible values for the SecurityAlertPolicyName const type. @@ -1973,6 +2304,19 @@ func PossibleSecurityAlertPolicyNameValues() []SecurityAlertPolicyName { } } +type SecurityAlertPolicyNameAutoGenerated string + +const ( + SecurityAlertPolicyNameAutoGeneratedDefault SecurityAlertPolicyNameAutoGenerated = "Default" +) + +// PossibleSecurityAlertPolicyNameAutoGeneratedValues returns the possible values for the SecurityAlertPolicyNameAutoGenerated const type. +func PossibleSecurityAlertPolicyNameAutoGeneratedValues() []SecurityAlertPolicyNameAutoGenerated { + return []SecurityAlertPolicyNameAutoGenerated{ + SecurityAlertPolicyNameAutoGeneratedDefault, + } +} + // SecurityAlertPolicyState - Specifies the state of the policy, whether it is enabled or disabled or a policy has not been // applied yet on the specific database. type SecurityAlertPolicyState string @@ -2078,6 +2422,19 @@ func PossibleSensitivityLabelUpdateKindValues() []SensitivityLabelUpdateKind { } } +type ServerConfigurationOptionName string + +const ( + ServerConfigurationOptionNameAllowPolybaseExport ServerConfigurationOptionName = "allowPolybaseExport" +) + +// PossibleServerConfigurationOptionNameValues returns the possible values for the ServerConfigurationOptionName const type. +func PossibleServerConfigurationOptionNameValues() []ServerConfigurationOptionName { + return []ServerConfigurationOptionName{ + ServerConfigurationOptionNameAllowPolybaseExport, + } +} + // ServerConnectionType - The server connection type. type ServerConnectionType string @@ -2112,8 +2469,8 @@ func PossibleServerKeyTypeValues() []ServerKeyType { } } -// ServerNetworkAccessFlag - Whether or not public endpoint access is allowed for this server. Value is optional but if passed -// in, must be 'Enabled' or 'Disabled' +// ServerNetworkAccessFlag - Whether or not to restrict outbound network access for this server. Value is optional but if +// passed in, must be 'Enabled' or 'Disabled' type ServerNetworkAccessFlag string const ( @@ -2129,6 +2486,25 @@ func PossibleServerNetworkAccessFlagValues() []ServerNetworkAccessFlag { } } +// ServerPublicNetworkAccessFlag - Whether or not public endpoint access is allowed for this server. Value is optional but +// if passed in, must be 'Enabled' or 'Disabled' or 'SecuredByPerimeter' +type ServerPublicNetworkAccessFlag string + +const ( + ServerPublicNetworkAccessFlagDisabled ServerPublicNetworkAccessFlag = "Disabled" + ServerPublicNetworkAccessFlagEnabled ServerPublicNetworkAccessFlag = "Enabled" + ServerPublicNetworkAccessFlagSecuredByPerimeter ServerPublicNetworkAccessFlag = "SecuredByPerimeter" +) + +// PossibleServerPublicNetworkAccessFlagValues returns the possible values for the ServerPublicNetworkAccessFlag const type. +func PossibleServerPublicNetworkAccessFlagValues() []ServerPublicNetworkAccessFlag { + return []ServerPublicNetworkAccessFlag{ + ServerPublicNetworkAccessFlagDisabled, + ServerPublicNetworkAccessFlagEnabled, + ServerPublicNetworkAccessFlagSecuredByPerimeter, + } +} + type ServerTrustGroupPropertiesTrustScopesItem string const ( @@ -2160,148 +2536,6 @@ func PossibleServerWorkspaceFeatureValues() []ServerWorkspaceFeature { } } -// ServiceObjectiveName - The serviceLevelObjective for SLO usage metric. -type ServiceObjectiveName string - -const ( - ServiceObjectiveNameBasic ServiceObjectiveName = "Basic" - ServiceObjectiveNameDS100 ServiceObjectiveName = "DS100" - ServiceObjectiveNameDS1000 ServiceObjectiveName = "DS1000" - ServiceObjectiveNameDS1200 ServiceObjectiveName = "DS1200" - ServiceObjectiveNameDS1500 ServiceObjectiveName = "DS1500" - ServiceObjectiveNameDS200 ServiceObjectiveName = "DS200" - ServiceObjectiveNameDS2000 ServiceObjectiveName = "DS2000" - ServiceObjectiveNameDS300 ServiceObjectiveName = "DS300" - ServiceObjectiveNameDS400 ServiceObjectiveName = "DS400" - ServiceObjectiveNameDS500 ServiceObjectiveName = "DS500" - ServiceObjectiveNameDS600 ServiceObjectiveName = "DS600" - ServiceObjectiveNameDW100 ServiceObjectiveName = "DW100" - ServiceObjectiveNameDW1000 ServiceObjectiveName = "DW1000" - ServiceObjectiveNameDW10000C ServiceObjectiveName = "DW10000c" - ServiceObjectiveNameDW1000C ServiceObjectiveName = "DW1000c" - ServiceObjectiveNameDW1200 ServiceObjectiveName = "DW1200" - ServiceObjectiveNameDW1500 ServiceObjectiveName = "DW1500" - ServiceObjectiveNameDW15000C ServiceObjectiveName = "DW15000c" - ServiceObjectiveNameDW1500C ServiceObjectiveName = "DW1500c" - ServiceObjectiveNameDW200 ServiceObjectiveName = "DW200" - ServiceObjectiveNameDW2000 ServiceObjectiveName = "DW2000" - ServiceObjectiveNameDW2000C ServiceObjectiveName = "DW2000c" - ServiceObjectiveNameDW2500C ServiceObjectiveName = "DW2500c" - ServiceObjectiveNameDW300 ServiceObjectiveName = "DW300" - ServiceObjectiveNameDW3000 ServiceObjectiveName = "DW3000" - ServiceObjectiveNameDW30000C ServiceObjectiveName = "DW30000c" - ServiceObjectiveNameDW3000C ServiceObjectiveName = "DW3000c" - ServiceObjectiveNameDW400 ServiceObjectiveName = "DW400" - ServiceObjectiveNameDW500 ServiceObjectiveName = "DW500" - ServiceObjectiveNameDW5000C ServiceObjectiveName = "DW5000c" - ServiceObjectiveNameDW600 ServiceObjectiveName = "DW600" - ServiceObjectiveNameDW6000 ServiceObjectiveName = "DW6000" - ServiceObjectiveNameDW6000C ServiceObjectiveName = "DW6000c" - ServiceObjectiveNameDW7500C ServiceObjectiveName = "DW7500c" - ServiceObjectiveNameElasticPool ServiceObjectiveName = "ElasticPool" - ServiceObjectiveNameFree ServiceObjectiveName = "Free" - ServiceObjectiveNameP1 ServiceObjectiveName = "P1" - ServiceObjectiveNameP11 ServiceObjectiveName = "P11" - ServiceObjectiveNameP15 ServiceObjectiveName = "P15" - ServiceObjectiveNameP2 ServiceObjectiveName = "P2" - ServiceObjectiveNameP3 ServiceObjectiveName = "P3" - ServiceObjectiveNameP4 ServiceObjectiveName = "P4" - ServiceObjectiveNameP6 ServiceObjectiveName = "P6" - ServiceObjectiveNamePRS1 ServiceObjectiveName = "PRS1" - ServiceObjectiveNamePRS2 ServiceObjectiveName = "PRS2" - ServiceObjectiveNamePRS4 ServiceObjectiveName = "PRS4" - ServiceObjectiveNamePRS6 ServiceObjectiveName = "PRS6" - ServiceObjectiveNameS0 ServiceObjectiveName = "S0" - ServiceObjectiveNameS1 ServiceObjectiveName = "S1" - ServiceObjectiveNameS12 ServiceObjectiveName = "S12" - ServiceObjectiveNameS2 ServiceObjectiveName = "S2" - ServiceObjectiveNameS3 ServiceObjectiveName = "S3" - ServiceObjectiveNameS4 ServiceObjectiveName = "S4" - ServiceObjectiveNameS6 ServiceObjectiveName = "S6" - ServiceObjectiveNameS7 ServiceObjectiveName = "S7" - ServiceObjectiveNameS9 ServiceObjectiveName = "S9" - ServiceObjectiveNameSystem ServiceObjectiveName = "System" - ServiceObjectiveNameSystem0 ServiceObjectiveName = "System0" - ServiceObjectiveNameSystem1 ServiceObjectiveName = "System1" - ServiceObjectiveNameSystem2 ServiceObjectiveName = "System2" - ServiceObjectiveNameSystem2L ServiceObjectiveName = "System2L" - ServiceObjectiveNameSystem3 ServiceObjectiveName = "System3" - ServiceObjectiveNameSystem3L ServiceObjectiveName = "System3L" - ServiceObjectiveNameSystem4 ServiceObjectiveName = "System4" - ServiceObjectiveNameSystem4L ServiceObjectiveName = "System4L" -) - -// PossibleServiceObjectiveNameValues returns the possible values for the ServiceObjectiveName const type. -func PossibleServiceObjectiveNameValues() []ServiceObjectiveName { - return []ServiceObjectiveName{ - ServiceObjectiveNameBasic, - ServiceObjectiveNameDS100, - ServiceObjectiveNameDS1000, - ServiceObjectiveNameDS1200, - ServiceObjectiveNameDS1500, - ServiceObjectiveNameDS200, - ServiceObjectiveNameDS2000, - ServiceObjectiveNameDS300, - ServiceObjectiveNameDS400, - ServiceObjectiveNameDS500, - ServiceObjectiveNameDS600, - ServiceObjectiveNameDW100, - ServiceObjectiveNameDW1000, - ServiceObjectiveNameDW10000C, - ServiceObjectiveNameDW1000C, - ServiceObjectiveNameDW1200, - ServiceObjectiveNameDW1500, - ServiceObjectiveNameDW15000C, - ServiceObjectiveNameDW1500C, - ServiceObjectiveNameDW200, - ServiceObjectiveNameDW2000, - ServiceObjectiveNameDW2000C, - ServiceObjectiveNameDW2500C, - ServiceObjectiveNameDW300, - ServiceObjectiveNameDW3000, - ServiceObjectiveNameDW30000C, - ServiceObjectiveNameDW3000C, - ServiceObjectiveNameDW400, - ServiceObjectiveNameDW500, - ServiceObjectiveNameDW5000C, - ServiceObjectiveNameDW600, - ServiceObjectiveNameDW6000, - ServiceObjectiveNameDW6000C, - ServiceObjectiveNameDW7500C, - ServiceObjectiveNameElasticPool, - ServiceObjectiveNameFree, - ServiceObjectiveNameP1, - ServiceObjectiveNameP11, - ServiceObjectiveNameP15, - ServiceObjectiveNameP2, - ServiceObjectiveNameP3, - ServiceObjectiveNameP4, - ServiceObjectiveNameP6, - ServiceObjectiveNamePRS1, - ServiceObjectiveNamePRS2, - ServiceObjectiveNamePRS4, - ServiceObjectiveNamePRS6, - ServiceObjectiveNameS0, - ServiceObjectiveNameS1, - ServiceObjectiveNameS12, - ServiceObjectiveNameS2, - ServiceObjectiveNameS3, - ServiceObjectiveNameS4, - ServiceObjectiveNameS6, - ServiceObjectiveNameS7, - ServiceObjectiveNameS9, - ServiceObjectiveNameSystem, - ServiceObjectiveNameSystem0, - ServiceObjectiveNameSystem1, - ServiceObjectiveNameSystem2, - ServiceObjectiveNameSystem2L, - ServiceObjectiveNameSystem3, - ServiceObjectiveNameSystem3L, - ServiceObjectiveNameSystem4, - ServiceObjectiveNameSystem4L, - } -} - // ServicePrincipalType - Service principal type. type ServicePrincipalType string @@ -2331,25 +2565,63 @@ func PossibleShortTermRetentionPolicyNameValues() []ShortTermRetentionPolicyName } } +type StartStopScheduleName string + +const ( + StartStopScheduleNameDefault StartStopScheduleName = "default" +) + +// PossibleStartStopScheduleNameValues returns the possible values for the StartStopScheduleName const type. +func PossibleStartStopScheduleNameValues() []StartStopScheduleName { + return []StartStopScheduleName{ + StartStopScheduleNameDefault, + } +} + +type Status string + +const ( + StatusCanceled Status = "Canceled" + StatusCompleted Status = "Completed" + StatusFailed Status = "Failed" + StatusInProgress Status = "InProgress" + StatusNotStarted Status = "NotStarted" + StatusSlowedDown Status = "SlowedDown" +) + +// PossibleStatusValues returns the possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{ + StatusCanceled, + StatusCompleted, + StatusFailed, + StatusInProgress, + StatusNotStarted, + StatusSlowedDown, + } +} + // StorageCapabilityStorageAccountType - The storage account type for the database's backups. type StorageCapabilityStorageAccountType string const ( - StorageCapabilityStorageAccountTypeGRS StorageCapabilityStorageAccountType = "GRS" - StorageCapabilityStorageAccountTypeLRS StorageCapabilityStorageAccountType = "LRS" - StorageCapabilityStorageAccountTypeZRS StorageCapabilityStorageAccountType = "ZRS" + StorageCapabilityStorageAccountTypeGRS StorageCapabilityStorageAccountType = "GRS" + StorageCapabilityStorageAccountTypeGZRS StorageCapabilityStorageAccountType = "GZRS" + StorageCapabilityStorageAccountTypeLRS StorageCapabilityStorageAccountType = "LRS" + StorageCapabilityStorageAccountTypeZRS StorageCapabilityStorageAccountType = "ZRS" ) // PossibleStorageCapabilityStorageAccountTypeValues returns the possible values for the StorageCapabilityStorageAccountType const type. func PossibleStorageCapabilityStorageAccountTypeValues() []StorageCapabilityStorageAccountType { return []StorageCapabilityStorageAccountType{ StorageCapabilityStorageAccountTypeGRS, + StorageCapabilityStorageAccountTypeGZRS, StorageCapabilityStorageAccountTypeLRS, StorageCapabilityStorageAccountTypeZRS, } } -// StorageKeyType - Storage key type. +// StorageKeyType - Storage key type: StorageAccessKey or SharedAccessKey. type StorageKeyType string const ( @@ -2589,77 +2861,6 @@ func PossibleTransparentDataEncryptionStateValues() []TransparentDataEncryptionS } } -// UnitDefinitionType - The unit of the metric. -type UnitDefinitionType string - -const ( - UnitDefinitionTypeBytes UnitDefinitionType = "Bytes" - UnitDefinitionTypeBytesPerSecond UnitDefinitionType = "BytesPerSecond" - UnitDefinitionTypeCount UnitDefinitionType = "Count" - UnitDefinitionTypeCountPerSecond UnitDefinitionType = "CountPerSecond" - UnitDefinitionTypePercent UnitDefinitionType = "Percent" - UnitDefinitionTypeSeconds UnitDefinitionType = "Seconds" -) - -// PossibleUnitDefinitionTypeValues returns the possible values for the UnitDefinitionType const type. -func PossibleUnitDefinitionTypeValues() []UnitDefinitionType { - return []UnitDefinitionType{ - UnitDefinitionTypeBytes, - UnitDefinitionTypeBytesPerSecond, - UnitDefinitionTypeCount, - UnitDefinitionTypeCountPerSecond, - UnitDefinitionTypePercent, - UnitDefinitionTypeSeconds, - } -} - -// UnitType - The unit of the metric. -type UnitType string - -const ( - UnitTypeBytes UnitType = "bytes" - UnitTypeBytesPerSecond UnitType = "bytesPerSecond" - UnitTypeCount UnitType = "count" - UnitTypeCountPerSecond UnitType = "countPerSecond" - UnitTypePercent UnitType = "percent" - UnitTypeSeconds UnitType = "seconds" -) - -// PossibleUnitTypeValues returns the possible values for the UnitType const type. -func PossibleUnitTypeValues() []UnitType { - return []UnitType{ - UnitTypeBytes, - UnitTypeBytesPerSecond, - UnitTypeCount, - UnitTypeCountPerSecond, - UnitTypePercent, - UnitTypeSeconds, - } -} - -type UpsertManagedServerOperationStepStatus string - -const ( - UpsertManagedServerOperationStepStatusCanceled UpsertManagedServerOperationStepStatus = "Canceled" - UpsertManagedServerOperationStepStatusCompleted UpsertManagedServerOperationStepStatus = "Completed" - UpsertManagedServerOperationStepStatusFailed UpsertManagedServerOperationStepStatus = "Failed" - UpsertManagedServerOperationStepStatusInProgress UpsertManagedServerOperationStepStatus = "InProgress" - UpsertManagedServerOperationStepStatusNotStarted UpsertManagedServerOperationStepStatus = "NotStarted" - UpsertManagedServerOperationStepStatusSlowedDown UpsertManagedServerOperationStepStatus = "SlowedDown" -) - -// PossibleUpsertManagedServerOperationStepStatusValues returns the possible values for the UpsertManagedServerOperationStepStatus const type. -func PossibleUpsertManagedServerOperationStepStatusValues() []UpsertManagedServerOperationStepStatus { - return []UpsertManagedServerOperationStepStatus{ - UpsertManagedServerOperationStepStatusCanceled, - UpsertManagedServerOperationStepStatusCompleted, - UpsertManagedServerOperationStepStatusFailed, - UpsertManagedServerOperationStepStatusInProgress, - UpsertManagedServerOperationStepStatusNotStarted, - UpsertManagedServerOperationStepStatusSlowedDown, - } -} - // VirtualNetworkRuleState - Virtual Network Rule State type VirtualNetworkRuleState string diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseadvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseadvancedthreatprotectionsettings_client.go rename to sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_client.go index 23ef15b995f1..0f305bcfa2ca 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseadvancedthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseadvancedthreatprotectionsettings_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 armsql @@ -31,9 +32,9 @@ type DatabaseAdvancedThreatProtectionSettingsClient struct { } // NewDatabaseAdvancedThreatProtectionSettingsClient creates a new instance of DatabaseAdvancedThreatProtectionSettingsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseAdvancedThreatProtectionSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseAdvancedThreatProtectionSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewDatabaseAdvancedThreatProtectionSettingsClient(subscriptionID string, cr // CreateOrUpdate - Creates or updates a database's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// advancedThreatProtectionName - The name of the Advanced Threat Protection state. -// parameters - The database Advanced Threat Protection state. -// options - DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions contains the optional parameters for the -// DatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - advancedThreatProtectionName - The name of the Advanced Threat Protection state. +// - parameters - The database Advanced Threat Protection state. +// - options - DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions contains the optional parameters for the +// DatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate method. func (client *DatabaseAdvancedThreatProtectionSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters DatabaseAdvancedThreatProtection, options *DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions) (DatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, advancedThreatProtectionName, parameters, options) if err != nil { @@ -108,7 +110,7 @@ func (client *DatabaseAdvancedThreatProtectionSettingsClient) createOrUpdateCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,14 +127,15 @@ func (client *DatabaseAdvancedThreatProtectionSettingsClient) createOrUpdateHand // Get - Gets a database's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// advancedThreatProtectionName - The name of the Advanced Threat Protection state. -// options - DatabaseAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the DatabaseAdvancedThreatProtectionSettingsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - advancedThreatProtectionName - The name of the Advanced Threat Protection state. +// - options - DatabaseAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the DatabaseAdvancedThreatProtectionSettingsClient.Get +// method. func (client *DatabaseAdvancedThreatProtectionSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *DatabaseAdvancedThreatProtectionSettingsClientGetOptions) (DatabaseAdvancedThreatProtectionSettingsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, advancedThreatProtectionName, options) if err != nil { @@ -176,7 +179,7 @@ func (client *DatabaseAdvancedThreatProtectionSettingsClient) getCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,14 +195,14 @@ func (client *DatabaseAdvancedThreatProtectionSettingsClient) getHandleResponse( } // NewListByDatabasePager - Gets a list of database's Advanced Threat Protection states. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions contains the optional parameters for the -// DatabaseAdvancedThreatProtectionSettingsClient.ListByDatabase method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions contains the optional parameters for the +// DatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager method. func (client *DatabaseAdvancedThreatProtectionSettingsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions) *runtime.Pager[DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse]{ More: func(page DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse) bool { @@ -252,7 +255,7 @@ func (client *DatabaseAdvancedThreatProtectionSettingsClient) listByDatabaseCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseadvisors_client.go b/sdk/resourcemanager/sql/armsql/databaseadvisors_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseadvisors_client.go rename to sdk/resourcemanager/sql/armsql/databaseadvisors_client.go index fbf894cf8870..351d47e15928 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseadvisors_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseadvisors_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 armsql @@ -31,9 +32,9 @@ type DatabaseAdvisorsClient struct { } // NewDatabaseAdvisorsClient creates a new instance of DatabaseAdvisorsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseAdvisorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseAdvisorsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewDatabaseAdvisorsClient(subscriptionID string, credential azcore.TokenCre // Get - Gets a database advisor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// advisorName - The name of the Database Advisor. -// options - DatabaseAdvisorsClientGetOptions contains the optional parameters for the DatabaseAdvisorsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - advisorName - The name of the Database Advisor. +// - options - DatabaseAdvisorsClientGetOptions contains the optional parameters for the DatabaseAdvisorsClient.Get method. func (client *DatabaseAdvisorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, options *DatabaseAdvisorsClientGetOptions) (DatabaseAdvisorsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, advisorName, options) if err != nil { @@ -106,7 +108,7 @@ func (client *DatabaseAdvisorsClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,13 +125,14 @@ func (client *DatabaseAdvisorsClient) getHandleResponse(resp *http.Response) (Da // ListByDatabase - Gets a list of database advisors. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabaseAdvisorsClientListByDatabaseOptions contains the optional parameters for the DatabaseAdvisorsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseAdvisorsClientListByDatabaseOptions contains the optional parameters for the DatabaseAdvisorsClient.ListByDatabase +// method. func (client *DatabaseAdvisorsClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabaseAdvisorsClientListByDatabaseOptions) (DatabaseAdvisorsClientListByDatabaseResponse, error) { req, err := client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -172,7 +175,7 @@ func (client *DatabaseAdvisorsClient) listByDatabaseCreateRequest(ctx context.Co if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -189,14 +192,15 @@ func (client *DatabaseAdvisorsClient) listByDatabaseHandleResponse(resp *http.Re // Update - Updates a database advisor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// advisorName - The name of the Database Advisor. -// parameters - The requested advisor resource state. -// options - DatabaseAdvisorsClientUpdateOptions contains the optional parameters for the DatabaseAdvisorsClient.Update method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - advisorName - The name of the Database Advisor. +// - parameters - The requested advisor resource state. +// - options - DatabaseAdvisorsClientUpdateOptions contains the optional parameters for the DatabaseAdvisorsClient.Update method. func (client *DatabaseAdvisorsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, parameters Advisor, options *DatabaseAdvisorsClientUpdateOptions) (DatabaseAdvisorsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, advisorName, parameters, options) if err != nil { @@ -240,7 +244,7 @@ func (client *DatabaseAdvisorsClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseautomatictuning_client.go b/sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseautomatictuning_client.go rename to sdk/resourcemanager/sql/armsql/databaseautomatictuning_client.go index 3826ebee3b40..e1672697b847 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseautomatictuning_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseautomatictuning_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 armsql @@ -31,9 +32,9 @@ type DatabaseAutomaticTuningClient struct { } // NewDatabaseAutomaticTuningClient creates a new instance of DatabaseAutomaticTuningClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseAutomaticTuningClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseAutomaticTuningClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewDatabaseAutomaticTuningClient(subscriptionID string, credential azcore.T // Get - Gets a database's automatic tuning. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabaseAutomaticTuningClientGetOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseAutomaticTuningClientGetOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Get +// method. func (client *DatabaseAutomaticTuningClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabaseAutomaticTuningClientGetOptions) (DatabaseAutomaticTuningClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -102,7 +104,7 @@ func (client *DatabaseAutomaticTuningClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -119,14 +121,15 @@ func (client *DatabaseAutomaticTuningClient) getHandleResponse(resp *http.Respon // Update - Update automatic tuning properties for target database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// parameters - The requested automatic tuning resource state. -// options - DatabaseAutomaticTuningClientUpdateOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Update -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - parameters - The requested automatic tuning resource state. +// - options - DatabaseAutomaticTuningClientUpdateOptions contains the optional parameters for the DatabaseAutomaticTuningClient.Update +// method. func (client *DatabaseAutomaticTuningClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseAutomaticTuning, options *DatabaseAutomaticTuningClientUpdateOptions) (DatabaseAutomaticTuningClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -166,7 +169,7 @@ func (client *DatabaseAutomaticTuningClient) updateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseblobauditingpolicies_client.go rename to sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_client.go index 8b45149569c2..79ac2d0f97c3 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseblobauditingpolicies_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 armsql @@ -31,9 +32,9 @@ type DatabaseBlobAuditingPoliciesClient struct { } // NewDatabaseBlobAuditingPoliciesClient creates a new instance of DatabaseBlobAuditingPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseBlobAuditingPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseBlobAuditingPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewDatabaseBlobAuditingPoliciesClient(subscriptionID string, credential azc // CreateOrUpdate - Creates or updates a database's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// parameters - The database blob auditing policy. -// options - DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - parameters - The database blob auditing policy. +// - options - DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.CreateOrUpdate +// method. func (client *DatabaseBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseBlobAuditingPolicy, options *DatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions) (DatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -104,7 +106,7 @@ func (client *DatabaseBlobAuditingPoliciesClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,13 +123,14 @@ func (client *DatabaseBlobAuditingPoliciesClient) createOrUpdateHandleResponse(r // Get - Gets a database's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.Get +// method. func (client *DatabaseBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabaseBlobAuditingPoliciesClientGetOptions) (DatabaseBlobAuditingPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -168,7 +171,7 @@ func (client *DatabaseBlobAuditingPoliciesClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,14 +187,14 @@ func (client *DatabaseBlobAuditingPoliciesClient) getHandleResponse(resp *http.R } // NewListByDatabasePager - Lists auditing settings of a database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.NewListByDatabasePager +// method. func (client *DatabaseBlobAuditingPoliciesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DatabaseBlobAuditingPoliciesClientListByDatabaseOptions) *runtime.Pager[DatabaseBlobAuditingPoliciesClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseBlobAuditingPoliciesClientListByDatabaseResponse]{ More: func(page DatabaseBlobAuditingPoliciesClientListByDatabaseResponse) bool { @@ -244,7 +247,7 @@ func (client *DatabaseBlobAuditingPoliciesClient) listByDatabaseCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databasecolumns_client.go b/sdk/resourcemanager/sql/armsql/databasecolumns_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_databasecolumns_client.go rename to sdk/resourcemanager/sql/armsql/databasecolumns_client.go index 415bef35b902..2e513e79ca83 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databasecolumns_client.go +++ b/sdk/resourcemanager/sql/armsql/databasecolumns_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 armsql @@ -31,9 +32,9 @@ type DatabaseColumnsClient struct { } // NewDatabaseColumnsClient creates a new instance of DatabaseColumnsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseColumnsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseColumnsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewDatabaseColumnsClient(subscriptionID string, credential azcore.TokenCred // Get - Get database column // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// columnName - The name of the column. -// options - DatabaseColumnsClientGetOptions contains the optional parameters for the DatabaseColumnsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - columnName - The name of the column. +// - options - DatabaseColumnsClientGetOptions contains the optional parameters for the DatabaseColumnsClient.Get method. func (client *DatabaseColumnsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, options *DatabaseColumnsClientGetOptions) (DatabaseColumnsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, options) if err != nil { @@ -116,7 +118,7 @@ func (client *DatabaseColumnsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -132,14 +134,14 @@ func (client *DatabaseColumnsClient) getHandleResponse(resp *http.Response) (Dat } // NewListByDatabasePager - List database columns -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the DatabaseColumnsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the DatabaseColumnsClient.NewListByDatabasePager +// method. func (client *DatabaseColumnsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DatabaseColumnsClientListByDatabaseOptions) *runtime.Pager[DatabaseColumnsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseColumnsClientListByDatabaseResponse]{ More: func(page DatabaseColumnsClientListByDatabaseResponse) bool { @@ -215,7 +217,7 @@ func (client *DatabaseColumnsClient) listByDatabaseCreateRequest(ctx context.Con if options != nil && options.Skiptoken != nil { reqQP.Set("$skiptoken", *options.Skiptoken) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -231,16 +233,16 @@ func (client *DatabaseColumnsClient) listByDatabaseHandleResponse(resp *http.Res } // NewListByTablePager - List database columns -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// options - DatabaseColumnsClientListByTableOptions contains the optional parameters for the DatabaseColumnsClient.ListByTable -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - options - DatabaseColumnsClientListByTableOptions contains the optional parameters for the DatabaseColumnsClient.NewListByTablePager +// method. func (client *DatabaseColumnsClient) NewListByTablePager(resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, options *DatabaseColumnsClientListByTableOptions) *runtime.Pager[DatabaseColumnsClientListByTableResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseColumnsClientListByTableResponse]{ More: func(page DatabaseColumnsClientListByTableResponse) bool { @@ -304,7 +306,7 @@ func (client *DatabaseColumnsClient) listByTableCreateRequest(ctx context.Contex if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client.go b/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client.go new file mode 100644 index 000000000000..d88115609cda --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databaseencryptionprotectors_client.go @@ -0,0 +1,210 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DatabaseEncryptionProtectorsClient contains the methods for the DatabaseEncryptionProtectors group. +// Don't use this type directly, use NewDatabaseEncryptionProtectorsClient() instead. +type DatabaseEncryptionProtectorsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDatabaseEncryptionProtectorsClient creates a new instance of DatabaseEncryptionProtectorsClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDatabaseEncryptionProtectorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseEncryptionProtectorsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DatabaseEncryptionProtectorsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginRevalidate - Revalidates an existing encryption protector for a particular database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - encryptionProtectorName - The name of the encryption protector to be updated. +// - options - DatabaseEncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the DatabaseEncryptionProtectorsClient.BeginRevalidate +// method. +func (client *DatabaseEncryptionProtectorsClient) BeginRevalidate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevalidateOptions) (*runtime.Poller[DatabaseEncryptionProtectorsClientRevalidateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.revalidate(ctx, resourceGroupName, serverName, databaseName, encryptionProtectorName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DatabaseEncryptionProtectorsClientRevalidateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[DatabaseEncryptionProtectorsClientRevalidateResponse](options.ResumeToken, client.pl, nil) + } +} + +// Revalidate - Revalidates an existing encryption protector for a particular database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *DatabaseEncryptionProtectorsClient) revalidate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevalidateOptions) (*http.Response, error) { + req, err := client.revalidateCreateRequest(ctx, resourceGroupName, serverName, databaseName, encryptionProtectorName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// revalidateCreateRequest creates the Revalidate request. +func (client *DatabaseEncryptionProtectorsClient) revalidateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevalidateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/encryptionProtector/{encryptionProtectorName}/revalidate" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if encryptionProtectorName == "" { + return nil, errors.New("parameter encryptionProtectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{encryptionProtectorName}", url.PathEscape(string(encryptionProtectorName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// BeginRevert - Reverts an existing encryption protector for a particular database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - encryptionProtectorName - The name of the encryption protector to be updated. +// - options - DatabaseEncryptionProtectorsClientBeginRevertOptions contains the optional parameters for the DatabaseEncryptionProtectorsClient.BeginRevert +// method. +func (client *DatabaseEncryptionProtectorsClient) BeginRevert(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevertOptions) (*runtime.Poller[DatabaseEncryptionProtectorsClientRevertResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.revert(ctx, resourceGroupName, serverName, databaseName, encryptionProtectorName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DatabaseEncryptionProtectorsClientRevertResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[DatabaseEncryptionProtectorsClientRevertResponse](options.ResumeToken, client.pl, nil) + } +} + +// Revert - Reverts an existing encryption protector for a particular database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *DatabaseEncryptionProtectorsClient) revert(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevertOptions) (*http.Response, error) { + req, err := client.revertCreateRequest(ctx, resourceGroupName, serverName, databaseName, encryptionProtectorName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// revertCreateRequest creates the Revert request. +func (client *DatabaseEncryptionProtectorsClient) revertCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, encryptionProtectorName EncryptionProtectorName, options *DatabaseEncryptionProtectorsClientBeginRevertOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/encryptionProtector/{encryptionProtectorName}/revert" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if encryptionProtectorName == "" { + return nil, errors.New("parameter encryptionProtectorName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{encryptionProtectorName}", url.PathEscape(string(encryptionProtectorName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseextensions_client.go b/sdk/resourcemanager/sql/armsql/databaseextensions_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseextensions_client.go rename to sdk/resourcemanager/sql/armsql/databaseextensions_client.go index 45898aed9988..6cad68b490f7 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseextensions_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseextensions_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 armsql @@ -31,9 +32,9 @@ type DatabaseExtensionsClient struct { } // NewDatabaseExtensionsClient creates a new instance of DatabaseExtensionsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseExtensionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseExtensionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,16 +55,17 @@ func NewDatabaseExtensionsClient(subscriptionID string, credential azcore.TokenC return client, nil } -// BeginCreateOrUpdate - Perform a database extension operation, like polybase import +// BeginCreateOrUpdate - Perform a database extension operation, like database import, database export, or polybase import // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// parameters - The database import request parameters. -// options - DatabaseExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseExtensionsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - parameters - The database import request parameters. +// - options - DatabaseExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabaseExtensionsClient.BeginCreateOrUpdate +// method. func (client *DatabaseExtensionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, extensionName string, parameters DatabaseExtensions, options *DatabaseExtensionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabaseExtensionsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, extensionName, parameters, options) @@ -76,9 +78,10 @@ func (client *DatabaseExtensionsClient) BeginCreateOrUpdate(ctx context.Context, } } -// CreateOrUpdate - Perform a database extension operation, like polybase import +// CreateOrUpdate - Perform a database extension operation, like database import, database export, or polybase import // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DatabaseExtensionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, extensionName string, parameters DatabaseExtensions, options *DatabaseExtensionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, extensionName, parameters, options) if err != nil { @@ -122,7 +125,7 @@ func (client *DatabaseExtensionsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -130,12 +133,13 @@ func (client *DatabaseExtensionsClient) createOrUpdateCreateRequest(ctx context. // Get - Gets a database extension. This will return resource not found as it is not supported. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabaseExtensionsClientGetOptions contains the optional parameters for the DatabaseExtensionsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseExtensionsClientGetOptions contains the optional parameters for the DatabaseExtensionsClient.Get method. func (client *DatabaseExtensionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, extensionName string, options *DatabaseExtensionsClientGetOptions) (DatabaseExtensionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, extensionName, options) if err != nil { @@ -179,20 +183,20 @@ func (client *DatabaseExtensionsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // NewListByDatabasePager - List database extension. This will return an empty list as it is not supported. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabaseExtensionsClientListByDatabaseOptions contains the optional parameters for the DatabaseExtensionsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseExtensionsClientListByDatabaseOptions contains the optional parameters for the DatabaseExtensionsClient.NewListByDatabasePager +// method. func (client *DatabaseExtensionsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DatabaseExtensionsClientListByDatabaseOptions) *runtime.Pager[DatabaseExtensionsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseExtensionsClientListByDatabaseResponse]{ More: func(page DatabaseExtensionsClientListByDatabaseResponse) bool { @@ -245,7 +249,7 @@ func (client *DatabaseExtensionsClient) listByDatabaseCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseoperations_client.go b/sdk/resourcemanager/sql/armsql/databaseoperations_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseoperations_client.go rename to sdk/resourcemanager/sql/armsql/databaseoperations_client.go index fcd2ea77cb73..d9e603afda21 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseoperations_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseoperations_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 armsql @@ -31,9 +32,9 @@ type DatabaseOperationsClient struct { } // NewDatabaseOperationsClient creates a new instance of DatabaseOperationsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseOperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewDatabaseOperationsClient(subscriptionID string, credential azcore.TokenC // Cancel - Cancels the asynchronous operation on the database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// operationID - The operation identifier. -// options - DatabaseOperationsClientCancelOptions contains the optional parameters for the DatabaseOperationsClient.Cancel -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - operationID - The operation identifier. +// - options - DatabaseOperationsClientCancelOptions contains the optional parameters for the DatabaseOperationsClient.Cancel +// method. func (client *DatabaseOperationsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, databaseName string, operationID string, options *DatabaseOperationsClientCancelOptions) (DatabaseOperationsClientCancelResponse, error) { req, err := client.cancelCreateRequest(ctx, resourceGroupName, serverName, databaseName, operationID, options) if err != nil { @@ -104,20 +106,20 @@ func (client *DatabaseOperationsClient) cancelCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // NewListByDatabasePager - Gets a list of operations performed on the database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabaseOperationsClientListByDatabaseOptions contains the optional parameters for the DatabaseOperationsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseOperationsClientListByDatabaseOptions contains the optional parameters for the DatabaseOperationsClient.NewListByDatabasePager +// method. func (client *DatabaseOperationsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DatabaseOperationsClientListByDatabaseOptions) *runtime.Pager[DatabaseOperationsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseOperationsClientListByDatabaseResponse]{ More: func(page DatabaseOperationsClientListByDatabaseResponse) bool { @@ -170,7 +172,7 @@ func (client *DatabaseOperationsClient) listByDatabaseCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaserecommendedactions_client.go b/sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaserecommendedactions_client.go rename to sdk/resourcemanager/sql/armsql/databaserecommendedactions_client.go index 54058de2c788..d38fb22aa9aa 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaserecommendedactions_client.go +++ b/sdk/resourcemanager/sql/armsql/databaserecommendedactions_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 armsql @@ -31,9 +32,9 @@ type DatabaseRecommendedActionsClient struct { } // NewDatabaseRecommendedActionsClient creates a new instance of DatabaseRecommendedActionsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseRecommendedActionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseRecommendedActionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewDatabaseRecommendedActionsClient(subscriptionID string, credential azcor // Get - Gets a database recommended action. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// advisorName - The name of the Database Advisor. -// recommendedActionName - The name of Database Recommended Action. -// options - DatabaseRecommendedActionsClientGetOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - advisorName - The name of the Database Advisor. +// - recommendedActionName - The name of Database Recommended Action. +// - options - DatabaseRecommendedActionsClientGetOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Get +// method. func (client *DatabaseRecommendedActionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, recommendedActionName string, options *DatabaseRecommendedActionsClientGetOptions) (DatabaseRecommendedActionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, advisorName, recommendedActionName, options) if err != nil { @@ -112,7 +114,7 @@ func (client *DatabaseRecommendedActionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -129,14 +131,15 @@ func (client *DatabaseRecommendedActionsClient) getHandleResponse(resp *http.Res // ListByDatabaseAdvisor - Gets list of Database Recommended Actions. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// advisorName - The name of the Database Advisor. -// options - DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions contains the optional parameters for the DatabaseRecommendedActionsClient.ListByDatabaseAdvisor -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - advisorName - The name of the Database Advisor. +// - options - DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions contains the optional parameters for the DatabaseRecommendedActionsClient.ListByDatabaseAdvisor +// method. func (client *DatabaseRecommendedActionsClient) ListByDatabaseAdvisor(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, options *DatabaseRecommendedActionsClientListByDatabaseAdvisorOptions) (DatabaseRecommendedActionsClientListByDatabaseAdvisorResponse, error) { req, err := client.listByDatabaseAdvisorCreateRequest(ctx, resourceGroupName, serverName, databaseName, advisorName, options) if err != nil { @@ -180,7 +183,7 @@ func (client *DatabaseRecommendedActionsClient) listByDatabaseAdvisorCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,16 +200,17 @@ func (client *DatabaseRecommendedActionsClient) listByDatabaseAdvisorHandleRespo // Update - Updates a database recommended action. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// advisorName - The name of the Database Advisor. -// recommendedActionName - The name of Database Recommended Action. -// parameters - The requested recommended action resource state. -// options - DatabaseRecommendedActionsClientUpdateOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Update -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - advisorName - The name of the Database Advisor. +// - recommendedActionName - The name of Database Recommended Action. +// - parameters - The requested recommended action resource state. +// - options - DatabaseRecommendedActionsClientUpdateOptions contains the optional parameters for the DatabaseRecommendedActionsClient.Update +// method. func (client *DatabaseRecommendedActionsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, advisorName string, recommendedActionName string, parameters RecommendedAction, options *DatabaseRecommendedActionsClientUpdateOptions) (DatabaseRecommendedActionsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, advisorName, recommendedActionName, parameters, options) if err != nil { @@ -254,7 +258,7 @@ func (client *DatabaseRecommendedActionsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databases_client.go b/sdk/resourcemanager/sql/armsql/databases_client.go similarity index 73% rename from sdk/resourcemanager/sql/armsql/zz_generated_databases_client.go rename to sdk/resourcemanager/sql/armsql/databases_client.go index 803bb32711fd..51dd5764e40d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databases_client.go +++ b/sdk/resourcemanager/sql/armsql/databases_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 armsql @@ -31,9 +32,9 @@ type DatabasesClient struct { } // NewDatabasesClient creates a new instance of DatabasesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabasesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,21 +57,24 @@ func NewDatabasesClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// parameters - The requested database resource state. -// options - DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - parameters - The requested database resource state. +// - options - DatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the DatabasesClient.BeginCreateOrUpdate +// method. func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[DatabasesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return nil, err } - return runtime.NewPoller[DatabasesClientCreateOrUpdateResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DatabasesClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[DatabasesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -78,7 +82,8 @@ func (client *DatabasesClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters Database, options *DatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -118,7 +123,7 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,19 +131,22 @@ func (client *DatabasesClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes the database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabasesClientBeginDeleteOptions contains the optional parameters for the DatabasesClient.BeginDelete method. func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*runtime.Poller[DatabasesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { return nil, err } - return runtime.NewPoller[DatabasesClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DatabasesClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) } else { return runtime.NewPollerFromResumeToken[DatabasesClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -146,7 +154,8 @@ func (client *DatabasesClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes the database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -186,20 +195,21 @@ func (client *DatabasesClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginExport - Exports a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// parameters - The database export request parameters. -// options - DatabasesClientBeginExportOptions contains the optional parameters for the DatabasesClient.BeginExport method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - parameters - The database export request parameters. +// - options - DatabasesClientBeginExportOptions contains the optional parameters for the DatabasesClient.BeginExport method. func (client *DatabasesClient) BeginExport(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExportDatabaseDefinition, options *DatabasesClientBeginExportOptions) (*runtime.Poller[DatabasesClientExportResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.export(ctx, resourceGroupName, serverName, databaseName, parameters, options) @@ -214,7 +224,8 @@ func (client *DatabasesClient) BeginExport(ctx context.Context, resourceGroupNam // Export - Exports a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DatabasesClient) export(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExportDatabaseDefinition, options *DatabasesClientBeginExportOptions) (*http.Response, error) { req, err := client.exportCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -254,7 +265,7 @@ func (client *DatabasesClient) exportCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -262,12 +273,13 @@ func (client *DatabasesClient) exportCreateRequest(ctx context.Context, resource // BeginFailover - Failovers a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database to failover. -// options - DatabasesClientBeginFailoverOptions contains the optional parameters for the DatabasesClient.BeginFailover method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database to failover. +// - options - DatabasesClientBeginFailoverOptions contains the optional parameters for the DatabasesClient.BeginFailover method. func (client *DatabasesClient) BeginFailover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginFailoverOptions) (*runtime.Poller[DatabasesClientFailoverResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.failover(ctx, resourceGroupName, serverName, databaseName, options) @@ -282,7 +294,8 @@ func (client *DatabasesClient) BeginFailover(ctx context.Context, resourceGroupN // Failover - Failovers a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DatabasesClient) failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginFailoverOptions) (*http.Response, error) { req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -325,19 +338,20 @@ func (client *DatabasesClient) failoverCreateRequest(ctx context.Context, resour if options != nil && options.ReplicaType != nil { reqQP.Set("replicaType", string(*options.ReplicaType)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method. func (client *DatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientGetOptions) (DatabasesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -377,7 +391,13 @@ func (client *DatabasesClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -394,13 +414,14 @@ func (client *DatabasesClient) getHandleResponse(resp *http.Response) (Databases // BeginImport - Imports a bacpac into a new database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// parameters - The database import request parameters. -// options - DatabasesClientBeginImportOptions contains the optional parameters for the DatabasesClient.BeginImport method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - parameters - The database import request parameters. +// - options - DatabasesClientBeginImportOptions contains the optional parameters for the DatabasesClient.BeginImport method. func (client *DatabasesClient) BeginImport(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ImportExistingDatabaseDefinition, options *DatabasesClientBeginImportOptions) (*runtime.Poller[DatabasesClientImportResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.importOperation(ctx, resourceGroupName, serverName, databaseName, parameters, options) @@ -415,7 +436,8 @@ func (client *DatabasesClient) BeginImport(ctx context.Context, resourceGroupNam // Import - Imports a bacpac into a new database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DatabasesClient) importOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ImportExistingDatabaseDefinition, options *DatabasesClientBeginImportOptions) (*http.Response, error) { req, err := client.importCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -455,21 +477,21 @@ func (client *DatabasesClient) importCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } // NewListByElasticPoolPager - Gets a list of databases in an elastic pool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// elasticPoolName - The name of the elastic pool. -// options - DatabasesClientListByElasticPoolOptions contains the optional parameters for the DatabasesClient.ListByElasticPool -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - elasticPoolName - The name of the elastic pool. +// - options - DatabasesClientListByElasticPoolOptions contains the optional parameters for the DatabasesClient.NewListByElasticPoolPager +// method. func (client *DatabasesClient) NewListByElasticPoolPager(resourceGroupName string, serverName string, elasticPoolName string, options *DatabasesClientListByElasticPoolOptions) *runtime.Pager[DatabasesClientListByElasticPoolResponse] { return runtime.NewPager(runtime.PagingHandler[DatabasesClientListByElasticPoolResponse]{ More: func(page DatabasesClientListByElasticPoolResponse) bool { @@ -522,7 +544,7 @@ func (client *DatabasesClient) listByElasticPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -538,12 +560,13 @@ func (client *DatabasesClient) listByElasticPoolHandleResponse(resp *http.Respon } // NewListByServerPager - Gets a list of databases. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.ListByServer method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.NewListByServerPager +// method. func (client *DatabasesClient) NewListByServerPager(resourceGroupName string, serverName string, options *DatabasesClientListByServerOptions) *runtime.Pager[DatabasesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[DatabasesClientListByServerResponse]{ More: func(page DatabasesClientListByServerResponse) bool { @@ -595,7 +618,7 @@ func (client *DatabasesClient) listByServerCreateRequest(ctx context.Context, re if options != nil && options.SkipToken != nil { reqQP.Set("$skipToken", *options.SkipToken) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -611,13 +634,13 @@ func (client *DatabasesClient) listByServerHandleResponse(resp *http.Response) ( } // NewListInaccessibleByServerPager - Gets a list of inaccessible databases in a logical server -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - DatabasesClientListInaccessibleByServerOptions contains the optional parameters for the DatabasesClient.ListInaccessibleByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - DatabasesClientListInaccessibleByServerOptions contains the optional parameters for the DatabasesClient.NewListInaccessibleByServerPager +// method. func (client *DatabasesClient) NewListInaccessibleByServerPager(resourceGroupName string, serverName string, options *DatabasesClientListInaccessibleByServerOptions) *runtime.Pager[DatabasesClientListInaccessibleByServerResponse] { return runtime.NewPager(runtime.PagingHandler[DatabasesClientListInaccessibleByServerResponse]{ More: func(page DatabasesClientListInaccessibleByServerResponse) bool { @@ -666,7 +689,7 @@ func (client *DatabasesClient) listInaccessibleByServerCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -681,155 +704,15 @@ func (client *DatabasesClient) listInaccessibleByServerHandleResponse(resp *http return result, nil } -// NewListMetricDefinitionsPager - Returns database metric definitions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabasesClientListMetricDefinitionsOptions contains the optional parameters for the DatabasesClient.ListMetricDefinitions -// method. -func (client *DatabasesClient) NewListMetricDefinitionsPager(resourceGroupName string, serverName string, databaseName string, options *DatabasesClientListMetricDefinitionsOptions) *runtime.Pager[DatabasesClientListMetricDefinitionsResponse] { - return runtime.NewPager(runtime.PagingHandler[DatabasesClientListMetricDefinitionsResponse]{ - More: func(page DatabasesClientListMetricDefinitionsResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *DatabasesClientListMetricDefinitionsResponse) (DatabasesClientListMetricDefinitionsResponse, error) { - req, err := client.listMetricDefinitionsCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) - if err != nil { - return DatabasesClientListMetricDefinitionsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DatabasesClientListMetricDefinitionsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabasesClientListMetricDefinitionsResponse{}, runtime.NewResponseError(resp) - } - return client.listMetricDefinitionsHandleResponse(resp) - }, - }) -} - -// listMetricDefinitionsCreateRequest creates the ListMetricDefinitions request. -func (client *DatabasesClient) listMetricDefinitionsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientListMetricDefinitionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metricDefinitions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listMetricDefinitionsHandleResponse handles the ListMetricDefinitions response. -func (client *DatabasesClient) listMetricDefinitionsHandleResponse(resp *http.Response) (DatabasesClientListMetricDefinitionsResponse, error) { - result := DatabasesClientListMetricDefinitionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MetricDefinitionListResult); err != nil { - return DatabasesClientListMetricDefinitionsResponse{}, err - } - return result, nil -} - -// NewListMetricsPager - Returns database metrics. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// filter - An OData filter expression that describes a subset of metrics to return. -// options - DatabasesClientListMetricsOptions contains the optional parameters for the DatabasesClient.ListMetrics method. -func (client *DatabasesClient) NewListMetricsPager(resourceGroupName string, serverName string, databaseName string, filter string, options *DatabasesClientListMetricsOptions) *runtime.Pager[DatabasesClientListMetricsResponse] { - return runtime.NewPager(runtime.PagingHandler[DatabasesClientListMetricsResponse]{ - More: func(page DatabasesClientListMetricsResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *DatabasesClientListMetricsResponse) (DatabasesClientListMetricsResponse, error) { - req, err := client.listMetricsCreateRequest(ctx, resourceGroupName, serverName, databaseName, filter, options) - if err != nil { - return DatabasesClientListMetricsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return DatabasesClientListMetricsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return DatabasesClientListMetricsResponse{}, runtime.NewResponseError(resp) - } - return client.listMetricsHandleResponse(resp) - }, - }) -} - -// listMetricsCreateRequest creates the ListMetrics request. -func (client *DatabasesClient) listMetricsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, filter string, options *DatabasesClientListMetricsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/metrics" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if databaseName == "" { - return nil, errors.New("parameter databaseName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - reqQP.Set("$filter", filter) - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listMetricsHandleResponse handles the ListMetrics response. -func (client *DatabasesClient) listMetricsHandleResponse(resp *http.Response) (DatabasesClientListMetricsResponse, error) { - result := DatabasesClientListMetricsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MetricListResult); err != nil { - return DatabasesClientListMetricsResponse{}, err - } - return result, nil -} - // BeginPause - Pauses a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database to be paused. -// options - DatabasesClientBeginPauseOptions contains the optional parameters for the DatabasesClient.BeginPause method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database to be paused. +// - options - DatabasesClientBeginPauseOptions contains the optional parameters for the DatabasesClient.BeginPause method. func (client *DatabasesClient) BeginPause(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginPauseOptions) (*runtime.Poller[DatabasesClientPauseResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.pause(ctx, resourceGroupName, serverName, databaseName, options) @@ -844,7 +727,8 @@ func (client *DatabasesClient) BeginPause(ctx context.Context, resourceGroupName // Pause - Pauses a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DatabasesClient) pause(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginPauseOptions) (*http.Response, error) { req, err := client.pauseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -884,7 +768,7 @@ func (client *DatabasesClient) pauseCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -892,13 +776,14 @@ func (client *DatabasesClient) pauseCreateRequest(ctx context.Context, resourceG // Rename - Renames a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database to rename. -// parameters - The resource move definition for renaming this database. -// options - DatabasesClientRenameOptions contains the optional parameters for the DatabasesClient.Rename method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database to rename. +// - parameters - The resource move definition for renaming this database. +// - options - DatabasesClientRenameOptions contains the optional parameters for the DatabasesClient.Rename method. func (client *DatabasesClient) Rename(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ResourceMoveDefinition, options *DatabasesClientRenameOptions) (DatabasesClientRenameResponse, error) { req, err := client.renameCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -938,19 +823,20 @@ func (client *DatabasesClient) renameCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, parameters) } // BeginResume - Resumes a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database to be resumed. -// options - DatabasesClientBeginResumeOptions contains the optional parameters for the DatabasesClient.BeginResume method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database to be resumed. +// - options - DatabasesClientBeginResumeOptions contains the optional parameters for the DatabasesClient.BeginResume method. func (client *DatabasesClient) BeginResume(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginResumeOptions) (*runtime.Poller[DatabasesClientResumeResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.resume(ctx, resourceGroupName, serverName, databaseName, options) @@ -965,7 +851,8 @@ func (client *DatabasesClient) BeginResume(ctx context.Context, resourceGroupNam // Resume - Resumes a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DatabasesClient) resume(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginResumeOptions) (*http.Response, error) { req, err := client.resumeCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -1005,7 +892,7 @@ func (client *DatabasesClient) resumeCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1013,20 +900,23 @@ func (client *DatabasesClient) resumeCreateRequest(ctx context.Context, resource // BeginUpdate - Updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// parameters - The requested database resource state. -// options - DatabasesClientBeginUpdateOptions contains the optional parameters for the DatabasesClient.BeginUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - parameters - The requested database resource state. +// - options - DatabasesClientBeginUpdateOptions contains the optional parameters for the DatabasesClient.BeginUpdate method. func (client *DatabasesClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseUpdate, options *DatabasesClientBeginUpdateOptions) (*runtime.Poller[DatabasesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { return nil, err } - return runtime.NewPoller[DatabasesClientUpdateResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[DatabasesClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) } else { return runtime.NewPollerFromResumeToken[DatabasesClientUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -1034,7 +924,8 @@ func (client *DatabasesClient) BeginUpdate(ctx context.Context, resourceGroupNam // Update - Updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DatabasesClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DatabaseUpdate, options *DatabasesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -1074,7 +965,7 @@ func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -1082,13 +973,14 @@ func (client *DatabasesClient) updateCreateRequest(ctx context.Context, resource // BeginUpgradeDataWarehouse - Upgrades a data warehouse. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database to be upgraded. -// options - DatabasesClientBeginUpgradeDataWarehouseOptions contains the optional parameters for the DatabasesClient.BeginUpgradeDataWarehouse -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database to be upgraded. +// - options - DatabasesClientBeginUpgradeDataWarehouseOptions contains the optional parameters for the DatabasesClient.BeginUpgradeDataWarehouse +// method. func (client *DatabasesClient) BeginUpgradeDataWarehouse(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginUpgradeDataWarehouseOptions) (*runtime.Poller[DatabasesClientUpgradeDataWarehouseResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.upgradeDataWarehouse(ctx, resourceGroupName, serverName, databaseName, options) @@ -1103,7 +995,8 @@ func (client *DatabasesClient) BeginUpgradeDataWarehouse(ctx context.Context, re // UpgradeDataWarehouse - Upgrades a data warehouse. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DatabasesClient) upgradeDataWarehouse(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabasesClientBeginUpgradeDataWarehouseOptions) (*http.Response, error) { req, err := client.upgradeDataWarehouseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -1143,7 +1036,7 @@ func (client *DatabasesClient) upgradeDataWarehouseCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseschemas_client.go b/sdk/resourcemanager/sql/armsql/databaseschemas_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseschemas_client.go rename to sdk/resourcemanager/sql/armsql/databaseschemas_client.go index 986e482c8473..62045131cb1a 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseschemas_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseschemas_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 armsql @@ -31,9 +32,9 @@ type DatabaseSchemasClient struct { } // NewDatabaseSchemasClient creates a new instance of DatabaseSchemasClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseSchemasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSchemasClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewDatabaseSchemasClient(subscriptionID string, credential azcore.TokenCred // Get - Get database schema // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// options - DatabaseSchemasClientGetOptions contains the optional parameters for the DatabaseSchemasClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - options - DatabaseSchemasClientGetOptions contains the optional parameters for the DatabaseSchemasClient.Get method. func (client *DatabaseSchemasClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, options *DatabaseSchemasClientGetOptions) (DatabaseSchemasClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, options) if err != nil { @@ -106,7 +108,7 @@ func (client *DatabaseSchemasClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -122,14 +124,14 @@ func (client *DatabaseSchemasClient) getHandleResponse(resp *http.Response) (Dat } // NewListByDatabasePager - List database schemas -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the DatabaseSchemasClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the DatabaseSchemasClient.NewListByDatabasePager +// method. func (client *DatabaseSchemasClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DatabaseSchemasClientListByDatabaseOptions) *runtime.Pager[DatabaseSchemasClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseSchemasClientListByDatabaseResponse]{ More: func(page DatabaseSchemasClientListByDatabaseResponse) bool { @@ -185,7 +187,7 @@ func (client *DatabaseSchemasClient) listByDatabaseCreateRequest(ctx context.Con if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databasesecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_databasesecurityalertpolicies_client.go rename to sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_client.go index ab0781b8a519..aef543a59b6d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databasesecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/databasesecurityalertpolicies_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 armsql @@ -31,9 +32,9 @@ type DatabaseSecurityAlertPoliciesClient struct { } // NewDatabaseSecurityAlertPoliciesClient creates a new instance of DatabaseSecurityAlertPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseSecurityAlertPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSecurityAlertPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewDatabaseSecurityAlertPoliciesClient(subscriptionID string, credential az // CreateOrUpdate - Creates or updates a database's security alert policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database for which the security alert policy is defined. -// securityAlertPolicyName - The name of the security alert policy. -// parameters - The database security alert policy. -// options - DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database for which the security alert policy is defined. +// - securityAlertPolicyName - The name of the security alert policy. +// - parameters - The database security alert policy. +// - options - DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.CreateOrUpdate +// method. func (client *DatabaseSecurityAlertPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, securityAlertPolicyName SecurityAlertPolicyName, parameters DatabaseSecurityAlertPolicy, options *DatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions) (DatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, securityAlertPolicyName, parameters, options) if err != nil { @@ -108,7 +110,7 @@ func (client *DatabaseSecurityAlertPoliciesClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,14 +127,15 @@ func (client *DatabaseSecurityAlertPoliciesClient) createOrUpdateHandleResponse( // Get - Gets a database's security alert policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database for which the security alert policy is defined. -// securityAlertPolicyName - The name of the security alert policy. -// options - DatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database for which the security alert policy is defined. +// - securityAlertPolicyName - The name of the security alert policy. +// - options - DatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.Get +// method. func (client *DatabaseSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, securityAlertPolicyName SecurityAlertPolicyName, options *DatabaseSecurityAlertPoliciesClientGetOptions) (DatabaseSecurityAlertPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, securityAlertPolicyName, options) if err != nil { @@ -176,7 +179,7 @@ func (client *DatabaseSecurityAlertPoliciesClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,14 +195,14 @@ func (client *DatabaseSecurityAlertPoliciesClient) getHandleResponse(resp *http. } // NewListByDatabasePager - Gets a list of database's security alert policies. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database for which the security alert policy is defined. -// options - DatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database for which the security alert policy is defined. +// - options - DatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.NewListByDatabasePager +// method. func (client *DatabaseSecurityAlertPoliciesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DatabaseSecurityAlertPoliciesClientListByDatabaseOptions) *runtime.Pager[DatabaseSecurityAlertPoliciesClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseSecurityAlertPoliciesClientListByDatabaseResponse]{ More: func(page DatabaseSecurityAlertPoliciesClientListByDatabaseResponse) bool { @@ -252,7 +255,7 @@ func (client *DatabaseSecurityAlertPoliciesClient) listByDatabaseCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client.go new file mode 100644 index 000000000000..2ee3b4df7894 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentbaselines_client.go @@ -0,0 +1,284 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DatabaseSQLVulnerabilityAssessmentBaselinesClient contains the methods for the DatabaseSQLVulnerabilityAssessmentBaselines group. +// Don't use this type directly, use NewDatabaseSQLVulnerabilityAssessmentBaselinesClient() instead. +type DatabaseSQLVulnerabilityAssessmentBaselinesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDatabaseSQLVulnerabilityAssessmentBaselinesClient creates a new instance of DatabaseSQLVulnerabilityAssessmentBaselinesClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDatabaseSQLVulnerabilityAssessmentBaselinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentBaselinesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DatabaseSQLVulnerabilityAssessmentBaselinesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Add a database's vulnerability assessment rule baseline list. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - parameters - The requested rule baseline resource. +// - options - DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions contains the optional parameters for the +// DatabaseSQLVulnerabilityAssessmentBaselinesClient.CreateOrUpdate method. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput, options *DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions) (DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, baselineName, parameters, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput, options *DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) createOrUpdateHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentBaselineSet); err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Get - Gets a list of database's sql vulnerability assessment rule baselines. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseSQLVulnerabilityAssessmentBaselinesClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentBaselinesClient.Get +// method. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *DatabaseSQLVulnerabilityAssessmentBaselinesClientGetOptions) (DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, baselineName, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *DatabaseSQLVulnerabilityAssessmentBaselinesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) getHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentBaselineSet); err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse{}, err + } + return result, nil +} + +// NewListBySQLVulnerabilityAssessmentPager - Gets a list of database's sql vulnerability assessment rule baselines. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentOptions contains the optional +// parameters for the DatabaseSQLVulnerabilityAssessmentBaselinesClient.NewListBySQLVulnerabilityAssessmentPager method. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) NewListBySQLVulnerabilityAssessmentPager(resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse] { + return runtime.NewPager(runtime.PagingHandler[DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse]{ + More: func(page DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse) (DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySQLVulnerabilityAssessmentCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse{}, runtime.NewResponseError(resp) + } + return client.listBySQLVulnerabilityAssessmentHandleResponse(resp) + }, + }) +} + +// listBySQLVulnerabilityAssessmentCreateRequest creates the ListBySQLVulnerabilityAssessment request. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) listBySQLVulnerabilityAssessmentCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySQLVulnerabilityAssessmentHandleResponse handles the ListBySQLVulnerabilityAssessment response. +func (client *DatabaseSQLVulnerabilityAssessmentBaselinesClient) listBySQLVulnerabilityAssessmentHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentBaselineSetListResult); err != nil { + return DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client.go new file mode 100644 index 000000000000..a17e21108234 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentexecutescan_client.go @@ -0,0 +1,131 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DatabaseSQLVulnerabilityAssessmentExecuteScanClient contains the methods for the DatabaseSQLVulnerabilityAssessmentExecuteScan group. +// Don't use this type directly, use NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient() instead. +type DatabaseSQLVulnerabilityAssessmentExecuteScanClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient creates a new instance of DatabaseSQLVulnerabilityAssessmentExecuteScanClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDatabaseSQLVulnerabilityAssessmentExecuteScanClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentExecuteScanClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DatabaseSQLVulnerabilityAssessmentExecuteScanClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginExecute - Executes a Vulnerability Assessment database scan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions contains the optional parameters for the +// DatabaseSQLVulnerabilityAssessmentExecuteScanClient.BeginExecute method. +func (client *DatabaseSQLVulnerabilityAssessmentExecuteScanClient) BeginExecute(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*runtime.Poller[DatabaseSQLVulnerabilityAssessmentExecuteScanClientExecuteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.execute(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[DatabaseSQLVulnerabilityAssessmentExecuteScanClientExecuteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DatabaseSQLVulnerabilityAssessmentExecuteScanClientExecuteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Execute - Executes a Vulnerability Assessment database scan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *DatabaseSQLVulnerabilityAssessmentExecuteScanClient) execute(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*http.Response, error) { + req, err := client.executeCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// executeCreateRequest creates the Execute request. +func (client *DatabaseSQLVulnerabilityAssessmentExecuteScanClient) executeCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client.go new file mode 100644 index 000000000000..c605bc3fc26b --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentrulebaselines_client.go @@ -0,0 +1,366 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient contains the methods for the DatabaseSQLVulnerabilityAssessmentRuleBaselines group. +// Don't use this type directly, use NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient() instead. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient creates a new instance of DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDatabaseSQLVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a database's vulnerability assessment rule baseline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - parameters - The requested rule baseline resource. +// - options - DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for +// the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineInput, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, baselineName, ruleID, parameters, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineInput, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) createOrUpdateHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentRuleBaseline); err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Removes the database's vulnerability assessment rule baseline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - options - DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Delete +// method. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, baselineName, ruleID, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Gets a database's sql vulnerability assessment rule baseline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - options - DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Get +// method. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetOptions) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, baselineName, ruleID, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) getHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentRuleBaseline); err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse{}, err + } + return result, nil +} + +// NewListByBaselinePager - Gets a list of database's sql vulnerability assessment rule baselines. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineOptions contains the optional parameters for +// the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.NewListByBaselinePager method. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) NewListByBaselinePager(resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse] { + return runtime.NewPager(runtime.PagingHandler[DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse]{ + More: func(page DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByBaselineCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, baselineName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse{}, runtime.NewResponseError(resp) + } + return client.listByBaselineHandleResponse(resp) + }, + }) +} + +// listByBaselineCreateRequest creates the ListByBaseline request. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) listByBaselineCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByBaselineHandleResponse handles the ListByBaseline response. +func (client *DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient) listByBaselineHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult); err != nil { + return DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client.go new file mode 100644 index 000000000000..b959397fb522 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscanresult_client.go @@ -0,0 +1,221 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DatabaseSQLVulnerabilityAssessmentScanResultClient contains the methods for the DatabaseSQLVulnerabilityAssessmentScanResult group. +// Don't use this type directly, use NewDatabaseSQLVulnerabilityAssessmentScanResultClient() instead. +type DatabaseSQLVulnerabilityAssessmentScanResultClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDatabaseSQLVulnerabilityAssessmentScanResultClient creates a new instance of DatabaseSQLVulnerabilityAssessmentScanResultClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDatabaseSQLVulnerabilityAssessmentScanResultClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentScanResultClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DatabaseSQLVulnerabilityAssessmentScanResultClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Get - Gets a vulnerability assessment scan record of a database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - scanID - The scan id of the SQL Vulnerability Assessment scan to retrieve result from. +// - scanResultID - The scan result id of the specific result to retrieve. +// - options - DatabaseSQLVulnerabilityAssessmentScanResultClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentScanResultClient.Get +// method. +func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, scanResultID string, options *DatabaseSQLVulnerabilityAssessmentScanResultClientGetOptions) (DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, scanResultID, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, scanResultID string, options *DatabaseSQLVulnerabilityAssessmentScanResultClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + if scanResultID == "" { + return nil, errors.New("parameter scanResultID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanResultId}", url.PathEscape(scanResultID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) getHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanResults); err != nil { + return DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse{}, err + } + return result, nil +} + +// NewListByScanPager - Gets a vulnerability assessment scan record of a database. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - scanID - The scan id of the SQL Vulnerability Assessment scan to retrieve result from. +// - options - DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanOptions contains the optional parameters for the +// DatabaseSQLVulnerabilityAssessmentScanResultClient.NewListByScanPager method. +func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) NewListByScanPager(resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, options *DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse] { + return runtime.NewPager(runtime.PagingHandler[DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse]{ + More: func(page DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse) (DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByScanCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse{}, runtime.NewResponseError(resp) + } + return client.listByScanHandleResponse(resp) + }, + }) +} + +// listByScanCreateRequest creates the ListByScan request. +func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) listByScanCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, options *DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByScanHandleResponse handles the ListByScan response. +func (client *DatabaseSQLVulnerabilityAssessmentScanResultClient) listByScanHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanListResult); err != nil { + return DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client.go new file mode 100644 index 000000000000..95b227bb0def --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentscans_client.go @@ -0,0 +1,211 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DatabaseSQLVulnerabilityAssessmentScansClient contains the methods for the DatabaseSQLVulnerabilityAssessmentScans group. +// Don't use this type directly, use NewDatabaseSQLVulnerabilityAssessmentScansClient() instead. +type DatabaseSQLVulnerabilityAssessmentScansClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDatabaseSQLVulnerabilityAssessmentScansClient creates a new instance of DatabaseSQLVulnerabilityAssessmentScansClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDatabaseSQLVulnerabilityAssessmentScansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentScansClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DatabaseSQLVulnerabilityAssessmentScansClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Get - Get a database vulnerability assessment scan result. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - scanID - The vulnerability assessment scan Id of the scan to retrieve. +// - options - DatabaseSQLVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentScansClient.Get +// method. +func (client *DatabaseSQLVulnerabilityAssessmentScansClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *DatabaseSQLVulnerabilityAssessmentScansClientGetOptions) (DatabaseSQLVulnerabilityAssessmentScansClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScansClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScansClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentScansClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DatabaseSQLVulnerabilityAssessmentScansClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *DatabaseSQLVulnerabilityAssessmentScansClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DatabaseSQLVulnerabilityAssessmentScansClient) getHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentScansClientGetResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentScansClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanRecordForSQL); err != nil { + return DatabaseSQLVulnerabilityAssessmentScansClientGetResponse{}, err + } + return result, nil +} + +// NewListBySQLVulnerabilityAssessmentsPager - Lists the vulnerability assessment scans of a database. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions contains the optional parameters +// for the DatabaseSQLVulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager method. +func (client *DatabaseSQLVulnerabilityAssessmentScansClient) NewListBySQLVulnerabilityAssessmentsPager(resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse] { + return runtime.NewPager(runtime.PagingHandler[DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse]{ + More: func(page DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse) (DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySQLVulnerabilityAssessmentsCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, runtime.NewResponseError(resp) + } + return client.listBySQLVulnerabilityAssessmentsHandleResponse(resp) + }, + }) +} + +// listBySQLVulnerabilityAssessmentsCreateRequest creates the ListBySQLVulnerabilityAssessments request. +func (client *DatabaseSQLVulnerabilityAssessmentScansClient) listBySQLVulnerabilityAssessmentsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySQLVulnerabilityAssessmentsHandleResponse handles the ListBySQLVulnerabilityAssessments response. +func (client *DatabaseSQLVulnerabilityAssessmentScansClient) listBySQLVulnerabilityAssessmentsHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanRecordForSQLListResult); err != nil { + return DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client.go b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client.go new file mode 100644 index 000000000000..061e5ed17271 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/databasesqlvulnerabilityassessmentssettings_client.go @@ -0,0 +1,201 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// DatabaseSQLVulnerabilityAssessmentsSettingsClient contains the methods for the DatabaseSQLVulnerabilityAssessmentsSettings group. +// Don't use this type directly, use NewDatabaseSQLVulnerabilityAssessmentsSettingsClient() instead. +type DatabaseSQLVulnerabilityAssessmentsSettingsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDatabaseSQLVulnerabilityAssessmentsSettingsClient creates a new instance of DatabaseSQLVulnerabilityAssessmentsSettingsClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDatabaseSQLVulnerabilityAssessmentsSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseSQLVulnerabilityAssessmentsSettingsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &DatabaseSQLVulnerabilityAssessmentsSettingsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Get - Gets SQL Vulnerability Assessment policy for database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - options - DatabaseSQLVulnerabilityAssessmentsSettingsClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentsSettingsClient.Get +// method. +func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentsSettingsClientGetOptions) (DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, options *DatabaseSQLVulnerabilityAssessmentsSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) getHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessment); err != nil { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + return result, nil +} + +// NewListByDatabasePager - Lists SQL Vulnerability Assessment policies associated with a database. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseOptions contains the optional parameters for the +// DatabaseSQLVulnerabilityAssessmentsSettingsClient.NewListByDatabasePager method. +func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseOptions) *runtime.Pager[DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse] { + return runtime.NewPager(runtime.PagingHandler[DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse]{ + More: func(page DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse) (DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseHandleResponse(resp) + }, + }) +} + +// listByDatabaseCreateRequest creates the ListByDatabase request. +func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sqlVulnerabilityAssessments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByDatabaseHandleResponse handles the ListByDatabase response. +func (client *DatabaseSQLVulnerabilityAssessmentsSettingsClient) listByDatabaseHandleResponse(resp *http.Response) (DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse, error) { + result := DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentListResult); err != nil { + return DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databasetables_client.go b/sdk/resourcemanager/sql/armsql/databasetables_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_databasetables_client.go rename to sdk/resourcemanager/sql/armsql/databasetables_client.go index 5fcfd0d2964b..9df369b6e040 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databasetables_client.go +++ b/sdk/resourcemanager/sql/armsql/databasetables_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 armsql @@ -31,9 +32,9 @@ type DatabaseTablesClient struct { } // NewDatabaseTablesClient creates a new instance of DatabaseTablesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseTablesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewDatabaseTablesClient(subscriptionID string, credential azcore.TokenCrede // Get - Get database table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// options - DatabaseTablesClientGetOptions contains the optional parameters for the DatabaseTablesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - options - DatabaseTablesClientGetOptions contains the optional parameters for the DatabaseTablesClient.Get method. func (client *DatabaseTablesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, options *DatabaseTablesClientGetOptions) (DatabaseTablesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, options) if err != nil { @@ -111,7 +113,7 @@ func (client *DatabaseTablesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -127,15 +129,15 @@ func (client *DatabaseTablesClient) getHandleResponse(resp *http.Response) (Data } // NewListBySchemaPager - List database tables -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// options - DatabaseTablesClientListBySchemaOptions contains the optional parameters for the DatabaseTablesClient.ListBySchema -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - options - DatabaseTablesClientListBySchemaOptions contains the optional parameters for the DatabaseTablesClient.NewListBySchemaPager +// method. func (client *DatabaseTablesClient) NewListBySchemaPager(resourceGroupName string, serverName string, databaseName string, schemaName string, options *DatabaseTablesClientListBySchemaOptions) *runtime.Pager[DatabaseTablesClientListBySchemaResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseTablesClientListBySchemaResponse]{ More: func(page DatabaseTablesClientListBySchemaResponse) bool { @@ -195,7 +197,7 @@ func (client *DatabaseTablesClient) listBySchemaCreateRequest(ctx context.Contex if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databaseusages_client.go b/sdk/resourcemanager/sql/armsql/databaseusages_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_databaseusages_client.go rename to sdk/resourcemanager/sql/armsql/databaseusages_client.go index 8ecdbe413185..db2426c81a44 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databaseusages_client.go +++ b/sdk/resourcemanager/sql/armsql/databaseusages_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 armsql @@ -31,9 +32,9 @@ type DatabaseUsagesClient struct { } // NewDatabaseUsagesClient creates a new instance of DatabaseUsagesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseUsagesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,14 +56,14 @@ func NewDatabaseUsagesClient(subscriptionID string, credential azcore.TokenCrede } // NewListByDatabasePager - Gets database usages. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DatabaseUsagesClientListByDatabaseOptions contains the optional parameters for the DatabaseUsagesClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DatabaseUsagesClientListByDatabaseOptions contains the optional parameters for the DatabaseUsagesClient.NewListByDatabasePager +// method. func (client *DatabaseUsagesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DatabaseUsagesClientListByDatabaseOptions) *runtime.Pager[DatabaseUsagesClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseUsagesClientListByDatabaseResponse]{ More: func(page DatabaseUsagesClientListByDatabaseResponse) bool { @@ -115,7 +116,7 @@ func (client *DatabaseUsagesClient) listByDatabaseCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go similarity index 81% rename from sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessmentrulebaselines_client.go rename to sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_client.go index e8b74c401a3c..2bee105dc793 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessmentrulebaselines_client.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentrulebaselines_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 armsql @@ -31,9 +32,9 @@ type DatabaseVulnerabilityAssessmentRuleBaselinesClient struct { } // NewDatabaseVulnerabilityAssessmentRuleBaselinesClient creates a new instance of DatabaseVulnerabilityAssessmentRuleBaselinesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseVulnerabilityAssessmentRuleBaselinesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,18 +57,19 @@ func NewDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string // CreateOrUpdate - Creates or updates a database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// ruleID - The vulnerability assessment rule ID. -// baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule -// and master for server level rule). -// parameters - The requested rule baseline resource. -// options - DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for -// the DatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule +// and master for server level rule). +// - parameters - The requested rule baseline resource. +// - options - DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for +// the DatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method. func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, parameters DatabaseVulnerabilityAssessmentRuleBaseline, options *DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions) (DatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, ruleID, baselineName, parameters, options) if err != nil { @@ -119,7 +121,7 @@ func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) createOrUpdate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -136,17 +138,18 @@ func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) createOrUpdate // Delete - Removes the database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// ruleID - The vulnerability assessment rule ID. -// baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule -// and master for server level rule). -// options - DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule +// and master for server level rule). +// - options - DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete +// method. func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, options *DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (DatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, ruleID, baselineName, options) if err != nil { @@ -198,24 +201,25 @@ func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) deleteCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// ruleID - The vulnerability assessment rule ID. -// baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule -// and master for server level rule). -// options - DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule +// and master for server level rule). +// - options - DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentRuleBaselinesClient.Get +// method. func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, options *DatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions) (DatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, ruleID, baselineName, options) if err != nil { @@ -267,7 +271,7 @@ func (client *DatabaseVulnerabilityAssessmentRuleBaselinesClient) getCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessments_client.go rename to sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_client.go index d4b8883d1883..083c799117cd 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessments_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 armsql @@ -31,9 +32,9 @@ type DatabaseVulnerabilityAssessmentsClient struct { } // NewDatabaseVulnerabilityAssessmentsClient creates a new instance of DatabaseVulnerabilityAssessmentsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseVulnerabilityAssessmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseVulnerabilityAssessmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewDatabaseVulnerabilityAssessmentsClient(subscriptionID string, credential // CreateOrUpdate - Creates or updates the database's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database for which the vulnerability assessment is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// parameters - The requested resource. -// options - DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database for which the vulnerability assessment is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - parameters - The requested resource. +// - options - DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.CreateOrUpdate +// method. func (client *DatabaseVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, parameters DatabaseVulnerabilityAssessment, options *DatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions) (DatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, parameters, options) if err != nil { @@ -108,7 +110,7 @@ func (client *DatabaseVulnerabilityAssessmentsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,14 +127,15 @@ func (client *DatabaseVulnerabilityAssessmentsClient) createOrUpdateHandleRespon // Delete - Removes the database's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database for which the vulnerability assessment is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// options - DatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database for which the vulnerability assessment is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Delete +// method. func (client *DatabaseVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseVulnerabilityAssessmentsClientDeleteOptions) (DatabaseVulnerabilityAssessmentsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) if err != nil { @@ -176,21 +179,22 @@ func (client *DatabaseVulnerabilityAssessmentsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets the database's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database for which the vulnerability assessment is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// options - DatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database for which the vulnerability assessment is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.Get +// method. func (client *DatabaseVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseVulnerabilityAssessmentsClientGetOptions) (DatabaseVulnerabilityAssessmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, options) if err != nil { @@ -234,7 +238,7 @@ func (client *DatabaseVulnerabilityAssessmentsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,14 +254,14 @@ func (client *DatabaseVulnerabilityAssessmentsClient) getHandleResponse(resp *ht } // NewListByDatabasePager - Lists the vulnerability assessment policies associated with a database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database for which the vulnerability assessment policies are defined. -// options - DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database for which the vulnerability assessment policies are defined. +// - options - DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.NewListByDatabasePager +// method. func (client *DatabaseVulnerabilityAssessmentsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions) *runtime.Pager[DatabaseVulnerabilityAssessmentsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseVulnerabilityAssessmentsClientListByDatabaseResponse]{ More: func(page DatabaseVulnerabilityAssessmentsClientListByDatabaseResponse) bool { @@ -310,7 +314,7 @@ func (client *DatabaseVulnerabilityAssessmentsClient) listByDatabaseCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessmentscans_client.go rename to sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_client.go index 05e6b68dcd6c..5a8a823f4005 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_databasevulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/sql/armsql/databasevulnerabilityassessmentscans_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 armsql @@ -31,9 +32,9 @@ type DatabaseVulnerabilityAssessmentScansClient struct { } // NewDatabaseVulnerabilityAssessmentScansClient creates a new instance of DatabaseVulnerabilityAssessmentScansClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDatabaseVulnerabilityAssessmentScansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DatabaseVulnerabilityAssessmentScansClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewDatabaseVulnerabilityAssessmentScansClient(subscriptionID string, creden // Export - Convert an existing scan result to a human readable format. If already exists nothing happens // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the scanned database. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// scanID - The vulnerability assessment scan Id. -// options - DatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Export -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the scanned database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - scanID - The vulnerability assessment scan Id. +// - options - DatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Export +// method. func (client *DatabaseVulnerabilityAssessmentScansClient) Export(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *DatabaseVulnerabilityAssessmentScansClientExportOptions) (DatabaseVulnerabilityAssessmentScansClientExportResponse, error) { req, err := client.exportCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, options) if err != nil { @@ -112,7 +114,7 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) exportCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -129,15 +131,16 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) exportHandleResponse(r // Get - Gets a vulnerability assessment scan record of a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// scanID - The vulnerability assessment scan Id of the scan to retrieve. -// options - DatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - scanID - The vulnerability assessment scan Id of the scan to retrieve. +// - options - DatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.Get +// method. func (client *DatabaseVulnerabilityAssessmentScansClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *DatabaseVulnerabilityAssessmentScansClientGetOptions) (DatabaseVulnerabilityAssessmentScansClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, options) if err != nil { @@ -185,7 +188,7 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) getCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,15 +205,16 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) getHandleResponse(resp // BeginInitiateScan - Executes a Vulnerability Assessment database scan. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// scanID - The vulnerability assessment scan Id of the scan to retrieve. -// options - DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - scanID - The vulnerability assessment scan Id of the scan to retrieve. +// - options - DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan +// method. func (client *DatabaseVulnerabilityAssessmentScansClient) BeginInitiateScan(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions) (*runtime.Poller[DatabaseVulnerabilityAssessmentScansClientInitiateScanResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.initiateScan(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, options) @@ -225,7 +229,8 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) BeginInitiateScan(ctx // InitiateScan - Executes a Vulnerability Assessment database scan. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DatabaseVulnerabilityAssessmentScansClient) initiateScan(ctx context.Context, resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *DatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions) (*http.Response, error) { req, err := client.initiateScanCreateRequest(ctx, resourceGroupName, serverName, databaseName, vulnerabilityAssessmentName, scanID, options) if err != nil { @@ -273,21 +278,21 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) initiateScanCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // NewListByDatabasePager - Lists the vulnerability assessment scans of a database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// options - DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.NewListByDatabasePager +// method. func (client *DatabaseVulnerabilityAssessmentScansClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions) *runtime.Pager[DatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse]{ More: func(page DatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse) bool { @@ -344,7 +349,7 @@ func (client *DatabaseVulnerabilityAssessmentScansClient) listByDatabaseCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_datamaskingpolicies_client.go b/sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go similarity index 71% rename from sdk/resourcemanager/sql/armsql/zz_generated_datamaskingpolicies_client.go rename to sdk/resourcemanager/sql/armsql/datamaskingpolicies_client.go index 4410ad5bbf01..e47c0cfe0631 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_datamaskingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/datamaskingpolicies_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 armsql @@ -31,9 +32,9 @@ type DataMaskingPoliciesClient struct { } // NewDataMaskingPoliciesClient creates a new instance of DataMaskingPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDataMaskingPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataMaskingPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,18 +55,20 @@ func NewDataMaskingPoliciesClient(subscriptionID string, credential azcore.Token return client, nil } -// CreateOrUpdate - Creates or updates a database data masking policy +// CreateOrUpdate - Creates or updates a database data masking policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// parameters - Parameters for creating or updating a data masking policy. -// options - DataMaskingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingPoliciesClient.CreateOrUpdate -// method. -func (client *DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DataMaskingPolicy, options *DataMaskingPoliciesClientCreateOrUpdateOptions) (DataMaskingPoliciesClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - dataMaskingPolicyName - The name of the database for which the data masking policy applies. +// - parameters - Parameters for creating or updating a data masking policy. +// - options - DataMaskingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingPoliciesClient.CreateOrUpdate +// method. +func (client *DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, parameters DataMaskingPolicy, options *DataMaskingPoliciesClientCreateOrUpdateOptions) (DataMaskingPoliciesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataMaskingPolicyName, parameters, options) if err != nil { return DataMaskingPoliciesClientCreateOrUpdateResponse{}, err } @@ -73,19 +76,15 @@ func (client *DataMaskingPoliciesClient) CreateOrUpdate(ctx context.Context, res if err != nil { return DataMaskingPoliciesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { return DataMaskingPoliciesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) } return client.createOrUpdateHandleResponse(resp) } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DataMaskingPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters DataMaskingPolicy, options *DataMaskingPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DataMaskingPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, parameters DataMaskingPolicy, options *DataMaskingPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -98,13 +97,20 @@ func (client *DataMaskingPoliciesClient) createOrUpdateCreateRequest(ctx context return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape("Default")) + if dataMaskingPolicyName == "" { + return nil, errors.New("parameter dataMaskingPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape(string(dataMaskingPolicyName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -119,16 +125,18 @@ func (client *DataMaskingPoliciesClient) createOrUpdateHandleResponse(resp *http return result, nil } -// Get - Gets a database data masking policy. +// Get - Gets the database data masking policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DataMaskingPoliciesClientGetOptions contains the optional parameters for the DataMaskingPoliciesClient.Get method. -func (client *DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DataMaskingPoliciesClientGetOptions) (DataMaskingPoliciesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - dataMaskingPolicyName - The name of the database for which the data masking policy applies. +// - options - DataMaskingPoliciesClientGetOptions contains the optional parameters for the DataMaskingPoliciesClient.Get method. +func (client *DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, options *DataMaskingPoliciesClientGetOptions) (DataMaskingPoliciesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataMaskingPolicyName, options) if err != nil { return DataMaskingPoliciesClientGetResponse{}, err } @@ -143,12 +151,8 @@ func (client *DataMaskingPoliciesClient) Get(ctx context.Context, resourceGroupN } // getCreateRequest creates the Get request. -func (client *DataMaskingPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DataMaskingPoliciesClientGetOptions) (*policy.Request, error) { +func (client *DataMaskingPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, options *DataMaskingPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -161,13 +165,20 @@ func (client *DataMaskingPoliciesClient) getCreateRequest(ctx context.Context, r return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape("Default")) + if dataMaskingPolicyName == "" { + return nil, errors.New("parameter dataMaskingPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape(string(dataMaskingPolicyName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_datamaskingrules_client.go b/sdk/resourcemanager/sql/armsql/datamaskingrules_client.go similarity index 70% rename from sdk/resourcemanager/sql/armsql/zz_generated_datamaskingrules_client.go rename to sdk/resourcemanager/sql/armsql/datamaskingrules_client.go index 0ef88ddc0179..83e9037f5b46 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_datamaskingrules_client.go +++ b/sdk/resourcemanager/sql/armsql/datamaskingrules_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 armsql @@ -31,9 +32,9 @@ type DataMaskingRulesClient struct { } // NewDataMaskingRulesClient creates a new instance of DataMaskingRulesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDataMaskingRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataMaskingRulesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,17 +57,19 @@ func NewDataMaskingRulesClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Creates or updates a database data masking rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// dataMaskingRuleName - The name of the data masking rule. -// parameters - The required parameters for creating or updating a data masking rule. -// options - DataMaskingRulesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingRulesClient.CreateOrUpdate -// method. -func (client *DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters DataMaskingRule, options *DataMaskingRulesClientCreateOrUpdateOptions) (DataMaskingRulesClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataMaskingRuleName, parameters, options) +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - dataMaskingPolicyName - The name of the database for which the data masking policy applies. +// - dataMaskingRuleName - The name of the data masking rule. +// - parameters - The required parameters for creating or updating a data masking rule. +// - options - DataMaskingRulesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingRulesClient.CreateOrUpdate +// method. +func (client *DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, dataMaskingRuleName string, parameters DataMaskingRule, options *DataMaskingRulesClientCreateOrUpdateOptions) (DataMaskingRulesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataMaskingPolicyName, dataMaskingRuleName, parameters, options) if err != nil { return DataMaskingRulesClientCreateOrUpdateResponse{}, err } @@ -81,12 +84,8 @@ func (client *DataMaskingRulesClient) CreateOrUpdate(ctx context.Context, resour } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *DataMaskingRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingRuleName string, parameters DataMaskingRule, options *DataMaskingRulesClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *DataMaskingRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, dataMaskingRuleName string, parameters DataMaskingRule, options *DataMaskingRulesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules/{dataMaskingRuleName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -99,17 +98,24 @@ func (client *DataMaskingRulesClient) createOrUpdateCreateRequest(ctx context.Co return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape("Default")) + if dataMaskingPolicyName == "" { + return nil, errors.New("parameter dataMaskingPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape(string(dataMaskingPolicyName))) if dataMaskingRuleName == "" { return nil, errors.New("parameter dataMaskingRuleName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{dataMaskingRuleName}", url.PathEscape(dataMaskingRuleName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,21 +131,28 @@ func (client *DataMaskingRulesClient) createOrUpdateHandleResponse(resp *http.Re } // NewListByDatabasePager - Gets a list of database data masking rules. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DataMaskingRulesClientListByDatabaseOptions contains the optional parameters for the DataMaskingRulesClient.ListByDatabase -// method. -func (client *DataMaskingRulesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DataMaskingRulesClientListByDatabaseOptions) *runtime.Pager[DataMaskingRulesClientListByDatabaseResponse] { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - dataMaskingPolicyName - The name of the database for which the data masking rule applies. +// - options - DataMaskingRulesClientListByDatabaseOptions contains the optional parameters for the DataMaskingRulesClient.NewListByDatabasePager +// method. +func (client *DataMaskingRulesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, options *DataMaskingRulesClientListByDatabaseOptions) *runtime.Pager[DataMaskingRulesClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DataMaskingRulesClientListByDatabaseResponse]{ More: func(page DataMaskingRulesClientListByDatabaseResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *DataMaskingRulesClientListByDatabaseResponse) (DataMaskingRulesClientListByDatabaseResponse, error) { - req, err := client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataMaskingPolicyName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { return DataMaskingRulesClientListByDatabaseResponse{}, err } @@ -156,12 +169,8 @@ func (client *DataMaskingRulesClient) NewListByDatabasePager(resourceGroupName s } // listByDatabaseCreateRequest creates the ListByDatabase request. -func (client *DataMaskingRulesClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *DataMaskingRulesClientListByDatabaseOptions) (*policy.Request, error) { +func (client *DataMaskingRulesClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataMaskingPolicyName DataMaskingPolicyName, options *DataMaskingRulesClientListByDatabaseOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/dataMaskingPolicies/{dataMaskingPolicyName}/rules" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -174,13 +183,20 @@ func (client *DataMaskingRulesClient) listByDatabaseCreateRequest(ctx context.Co return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) - urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape("Default")) + if dataMaskingPolicyName == "" { + return nil, errors.New("parameter dataMaskingPolicyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dataMaskingPolicyName}", url.PathEscape(string(dataMaskingPolicyName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_datawarehouseuseractivities_client.go b/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_datawarehouseuseractivities_client.go rename to sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_client.go index 1deafd72dec8..284c7606ef90 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_datawarehouseuseractivities_client.go +++ b/sdk/resourcemanager/sql/armsql/datawarehouseuseractivities_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 armsql @@ -31,9 +32,9 @@ type DataWarehouseUserActivitiesClient struct { } // NewDataWarehouseUserActivitiesClient creates a new instance of DataWarehouseUserActivitiesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDataWarehouseUserActivitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DataWarehouseUserActivitiesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewDataWarehouseUserActivitiesClient(subscriptionID string, credential azco // Get - Gets the user activities of a data warehouse which includes running and suspended queries // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// dataWarehouseUserActivityName - The activity name of the data warehouse. -// options - DataWarehouseUserActivitiesClientGetOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - dataWarehouseUserActivityName - The activity name of the data warehouse. +// - options - DataWarehouseUserActivitiesClientGetOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.Get +// method. func (client *DataWarehouseUserActivitiesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, dataWarehouseUserActivityName DataWarehouseUserActivityName, options *DataWarehouseUserActivitiesClientGetOptions) (DataWarehouseUserActivitiesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, dataWarehouseUserActivityName, options) if err != nil { @@ -107,7 +109,7 @@ func (client *DataWarehouseUserActivitiesClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,14 +125,14 @@ func (client *DataWarehouseUserActivitiesClient) getHandleResponse(resp *http.Re } // NewListByDatabasePager - List the user activities of a data warehouse which includes running and suspended queries -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - DataWarehouseUserActivitiesClientListByDatabaseOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - DataWarehouseUserActivitiesClientListByDatabaseOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.NewListByDatabasePager +// method. func (client *DataWarehouseUserActivitiesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *DataWarehouseUserActivitiesClientListByDatabaseOptions) *runtime.Pager[DataWarehouseUserActivitiesClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[DataWarehouseUserActivitiesClientListByDatabaseResponse]{ More: func(page DataWarehouseUserActivitiesClientListByDatabaseResponse) bool { @@ -183,7 +185,7 @@ func (client *DataWarehouseUserActivitiesClient) listByDatabaseCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_deletedservers_client.go b/sdk/resourcemanager/sql/armsql/deletedservers_client.go similarity index 87% rename from sdk/resourcemanager/sql/armsql/zz_generated_deletedservers_client.go rename to sdk/resourcemanager/sql/armsql/deletedservers_client.go index 0ff3e9a37830..a00508da1d45 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_deletedservers_client.go +++ b/sdk/resourcemanager/sql/armsql/deletedservers_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 armsql @@ -31,9 +32,9 @@ type DeletedServersClient struct { } // NewDeletedServersClient creates a new instance of DeletedServersClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDeletedServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeletedServersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,10 +57,11 @@ func NewDeletedServersClient(subscriptionID string, credential azcore.TokenCrede // Get - Gets a deleted server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// locationName - The name of the region where the resource is located. -// deletedServerName - The name of the deleted server. -// options - DeletedServersClientGetOptions contains the optional parameters for the DeletedServersClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The name of the region where the resource is located. +// - deletedServerName - The name of the deleted server. +// - options - DeletedServersClientGetOptions contains the optional parameters for the DeletedServersClient.Get method. func (client *DeletedServersClient) Get(ctx context.Context, locationName string, deletedServerName string, options *DeletedServersClientGetOptions) (DeletedServersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, locationName, deletedServerName, options) if err != nil { @@ -95,7 +97,7 @@ func (client *DeletedServersClient) getCreateRequest(ctx context.Context, locati return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,9 +113,9 @@ func (client *DeletedServersClient) getHandleResponse(resp *http.Response) (Dele } // NewListPager - Gets a list of all deleted servers in a subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// options - DeletedServersClientListOptions contains the optional parameters for the DeletedServersClient.List method. +// +// Generated from API version 2022-11-01-preview +// - options - DeletedServersClientListOptions contains the optional parameters for the DeletedServersClient.NewListPager method. func (client *DeletedServersClient) NewListPager(options *DeletedServersClientListOptions) *runtime.Pager[DeletedServersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[DeletedServersClientListResponse]{ More: func(page DeletedServersClientListResponse) bool { @@ -154,7 +156,7 @@ func (client *DeletedServersClient) listCreateRequest(ctx context.Context, optio return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -170,11 +172,11 @@ func (client *DeletedServersClient) listHandleResponse(resp *http.Response) (Del } // NewListByLocationPager - Gets a list of deleted servers for a location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// locationName - The name of the region where the resource is located. -// options - DeletedServersClientListByLocationOptions contains the optional parameters for the DeletedServersClient.ListByLocation -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The name of the region where the resource is located. +// - options - DeletedServersClientListByLocationOptions contains the optional parameters for the DeletedServersClient.NewListByLocationPager +// method. func (client *DeletedServersClient) NewListByLocationPager(locationName string, options *DeletedServersClientListByLocationOptions) *runtime.Pager[DeletedServersClientListByLocationResponse] { return runtime.NewPager(runtime.PagingHandler[DeletedServersClientListByLocationResponse]{ More: func(page DeletedServersClientListByLocationResponse) bool { @@ -219,7 +221,7 @@ func (client *DeletedServersClient) listByLocationCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -236,11 +238,12 @@ func (client *DeletedServersClient) listByLocationHandleResponse(resp *http.Resp // BeginRecover - Recovers a deleted server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// locationName - The name of the region where the resource is located. -// deletedServerName - The name of the deleted server. -// options - DeletedServersClientBeginRecoverOptions contains the optional parameters for the DeletedServersClient.BeginRecover -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The name of the region where the resource is located. +// - deletedServerName - The name of the deleted server. +// - options - DeletedServersClientBeginRecoverOptions contains the optional parameters for the DeletedServersClient.BeginRecover +// method. func (client *DeletedServersClient) BeginRecover(ctx context.Context, locationName string, deletedServerName string, options *DeletedServersClientBeginRecoverOptions) (*runtime.Poller[DeletedServersClientRecoverResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.recoverOperation(ctx, locationName, deletedServerName, options) @@ -255,7 +258,8 @@ func (client *DeletedServersClient) BeginRecover(ctx context.Context, locationNa // Recover - Recovers a deleted server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DeletedServersClient) recoverOperation(ctx context.Context, locationName string, deletedServerName string, options *DeletedServersClientBeginRecoverOptions) (*http.Response, error) { req, err := client.recoverCreateRequest(ctx, locationName, deletedServerName, options) if err != nil { @@ -291,7 +295,7 @@ func (client *DeletedServersClient) recoverCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_distributedavailabilitygroups_client.go b/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go similarity index 71% rename from sdk/resourcemanager/sql/armsql/zz_generated_distributedavailabilitygroups_client.go rename to sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_client.go index d6ae08c3531f..549303caacb7 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_distributedavailabilitygroups_client.go +++ b/sdk/resourcemanager/sql/armsql/distributedavailabilitygroups_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 armsql @@ -31,9 +32,9 @@ type DistributedAvailabilityGroupsClient struct { } // NewDistributedAvailabilityGroupsClient creates a new instance of DistributedAvailabilityGroupsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDistributedAvailabilityGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DistributedAvailabilityGroupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewDistributedAvailabilityGroupsClient(subscriptionID string, credential az // BeginCreateOrUpdate - Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// distributedAvailabilityGroupName - The distributed availability group name. -// parameters - The distributed availability group info. -// options - DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - distributedAvailabilityGroupName - The distributed availability group name. +// - parameters - The distributed availability group info. +// - options - DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginCreateOrUpdate +// method. func (client *DistributedAvailabilityGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup, options *DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[DistributedAvailabilityGroupsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) @@ -78,7 +80,8 @@ func (client *DistributedAvailabilityGroupsClient) BeginCreateOrUpdate(ctx conte // CreateOrUpdate - Creates a distributed availability group between Sql On-Prem and Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DistributedAvailabilityGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup, options *DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *DistributedAvailabilityGroupsClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *DistributedAvailabilityGroupsClient) createOrUpdateCreateRequest(c // BeginDelete - Drops a distributed availability group between Sql On-Prem and Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// distributedAvailabilityGroupName - The distributed availability group name. -// options - DistributedAvailabilityGroupsClientBeginDeleteOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - distributedAvailabilityGroupName - The distributed availability group name. +// - options - DistributedAvailabilityGroupsClientBeginDeleteOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginDelete +// method. func (client *DistributedAvailabilityGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, options *DistributedAvailabilityGroupsClientBeginDeleteOptions) (*runtime.Poller[DistributedAvailabilityGroupsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, options) @@ -147,7 +151,8 @@ func (client *DistributedAvailabilityGroupsClient) BeginDelete(ctx context.Conte // Delete - Drops a distributed availability group between Sql On-Prem and Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DistributedAvailabilityGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, options *DistributedAvailabilityGroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, options) if err != nil { @@ -187,20 +192,21 @@ func (client *DistributedAvailabilityGroupsClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a distributed availability group info. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// distributedAvailabilityGroupName - The distributed availability group name. -// options - DistributedAvailabilityGroupsClientGetOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - distributedAvailabilityGroupName - The distributed availability group name. +// - options - DistributedAvailabilityGroupsClientGetOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.Get +// method. func (client *DistributedAvailabilityGroupsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, options *DistributedAvailabilityGroupsClientGetOptions) (DistributedAvailabilityGroupsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, options) if err != nil { @@ -240,7 +246,7 @@ func (client *DistributedAvailabilityGroupsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,13 +262,13 @@ func (client *DistributedAvailabilityGroupsClient) getHandleResponse(resp *http. } // NewListByInstancePager - Gets a list of a distributed availability groups in instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - DistributedAvailabilityGroupsClientListByInstanceOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - DistributedAvailabilityGroupsClientListByInstanceOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.NewListByInstancePager +// method. func (client *DistributedAvailabilityGroupsClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *DistributedAvailabilityGroupsClientListByInstanceOptions) *runtime.Pager[DistributedAvailabilityGroupsClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[DistributedAvailabilityGroupsClientListByInstanceResponse]{ More: func(page DistributedAvailabilityGroupsClientListByInstanceResponse) bool { @@ -311,7 +317,7 @@ func (client *DistributedAvailabilityGroupsClient) listByInstanceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,16 +332,89 @@ func (client *DistributedAvailabilityGroupsClient) listByInstanceHandleResponse( return result, nil } +// BeginSetRole - Sets the role for managed instance in a distributed availability group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - distributedAvailabilityGroupName - The distributed availability group name. +// - parameters - The distributed availability group set role request parameters. +// - options - DistributedAvailabilityGroupsClientBeginSetRoleOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginSetRole +// method. +func (client *DistributedAvailabilityGroupsClient) BeginSetRole(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroupSetRole, options *DistributedAvailabilityGroupsClientBeginSetRoleOptions) (*runtime.Poller[DistributedAvailabilityGroupsClientSetRoleResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.setRole(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[DistributedAvailabilityGroupsClientSetRoleResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[DistributedAvailabilityGroupsClientSetRoleResponse](options.ResumeToken, client.pl, nil) + } +} + +// SetRole - Sets the role for managed instance in a distributed availability group. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *DistributedAvailabilityGroupsClient) setRole(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroupSetRole, options *DistributedAvailabilityGroupsClientBeginSetRoleOptions) (*http.Response, error) { + req, err := client.setRoleCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// setRoleCreateRequest creates the SetRole request. +func (client *DistributedAvailabilityGroupsClient) setRoleCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroupSetRole, options *DistributedAvailabilityGroupsClientBeginSetRoleOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/distributedAvailabilityGroups/{distributedAvailabilityGroupName}/setRole" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if distributedAvailabilityGroupName == "" { + return nil, errors.New("parameter distributedAvailabilityGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{distributedAvailabilityGroupName}", url.PathEscape(distributedAvailabilityGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + // BeginUpdate - Updates a distributed availability group replication mode. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// distributedAvailabilityGroupName - The distributed availability group name. -// parameters - The distributed availability group info. -// options - DistributedAvailabilityGroupsClientBeginUpdateOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - distributedAvailabilityGroupName - The distributed availability group name. +// - parameters - The distributed availability group info. +// - options - DistributedAvailabilityGroupsClientBeginUpdateOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginUpdate +// method. func (client *DistributedAvailabilityGroupsClient) BeginUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup, options *DistributedAvailabilityGroupsClientBeginUpdateOptions) (*runtime.Poller[DistributedAvailabilityGroupsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) @@ -350,7 +429,8 @@ func (client *DistributedAvailabilityGroupsClient) BeginUpdate(ctx context.Conte // Update - Updates a distributed availability group replication mode. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *DistributedAvailabilityGroupsClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, distributedAvailabilityGroupName string, parameters DistributedAvailabilityGroup, options *DistributedAvailabilityGroupsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, distributedAvailabilityGroupName, parameters, options) if err != nil { @@ -390,7 +470,7 @@ func (client *DistributedAvailabilityGroupsClient) updateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpooloperations_client.go b/sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_elasticpooloperations_client.go rename to sdk/resourcemanager/sql/armsql/elasticpooloperations_client.go index d38c36b8fbaa..8ed670d15a87 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpooloperations_client.go +++ b/sdk/resourcemanager/sql/armsql/elasticpooloperations_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 armsql @@ -31,9 +32,9 @@ type ElasticPoolOperationsClient struct { } // NewElasticPoolOperationsClient creates a new instance of ElasticPoolOperationsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewElasticPoolOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ElasticPoolOperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewElasticPoolOperationsClient(subscriptionID string, credential azcore.Tok // Cancel - Cancels the asynchronous operation on the elastic pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// operationID - The operation identifier. -// options - ElasticPoolOperationsClientCancelOptions contains the optional parameters for the ElasticPoolOperationsClient.Cancel -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - operationID - The operation identifier. +// - options - ElasticPoolOperationsClientCancelOptions contains the optional parameters for the ElasticPoolOperationsClient.Cancel +// method. func (client *ElasticPoolOperationsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, operationID string, options *ElasticPoolOperationsClientCancelOptions) (ElasticPoolOperationsClientCancelResponse, error) { req, err := client.cancelCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, operationID, options) if err != nil { @@ -103,19 +105,19 @@ func (client *ElasticPoolOperationsClient) cancelCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // NewListByElasticPoolPager - Gets a list of operations performed on the elastic pool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ElasticPoolOperationsClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolOperationsClient.ListByElasticPool -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ElasticPoolOperationsClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolOperationsClient.NewListByElasticPoolPager +// method. func (client *ElasticPoolOperationsClient) NewListByElasticPoolPager(resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolOperationsClientListByElasticPoolOptions) *runtime.Pager[ElasticPoolOperationsClientListByElasticPoolResponse] { return runtime.NewPager(runtime.PagingHandler[ElasticPoolOperationsClientListByElasticPoolResponse]{ More: func(page ElasticPoolOperationsClientListByElasticPoolResponse) bool { @@ -168,7 +170,7 @@ func (client *ElasticPoolOperationsClient) listByElasticPoolCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpools_client.go b/sdk/resourcemanager/sql/armsql/elasticpools_client.go similarity index 63% rename from sdk/resourcemanager/sql/armsql/zz_generated_elasticpools_client.go rename to sdk/resourcemanager/sql/armsql/elasticpools_client.go index 8054b3e8c26b..64f0af5c778a 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpools_client.go +++ b/sdk/resourcemanager/sql/armsql/elasticpools_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 armsql @@ -32,9 +33,9 @@ type ElasticPoolsClient struct { } // NewElasticPoolsClient creates a new instance of ElasticPoolsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewElasticPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ElasticPoolsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,21 +58,24 @@ func NewElasticPoolsClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Creates or updates an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// elasticPoolName - The name of the elastic pool. -// parameters - The elastic pool parameters. -// options - ElasticPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the ElasticPoolsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - elasticPoolName - The name of the elastic pool. +// - parameters - The elastic pool parameters. +// - options - ElasticPoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the ElasticPoolsClient.BeginCreateOrUpdate +// method. func (client *ElasticPoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPool, options *ElasticPoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ElasticPoolsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, elasticPoolName, parameters, options) if err != nil { return nil, err } - return runtime.NewPoller[ElasticPoolsClientCreateOrUpdateResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ElasticPoolsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) } else { return runtime.NewPollerFromResumeToken[ElasticPoolsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -79,7 +83,8 @@ func (client *ElasticPoolsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates or updates an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ElasticPoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPool, options *ElasticPoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, parameters, options) if err != nil { @@ -119,7 +124,7 @@ func (client *ElasticPoolsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -127,20 +132,23 @@ func (client *ElasticPoolsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Deletes an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// elasticPoolName - The name of the elastic pool. -// options - ElasticPoolsClientBeginDeleteOptions contains the optional parameters for the ElasticPoolsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - elasticPoolName - The name of the elastic pool. +// - options - ElasticPoolsClientBeginDeleteOptions contains the optional parameters for the ElasticPoolsClient.BeginDelete +// method. func (client *ElasticPoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientBeginDeleteOptions) (*runtime.Poller[ElasticPoolsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, elasticPoolName, options) if err != nil { return nil, err } - return runtime.NewPoller[ElasticPoolsClientDeleteResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ElasticPoolsClientDeleteResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) } else { return runtime.NewPollerFromResumeToken[ElasticPoolsClientDeleteResponse](options.ResumeToken, client.pl, nil) } @@ -148,7 +156,8 @@ func (client *ElasticPoolsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ElasticPoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) if err != nil { @@ -188,20 +197,21 @@ func (client *ElasticPoolsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginFailover - Failovers an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// elasticPoolName - The name of the elastic pool to failover. -// options - ElasticPoolsClientBeginFailoverOptions contains the optional parameters for the ElasticPoolsClient.BeginFailover -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - elasticPoolName - The name of the elastic pool to failover. +// - options - ElasticPoolsClientBeginFailoverOptions contains the optional parameters for the ElasticPoolsClient.BeginFailover +// method. func (client *ElasticPoolsClient) BeginFailover(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientBeginFailoverOptions) (*runtime.Poller[ElasticPoolsClientFailoverResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.failover(ctx, resourceGroupName, serverName, elasticPoolName, options) @@ -216,7 +226,8 @@ func (client *ElasticPoolsClient) BeginFailover(ctx context.Context, resourceGro // Failover - Failovers an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ElasticPoolsClient) failover(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientBeginFailoverOptions) (*http.Response, error) { req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) if err != nil { @@ -256,19 +267,20 @@ func (client *ElasticPoolsClient) failoverCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// elasticPoolName - The name of the elastic pool. -// options - ElasticPoolsClientGetOptions contains the optional parameters for the ElasticPoolsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - elasticPoolName - The name of the elastic pool. +// - options - ElasticPoolsClientGetOptions contains the optional parameters for the ElasticPoolsClient.Get method. func (client *ElasticPoolsClient) Get(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientGetOptions) (ElasticPoolsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) if err != nil { @@ -308,7 +320,7 @@ func (client *ElasticPoolsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,13 +336,13 @@ func (client *ElasticPoolsClient) getHandleResponse(resp *http.Response) (Elasti } // NewListByServerPager - Gets all elastic pools in a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ElasticPoolsClientListByServerOptions contains the optional parameters for the ElasticPoolsClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ElasticPoolsClientListByServerOptions contains the optional parameters for the ElasticPoolsClient.NewListByServerPager +// method. func (client *ElasticPoolsClient) NewListByServerPager(resourceGroupName string, serverName string, options *ElasticPoolsClientListByServerOptions) *runtime.Pager[ElasticPoolsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ElasticPoolsClientListByServerResponse]{ More: func(page ElasticPoolsClientListByServerResponse) bool { @@ -382,7 +394,7 @@ func (client *ElasticPoolsClient) listByServerCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } - reqQP.Set("api-version", "2021-08-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -397,165 +409,26 @@ func (client *ElasticPoolsClient) listByServerHandleResponse(resp *http.Response return result, nil } -// NewListMetricDefinitionsPager - Returns elastic pool metric definitions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// elasticPoolName - The name of the elastic pool. -// options - ElasticPoolsClientListMetricDefinitionsOptions contains the optional parameters for the ElasticPoolsClient.ListMetricDefinitions -// method. -func (client *ElasticPoolsClient) NewListMetricDefinitionsPager(resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientListMetricDefinitionsOptions) *runtime.Pager[ElasticPoolsClientListMetricDefinitionsResponse] { - return runtime.NewPager(runtime.PagingHandler[ElasticPoolsClientListMetricDefinitionsResponse]{ - More: func(page ElasticPoolsClientListMetricDefinitionsResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ElasticPoolsClientListMetricDefinitionsResponse) (ElasticPoolsClientListMetricDefinitionsResponse, error) { - req, err := client.listMetricDefinitionsCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) - if err != nil { - return ElasticPoolsClientListMetricDefinitionsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ElasticPoolsClientListMetricDefinitionsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ElasticPoolsClientListMetricDefinitionsResponse{}, runtime.NewResponseError(resp) - } - return client.listMetricDefinitionsHandleResponse(resp) - }, - }) -} - -// listMetricDefinitionsCreateRequest creates the ListMetricDefinitions request. -func (client *ElasticPoolsClient) listMetricDefinitionsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolsClientListMetricDefinitionsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metricDefinitions" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if elasticPoolName == "" { - return nil, errors.New("parameter elasticPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{elasticPoolName}", url.PathEscape(elasticPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listMetricDefinitionsHandleResponse handles the ListMetricDefinitions response. -func (client *ElasticPoolsClient) listMetricDefinitionsHandleResponse(resp *http.Response) (ElasticPoolsClientListMetricDefinitionsResponse, error) { - result := ElasticPoolsClientListMetricDefinitionsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MetricDefinitionListResult); err != nil { - return ElasticPoolsClientListMetricDefinitionsResponse{}, err - } - return result, nil -} - -// NewListMetricsPager - Returns elastic pool metrics. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// elasticPoolName - The name of the elastic pool. -// filter - An OData filter expression that describes a subset of metrics to return. -// options - ElasticPoolsClientListMetricsOptions contains the optional parameters for the ElasticPoolsClient.ListMetrics -// method. -func (client *ElasticPoolsClient) NewListMetricsPager(resourceGroupName string, serverName string, elasticPoolName string, filter string, options *ElasticPoolsClientListMetricsOptions) *runtime.Pager[ElasticPoolsClientListMetricsResponse] { - return runtime.NewPager(runtime.PagingHandler[ElasticPoolsClientListMetricsResponse]{ - More: func(page ElasticPoolsClientListMetricsResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ElasticPoolsClientListMetricsResponse) (ElasticPoolsClientListMetricsResponse, error) { - req, err := client.listMetricsCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, filter, options) - if err != nil { - return ElasticPoolsClientListMetricsResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ElasticPoolsClientListMetricsResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ElasticPoolsClientListMetricsResponse{}, runtime.NewResponseError(resp) - } - return client.listMetricsHandleResponse(resp) - }, - }) -} - -// listMetricsCreateRequest creates the ListMetrics request. -func (client *ElasticPoolsClient) listMetricsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, filter string, options *ElasticPoolsClientListMetricsOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/metrics" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if elasticPoolName == "" { - return nil, errors.New("parameter elasticPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{elasticPoolName}", url.PathEscape(elasticPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - reqQP.Set("$filter", filter) - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listMetricsHandleResponse handles the ListMetrics response. -func (client *ElasticPoolsClient) listMetricsHandleResponse(resp *http.Response) (ElasticPoolsClientListMetricsResponse, error) { - result := ElasticPoolsClientListMetricsResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.MetricListResult); err != nil { - return ElasticPoolsClientListMetricsResponse{}, err - } - return result, nil -} - // BeginUpdate - Updates an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// elasticPoolName - The name of the elastic pool. -// parameters - The elastic pool update parameters. -// options - ElasticPoolsClientBeginUpdateOptions contains the optional parameters for the ElasticPoolsClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - elasticPoolName - The name of the elastic pool. +// - parameters - The elastic pool update parameters. +// - options - ElasticPoolsClientBeginUpdateOptions contains the optional parameters for the ElasticPoolsClient.BeginUpdate +// method. func (client *ElasticPoolsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPoolUpdate, options *ElasticPoolsClientBeginUpdateOptions) (*runtime.Poller[ElasticPoolsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, serverName, elasticPoolName, parameters, options) if err != nil { return nil, err } - return runtime.NewPoller[ElasticPoolsClientUpdateResponse](resp, client.pl, nil) + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ElasticPoolsClientUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) } else { return runtime.NewPollerFromResumeToken[ElasticPoolsClientUpdateResponse](options.ResumeToken, client.pl, nil) } @@ -563,7 +436,8 @@ func (client *ElasticPoolsClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Updates an elastic pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ElasticPoolsClient) update(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, parameters ElasticPoolUpdate, options *ElasticPoolsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, parameters, options) if err != nil { @@ -603,7 +477,7 @@ func (client *ElasticPoolsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_encryptionprotectors_client.go b/sdk/resourcemanager/sql/armsql/encryptionprotectors_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_encryptionprotectors_client.go rename to sdk/resourcemanager/sql/armsql/encryptionprotectors_client.go index 993f39a13e9e..14eb2df25ffb 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_encryptionprotectors_client.go +++ b/sdk/resourcemanager/sql/armsql/encryptionprotectors_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 armsql @@ -31,9 +32,9 @@ type EncryptionProtectorsClient struct { } // NewEncryptionProtectorsClient creates a new instance of EncryptionProtectorsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewEncryptionProtectorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EncryptionProtectorsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewEncryptionProtectorsClient(subscriptionID string, credential azcore.Toke // BeginCreateOrUpdate - Updates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// encryptionProtectorName - The name of the encryption protector to be updated. -// parameters - The requested encryption protector resource state. -// options - EncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - encryptionProtectorName - The name of the encryption protector to be updated. +// - parameters - The requested encryption protector resource state. +// - options - EncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginCreateOrUpdate +// method. func (client *EncryptionProtectorsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName EncryptionProtectorName, parameters EncryptionProtector, options *EncryptionProtectorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[EncryptionProtectorsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, encryptionProtectorName, parameters, options) @@ -78,7 +80,8 @@ func (client *EncryptionProtectorsClient) BeginCreateOrUpdate(ctx context.Contex // CreateOrUpdate - Updates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *EncryptionProtectorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName EncryptionProtectorName, parameters EncryptionProtector, options *EncryptionProtectorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, encryptionProtectorName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *EncryptionProtectorsClient) createOrUpdateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *EncryptionProtectorsClient) createOrUpdateCreateRequest(ctx contex // Get - Gets a server encryption protector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// encryptionProtectorName - The name of the encryption protector to be retrieved. -// options - EncryptionProtectorsClientGetOptions contains the optional parameters for the EncryptionProtectorsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - encryptionProtectorName - The name of the encryption protector to be retrieved. +// - options - EncryptionProtectorsClientGetOptions contains the optional parameters for the EncryptionProtectorsClient.Get +// method. func (client *EncryptionProtectorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName EncryptionProtectorName, options *EncryptionProtectorsClientGetOptions) (EncryptionProtectorsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, encryptionProtectorName, options) if err != nil { @@ -172,7 +176,7 @@ func (client *EncryptionProtectorsClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,13 +192,13 @@ func (client *EncryptionProtectorsClient) getHandleResponse(resp *http.Response) } // NewListByServerPager - Gets a list of server encryption protectors -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - EncryptionProtectorsClientListByServerOptions contains the optional parameters for the EncryptionProtectorsClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - EncryptionProtectorsClientListByServerOptions contains the optional parameters for the EncryptionProtectorsClient.NewListByServerPager +// method. func (client *EncryptionProtectorsClient) NewListByServerPager(resourceGroupName string, serverName string, options *EncryptionProtectorsClientListByServerOptions) *runtime.Pager[EncryptionProtectorsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[EncryptionProtectorsClientListByServerResponse]{ More: func(page EncryptionProtectorsClientListByServerResponse) bool { @@ -243,7 +247,7 @@ func (client *EncryptionProtectorsClient) listByServerCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,13 +264,14 @@ func (client *EncryptionProtectorsClient) listByServerHandleResponse(resp *http. // BeginRevalidate - Revalidates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// encryptionProtectorName - The name of the encryption protector to be updated. -// options - EncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginRevalidate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - encryptionProtectorName - The name of the encryption protector to be updated. +// - options - EncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the EncryptionProtectorsClient.BeginRevalidate +// method. func (client *EncryptionProtectorsClient) BeginRevalidate(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName EncryptionProtectorName, options *EncryptionProtectorsClientBeginRevalidateOptions) (*runtime.Poller[EncryptionProtectorsClientRevalidateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.revalidate(ctx, resourceGroupName, serverName, encryptionProtectorName, options) @@ -281,7 +286,8 @@ func (client *EncryptionProtectorsClient) BeginRevalidate(ctx context.Context, r // Revalidate - Revalidates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *EncryptionProtectorsClient) revalidate(ctx context.Context, resourceGroupName string, serverName string, encryptionProtectorName EncryptionProtectorName, options *EncryptionProtectorsClientBeginRevalidateOptions) (*http.Response, error) { req, err := client.revalidateCreateRequest(ctx, resourceGroupName, serverName, encryptionProtectorName, options) if err != nil { @@ -321,7 +327,7 @@ func (client *EncryptionProtectorsClient) revalidateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_endpointcertificates_client.go b/sdk/resourcemanager/sql/armsql/endpointcertificates_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_endpointcertificates_client.go rename to sdk/resourcemanager/sql/armsql/endpointcertificates_client.go index f5ed612ab9da..bd267c7325ad 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_endpointcertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/endpointcertificates_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 armsql @@ -31,9 +32,9 @@ type EndpointCertificatesClient struct { } // NewEndpointCertificatesClient creates a new instance of EndpointCertificatesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewEndpointCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EndpointCertificatesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewEndpointCertificatesClient(subscriptionID string, credential azcore.Toke // Get - Gets a certificate used on the endpoint with the given id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// endpointType - Type of the endpoint whose certificate the customer is looking for. -// options - EndpointCertificatesClientGetOptions contains the optional parameters for the EndpointCertificatesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - endpointType - Type of the endpoint whose certificate the customer is looking for. +// - options - EndpointCertificatesClientGetOptions contains the optional parameters for the EndpointCertificatesClient.Get +// method. func (client *EndpointCertificatesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, endpointType string, options *EndpointCertificatesClientGetOptions) (EndpointCertificatesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, endpointType, options) if err != nil { @@ -102,7 +104,7 @@ func (client *EndpointCertificatesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,13 +120,13 @@ func (client *EndpointCertificatesClient) getHandleResponse(resp *http.Response) } // NewListByInstancePager - List certificates used on endpoints on the target instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - EndpointCertificatesClientListByInstanceOptions contains the optional parameters for the EndpointCertificatesClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - EndpointCertificatesClientListByInstanceOptions contains the optional parameters for the EndpointCertificatesClient.NewListByInstancePager +// method. func (client *EndpointCertificatesClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *EndpointCertificatesClientListByInstanceOptions) *runtime.Pager[EndpointCertificatesClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[EndpointCertificatesClientListByInstanceResponse]{ More: func(page EndpointCertificatesClientListByInstanceResponse) bool { @@ -173,7 +175,7 @@ func (client *EndpointCertificatesClient) listByInstanceCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_extendeddatabaseblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_extendeddatabaseblobauditingpolicies_client.go rename to sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_client.go index 0e52c2ac6843..99fc6458ddcb 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_extendeddatabaseblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/extendeddatabaseblobauditingpolicies_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 armsql @@ -31,9 +32,9 @@ type ExtendedDatabaseBlobAuditingPoliciesClient struct { } // NewExtendedDatabaseBlobAuditingPoliciesClient creates a new instance of ExtendedDatabaseBlobAuditingPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewExtendedDatabaseBlobAuditingPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExtendedDatabaseBlobAuditingPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewExtendedDatabaseBlobAuditingPoliciesClient(subscriptionID string, creden // CreateOrUpdate - Creates or updates an extended database's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// parameters - The extended database blob auditing policy. -// options - ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - parameters - The extended database blob auditing policy. +// - options - ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.CreateOrUpdate +// method. func (client *ExtendedDatabaseBlobAuditingPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters ExtendedDatabaseBlobAuditingPolicy, options *ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateOptions) (ExtendedDatabaseBlobAuditingPoliciesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -104,7 +106,7 @@ func (client *ExtendedDatabaseBlobAuditingPoliciesClient) createOrUpdateCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,13 +123,14 @@ func (client *ExtendedDatabaseBlobAuditingPoliciesClient) createOrUpdateHandleRe // Get - Gets an extended database's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - ExtendedDatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - ExtendedDatabaseBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.Get +// method. func (client *ExtendedDatabaseBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *ExtendedDatabaseBlobAuditingPoliciesClientGetOptions) (ExtendedDatabaseBlobAuditingPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -168,7 +171,7 @@ func (client *ExtendedDatabaseBlobAuditingPoliciesClient) getCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,14 +187,14 @@ func (client *ExtendedDatabaseBlobAuditingPoliciesClient) getHandleResponse(resp } // NewListByDatabasePager - Lists extended auditing settings of a database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.NewListByDatabasePager +// method. func (client *ExtendedDatabaseBlobAuditingPoliciesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions) *runtime.Pager[ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResponse]{ More: func(page ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResponse) bool { @@ -244,7 +247,7 @@ func (client *ExtendedDatabaseBlobAuditingPoliciesClient) listByDatabaseCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_extendedserverblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_extendedserverblobauditingpolicies_client.go rename to sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_client.go index b7ac23a6aaea..8148f2c69ec8 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_extendedserverblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/extendedserverblobauditingpolicies_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 armsql @@ -31,9 +32,9 @@ type ExtendedServerBlobAuditingPoliciesClient struct { } // NewExtendedServerBlobAuditingPoliciesClient creates a new instance of ExtendedServerBlobAuditingPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewExtendedServerBlobAuditingPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExtendedServerBlobAuditingPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewExtendedServerBlobAuditingPoliciesClient(subscriptionID string, credenti // BeginCreateOrUpdate - Creates or updates an extended server's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// parameters - Properties of extended blob auditing policy -// options - ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - parameters - Properties of extended blob auditing policy +// - options - ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.BeginCreateOrUpdate +// method. func (client *ExtendedServerBlobAuditingPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ExtendedServerBlobAuditingPolicy, options *ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, parameters, options) @@ -77,7 +79,8 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - Creates or updates an extended server's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ExtendedServerBlobAuditingPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ExtendedServerBlobAuditingPolicy, options *ExtendedServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { @@ -114,7 +117,7 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) createOrUpdateCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,12 +125,13 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) createOrUpdateCreateRequ // Get - Gets an extended server's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ExtendedServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ExtendedServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.Get +// method. func (client *ExtendedServerBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *ExtendedServerBlobAuditingPoliciesClientGetOptions) (ExtendedServerBlobAuditingPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, options) if err != nil { @@ -164,7 +168,7 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,13 +184,13 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) getHandleResponse(resp * } // NewListByServerPager - Lists extended auditing settings of a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ExtendedServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ExtendedServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.NewListByServerPager +// method. func (client *ExtendedServerBlobAuditingPoliciesClient) NewListByServerPager(resourceGroupName string, serverName string, options *ExtendedServerBlobAuditingPoliciesClientListByServerOptions) *runtime.Pager[ExtendedServerBlobAuditingPoliciesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ExtendedServerBlobAuditingPoliciesClientListByServerResponse]{ More: func(page ExtendedServerBlobAuditingPoliciesClientListByServerResponse) bool { @@ -235,7 +239,7 @@ func (client *ExtendedServerBlobAuditingPoliciesClient) listByServerCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_failovergroups_client.go b/sdk/resourcemanager/sql/armsql/failovergroups_client.go similarity index 72% rename from sdk/resourcemanager/sql/armsql/zz_generated_failovergroups_client.go rename to sdk/resourcemanager/sql/armsql/failovergroups_client.go index a3f59a61af5b..64f47a8a575e 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_failovergroups_client.go +++ b/sdk/resourcemanager/sql/armsql/failovergroups_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 armsql @@ -31,9 +32,9 @@ type FailoverGroupsClient struct { } // NewFailoverGroupsClient creates a new instance of FailoverGroupsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewFailoverGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FailoverGroupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewFailoverGroupsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server containing the failover group. -// failoverGroupName - The name of the failover group. -// parameters - The failover group parameters. -// options - FailoverGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server containing the failover group. +// - failoverGroupName - The name of the failover group. +// - parameters - The failover group parameters. +// - options - FailoverGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginCreateOrUpdate +// method. func (client *FailoverGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroup, options *FailoverGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[FailoverGroupsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, failoverGroupName, parameters, options) @@ -78,7 +80,8 @@ func (client *FailoverGroupsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *FailoverGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroup, options *FailoverGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *FailoverGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *FailoverGroupsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes a failover group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server containing the failover group. -// failoverGroupName - The name of the failover group. -// options - FailoverGroupsClientBeginDeleteOptions contains the optional parameters for the FailoverGroupsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server containing the failover group. +// - failoverGroupName - The name of the failover group. +// - options - FailoverGroupsClientBeginDeleteOptions contains the optional parameters for the FailoverGroupsClient.BeginDelete +// method. func (client *FailoverGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginDeleteOptions) (*runtime.Poller[FailoverGroupsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, failoverGroupName, options) @@ -147,7 +151,8 @@ func (client *FailoverGroupsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a failover group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *FailoverGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) if err != nil { @@ -187,20 +192,21 @@ func (client *FailoverGroupsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginFailover - Fails over from the current primary server to this server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server containing the failover group. -// failoverGroupName - The name of the failover group. -// options - FailoverGroupsClientBeginFailoverOptions contains the optional parameters for the FailoverGroupsClient.BeginFailover -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server containing the failover group. +// - failoverGroupName - The name of the failover group. +// - options - FailoverGroupsClientBeginFailoverOptions contains the optional parameters for the FailoverGroupsClient.BeginFailover +// method. func (client *FailoverGroupsClient) BeginFailover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginFailoverOptions) (*runtime.Poller[FailoverGroupsClientFailoverResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.failover(ctx, resourceGroupName, serverName, failoverGroupName, options) @@ -215,7 +221,8 @@ func (client *FailoverGroupsClient) BeginFailover(ctx context.Context, resourceG // Failover - Fails over from the current primary server to this server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *FailoverGroupsClient) failover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginFailoverOptions) (*http.Response, error) { req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) if err != nil { @@ -255,7 +262,7 @@ func (client *FailoverGroupsClient) failoverCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,13 +271,14 @@ func (client *FailoverGroupsClient) failoverCreateRequest(ctx context.Context, r // BeginForceFailoverAllowDataLoss - Fails over from the current primary server to this server. This operation might result // in data loss. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server containing the failover group. -// failoverGroupName - The name of the failover group. -// options - FailoverGroupsClientBeginForceFailoverAllowDataLossOptions contains the optional parameters for the FailoverGroupsClient.BeginForceFailoverAllowDataLoss -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server containing the failover group. +// - failoverGroupName - The name of the failover group. +// - options - FailoverGroupsClientBeginForceFailoverAllowDataLossOptions contains the optional parameters for the FailoverGroupsClient.BeginForceFailoverAllowDataLoss +// method. func (client *FailoverGroupsClient) BeginForceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginForceFailoverAllowDataLossOptions) (*runtime.Poller[FailoverGroupsClientForceFailoverAllowDataLossResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.forceFailoverAllowDataLoss(ctx, resourceGroupName, serverName, failoverGroupName, options) @@ -286,7 +294,8 @@ func (client *FailoverGroupsClient) BeginForceFailoverAllowDataLoss(ctx context. // ForceFailoverAllowDataLoss - Fails over from the current primary server to this server. This operation might result in // data loss. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *FailoverGroupsClient) forceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientBeginForceFailoverAllowDataLossOptions) (*http.Response, error) { req, err := client.forceFailoverAllowDataLossCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) if err != nil { @@ -326,7 +335,7 @@ func (client *FailoverGroupsClient) forceFailoverAllowDataLossCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,12 +343,13 @@ func (client *FailoverGroupsClient) forceFailoverAllowDataLossCreateRequest(ctx // Get - Gets a failover group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server containing the failover group. -// failoverGroupName - The name of the failover group. -// options - FailoverGroupsClientGetOptions contains the optional parameters for the FailoverGroupsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server containing the failover group. +// - failoverGroupName - The name of the failover group. +// - options - FailoverGroupsClientGetOptions contains the optional parameters for the FailoverGroupsClient.Get method. func (client *FailoverGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, options *FailoverGroupsClientGetOptions) (FailoverGroupsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, options) if err != nil { @@ -379,7 +389,7 @@ func (client *FailoverGroupsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -395,13 +405,13 @@ func (client *FailoverGroupsClient) getHandleResponse(resp *http.Response) (Fail } // NewListByServerPager - Lists the failover groups in a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server containing the failover group. -// options - FailoverGroupsClientListByServerOptions contains the optional parameters for the FailoverGroupsClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server containing the failover group. +// - options - FailoverGroupsClientListByServerOptions contains the optional parameters for the FailoverGroupsClient.NewListByServerPager +// method. func (client *FailoverGroupsClient) NewListByServerPager(resourceGroupName string, serverName string, options *FailoverGroupsClientListByServerOptions) *runtime.Pager[FailoverGroupsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[FailoverGroupsClientListByServerResponse]{ More: func(page FailoverGroupsClientListByServerResponse) bool { @@ -450,7 +460,7 @@ func (client *FailoverGroupsClient) listByServerCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -465,16 +475,93 @@ func (client *FailoverGroupsClient) listByServerHandleResponse(resp *http.Respon return result, nil } +// BeginTryPlannedBeforeForcedFailover - Fails over from the current primary server to this server. This operation tries planned +// before forced failover but might still result in data loss. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - failoverGroupName - The name of the failover group. +// - parameters - The try planned before force failover of failover group parameters. +// - options - FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions contains the optional parameters for the FailoverGroupsClient.BeginTryPlannedBeforeForcedFailover +// method. +func (client *FailoverGroupsClient) BeginTryPlannedBeforeForcedFailover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroupTryPlannedBeforeForcedFailover, options *FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions) (*runtime.Poller[FailoverGroupsClientTryPlannedBeforeForcedFailoverResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.tryPlannedBeforeForcedFailover(ctx, resourceGroupName, serverName, failoverGroupName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[FailoverGroupsClientTryPlannedBeforeForcedFailoverResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[FailoverGroupsClientTryPlannedBeforeForcedFailoverResponse](options.ResumeToken, client.pl, nil) + } +} + +// TryPlannedBeforeForcedFailover - Fails over from the current primary server to this server. This operation tries planned +// before forced failover but might still result in data loss. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *FailoverGroupsClient) tryPlannedBeforeForcedFailover(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroupTryPlannedBeforeForcedFailover, options *FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions) (*http.Response, error) { + req, err := client.tryPlannedBeforeForcedFailoverCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// tryPlannedBeforeForcedFailoverCreateRequest creates the TryPlannedBeforeForcedFailover request. +func (client *FailoverGroupsClient) tryPlannedBeforeForcedFailoverCreateRequest(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroupTryPlannedBeforeForcedFailover, options *FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/failoverGroups/{failoverGroupName}/tryPlannedBeforeForcedFailover" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if failoverGroupName == "" { + return nil, errors.New("parameter failoverGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{failoverGroupName}", url.PathEscape(failoverGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + // BeginUpdate - Updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server containing the failover group. -// failoverGroupName - The name of the failover group. -// parameters - The failover group parameters. -// options - FailoverGroupsClientBeginUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server containing the failover group. +// - failoverGroupName - The name of the failover group. +// - parameters - The failover group parameters. +// - options - FailoverGroupsClientBeginUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginUpdate +// method. func (client *FailoverGroupsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroupUpdate, options *FailoverGroupsClientBeginUpdateOptions) (*runtime.Poller[FailoverGroupsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, serverName, failoverGroupName, parameters, options) @@ -489,7 +576,8 @@ func (client *FailoverGroupsClient) BeginUpdate(ctx context.Context, resourceGro // Update - Updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *FailoverGroupsClient) update(ctx context.Context, resourceGroupName string, serverName string, failoverGroupName string, parameters FailoverGroupUpdate, options *FailoverGroupsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, failoverGroupName, parameters, options) if err != nil { @@ -529,7 +617,7 @@ func (client *FailoverGroupsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_firewallrules_client.go b/sdk/resourcemanager/sql/armsql/firewallrules_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_firewallrules_client.go rename to sdk/resourcemanager/sql/armsql/firewallrules_client.go index 4e1892079353..21e02f9a0e1f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_firewallrules_client.go +++ b/sdk/resourcemanager/sql/armsql/firewallrules_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 armsql @@ -31,9 +32,9 @@ type FirewallRulesClient struct { } // NewFirewallRulesClient creates a new instance of FirewallRulesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FirewallRulesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewFirewallRulesClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates or updates a firewall rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// firewallRuleName - The name of the firewall rule. -// parameters - The required parameters for creating or updating a firewall rule. -// options - FirewallRulesClientCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - firewallRuleName - The name of the firewall rule. +// - parameters - The required parameters for creating or updating a firewall rule. +// - options - FirewallRulesClientCreateOrUpdateOptions contains the optional parameters for the FirewallRulesClient.CreateOrUpdate +// method. func (client *FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters FirewallRule, options *FirewallRulesClientCreateOrUpdateOptions) (FirewallRulesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, firewallRuleName, parameters, options) if err != nil { @@ -103,7 +105,7 @@ func (client *FirewallRulesClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,12 +122,13 @@ func (client *FirewallRulesClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes a firewall rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// firewallRuleName - The name of the firewall rule. -// options - FirewallRulesClientDeleteOptions contains the optional parameters for the FirewallRulesClient.Delete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - firewallRuleName - The name of the firewall rule. +// - options - FirewallRulesClientDeleteOptions contains the optional parameters for the FirewallRulesClient.Delete method. func (client *FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientDeleteOptions) (FirewallRulesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, firewallRuleName, options) if err != nil { @@ -165,19 +168,20 @@ func (client *FirewallRulesClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a firewall rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// firewallRuleName - The name of the firewall rule. -// options - FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - firewallRuleName - The name of the firewall rule. +// - options - FirewallRulesClientGetOptions contains the optional parameters for the FirewallRulesClient.Get method. func (client *FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *FirewallRulesClientGetOptions) (FirewallRulesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, firewallRuleName, options) if err != nil { @@ -217,7 +221,7 @@ func (client *FirewallRulesClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -233,13 +237,13 @@ func (client *FirewallRulesClient) getHandleResponse(resp *http.Response) (Firew } // NewListByServerPager - Gets a list of firewall rules. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.NewListByServerPager +// method. func (client *FirewallRulesClient) NewListByServerPager(resourceGroupName string, serverName string, options *FirewallRulesClientListByServerOptions) *runtime.Pager[FirewallRulesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[FirewallRulesClientListByServerResponse]{ More: func(page FirewallRulesClientListByServerResponse) bool { @@ -288,7 +292,7 @@ func (client *FirewallRulesClient) listByServerCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,11 +309,12 @@ func (client *FirewallRulesClient) listByServerHandleResponse(resp *http.Respons // Replace - Replaces all firewall rules on the server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - FirewallRulesClientReplaceOptions contains the optional parameters for the FirewallRulesClient.Replace method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - FirewallRulesClientReplaceOptions contains the optional parameters for the FirewallRulesClient.Replace method. func (client *FirewallRulesClient) Replace(ctx context.Context, resourceGroupName string, serverName string, parameters FirewallRuleList, options *FirewallRulesClientReplaceOptions) (FirewallRulesClientReplaceResponse, error) { req, err := client.replaceCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { @@ -345,7 +350,7 @@ func (client *FirewallRulesClient) replaceCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_geobackuppolicies_client.go b/sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go similarity index 72% rename from sdk/resourcemanager/sql/armsql/zz_generated_geobackuppolicies_client.go rename to sdk/resourcemanager/sql/armsql/geobackuppolicies_client.go index 9f4a3421f2fd..9d60ab13ac3b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_geobackuppolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/geobackuppolicies_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 armsql @@ -31,9 +32,9 @@ type GeoBackupPoliciesClient struct { } // NewGeoBackupPoliciesClient creates a new instance of GeoBackupPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewGeoBackupPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GeoBackupPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,17 +55,18 @@ func NewGeoBackupPoliciesClient(subscriptionID string, credential azcore.TokenCr return client, nil } -// CreateOrUpdate - Updates a database geo backup policy. +// CreateOrUpdate - Create or update a database default Geo backup policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// geoBackupPolicyName - The name of the geo backup policy. -// parameters - The required parameters for creating or updating the geo backup policy. -// options - GeoBackupPoliciesClientCreateOrUpdateOptions contains the optional parameters for the GeoBackupPoliciesClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - geoBackupPolicyName - The name of the Geo backup policy. This should always be 'Default'. +// - parameters - The required parameters for creating or updating the geo backup policy. +// - options - GeoBackupPoliciesClientCreateOrUpdateOptions contains the optional parameters for the GeoBackupPoliciesClient.CreateOrUpdate +// method. func (client *GeoBackupPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName GeoBackupPolicyName, parameters GeoBackupPolicy, options *GeoBackupPoliciesClientCreateOrUpdateOptions) (GeoBackupPoliciesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, geoBackupPolicyName, parameters, options) if err != nil { @@ -83,10 +85,6 @@ func (client *GeoBackupPoliciesClient) CreateOrUpdate(ctx context.Context, resou // createOrUpdateCreateRequest creates the CreateOrUpdate request. func (client *GeoBackupPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName GeoBackupPolicyName, parameters GeoBackupPolicy, options *GeoBackupPoliciesClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -103,12 +101,16 @@ func (client *GeoBackupPoliciesClient) createOrUpdateCreateRequest(ctx context.C return nil, errors.New("parameter geoBackupPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{geoBackupPolicyName}", url.PathEscape(string(geoBackupPolicyName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -123,15 +125,16 @@ func (client *GeoBackupPoliciesClient) createOrUpdateHandleResponse(resp *http.R return result, nil } -// Get - Gets a geo backup policy. +// Get - Gets a Geo backup policy for the given database resource. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// geoBackupPolicyName - The name of the geo backup policy. -// options - GeoBackupPoliciesClientGetOptions contains the optional parameters for the GeoBackupPoliciesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - geoBackupPolicyName - The name of the Geo backup policy. This should always be 'Default'. +// - options - GeoBackupPoliciesClientGetOptions contains the optional parameters for the GeoBackupPoliciesClient.Get method. func (client *GeoBackupPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName GeoBackupPolicyName, options *GeoBackupPoliciesClientGetOptions) (GeoBackupPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, geoBackupPolicyName, options) if err != nil { @@ -150,10 +153,6 @@ func (client *GeoBackupPoliciesClient) Get(ctx context.Context, resourceGroupNam // getCreateRequest creates the Get request. func (client *GeoBackupPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, geoBackupPolicyName GeoBackupPolicyName, options *GeoBackupPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies/{geoBackupPolicyName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -170,12 +169,16 @@ func (client *GeoBackupPoliciesClient) getCreateRequest(ctx context.Context, res return nil, errors.New("parameter geoBackupPolicyName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{geoBackupPolicyName}", url.PathEscape(string(geoBackupPolicyName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,44 +193,46 @@ func (client *GeoBackupPoliciesClient) getHandleResponse(resp *http.Response) (G return result, nil } -// NewListByDatabasePager - Returns a list of geo backup policies. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - GeoBackupPoliciesClientListByDatabaseOptions contains the optional parameters for the GeoBackupPoliciesClient.ListByDatabase -// method. -func (client *GeoBackupPoliciesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *GeoBackupPoliciesClientListByDatabaseOptions) *runtime.Pager[GeoBackupPoliciesClientListByDatabaseResponse] { - return runtime.NewPager(runtime.PagingHandler[GeoBackupPoliciesClientListByDatabaseResponse]{ - More: func(page GeoBackupPoliciesClientListByDatabaseResponse) bool { - return false +// NewListPager - Gets a list of Geo backup policies for the given database resource. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - GeoBackupPoliciesClientListOptions contains the optional parameters for the GeoBackupPoliciesClient.NewListPager +// method. +func (client *GeoBackupPoliciesClient) NewListPager(resourceGroupName string, serverName string, databaseName string, options *GeoBackupPoliciesClientListOptions) *runtime.Pager[GeoBackupPoliciesClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[GeoBackupPoliciesClientListResponse]{ + More: func(page GeoBackupPoliciesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - Fetcher: func(ctx context.Context, page *GeoBackupPoliciesClientListByDatabaseResponse) (GeoBackupPoliciesClientListByDatabaseResponse, error) { - req, err := client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + Fetcher: func(ctx context.Context, page *GeoBackupPoliciesClientListResponse) (GeoBackupPoliciesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { - return GeoBackupPoliciesClientListByDatabaseResponse{}, err + return GeoBackupPoliciesClientListResponse{}, err } resp, err := client.pl.Do(req) if err != nil { - return GeoBackupPoliciesClientListByDatabaseResponse{}, err + return GeoBackupPoliciesClientListResponse{}, err } if !runtime.HasStatusCode(resp, http.StatusOK) { - return GeoBackupPoliciesClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + return GeoBackupPoliciesClientListResponse{}, runtime.NewResponseError(resp) } - return client.listByDatabaseHandleResponse(resp) + return client.listHandleResponse(resp) }, }) } -// listByDatabaseCreateRequest creates the ListByDatabase request. -func (client *GeoBackupPoliciesClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *GeoBackupPoliciesClientListByDatabaseOptions) (*policy.Request, error) { +// listCreateRequest creates the List request. +func (client *GeoBackupPoliciesClient) listCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *GeoBackupPoliciesClientListOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/geoBackupPolicies" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -240,22 +245,26 @@ func (client *GeoBackupPoliciesClient) listByDatabaseCreateRequest(ctx context.C return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } -// listByDatabaseHandleResponse handles the ListByDatabase response. -func (client *GeoBackupPoliciesClient) listByDatabaseHandleResponse(resp *http.Response) (GeoBackupPoliciesClientListByDatabaseResponse, error) { - result := GeoBackupPoliciesClientListByDatabaseResponse{} +// listHandleResponse handles the List response. +func (client *GeoBackupPoliciesClient) listHandleResponse(resp *http.Response) (GeoBackupPoliciesClientListResponse, error) { + result := GeoBackupPoliciesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.GeoBackupPolicyListResult); err != nil { - return GeoBackupPoliciesClientListByDatabaseResponse{}, err + return GeoBackupPoliciesClientListResponse{}, err } return result, nil } diff --git a/sdk/resourcemanager/sql/armsql/go.mod b/sdk/resourcemanager/sql/armsql/go.mod index 77e8d20659cd..34daab2f15ff 100644 --- a/sdk/resourcemanager/sql/armsql/go.mod +++ b/sdk/resourcemanager/sql/armsql/go.mod @@ -1,23 +1,15 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) retract v0.6.0 diff --git a/sdk/resourcemanager/sql/armsql/go.sum b/sdk/resourcemanager/sql/armsql/go.sum index ed5b814680ee..3afb578030a5 100644 --- a/sdk/resourcemanager/sql/armsql/go.sum +++ b/sdk/resourcemanager/sql/armsql/go.sum @@ -1,33 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/montanaflynn/stats v0.6.6/go.mod h1:etXPPgVO6n31NxCd9KQUMvCM+ve0ruNzt6R8Bnaayow= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 h1:Qj1ukM4GlMWXNdMBuXcXfz/Kw9s1qm0CLY32QxuSImI= -github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4/go.mod h1:N6UoU20jOqggOuDwUaBQpluzLNDqif3kq9z2wpdYEfQ= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_instancefailovergroups_client.go b/sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_instancefailovergroups_client.go rename to sdk/resourcemanager/sql/armsql/instancefailovergroups_client.go index 63c03e331304..a8276e9bd43c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_instancefailovergroups_client.go +++ b/sdk/resourcemanager/sql/armsql/instancefailovergroups_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 armsql @@ -31,9 +32,9 @@ type InstanceFailoverGroupsClient struct { } // NewInstanceFailoverGroupsClient creates a new instance of InstanceFailoverGroupsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewInstanceFailoverGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InstanceFailoverGroupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewInstanceFailoverGroupsClient(subscriptionID string, credential azcore.To // BeginCreateOrUpdate - Creates or updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The name of the region where the resource is located. -// failoverGroupName - The name of the failover group. -// parameters - The failover group parameters. -// options - InstanceFailoverGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The name of the region where the resource is located. +// - failoverGroupName - The name of the failover group. +// - parameters - The failover group parameters. +// - options - InstanceFailoverGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginCreateOrUpdate +// method. func (client *InstanceFailoverGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, parameters InstanceFailoverGroup, options *InstanceFailoverGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[InstanceFailoverGroupsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, locationName, failoverGroupName, parameters, options) @@ -78,7 +80,8 @@ func (client *InstanceFailoverGroupsClient) BeginCreateOrUpdate(ctx context.Cont // CreateOrUpdate - Creates or updates a failover group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *InstanceFailoverGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, parameters InstanceFailoverGroup, options *InstanceFailoverGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *InstanceFailoverGroupsClient) createOrUpdateCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *InstanceFailoverGroupsClient) createOrUpdateCreateRequest(ctx cont // BeginDelete - Deletes a failover group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The name of the region where the resource is located. -// failoverGroupName - The name of the failover group. -// options - InstanceFailoverGroupsClientBeginDeleteOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The name of the region where the resource is located. +// - failoverGroupName - The name of the failover group. +// - options - InstanceFailoverGroupsClientBeginDeleteOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginDelete +// method. func (client *InstanceFailoverGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginDeleteOptions) (*runtime.Poller[InstanceFailoverGroupsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, locationName, failoverGroupName, options) @@ -147,7 +151,8 @@ func (client *InstanceFailoverGroupsClient) BeginDelete(ctx context.Context, res // Delete - Deletes a failover group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *InstanceFailoverGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, options) if err != nil { @@ -187,20 +192,21 @@ func (client *InstanceFailoverGroupsClient) deleteCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginFailover - Fails over from the current primary managed instance to this managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The name of the region where the resource is located. -// failoverGroupName - The name of the failover group. -// options - InstanceFailoverGroupsClientBeginFailoverOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginFailover -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The name of the region where the resource is located. +// - failoverGroupName - The name of the failover group. +// - options - InstanceFailoverGroupsClientBeginFailoverOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginFailover +// method. func (client *InstanceFailoverGroupsClient) BeginFailover(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginFailoverOptions) (*runtime.Poller[InstanceFailoverGroupsClientFailoverResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.failover(ctx, resourceGroupName, locationName, failoverGroupName, options) @@ -215,7 +221,8 @@ func (client *InstanceFailoverGroupsClient) BeginFailover(ctx context.Context, r // Failover - Fails over from the current primary managed instance to this managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *InstanceFailoverGroupsClient) failover(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginFailoverOptions) (*http.Response, error) { req, err := client.failoverCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, options) if err != nil { @@ -255,7 +262,7 @@ func (client *InstanceFailoverGroupsClient) failoverCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,13 +271,14 @@ func (client *InstanceFailoverGroupsClient) failoverCreateRequest(ctx context.Co // BeginForceFailoverAllowDataLoss - Fails over from the current primary managed instance to this managed instance. This operation // might result in data loss. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The name of the region where the resource is located. -// failoverGroupName - The name of the failover group. -// options - InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginForceFailoverAllowDataLoss -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The name of the region where the resource is located. +// - failoverGroupName - The name of the failover group. +// - options - InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions contains the optional parameters for the InstanceFailoverGroupsClient.BeginForceFailoverAllowDataLoss +// method. func (client *InstanceFailoverGroupsClient) BeginForceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions) (*runtime.Poller[InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.forceFailoverAllowDataLoss(ctx, resourceGroupName, locationName, failoverGroupName, options) @@ -286,7 +294,8 @@ func (client *InstanceFailoverGroupsClient) BeginForceFailoverAllowDataLoss(ctx // ForceFailoverAllowDataLoss - Fails over from the current primary managed instance to this managed instance. This operation // might result in data loss. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *InstanceFailoverGroupsClient) forceFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientBeginForceFailoverAllowDataLossOptions) (*http.Response, error) { req, err := client.forceFailoverAllowDataLossCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, options) if err != nil { @@ -326,7 +335,7 @@ func (client *InstanceFailoverGroupsClient) forceFailoverAllowDataLossCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,13 +343,14 @@ func (client *InstanceFailoverGroupsClient) forceFailoverAllowDataLossCreateRequ // Get - Gets a failover group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The name of the region where the resource is located. -// failoverGroupName - The name of the failover group. -// options - InstanceFailoverGroupsClientGetOptions contains the optional parameters for the InstanceFailoverGroupsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The name of the region where the resource is located. +// - failoverGroupName - The name of the failover group. +// - options - InstanceFailoverGroupsClientGetOptions contains the optional parameters for the InstanceFailoverGroupsClient.Get +// method. func (client *InstanceFailoverGroupsClient) Get(ctx context.Context, resourceGroupName string, locationName string, failoverGroupName string, options *InstanceFailoverGroupsClientGetOptions) (InstanceFailoverGroupsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, locationName, failoverGroupName, options) if err != nil { @@ -380,7 +390,7 @@ func (client *InstanceFailoverGroupsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -396,13 +406,13 @@ func (client *InstanceFailoverGroupsClient) getHandleResponse(resp *http.Respons } // NewListByLocationPager - Lists the failover groups in a location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The name of the region where the resource is located. -// options - InstanceFailoverGroupsClientListByLocationOptions contains the optional parameters for the InstanceFailoverGroupsClient.ListByLocation -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The name of the region where the resource is located. +// - options - InstanceFailoverGroupsClientListByLocationOptions contains the optional parameters for the InstanceFailoverGroupsClient.NewListByLocationPager +// method. func (client *InstanceFailoverGroupsClient) NewListByLocationPager(resourceGroupName string, locationName string, options *InstanceFailoverGroupsClientListByLocationOptions) *runtime.Pager[InstanceFailoverGroupsClientListByLocationResponse] { return runtime.NewPager(runtime.PagingHandler[InstanceFailoverGroupsClientListByLocationResponse]{ More: func(page InstanceFailoverGroupsClientListByLocationResponse) bool { @@ -451,7 +461,7 @@ func (client *InstanceFailoverGroupsClient) listByLocationCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_instancepools_client.go b/sdk/resourcemanager/sql/armsql/instancepools_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_instancepools_client.go rename to sdk/resourcemanager/sql/armsql/instancepools_client.go index 554d961a1094..9f2ac82a1b4c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_instancepools_client.go +++ b/sdk/resourcemanager/sql/armsql/instancepools_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 armsql @@ -31,9 +32,9 @@ type InstancePoolsClient struct { } // NewInstancePoolsClient creates a new instance of InstancePoolsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewInstancePoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InstancePoolsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewInstancePoolsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreateOrUpdate - Creates or updates an instance pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// instancePoolName - The name of the instance pool to be created or updated. -// parameters - The requested instance pool resource state. -// options - InstancePoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the InstancePoolsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - instancePoolName - The name of the instance pool to be created or updated. +// - parameters - The requested instance pool resource state. +// - options - InstancePoolsClientBeginCreateOrUpdateOptions contains the optional parameters for the InstancePoolsClient.BeginCreateOrUpdate +// method. func (client *InstancePoolsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePool, options *InstancePoolsClientBeginCreateOrUpdateOptions) (*runtime.Poller[InstancePoolsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, instancePoolName, parameters, options) @@ -77,7 +79,8 @@ func (client *InstancePoolsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates an instance pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *InstancePoolsClient) createOrUpdate(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePool, options *InstancePoolsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, instancePoolName, parameters, options) if err != nil { @@ -113,7 +116,7 @@ func (client *InstancePoolsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,12 +124,13 @@ func (client *InstancePoolsClient) createOrUpdateCreateRequest(ctx context.Conte // BeginDelete - Deletes an instance pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// instancePoolName - The name of the instance pool to be deleted -// options - InstancePoolsClientBeginDeleteOptions contains the optional parameters for the InstancePoolsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - instancePoolName - The name of the instance pool to be deleted +// - options - InstancePoolsClientBeginDeleteOptions contains the optional parameters for the InstancePoolsClient.BeginDelete +// method. func (client *InstancePoolsClient) BeginDelete(ctx context.Context, resourceGroupName string, instancePoolName string, options *InstancePoolsClientBeginDeleteOptions) (*runtime.Poller[InstancePoolsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, instancePoolName, options) @@ -141,7 +145,8 @@ func (client *InstancePoolsClient) BeginDelete(ctx context.Context, resourceGrou // Delete - Deletes an instance pool // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *InstancePoolsClient) deleteOperation(ctx context.Context, resourceGroupName string, instancePoolName string, options *InstancePoolsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, instancePoolName, options) if err != nil { @@ -177,18 +182,19 @@ func (client *InstancePoolsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets an instance pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// instancePoolName - The name of the instance pool to be retrieved. -// options - InstancePoolsClientGetOptions contains the optional parameters for the InstancePoolsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - instancePoolName - The name of the instance pool to be retrieved. +// - options - InstancePoolsClientGetOptions contains the optional parameters for the InstancePoolsClient.Get method. func (client *InstancePoolsClient) Get(ctx context.Context, resourceGroupName string, instancePoolName string, options *InstancePoolsClientGetOptions) (InstancePoolsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, instancePoolName, options) if err != nil { @@ -224,7 +230,7 @@ func (client *InstancePoolsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,9 +246,9 @@ func (client *InstancePoolsClient) getHandleResponse(resp *http.Response) (Insta } // NewListPager - Gets a list of all instance pools in the subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// options - InstancePoolsClientListOptions contains the optional parameters for the InstancePoolsClient.List method. +// +// Generated from API version 2022-11-01-preview +// - options - InstancePoolsClientListOptions contains the optional parameters for the InstancePoolsClient.NewListPager method. func (client *InstancePoolsClient) NewListPager(options *InstancePoolsClientListOptions) *runtime.Pager[InstancePoolsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[InstancePoolsClientListResponse]{ More: func(page InstancePoolsClientListResponse) bool { @@ -283,7 +289,7 @@ func (client *InstancePoolsClient) listCreateRequest(ctx context.Context, option return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -299,12 +305,12 @@ func (client *InstancePoolsClient) listHandleResponse(resp *http.Response) (Inst } // NewListByResourceGroupPager - Gets a list of instance pools in the resource group -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// options - InstancePoolsClientListByResourceGroupOptions contains the optional parameters for the InstancePoolsClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - options - InstancePoolsClientListByResourceGroupOptions contains the optional parameters for the InstancePoolsClient.NewListByResourceGroupPager +// method. func (client *InstancePoolsClient) NewListByResourceGroupPager(resourceGroupName string, options *InstancePoolsClientListByResourceGroupOptions) *runtime.Pager[InstancePoolsClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[InstancePoolsClientListByResourceGroupResponse]{ More: func(page InstancePoolsClientListByResourceGroupResponse) bool { @@ -349,7 +355,7 @@ func (client *InstancePoolsClient) listByResourceGroupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -366,13 +372,14 @@ func (client *InstancePoolsClient) listByResourceGroupHandleResponse(resp *http. // BeginUpdate - Updates an instance pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// instancePoolName - The name of the instance pool to be updated. -// parameters - The requested instance pool resource state. -// options - InstancePoolsClientBeginUpdateOptions contains the optional parameters for the InstancePoolsClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - instancePoolName - The name of the instance pool to be updated. +// - parameters - The requested instance pool resource state. +// - options - InstancePoolsClientBeginUpdateOptions contains the optional parameters for the InstancePoolsClient.BeginUpdate +// method. func (client *InstancePoolsClient) BeginUpdate(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePoolUpdate, options *InstancePoolsClientBeginUpdateOptions) (*runtime.Poller[InstancePoolsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, instancePoolName, parameters, options) @@ -387,7 +394,8 @@ func (client *InstancePoolsClient) BeginUpdate(ctx context.Context, resourceGrou // Update - Updates an instance pool. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *InstancePoolsClient) update(ctx context.Context, resourceGroupName string, instancePoolName string, parameters InstancePoolUpdate, options *InstancePoolsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, instancePoolName, parameters, options) if err != nil { @@ -423,7 +431,7 @@ func (client *InstancePoolsClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_ipv6firewallrules_client.go b/sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_ipv6firewallrules_client.go rename to sdk/resourcemanager/sql/armsql/ipv6firewallrules_client.go index 39600712cd12..15d7ddcd97ec 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_ipv6firewallrules_client.go +++ b/sdk/resourcemanager/sql/armsql/ipv6firewallrules_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 armsql @@ -31,9 +32,9 @@ type IPv6FirewallRulesClient struct { } // NewIPv6FirewallRulesClient creates a new instance of IPv6FirewallRulesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewIPv6FirewallRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IPv6FirewallRulesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewIPv6FirewallRulesClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Creates or updates an IPv6 firewall rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// firewallRuleName - The name of the firewall rule. -// parameters - The required parameters for creating or updating an IPv6 firewall rule. -// options - IPv6FirewallRulesClientCreateOrUpdateOptions contains the optional parameters for the IPv6FirewallRulesClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - firewallRuleName - The name of the firewall rule. +// - parameters - The required parameters for creating or updating an IPv6 firewall rule. +// - options - IPv6FirewallRulesClientCreateOrUpdateOptions contains the optional parameters for the IPv6FirewallRulesClient.CreateOrUpdate +// method. func (client *IPv6FirewallRulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, parameters IPv6FirewallRule, options *IPv6FirewallRulesClientCreateOrUpdateOptions) (IPv6FirewallRulesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, firewallRuleName, parameters, options) if err != nil { @@ -103,7 +105,7 @@ func (client *IPv6FirewallRulesClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,13 +122,14 @@ func (client *IPv6FirewallRulesClient) createOrUpdateHandleResponse(resp *http.R // Delete - Deletes an IPv6 firewall rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// firewallRuleName - The name of the firewall rule. -// options - IPv6FirewallRulesClientDeleteOptions contains the optional parameters for the IPv6FirewallRulesClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - firewallRuleName - The name of the firewall rule. +// - options - IPv6FirewallRulesClientDeleteOptions contains the optional parameters for the IPv6FirewallRulesClient.Delete +// method. func (client *IPv6FirewallRulesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *IPv6FirewallRulesClientDeleteOptions) (IPv6FirewallRulesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, firewallRuleName, options) if err != nil { @@ -166,19 +169,20 @@ func (client *IPv6FirewallRulesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets an IPv6 firewall rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// firewallRuleName - The name of the firewall rule. -// options - IPv6FirewallRulesClientGetOptions contains the optional parameters for the IPv6FirewallRulesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - firewallRuleName - The name of the firewall rule. +// - options - IPv6FirewallRulesClientGetOptions contains the optional parameters for the IPv6FirewallRulesClient.Get method. func (client *IPv6FirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, firewallRuleName string, options *IPv6FirewallRulesClientGetOptions) (IPv6FirewallRulesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, firewallRuleName, options) if err != nil { @@ -218,7 +222,7 @@ func (client *IPv6FirewallRulesClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,13 +238,13 @@ func (client *IPv6FirewallRulesClient) getHandleResponse(resp *http.Response) (I } // NewListByServerPager - Gets a list of IPv6 firewall rules. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - IPv6FirewallRulesClientListByServerOptions contains the optional parameters for the IPv6FirewallRulesClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - IPv6FirewallRulesClientListByServerOptions contains the optional parameters for the IPv6FirewallRulesClient.NewListByServerPager +// method. func (client *IPv6FirewallRulesClient) NewListByServerPager(resourceGroupName string, serverName string, options *IPv6FirewallRulesClientListByServerOptions) *runtime.Pager[IPv6FirewallRulesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[IPv6FirewallRulesClientListByServerResponse]{ More: func(page IPv6FirewallRulesClientListByServerResponse) bool { @@ -289,7 +293,7 @@ func (client *IPv6FirewallRulesClient) listByServerCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobagents_client.go b/sdk/resourcemanager/sql/armsql/jobagents_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobagents_client.go rename to sdk/resourcemanager/sql/armsql/jobagents_client.go index 5009424efefc..64f10fb9c8de 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobagents_client.go +++ b/sdk/resourcemanager/sql/armsql/jobagents_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 armsql @@ -31,9 +32,9 @@ type JobAgentsClient struct { } // NewJobAgentsClient creates a new instance of JobAgentsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobAgentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobAgentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewJobAgentsClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Creates or updates a job agent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent to be created or updated. -// parameters - The requested job agent resource state. -// options - JobAgentsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobAgentsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent to be created or updated. +// - parameters - The requested job agent resource state. +// - options - JobAgentsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobAgentsClient.BeginCreateOrUpdate +// method. func (client *JobAgentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgent, options *JobAgentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[JobAgentsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, jobAgentName, parameters, options) @@ -78,7 +80,8 @@ func (client *JobAgentsClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates or updates a job agent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *JobAgentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgent, options *JobAgentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *JobAgentsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,12 +129,13 @@ func (client *JobAgentsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes a job agent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent to be deleted. -// options - JobAgentsClientBeginDeleteOptions contains the optional parameters for the JobAgentsClient.BeginDelete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent to be deleted. +// - options - JobAgentsClientBeginDeleteOptions contains the optional parameters for the JobAgentsClient.BeginDelete method. func (client *JobAgentsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, options *JobAgentsClientBeginDeleteOptions) (*runtime.Poller[JobAgentsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, jobAgentName, options) @@ -146,7 +150,8 @@ func (client *JobAgentsClient) BeginDelete(ctx context.Context, resourceGroupNam // Delete - Deletes a job agent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *JobAgentsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, options *JobAgentsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, options) if err != nil { @@ -186,19 +191,20 @@ func (client *JobAgentsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a job agent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent to be retrieved. -// options - JobAgentsClientGetOptions contains the optional parameters for the JobAgentsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent to be retrieved. +// - options - JobAgentsClientGetOptions contains the optional parameters for the JobAgentsClient.Get method. func (client *JobAgentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, options *JobAgentsClientGetOptions) (JobAgentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, options) if err != nil { @@ -238,7 +244,7 @@ func (client *JobAgentsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -254,12 +260,13 @@ func (client *JobAgentsClient) getHandleResponse(resp *http.Response) (JobAgents } // NewListByServerPager - Gets a list of job agents in a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - JobAgentsClientListByServerOptions contains the optional parameters for the JobAgentsClient.ListByServer method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - JobAgentsClientListByServerOptions contains the optional parameters for the JobAgentsClient.NewListByServerPager +// method. func (client *JobAgentsClient) NewListByServerPager(resourceGroupName string, serverName string, options *JobAgentsClientListByServerOptions) *runtime.Pager[JobAgentsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[JobAgentsClientListByServerResponse]{ More: func(page JobAgentsClientListByServerResponse) bool { @@ -308,7 +315,7 @@ func (client *JobAgentsClient) listByServerCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,13 +332,14 @@ func (client *JobAgentsClient) listByServerHandleResponse(resp *http.Response) ( // BeginUpdate - Updates a job agent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent to be updated. -// parameters - The update to the job agent. -// options - JobAgentsClientBeginUpdateOptions contains the optional parameters for the JobAgentsClient.BeginUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent to be updated. +// - parameters - The update to the job agent. +// - options - JobAgentsClientBeginUpdateOptions contains the optional parameters for the JobAgentsClient.BeginUpdate method. func (client *JobAgentsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgentUpdate, options *JobAgentsClientBeginUpdateOptions) (*runtime.Poller[JobAgentsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, serverName, jobAgentName, parameters, options) @@ -346,7 +354,8 @@ func (client *JobAgentsClient) BeginUpdate(ctx context.Context, resourceGroupNam // Update - Updates a job agent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *JobAgentsClient) update(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, parameters JobAgentUpdate, options *JobAgentsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, parameters, options) if err != nil { @@ -386,7 +395,7 @@ func (client *JobAgentsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobcredentials_client.go b/sdk/resourcemanager/sql/armsql/jobcredentials_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobcredentials_client.go rename to sdk/resourcemanager/sql/armsql/jobcredentials_client.go index 433a8d8b6bbd..e5876a24c67d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobcredentials_client.go +++ b/sdk/resourcemanager/sql/armsql/jobcredentials_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 armsql @@ -31,9 +32,9 @@ type JobCredentialsClient struct { } // NewJobCredentialsClient creates a new instance of JobCredentialsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobCredentialsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobCredentialsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewJobCredentialsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Creates or updates a job credential. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// credentialName - The name of the credential. -// parameters - The requested job credential state. -// options - JobCredentialsClientCreateOrUpdateOptions contains the optional parameters for the JobCredentialsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - credentialName - The name of the credential. +// - parameters - The requested job credential state. +// - options - JobCredentialsClientCreateOrUpdateOptions contains the optional parameters for the JobCredentialsClient.CreateOrUpdate +// method. func (client *JobCredentialsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string, parameters JobCredential, options *JobCredentialsClientCreateOrUpdateOptions) (JobCredentialsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, credentialName, parameters, options) if err != nil { @@ -108,7 +110,7 @@ func (client *JobCredentialsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,13 +127,14 @@ func (client *JobCredentialsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Deletes a job credential. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// credentialName - The name of the credential. -// options - JobCredentialsClientDeleteOptions contains the optional parameters for the JobCredentialsClient.Delete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - credentialName - The name of the credential. +// - options - JobCredentialsClientDeleteOptions contains the optional parameters for the JobCredentialsClient.Delete method. func (client *JobCredentialsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string, options *JobCredentialsClientDeleteOptions) (JobCredentialsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, credentialName, options) if err != nil { @@ -175,20 +178,21 @@ func (client *JobCredentialsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a jobs credential. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// credentialName - The name of the credential. -// options - JobCredentialsClientGetOptions contains the optional parameters for the JobCredentialsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - credentialName - The name of the credential. +// - options - JobCredentialsClientGetOptions contains the optional parameters for the JobCredentialsClient.Get method. func (client *JobCredentialsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, credentialName string, options *JobCredentialsClientGetOptions) (JobCredentialsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, credentialName, options) if err != nil { @@ -232,7 +236,7 @@ func (client *JobCredentialsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,14 +252,14 @@ func (client *JobCredentialsClient) getHandleResponse(resp *http.Response) (JobC } // NewListByAgentPager - Gets a list of jobs credentials. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// options - JobCredentialsClientListByAgentOptions contains the optional parameters for the JobCredentialsClient.ListByAgent -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - options - JobCredentialsClientListByAgentOptions contains the optional parameters for the JobCredentialsClient.NewListByAgentPager +// method. func (client *JobCredentialsClient) NewListByAgentPager(resourceGroupName string, serverName string, jobAgentName string, options *JobCredentialsClientListByAgentOptions) *runtime.Pager[JobCredentialsClientListByAgentResponse] { return runtime.NewPager(runtime.PagingHandler[JobCredentialsClientListByAgentResponse]{ More: func(page JobCredentialsClientListByAgentResponse) bool { @@ -308,7 +312,7 @@ func (client *JobCredentialsClient) listByAgentCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobexecutions_client.go b/sdk/resourcemanager/sql/armsql/jobexecutions_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobexecutions_client.go rename to sdk/resourcemanager/sql/armsql/jobexecutions_client.go index a472f6a1a393..f21638c4c472 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobexecutions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobexecutions_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 armsql @@ -33,9 +34,9 @@ type JobExecutionsClient struct { } // NewJobExecutionsClient creates a new instance of JobExecutionsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobExecutionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobExecutionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +59,15 @@ func NewJobExecutionsClient(subscriptionID string, credential azcore.TokenCreden // Cancel - Requests cancellation of a job execution. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job. -// jobExecutionID - The id of the job execution to cancel. -// options - JobExecutionsClientCancelOptions contains the optional parameters for the JobExecutionsClient.Cancel method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job. +// - jobExecutionID - The id of the job execution to cancel. +// - options - JobExecutionsClientCancelOptions contains the optional parameters for the JobExecutionsClient.Cancel method. func (client *JobExecutionsClient) Cancel(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobExecutionsClientCancelOptions) (JobExecutionsClientCancelResponse, error) { req, err := client.cancelCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, options) if err != nil { @@ -110,21 +112,22 @@ func (client *JobExecutionsClient) cancelCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginCreate - Starts an elastic job execution. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// options - JobExecutionsClientBeginCreateOptions contains the optional parameters for the JobExecutionsClient.BeginCreate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - options - JobExecutionsClientBeginCreateOptions contains the optional parameters for the JobExecutionsClient.BeginCreate +// method. func (client *JobExecutionsClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobExecutionsClientBeginCreateOptions) (*runtime.Poller[JobExecutionsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, serverName, jobAgentName, jobName, options) @@ -139,7 +142,8 @@ func (client *JobExecutionsClient) BeginCreate(ctx context.Context, resourceGrou // Create - Starts an elastic job execution. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *JobExecutionsClient) create(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobExecutionsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, options) if err != nil { @@ -183,7 +187,7 @@ func (client *JobExecutionsClient) createCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,15 +195,16 @@ func (client *JobExecutionsClient) createCreateRequest(ctx context.Context, reso // BeginCreateOrUpdate - Creates or updates a job execution. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// jobExecutionID - The job execution id to create the job execution under. -// options - JobExecutionsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobExecutionsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - jobExecutionID - The job execution id to create the job execution under. +// - options - JobExecutionsClientBeginCreateOrUpdateOptions contains the optional parameters for the JobExecutionsClient.BeginCreateOrUpdate +// method. func (client *JobExecutionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobExecutionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[JobExecutionsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, options) @@ -214,7 +219,8 @@ func (client *JobExecutionsClient) BeginCreateOrUpdate(ctx context.Context, reso // CreateOrUpdate - Creates or updates a job execution. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *JobExecutionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobExecutionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, options) if err != nil { @@ -259,7 +265,7 @@ func (client *JobExecutionsClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,14 +273,15 @@ func (client *JobExecutionsClient) createOrUpdateCreateRequest(ctx context.Conte // Get - Gets a job execution. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job. -// jobExecutionID - The id of the job execution -// options - JobExecutionsClientGetOptions contains the optional parameters for the JobExecutionsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job. +// - jobExecutionID - The id of the job execution +// - options - JobExecutionsClientGetOptions contains the optional parameters for the JobExecutionsClient.Get method. func (client *JobExecutionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobExecutionsClientGetOptions) (JobExecutionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, options) if err != nil { @@ -319,7 +326,7 @@ func (client *JobExecutionsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,14 +342,14 @@ func (client *JobExecutionsClient) getHandleResponse(resp *http.Response) (JobEx } // NewListByAgentPager - Lists all executions in a job agent. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// options - JobExecutionsClientListByAgentOptions contains the optional parameters for the JobExecutionsClient.ListByAgent -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - options - JobExecutionsClientListByAgentOptions contains the optional parameters for the JobExecutionsClient.NewListByAgentPager +// method. func (client *JobExecutionsClient) NewListByAgentPager(resourceGroupName string, serverName string, jobAgentName string, options *JobExecutionsClientListByAgentOptions) *runtime.Pager[JobExecutionsClientListByAgentResponse] { return runtime.NewPager(runtime.PagingHandler[JobExecutionsClientListByAgentResponse]{ More: func(page JobExecutionsClientListByAgentResponse) bool { @@ -411,12 +418,12 @@ func (client *JobExecutionsClient) listByAgentCreateRequest(ctx context.Context, reqQP.Set("isActive", strconv.FormatBool(*options.IsActive)) } if options != nil && options.Skip != nil { - reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -432,14 +439,15 @@ func (client *JobExecutionsClient) listByAgentHandleResponse(resp *http.Response } // NewListByJobPager - Lists a job's executions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// options - JobExecutionsClientListByJobOptions contains the optional parameters for the JobExecutionsClient.ListByJob method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - options - JobExecutionsClientListByJobOptions contains the optional parameters for the JobExecutionsClient.NewListByJobPager +// method. func (client *JobExecutionsClient) NewListByJobPager(resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobExecutionsClientListByJobOptions) *runtime.Pager[JobExecutionsClientListByJobResponse] { return runtime.NewPager(runtime.PagingHandler[JobExecutionsClientListByJobResponse]{ More: func(page JobExecutionsClientListByJobResponse) bool { @@ -512,12 +520,12 @@ func (client *JobExecutionsClient) listByJobCreateRequest(ctx context.Context, r reqQP.Set("isActive", strconv.FormatBool(*options.IsActive)) } if options != nil && options.Skip != nil { - reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobs_client.go b/sdk/resourcemanager/sql/armsql/jobs_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobs_client.go rename to sdk/resourcemanager/sql/armsql/jobs_client.go index ca3f25714cf9..8e32ef53fcb4 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobs_client.go +++ b/sdk/resourcemanager/sql/armsql/jobs_client.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armsql @@ -31,9 +32,9 @@ type JobsClient struct { } // NewJobsClient creates a new instance of JobsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // CreateOrUpdate - Creates or updates a job. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// parameters - The requested job state. -// options - JobsClientCreateOrUpdateOptions contains the optional parameters for the JobsClient.CreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - parameters - The requested job state. +// - options - JobsClientCreateOrUpdateOptions contains the optional parameters for the JobsClient.CreateOrUpdate method. func (client *JobsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, parameters Job, options *JobsClientCreateOrUpdateOptions) (JobsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, parameters, options) if err != nil { @@ -107,7 +109,7 @@ func (client *JobsClient) createOrUpdateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -124,13 +126,14 @@ func (client *JobsClient) createOrUpdateHandleResponse(resp *http.Response) (Job // Delete - Deletes a job. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to delete. -// options - JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to delete. +// - options - JobsClientDeleteOptions contains the optional parameters for the JobsClient.Delete method. func (client *JobsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobsClientDeleteOptions) (JobsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, options) if err != nil { @@ -174,20 +177,21 @@ func (client *JobsClient) deleteCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a job. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - options - JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. func (client *JobsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobsClientGetOptions) (JobsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, options) if err != nil { @@ -231,7 +235,7 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,13 +251,13 @@ func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetR } // NewListByAgentPager - Gets a list of jobs. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// options - JobsClientListByAgentOptions contains the optional parameters for the JobsClient.ListByAgent method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - options - JobsClientListByAgentOptions contains the optional parameters for the JobsClient.NewListByAgentPager method. func (client *JobsClient) NewListByAgentPager(resourceGroupName string, serverName string, jobAgentName string, options *JobsClientListByAgentOptions) *runtime.Pager[JobsClientListByAgentResponse] { return runtime.NewPager(runtime.PagingHandler[JobsClientListByAgentResponse]{ More: func(page JobsClientListByAgentResponse) bool { @@ -306,7 +310,7 @@ func (client *JobsClient) listByAgentCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobstepexecutions_client.go b/sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobstepexecutions_client.go rename to sdk/resourcemanager/sql/armsql/jobstepexecutions_client.go index 43fb9a9d6ab6..36af166d02a3 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobstepexecutions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobstepexecutions_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 armsql @@ -33,9 +34,9 @@ type JobStepExecutionsClient struct { } // NewJobStepExecutionsClient creates a new instance of JobStepExecutionsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobStepExecutionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobStepExecutionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,15 +59,16 @@ func NewJobStepExecutionsClient(subscriptionID string, credential azcore.TokenCr // Get - Gets a step execution of a job execution. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// jobExecutionID - The unique id of the job execution -// stepName - The name of the step. -// options - JobStepExecutionsClientGetOptions contains the optional parameters for the JobStepExecutionsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - jobExecutionID - The unique id of the job execution +// - stepName - The name of the step. +// - options - JobStepExecutionsClientGetOptions contains the optional parameters for the JobStepExecutionsClient.Get method. func (client *JobStepExecutionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, stepName string, options *JobStepExecutionsClientGetOptions) (JobStepExecutionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, stepName, options) if err != nil { @@ -115,7 +117,7 @@ func (client *JobStepExecutionsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -131,16 +133,16 @@ func (client *JobStepExecutionsClient) getHandleResponse(resp *http.Response) (J } // NewListByJobExecutionPager - Lists the step executions of a job execution. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// jobExecutionID - The id of the job execution -// options - JobStepExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobStepExecutionsClient.ListByJobExecution -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - jobExecutionID - The id of the job execution +// - options - JobStepExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobStepExecutionsClient.NewListByJobExecutionPager +// method. func (client *JobStepExecutionsClient) NewListByJobExecutionPager(resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobStepExecutionsClientListByJobExecutionOptions) *runtime.Pager[JobStepExecutionsClientListByJobExecutionResponse] { return runtime.NewPager(runtime.PagingHandler[JobStepExecutionsClientListByJobExecutionResponse]{ More: func(page JobStepExecutionsClientListByJobExecutionResponse) bool { @@ -214,12 +216,12 @@ func (client *JobStepExecutionsClient) listByJobExecutionCreateRequest(ctx conte reqQP.Set("isActive", strconv.FormatBool(*options.IsActive)) } if options != nil && options.Skip != nil { - reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobsteps_client.go b/sdk/resourcemanager/sql/armsql/jobsteps_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobsteps_client.go rename to sdk/resourcemanager/sql/armsql/jobsteps_client.go index 32ecf9ea7778..2e3ac580f0ea 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobsteps_client.go +++ b/sdk/resourcemanager/sql/armsql/jobsteps_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 armsql @@ -32,9 +33,9 @@ type JobStepsClient struct { } // NewJobStepsClient creates a new instance of JobStepsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobStepsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobStepsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,15 +58,16 @@ func NewJobStepsClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or updates a job step. This will implicitly create a new job version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job. -// stepName - The name of the job step. -// parameters - The requested state of the job step. -// options - JobStepsClientCreateOrUpdateOptions contains the optional parameters for the JobStepsClient.CreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job. +// - stepName - The name of the job step. +// - parameters - The requested state of the job step. +// - options - JobStepsClientCreateOrUpdateOptions contains the optional parameters for the JobStepsClient.CreateOrUpdate method. func (client *JobStepsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string, parameters JobStep, options *JobStepsClientCreateOrUpdateOptions) (JobStepsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, stepName, parameters, options) if err != nil { @@ -113,7 +115,7 @@ func (client *JobStepsClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -130,14 +132,15 @@ func (client *JobStepsClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes a job step. This will implicitly create a new job version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job. -// stepName - The name of the job step to delete. -// options - JobStepsClientDeleteOptions contains the optional parameters for the JobStepsClient.Delete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job. +// - stepName - The name of the job step to delete. +// - options - JobStepsClientDeleteOptions contains the optional parameters for the JobStepsClient.Delete method. func (client *JobStepsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string, options *JobStepsClientDeleteOptions) (JobStepsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, stepName, options) if err != nil { @@ -185,21 +188,22 @@ func (client *JobStepsClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a job step in a job's current version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job. -// stepName - The name of the job step. -// options - JobStepsClientGetOptions contains the optional parameters for the JobStepsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job. +// - stepName - The name of the job step. +// - options - JobStepsClientGetOptions contains the optional parameters for the JobStepsClient.Get method. func (client *JobStepsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, stepName string, options *JobStepsClientGetOptions) (JobStepsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, stepName, options) if err != nil { @@ -247,7 +251,7 @@ func (client *JobStepsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,15 +268,16 @@ func (client *JobStepsClient) getHandleResponse(resp *http.Response) (JobStepsCl // GetByVersion - Gets the specified version of a job step. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job. -// jobVersion - The version of the job to get. -// stepName - The name of the job step. -// options - JobStepsClientGetByVersionOptions contains the optional parameters for the JobStepsClient.GetByVersion method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job. +// - jobVersion - The version of the job to get. +// - stepName - The name of the job step. +// - options - JobStepsClientGetByVersionOptions contains the optional parameters for the JobStepsClient.GetByVersion method. func (client *JobStepsClient) GetByVersion(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32, stepName string, options *JobStepsClientGetByVersionOptions) (JobStepsClientGetByVersionResponse, error) { req, err := client.getByVersionCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobVersion, stepName, options) if err != nil { @@ -321,7 +326,7 @@ func (client *JobStepsClient) getByVersionCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -337,14 +342,14 @@ func (client *JobStepsClient) getByVersionHandleResponse(resp *http.Response) (J } // NewListByJobPager - Gets all job steps for a job's current version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// options - JobStepsClientListByJobOptions contains the optional parameters for the JobStepsClient.ListByJob method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - options - JobStepsClientListByJobOptions contains the optional parameters for the JobStepsClient.NewListByJobPager method. func (client *JobStepsClient) NewListByJobPager(resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobStepsClientListByJobOptions) *runtime.Pager[JobStepsClientListByJobResponse] { return runtime.NewPager(runtime.PagingHandler[JobStepsClientListByJobResponse]{ More: func(page JobStepsClientListByJobResponse) bool { @@ -401,7 +406,7 @@ func (client *JobStepsClient) listByJobCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -417,15 +422,16 @@ func (client *JobStepsClient) listByJobHandleResponse(resp *http.Response) (JobS } // NewListByVersionPager - Gets all job steps in the specified job version. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// jobVersion - The version of the job to get. -// options - JobStepsClientListByVersionOptions contains the optional parameters for the JobStepsClient.ListByVersion method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - jobVersion - The version of the job to get. +// - options - JobStepsClientListByVersionOptions contains the optional parameters for the JobStepsClient.NewListByVersionPager +// method. func (client *JobStepsClient) NewListByVersionPager(resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32, options *JobStepsClientListByVersionOptions) *runtime.Pager[JobStepsClientListByVersionResponse] { return runtime.NewPager(runtime.PagingHandler[JobStepsClientListByVersionResponse]{ More: func(page JobStepsClientListByVersionResponse) bool { @@ -483,7 +489,7 @@ func (client *JobStepsClient) listByVersionCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobtargetexecutions_client.go b/sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobtargetexecutions_client.go rename to sdk/resourcemanager/sql/armsql/jobtargetexecutions_client.go index 677ed472765f..0081667f0d44 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobtargetexecutions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobtargetexecutions_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 armsql @@ -33,9 +34,9 @@ type JobTargetExecutionsClient struct { } // NewJobTargetExecutionsClient creates a new instance of JobTargetExecutionsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobTargetExecutionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobTargetExecutionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,16 +59,17 @@ func NewJobTargetExecutionsClient(subscriptionID string, credential azcore.Token // Get - Gets a target execution. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// jobExecutionID - The unique id of the job execution -// stepName - The name of the step. -// targetID - The target id. -// options - JobTargetExecutionsClientGetOptions contains the optional parameters for the JobTargetExecutionsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - jobExecutionID - The unique id of the job execution +// - stepName - The name of the step. +// - targetID - The target id. +// - options - JobTargetExecutionsClientGetOptions contains the optional parameters for the JobTargetExecutionsClient.Get method. func (client *JobTargetExecutionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, stepName string, targetID string, options *JobTargetExecutionsClientGetOptions) (JobTargetExecutionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobExecutionID, stepName, targetID, options) if err != nil { @@ -117,7 +119,7 @@ func (client *JobTargetExecutionsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -133,16 +135,16 @@ func (client *JobTargetExecutionsClient) getHandleResponse(resp *http.Response) } // NewListByJobExecutionPager - Lists target executions for all steps of a job execution. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// jobExecutionID - The id of the job execution -// options - JobTargetExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobTargetExecutionsClient.ListByJobExecution -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - jobExecutionID - The id of the job execution +// - options - JobTargetExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobTargetExecutionsClient.NewListByJobExecutionPager +// method. func (client *JobTargetExecutionsClient) NewListByJobExecutionPager(resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, options *JobTargetExecutionsClientListByJobExecutionOptions) *runtime.Pager[JobTargetExecutionsClientListByJobExecutionResponse] { return runtime.NewPager(runtime.PagingHandler[JobTargetExecutionsClientListByJobExecutionResponse]{ More: func(page JobTargetExecutionsClientListByJobExecutionResponse) bool { @@ -216,12 +218,12 @@ func (client *JobTargetExecutionsClient) listByJobExecutionCreateRequest(ctx con reqQP.Set("isActive", strconv.FormatBool(*options.IsActive)) } if options != nil && options.Skip != nil { - reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,17 +239,17 @@ func (client *JobTargetExecutionsClient) listByJobExecutionHandleResponse(resp * } // NewListByStepPager - Lists the target executions of a job step execution. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// jobExecutionID - The id of the job execution -// stepName - The name of the step. -// options - JobTargetExecutionsClientListByStepOptions contains the optional parameters for the JobTargetExecutionsClient.ListByStep -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - jobExecutionID - The id of the job execution +// - stepName - The name of the step. +// - options - JobTargetExecutionsClientListByStepOptions contains the optional parameters for the JobTargetExecutionsClient.NewListByStepPager +// method. func (client *JobTargetExecutionsClient) NewListByStepPager(resourceGroupName string, serverName string, jobAgentName string, jobName string, jobExecutionID string, stepName string, options *JobTargetExecutionsClientListByStepOptions) *runtime.Pager[JobTargetExecutionsClientListByStepResponse] { return runtime.NewPager(runtime.PagingHandler[JobTargetExecutionsClientListByStepResponse]{ More: func(page JobTargetExecutionsClientListByStepResponse) bool { @@ -325,12 +327,12 @@ func (client *JobTargetExecutionsClient) listByStepCreateRequest(ctx context.Con reqQP.Set("isActive", strconv.FormatBool(*options.IsActive)) } if options != nil && options.Skip != nil { - reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobtargetgroups_client.go b/sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobtargetgroups_client.go rename to sdk/resourcemanager/sql/armsql/jobtargetgroups_client.go index 0f39afceaaf5..be8918236909 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobtargetgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/jobtargetgroups_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 armsql @@ -31,9 +32,9 @@ type JobTargetGroupsClient struct { } // NewJobTargetGroupsClient creates a new instance of JobTargetGroupsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobTargetGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobTargetGroupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewJobTargetGroupsClient(subscriptionID string, credential azcore.TokenCred // CreateOrUpdate - Creates or updates a target group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// targetGroupName - The name of the target group. -// parameters - The requested state of the target group. -// options - JobTargetGroupsClientCreateOrUpdateOptions contains the optional parameters for the JobTargetGroupsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - targetGroupName - The name of the target group. +// - parameters - The requested state of the target group. +// - options - JobTargetGroupsClientCreateOrUpdateOptions contains the optional parameters for the JobTargetGroupsClient.CreateOrUpdate +// method. func (client *JobTargetGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string, parameters JobTargetGroup, options *JobTargetGroupsClientCreateOrUpdateOptions) (JobTargetGroupsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, targetGroupName, parameters, options) if err != nil { @@ -108,7 +110,7 @@ func (client *JobTargetGroupsClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,13 +127,14 @@ func (client *JobTargetGroupsClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Deletes a target group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// targetGroupName - The name of the target group. -// options - JobTargetGroupsClientDeleteOptions contains the optional parameters for the JobTargetGroupsClient.Delete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - targetGroupName - The name of the target group. +// - options - JobTargetGroupsClientDeleteOptions contains the optional parameters for the JobTargetGroupsClient.Delete method. func (client *JobTargetGroupsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string, options *JobTargetGroupsClientDeleteOptions) (JobTargetGroupsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, targetGroupName, options) if err != nil { @@ -175,20 +178,21 @@ func (client *JobTargetGroupsClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a target group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// targetGroupName - The name of the target group. -// options - JobTargetGroupsClientGetOptions contains the optional parameters for the JobTargetGroupsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - targetGroupName - The name of the target group. +// - options - JobTargetGroupsClientGetOptions contains the optional parameters for the JobTargetGroupsClient.Get method. func (client *JobTargetGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, targetGroupName string, options *JobTargetGroupsClientGetOptions) (JobTargetGroupsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, targetGroupName, options) if err != nil { @@ -232,7 +236,7 @@ func (client *JobTargetGroupsClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -248,14 +252,14 @@ func (client *JobTargetGroupsClient) getHandleResponse(resp *http.Response) (Job } // NewListByAgentPager - Gets all target groups in an agent. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// options - JobTargetGroupsClientListByAgentOptions contains the optional parameters for the JobTargetGroupsClient.ListByAgent -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - options - JobTargetGroupsClientListByAgentOptions contains the optional parameters for the JobTargetGroupsClient.NewListByAgentPager +// method. func (client *JobTargetGroupsClient) NewListByAgentPager(resourceGroupName string, serverName string, jobAgentName string, options *JobTargetGroupsClientListByAgentOptions) *runtime.Pager[JobTargetGroupsClientListByAgentResponse] { return runtime.NewPager(runtime.PagingHandler[JobTargetGroupsClientListByAgentResponse]{ More: func(page JobTargetGroupsClientListByAgentResponse) bool { @@ -308,7 +312,7 @@ func (client *JobTargetGroupsClient) listByAgentCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_jobversions_client.go b/sdk/resourcemanager/sql/armsql/jobversions_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_jobversions_client.go rename to sdk/resourcemanager/sql/armsql/jobversions_client.go index b05202e937bb..68c9a727718f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_jobversions_client.go +++ b/sdk/resourcemanager/sql/armsql/jobversions_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 armsql @@ -32,9 +33,9 @@ type JobVersionsClient struct { } // NewJobVersionsClient creates a new instance of JobVersionsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobVersionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobVersionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +58,15 @@ func NewJobVersionsClient(subscriptionID string, credential azcore.TokenCredenti // Get - Gets a job version. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job. -// jobVersion - The version of the job to get. -// options - JobVersionsClientGetOptions contains the optional parameters for the JobVersionsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job. +// - jobVersion - The version of the job to get. +// - options - JobVersionsClientGetOptions contains the optional parameters for the JobVersionsClient.Get method. func (client *JobVersionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, jobAgentName string, jobName string, jobVersion int32, options *JobVersionsClientGetOptions) (JobVersionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, jobAgentName, jobName, jobVersion, options) if err != nil { @@ -109,7 +111,7 @@ func (client *JobVersionsClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -125,14 +127,15 @@ func (client *JobVersionsClient) getHandleResponse(resp *http.Response) (JobVers } // NewListByJobPager - Gets all versions of a job. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// jobAgentName - The name of the job agent. -// jobName - The name of the job to get. -// options - JobVersionsClientListByJobOptions contains the optional parameters for the JobVersionsClient.ListByJob method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - jobAgentName - The name of the job agent. +// - jobName - The name of the job to get. +// - options - JobVersionsClientListByJobOptions contains the optional parameters for the JobVersionsClient.NewListByJobPager +// method. func (client *JobVersionsClient) NewListByJobPager(resourceGroupName string, serverName string, jobAgentName string, jobName string, options *JobVersionsClientListByJobOptions) *runtime.Pager[JobVersionsClientListByJobResponse] { return runtime.NewPager(runtime.PagingHandler[JobVersionsClientListByJobResponse]{ More: func(page JobVersionsClientListByJobResponse) bool { @@ -189,7 +192,7 @@ func (client *JobVersionsClient) listByJobCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_ledgerdigestuploads_client.go b/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_ledgerdigestuploads_client.go rename to sdk/resourcemanager/sql/armsql/ledgerdigestuploads_client.go index 0d3ee6c026a6..e3aa61109551 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_ledgerdigestuploads_client.go +++ b/sdk/resourcemanager/sql/armsql/ledgerdigestuploads_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 armsql @@ -31,9 +32,9 @@ type LedgerDigestUploadsClient struct { } // NewLedgerDigestUploadsClient creates a new instance of LedgerDigestUploadsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewLedgerDigestUploadsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LedgerDigestUploadsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewLedgerDigestUploadsClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - LedgerDigestUploadsClientBeginCreateOrUpdateOptions contains the optional parameters for the LedgerDigestUploadsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - LedgerDigestUploadsClientBeginCreateOrUpdateOptions contains the optional parameters for the LedgerDigestUploadsClient.BeginCreateOrUpdate +// method. func (client *LedgerDigestUploadsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, parameters LedgerDigestUploads, options *LedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*runtime.Poller[LedgerDigestUploadsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, ledgerDigestUploads, parameters, options) @@ -77,7 +79,8 @@ func (client *LedgerDigestUploadsClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview +// +// Generated from API version 2022-11-01-preview func (client *LedgerDigestUploadsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, parameters LedgerDigestUploads, options *LedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, ledgerDigestUploads, parameters, options) if err != nil { @@ -121,7 +124,7 @@ func (client *LedgerDigestUploadsClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -129,13 +132,14 @@ func (client *LedgerDigestUploadsClient) createOrUpdateCreateRequest(ctx context // BeginDisable - Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - LedgerDigestUploadsClientBeginDisableOptions contains the optional parameters for the LedgerDigestUploadsClient.BeginDisable -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - LedgerDigestUploadsClientBeginDisableOptions contains the optional parameters for the LedgerDigestUploadsClient.BeginDisable +// method. func (client *LedgerDigestUploadsClient) BeginDisable(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, options *LedgerDigestUploadsClientBeginDisableOptions) (*runtime.Poller[LedgerDigestUploadsClientDisableResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.disable(ctx, resourceGroupName, serverName, databaseName, ledgerDigestUploads, options) @@ -150,7 +154,8 @@ func (client *LedgerDigestUploadsClient) BeginDisable(ctx context.Context, resou // Disable - Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview +// +// Generated from API version 2022-11-01-preview func (client *LedgerDigestUploadsClient) disable(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, options *LedgerDigestUploadsClientBeginDisableOptions) (*http.Response, error) { req, err := client.disableCreateRequest(ctx, resourceGroupName, serverName, databaseName, ledgerDigestUploads, options) if err != nil { @@ -194,7 +199,7 @@ func (client *LedgerDigestUploadsClient) disableCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,12 +207,13 @@ func (client *LedgerDigestUploadsClient) disableCreateRequest(ctx context.Contex // Get - Gets the current ledger digest upload configuration for a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - LedgerDigestUploadsClientGetOptions contains the optional parameters for the LedgerDigestUploadsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - LedgerDigestUploadsClientGetOptions contains the optional parameters for the LedgerDigestUploadsClient.Get method. func (client *LedgerDigestUploadsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, ledgerDigestUploads LedgerDigestUploadsName, options *LedgerDigestUploadsClientGetOptions) (LedgerDigestUploadsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, ledgerDigestUploads, options) if err != nil { @@ -251,7 +257,7 @@ func (client *LedgerDigestUploadsClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,14 +273,14 @@ func (client *LedgerDigestUploadsClient) getHandleResponse(resp *http.Response) } // NewListByDatabasePager - Gets all ledger digest upload settings on a database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - LedgerDigestUploadsClientListByDatabaseOptions contains the optional parameters for the LedgerDigestUploadsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - LedgerDigestUploadsClientListByDatabaseOptions contains the optional parameters for the LedgerDigestUploadsClient.NewListByDatabasePager +// method. func (client *LedgerDigestUploadsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *LedgerDigestUploadsClientListByDatabaseOptions) *runtime.Pager[LedgerDigestUploadsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[LedgerDigestUploadsClientListByDatabaseResponse]{ More: func(page LedgerDigestUploadsClientListByDatabaseResponse) bool { @@ -327,7 +333,7 @@ func (client *LedgerDigestUploadsClient) listByDatabaseCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionbackups_client.go b/sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go similarity index 87% rename from sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionbackups_client.go rename to sdk/resourcemanager/sql/armsql/longtermretentionbackups_client.go index f47e0d434b78..2d6ceae4f2a9 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionbackups_client.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionbackups_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 armsql @@ -32,9 +33,9 @@ type LongTermRetentionBackupsClient struct { } // NewLongTermRetentionBackupsClient creates a new instance of LongTermRetentionBackupsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewLongTermRetentionBackupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LongTermRetentionBackupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +58,15 @@ func NewLongTermRetentionBackupsClient(subscriptionID string, credential azcore. // BeginCopy - Copy an existing long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// locationName - The location of the database. -// longTermRetentionServerName - The name of the server -// longTermRetentionDatabaseName - The name of the database -// backupName - The backup name. -// parameters - The parameters needed for long term retention copy request -// options - LongTermRetentionBackupsClientBeginCopyOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginCopy -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location of the database. +// - longTermRetentionServerName - The name of the server +// - longTermRetentionDatabaseName - The name of the database +// - backupName - The backup name. +// - parameters - The parameters needed for long term retention copy request +// - options - LongTermRetentionBackupsClientBeginCopyOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginCopy +// method. func (client *LongTermRetentionBackupsClient) BeginCopy(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginCopyOptions) (*runtime.Poller[LongTermRetentionBackupsClientCopyResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.copyOperation(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) @@ -79,7 +81,8 @@ func (client *LongTermRetentionBackupsClient) BeginCopy(ctx context.Context, loc // Copy - Copy an existing long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *LongTermRetentionBackupsClient) copyOperation(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginCopyOptions) (*http.Response, error) { req, err := client.copyCreateRequest(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) if err != nil { @@ -123,7 +126,7 @@ func (client *LongTermRetentionBackupsClient) copyCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -131,16 +134,17 @@ func (client *LongTermRetentionBackupsClient) copyCreateRequest(ctx context.Cont // BeginCopyByResourceGroup - Copy an existing long term retention backup to a different server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The location of the database. -// longTermRetentionServerName - The name of the server -// longTermRetentionDatabaseName - The name of the database -// backupName - The backup name. -// parameters - The parameters needed for long term retention copy request -// options - LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginCopyByResourceGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The location of the database. +// - longTermRetentionServerName - The name of the server +// - longTermRetentionDatabaseName - The name of the database +// - backupName - The backup name. +// - parameters - The parameters needed for long term retention copy request +// - options - LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginCopyByResourceGroup +// method. func (client *LongTermRetentionBackupsClient) BeginCopyByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions) (*runtime.Poller[LongTermRetentionBackupsClientCopyByResourceGroupResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.copyByResourceGroup(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) @@ -155,7 +159,8 @@ func (client *LongTermRetentionBackupsClient) BeginCopyByResourceGroup(ctx conte // CopyByResourceGroup - Copy an existing long term retention backup to a different server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *LongTermRetentionBackupsClient) copyByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters CopyLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginCopyByResourceGroupOptions) (*http.Response, error) { req, err := client.copyByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) if err != nil { @@ -203,7 +208,7 @@ func (client *LongTermRetentionBackupsClient) copyByResourceGroupCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -211,13 +216,14 @@ func (client *LongTermRetentionBackupsClient) copyByResourceGroupCreateRequest(c // BeginDelete - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// locationName - The location of the database -// longTermRetentionServerName - The name of the server -// longTermRetentionDatabaseName - The name of the database -// backupName - The backup name. -// options - LongTermRetentionBackupsClientBeginDeleteOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location of the database +// - longTermRetentionServerName - The name of the server +// - longTermRetentionDatabaseName - The name of the database +// - backupName - The backup name. +// - options - LongTermRetentionBackupsClientBeginDeleteOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginDelete +// method. func (client *LongTermRetentionBackupsClient) BeginDelete(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientBeginDeleteOptions) (*runtime.Poller[LongTermRetentionBackupsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) @@ -232,7 +238,8 @@ func (client *LongTermRetentionBackupsClient) BeginDelete(ctx context.Context, l // Delete - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *LongTermRetentionBackupsClient) deleteOperation(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) if err != nil { @@ -276,22 +283,23 @@ func (client *LongTermRetentionBackupsClient) deleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteByResourceGroup - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The location of the database -// longTermRetentionServerName - The name of the server -// longTermRetentionDatabaseName - The name of the database -// backupName - The backup name. -// options - LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginDeleteByResourceGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The location of the database +// - longTermRetentionServerName - The name of the server +// - longTermRetentionDatabaseName - The name of the database +// - backupName - The backup name. +// - options - LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginDeleteByResourceGroup +// method. func (client *LongTermRetentionBackupsClient) BeginDeleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions) (*runtime.Poller[LongTermRetentionBackupsClientDeleteByResourceGroupResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteByResourceGroup(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) @@ -306,7 +314,8 @@ func (client *LongTermRetentionBackupsClient) BeginDeleteByResourceGroup(ctx con // DeleteByResourceGroup - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *LongTermRetentionBackupsClient) deleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientBeginDeleteByResourceGroupOptions) (*http.Response, error) { req, err := client.deleteByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) if err != nil { @@ -354,20 +363,21 @@ func (client *LongTermRetentionBackupsClient) deleteByResourceGroupCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// locationName - The location of the database. -// longTermRetentionServerName - The name of the server -// longTermRetentionDatabaseName - The name of the database -// backupName - The backup name. -// options - LongTermRetentionBackupsClientGetOptions contains the optional parameters for the LongTermRetentionBackupsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location of the database. +// - longTermRetentionServerName - The name of the server +// - longTermRetentionDatabaseName - The name of the database +// - backupName - The backup name. +// - options - LongTermRetentionBackupsClientGetOptions contains the optional parameters for the LongTermRetentionBackupsClient.Get +// method. func (client *LongTermRetentionBackupsClient) Get(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientGetOptions) (LongTermRetentionBackupsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) if err != nil { @@ -411,7 +421,7 @@ func (client *LongTermRetentionBackupsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -428,15 +438,16 @@ func (client *LongTermRetentionBackupsClient) getHandleResponse(resp *http.Respo // GetByResourceGroup - Gets a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The location of the database. -// longTermRetentionServerName - The name of the server -// longTermRetentionDatabaseName - The name of the database -// backupName - The backup name. -// options - LongTermRetentionBackupsClientGetByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.GetByResourceGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The location of the database. +// - longTermRetentionServerName - The name of the server +// - longTermRetentionDatabaseName - The name of the database +// - backupName - The backup name. +// - options - LongTermRetentionBackupsClientGetByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.GetByResourceGroup +// method. func (client *LongTermRetentionBackupsClient) GetByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, options *LongTermRetentionBackupsClientGetByResourceGroupOptions) (LongTermRetentionBackupsClientGetByResourceGroupResponse, error) { req, err := client.getByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, options) if err != nil { @@ -484,7 +495,7 @@ func (client *LongTermRetentionBackupsClient) getByResourceGroupCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -500,13 +511,13 @@ func (client *LongTermRetentionBackupsClient) getByResourceGroupHandleResponse(r } // NewListByDatabasePager - Lists all long term retention backups for a database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// locationName - The location of the database -// longTermRetentionServerName - The name of the server -// longTermRetentionDatabaseName - The name of the database -// options - LongTermRetentionBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location of the database +// - longTermRetentionServerName - The name of the server +// - longTermRetentionDatabaseName - The name of the database +// - options - LongTermRetentionBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByDatabasePager +// method. func (client *LongTermRetentionBackupsClient) NewListByDatabasePager(locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, options *LongTermRetentionBackupsClientListByDatabaseOptions) *runtime.Pager[LongTermRetentionBackupsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionBackupsClientListByDatabaseResponse]{ More: func(page LongTermRetentionBackupsClientListByDatabaseResponse) bool { @@ -565,7 +576,7 @@ func (client *LongTermRetentionBackupsClient) listByDatabaseCreateRequest(ctx co if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -581,11 +592,11 @@ func (client *LongTermRetentionBackupsClient) listByDatabaseHandleResponse(resp } // NewListByLocationPager - Lists the long term retention backups for a given location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// locationName - The location of the database -// options - LongTermRetentionBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByLocation -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location of the database +// - options - LongTermRetentionBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByLocationPager +// method. func (client *LongTermRetentionBackupsClient) NewListByLocationPager(locationName string, options *LongTermRetentionBackupsClientListByLocationOptions) *runtime.Pager[LongTermRetentionBackupsClientListByLocationResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionBackupsClientListByLocationResponse]{ More: func(page LongTermRetentionBackupsClientListByLocationResponse) bool { @@ -636,7 +647,7 @@ func (client *LongTermRetentionBackupsClient) listByLocationCreateRequest(ctx co if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -652,15 +663,15 @@ func (client *LongTermRetentionBackupsClient) listByLocationHandleResponse(resp } // NewListByResourceGroupDatabasePager - Lists all long term retention backups for a database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The location of the database -// longTermRetentionServerName - The name of the server -// longTermRetentionDatabaseName - The name of the database -// options - LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByResourceGroupDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The location of the database +// - longTermRetentionServerName - The name of the server +// - longTermRetentionDatabaseName - The name of the database +// - options - LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByResourceGroupDatabasePager +// method. func (client *LongTermRetentionBackupsClient) NewListByResourceGroupDatabasePager(resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, options *LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions) *runtime.Pager[LongTermRetentionBackupsClientListByResourceGroupDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionBackupsClientListByResourceGroupDatabaseResponse]{ More: func(page LongTermRetentionBackupsClientListByResourceGroupDatabaseResponse) bool { @@ -723,7 +734,7 @@ func (client *LongTermRetentionBackupsClient) listByResourceGroupDatabaseCreateR if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -739,13 +750,13 @@ func (client *LongTermRetentionBackupsClient) listByResourceGroupDatabaseHandleR } // NewListByResourceGroupLocationPager - Lists the long term retention backups for a given location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The location of the database -// options - LongTermRetentionBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByResourceGroupLocation -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The location of the database +// - options - LongTermRetentionBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByResourceGroupLocationPager +// method. func (client *LongTermRetentionBackupsClient) NewListByResourceGroupLocationPager(resourceGroupName string, locationName string, options *LongTermRetentionBackupsClientListByResourceGroupLocationOptions) *runtime.Pager[LongTermRetentionBackupsClientListByResourceGroupLocationResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionBackupsClientListByResourceGroupLocationResponse]{ More: func(page LongTermRetentionBackupsClientListByResourceGroupLocationResponse) bool { @@ -800,7 +811,7 @@ func (client *LongTermRetentionBackupsClient) listByResourceGroupLocationCreateR if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -816,14 +827,14 @@ func (client *LongTermRetentionBackupsClient) listByResourceGroupLocationHandleR } // NewListByResourceGroupServerPager - Lists the long term retention backups for a given server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The location of the database -// longTermRetentionServerName - The name of the server -// options - LongTermRetentionBackupsClientListByResourceGroupServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByResourceGroupServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The location of the database +// - longTermRetentionServerName - The name of the server +// - options - LongTermRetentionBackupsClientListByResourceGroupServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByResourceGroupServerPager +// method. func (client *LongTermRetentionBackupsClient) NewListByResourceGroupServerPager(resourceGroupName string, locationName string, longTermRetentionServerName string, options *LongTermRetentionBackupsClientListByResourceGroupServerOptions) *runtime.Pager[LongTermRetentionBackupsClientListByResourceGroupServerResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionBackupsClientListByResourceGroupServerResponse]{ More: func(page LongTermRetentionBackupsClientListByResourceGroupServerResponse) bool { @@ -882,7 +893,7 @@ func (client *LongTermRetentionBackupsClient) listByResourceGroupServerCreateReq if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -898,12 +909,12 @@ func (client *LongTermRetentionBackupsClient) listByResourceGroupServerHandleRes } // NewListByServerPager - Lists the long term retention backups for a given server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// locationName - The location of the database -// longTermRetentionServerName - The name of the server -// options - LongTermRetentionBackupsClientListByServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location of the database +// - longTermRetentionServerName - The name of the server +// - options - LongTermRetentionBackupsClientListByServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByServerPager +// method. func (client *LongTermRetentionBackupsClient) NewListByServerPager(locationName string, longTermRetentionServerName string, options *LongTermRetentionBackupsClientListByServerOptions) *runtime.Pager[LongTermRetentionBackupsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionBackupsClientListByServerResponse]{ More: func(page LongTermRetentionBackupsClientListByServerResponse) bool { @@ -958,7 +969,7 @@ func (client *LongTermRetentionBackupsClient) listByServerCreateRequest(ctx cont if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -975,14 +986,15 @@ func (client *LongTermRetentionBackupsClient) listByServerHandleResponse(resp *h // BeginUpdate - Updates an existing long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// locationName - The location of the database. -// longTermRetentionServerName - The name of the server -// longTermRetentionDatabaseName - The name of the database -// backupName - The backup name. -// parameters - The requested backup resource state -// options - LongTermRetentionBackupsClientBeginUpdateOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location of the database. +// - longTermRetentionServerName - The name of the server +// - longTermRetentionDatabaseName - The name of the database +// - backupName - The backup name. +// - parameters - The requested backup resource state +// - options - LongTermRetentionBackupsClientBeginUpdateOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginUpdate +// method. func (client *LongTermRetentionBackupsClient) BeginUpdate(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginUpdateOptions) (*runtime.Poller[LongTermRetentionBackupsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) @@ -997,7 +1009,8 @@ func (client *LongTermRetentionBackupsClient) BeginUpdate(ctx context.Context, l // Update - Updates an existing long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *LongTermRetentionBackupsClient) update(ctx context.Context, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) if err != nil { @@ -1041,7 +1054,7 @@ func (client *LongTermRetentionBackupsClient) updateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -1049,16 +1062,17 @@ func (client *LongTermRetentionBackupsClient) updateCreateRequest(ctx context.Co // BeginUpdateByResourceGroup - Updates an existing long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The location of the database. -// longTermRetentionServerName - The name of the server -// longTermRetentionDatabaseName - The name of the database -// backupName - The backup name. -// parameters - The requested backup resource state -// options - LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginUpdateByResourceGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The location of the database. +// - longTermRetentionServerName - The name of the server +// - longTermRetentionDatabaseName - The name of the database +// - backupName - The backup name. +// - parameters - The requested backup resource state +// - options - LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions contains the optional parameters for the LongTermRetentionBackupsClient.BeginUpdateByResourceGroup +// method. func (client *LongTermRetentionBackupsClient) BeginUpdateByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions) (*runtime.Poller[LongTermRetentionBackupsClientUpdateByResourceGroupResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.updateByResourceGroup(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) @@ -1073,7 +1087,8 @@ func (client *LongTermRetentionBackupsClient) BeginUpdateByResourceGroup(ctx con // UpdateByResourceGroup - Updates an existing long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *LongTermRetentionBackupsClient) updateByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, longTermRetentionServerName string, longTermRetentionDatabaseName string, backupName string, parameters UpdateLongTermRetentionBackupParameters, options *LongTermRetentionBackupsClientBeginUpdateByResourceGroupOptions) (*http.Response, error) { req, err := client.updateByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, longTermRetentionServerName, longTermRetentionDatabaseName, backupName, parameters, options) if err != nil { @@ -1121,7 +1136,7 @@ func (client *LongTermRetentionBackupsClient) updateByResourceGroupCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionmanagedinstancebackups_client.go b/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go similarity index 87% rename from sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionmanagedinstancebackups_client.go rename to sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_client.go index b7dd9edac1ea..b445897753cb 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionmanagedinstancebackups_client.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionmanagedinstancebackups_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 armsql @@ -32,9 +33,9 @@ type LongTermRetentionManagedInstanceBackupsClient struct { } // NewLongTermRetentionManagedInstanceBackupsClient creates a new instance of LongTermRetentionManagedInstanceBackupsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewLongTermRetentionManagedInstanceBackupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LongTermRetentionManagedInstanceBackupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +58,14 @@ func NewLongTermRetentionManagedInstanceBackupsClient(subscriptionID string, cre // BeginDelete - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// locationName - The location of the database. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database. -// backupName - The backup name. -// options - LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location of the database. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database. +// - backupName - The backup name. +// - options - LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.BeginDelete +// method. func (client *LongTermRetentionManagedInstanceBackupsClient) BeginDelete(ctx context.Context, locationName string, managedInstanceName string, databaseName string, backupName string, options *LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions) (*runtime.Poller[LongTermRetentionManagedInstanceBackupsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, locationName, managedInstanceName, databaseName, backupName, options) @@ -78,7 +80,8 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) BeginDelete(ctx con // Delete - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *LongTermRetentionManagedInstanceBackupsClient) deleteOperation(ctx context.Context, locationName string, managedInstanceName string, databaseName string, backupName string, options *LongTermRetentionManagedInstanceBackupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, locationName, managedInstanceName, databaseName, backupName, options) if err != nil { @@ -122,22 +125,23 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) deleteCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginDeleteByResourceGroup - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The location of the database -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database. -// backupName - The backup name. -// options - LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions contains the optional parameters -// for the LongTermRetentionManagedInstanceBackupsClient.BeginDeleteByResourceGroup method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The location of the database +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database. +// - backupName - The backup name. +// - options - LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions contains the optional parameters +// for the LongTermRetentionManagedInstanceBackupsClient.BeginDeleteByResourceGroup method. func (client *LongTermRetentionManagedInstanceBackupsClient) BeginDeleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, backupName string, options *LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions) (*runtime.Poller[LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteByResourceGroup(ctx, resourceGroupName, locationName, managedInstanceName, databaseName, backupName, options) @@ -152,7 +156,8 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) BeginDeleteByResour // DeleteByResourceGroup - Deletes a long term retention backup. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *LongTermRetentionManagedInstanceBackupsClient) deleteByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, backupName string, options *LongTermRetentionManagedInstanceBackupsClientBeginDeleteByResourceGroupOptions) (*http.Response, error) { req, err := client.deleteByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, managedInstanceName, databaseName, backupName, options) if err != nil { @@ -200,20 +205,21 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) deleteByResourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a long term retention backup for a managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// locationName - The location of the database. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database. -// backupName - The backup name. -// options - LongTermRetentionManagedInstanceBackupsClientGetOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location of the database. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database. +// - backupName - The backup name. +// - options - LongTermRetentionManagedInstanceBackupsClientGetOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.Get +// method. func (client *LongTermRetentionManagedInstanceBackupsClient) Get(ctx context.Context, locationName string, managedInstanceName string, databaseName string, backupName string, options *LongTermRetentionManagedInstanceBackupsClientGetOptions) (LongTermRetentionManagedInstanceBackupsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, locationName, managedInstanceName, databaseName, backupName, options) if err != nil { @@ -257,7 +263,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -274,15 +280,16 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) getHandleResponse(r // GetByResourceGroup - Gets a long term retention backup for a managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The location of the database. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database. -// backupName - The backup name. -// options - LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions contains the optional parameters for the -// LongTermRetentionManagedInstanceBackupsClient.GetByResourceGroup method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The location of the database. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database. +// - backupName - The backup name. +// - options - LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions contains the optional parameters for the +// LongTermRetentionManagedInstanceBackupsClient.GetByResourceGroup method. func (client *LongTermRetentionManagedInstanceBackupsClient) GetByResourceGroup(ctx context.Context, resourceGroupName string, locationName string, managedInstanceName string, databaseName string, backupName string, options *LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupOptions) (LongTermRetentionManagedInstanceBackupsClientGetByResourceGroupResponse, error) { req, err := client.getByResourceGroupCreateRequest(ctx, resourceGroupName, locationName, managedInstanceName, databaseName, backupName, options) if err != nil { @@ -330,7 +337,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) getByResourceGroupC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -346,13 +353,13 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) getByResourceGroupH } // NewListByDatabasePager - Lists all long term retention backups for a managed database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// locationName - The location of the database. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database. -// options - LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location of the database. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database. +// - options - LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByDatabasePager +// method. func (client *LongTermRetentionManagedInstanceBackupsClient) NewListByDatabasePager(locationName string, managedInstanceName string, databaseName string, options *LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions) *runtime.Pager[LongTermRetentionManagedInstanceBackupsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionManagedInstanceBackupsClientListByDatabaseResponse]{ More: func(page LongTermRetentionManagedInstanceBackupsClientListByDatabaseResponse) bool { @@ -411,7 +418,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByDatabaseCreat if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -427,12 +434,12 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByDatabaseHandl } // NewListByInstancePager - Lists the long term retention backups for a given managed instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// locationName - The location of the database -// managedInstanceName - The name of the managed instance. -// options - LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location of the database +// - managedInstanceName - The name of the managed instance. +// - options - LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByInstancePager +// method. func (client *LongTermRetentionManagedInstanceBackupsClient) NewListByInstancePager(locationName string, managedInstanceName string, options *LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions) *runtime.Pager[LongTermRetentionManagedInstanceBackupsClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionManagedInstanceBackupsClientListByInstanceResponse]{ More: func(page LongTermRetentionManagedInstanceBackupsClientListByInstanceResponse) bool { @@ -487,7 +494,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByInstanceCreat if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -503,11 +510,11 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByInstanceHandl } // NewListByLocationPager - Lists the long term retention backups for managed databases in a given location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// locationName - The location of the database. -// options - LongTermRetentionManagedInstanceBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByLocation -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The location of the database. +// - options - LongTermRetentionManagedInstanceBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByLocationPager +// method. func (client *LongTermRetentionManagedInstanceBackupsClient) NewListByLocationPager(locationName string, options *LongTermRetentionManagedInstanceBackupsClientListByLocationOptions) *runtime.Pager[LongTermRetentionManagedInstanceBackupsClientListByLocationResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionManagedInstanceBackupsClientListByLocationResponse]{ More: func(page LongTermRetentionManagedInstanceBackupsClientListByLocationResponse) bool { @@ -558,7 +565,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByLocationCreat if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -574,15 +581,15 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByLocationHandl } // NewListByResourceGroupDatabasePager - Lists all long term retention backups for a managed database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The location of the database -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database. -// options - LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters -// for the LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupDatabase method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The location of the database +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database. +// - options - LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters +// for the LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupDatabasePager method. func (client *LongTermRetentionManagedInstanceBackupsClient) NewListByResourceGroupDatabasePager(resourceGroupName string, locationName string, managedInstanceName string, databaseName string, options *LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions) *runtime.Pager[LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResponse]{ More: func(page LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResponse) bool { @@ -645,7 +652,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroup if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -661,14 +668,14 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroup } // NewListByResourceGroupInstancePager - Lists the long term retention backups for a given managed instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The location of the database. -// managedInstanceName - The name of the managed instance. -// options - LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions contains the optional parameters -// for the LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupInstance method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The location of the database. +// - managedInstanceName - The name of the managed instance. +// - options - LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions contains the optional parameters +// for the LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupInstancePager method. func (client *LongTermRetentionManagedInstanceBackupsClient) NewListByResourceGroupInstancePager(resourceGroupName string, locationName string, managedInstanceName string, options *LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions) *runtime.Pager[LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResponse]{ More: func(page LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResponse) bool { @@ -727,7 +734,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroup if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -743,13 +750,13 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroup } // NewListByResourceGroupLocationPager - Lists the long term retention backups for managed databases in a given location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The location of the database. -// options - LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions contains the optional parameters -// for the LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupLocation method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The location of the database. +// - options - LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions contains the optional parameters +// for the LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupLocationPager method. func (client *LongTermRetentionManagedInstanceBackupsClient) NewListByResourceGroupLocationPager(resourceGroupName string, locationName string, options *LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions) *runtime.Pager[LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResponse]{ More: func(page LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResponse) bool { @@ -804,7 +811,7 @@ func (client *LongTermRetentionManagedInstanceBackupsClient) listByResourceGroup if options != nil && options.DatabaseState != nil { reqQP.Set("databaseState", string(*options.DatabaseState)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionpolicies_client.go rename to sdk/resourcemanager/sql/armsql/longtermretentionpolicies_client.go index 11321fbf9f76..8cf759c740cd 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_longtermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/longtermretentionpolicies_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 armsql @@ -31,9 +32,9 @@ type LongTermRetentionPoliciesClient struct { } // NewLongTermRetentionPoliciesClient creates a new instance of LongTermRetentionPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewLongTermRetentionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LongTermRetentionPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewLongTermRetentionPoliciesClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Sets a database's long term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// policyName - The policy name. Should always be Default. -// parameters - The long term retention policy info. -// options - LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the LongTermRetentionPoliciesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - policyName - The policy name. Should always be Default. +// - parameters - The long term retention policy info. +// - options - LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the LongTermRetentionPoliciesClient.BeginCreateOrUpdate +// method. func (client *LongTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName LongTermRetentionPolicyName, parameters LongTermRetentionPolicy, options *LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[LongTermRetentionPoliciesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, policyName, parameters, options) @@ -79,7 +81,8 @@ func (client *LongTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Sets a database's long term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *LongTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName LongTermRetentionPolicyName, parameters LongTermRetentionPolicy, options *LongTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, parameters, options) if err != nil { @@ -123,7 +126,7 @@ func (client *LongTermRetentionPoliciesClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -131,14 +134,15 @@ func (client *LongTermRetentionPoliciesClient) createOrUpdateCreateRequest(ctx c // Get - Gets a database's long term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// policyName - The policy name. Should always be Default. -// options - LongTermRetentionPoliciesClientGetOptions contains the optional parameters for the LongTermRetentionPoliciesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - policyName - The policy name. Should always be Default. +// - options - LongTermRetentionPoliciesClientGetOptions contains the optional parameters for the LongTermRetentionPoliciesClient.Get +// method. func (client *LongTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, policyName LongTermRetentionPolicyName, options *LongTermRetentionPoliciesClientGetOptions) (LongTermRetentionPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, policyName, options) if err != nil { @@ -182,7 +186,7 @@ func (client *LongTermRetentionPoliciesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,14 +202,14 @@ func (client *LongTermRetentionPoliciesClient) getHandleResponse(resp *http.Resp } // NewListByDatabasePager - Gets a database's long term retention policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - LongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionPoliciesClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - LongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionPoliciesClient.NewListByDatabasePager +// method. func (client *LongTermRetentionPoliciesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *LongTermRetentionPoliciesClientListByDatabaseOptions) *runtime.Pager[LongTermRetentionPoliciesClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[LongTermRetentionPoliciesClientListByDatabaseResponse]{ More: func(page LongTermRetentionPoliciesClientListByDatabaseResponse) bool { @@ -258,7 +262,7 @@ func (client *LongTermRetentionPoliciesClient) listByDatabaseCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_maintenancewindowoptions_client.go b/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_maintenancewindowoptions_client.go rename to sdk/resourcemanager/sql/armsql/maintenancewindowoptions_client.go index 21551e4d703a..d7e66ea8b1e3 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_maintenancewindowoptions_client.go +++ b/sdk/resourcemanager/sql/armsql/maintenancewindowoptions_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 armsql @@ -31,9 +32,9 @@ type MaintenanceWindowOptionsClient struct { } // NewMaintenanceWindowOptionsClient creates a new instance of MaintenanceWindowOptionsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewMaintenanceWindowOptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MaintenanceWindowOptionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewMaintenanceWindowOptionsClient(subscriptionID string, credential azcore. // Get - Gets a list of available maintenance windows. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database to get maintenance windows options for. -// maintenanceWindowOptionsName - Maintenance window options name. -// options - MaintenanceWindowOptionsClientGetOptions contains the optional parameters for the MaintenanceWindowOptionsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database to get maintenance windows options for. +// - maintenanceWindowOptionsName - Maintenance window options name. +// - options - MaintenanceWindowOptionsClientGetOptions contains the optional parameters for the MaintenanceWindowOptionsClient.Get +// method. func (client *MaintenanceWindowOptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, maintenanceWindowOptionsName string, options *MaintenanceWindowOptionsClientGetOptions) (MaintenanceWindowOptionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, maintenanceWindowOptionsName, options) if err != nil { @@ -104,7 +106,7 @@ func (client *MaintenanceWindowOptionsClient) getCreateRequest(ctx context.Conte } reqQP := req.Raw().URL.Query() reqQP.Set("maintenanceWindowOptionsName", maintenanceWindowOptionsName) - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_maintenancewindows_client.go b/sdk/resourcemanager/sql/armsql/maintenancewindows_client.go similarity index 83% rename from sdk/resourcemanager/sql/armsql/zz_generated_maintenancewindows_client.go rename to sdk/resourcemanager/sql/armsql/maintenancewindows_client.go index cefdee84eaf4..aebbb94b0153 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_maintenancewindows_client.go +++ b/sdk/resourcemanager/sql/armsql/maintenancewindows_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 armsql @@ -31,9 +32,9 @@ type MaintenanceWindowsClient struct { } // NewMaintenanceWindowsClient creates a new instance of MaintenanceWindowsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewMaintenanceWindowsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MaintenanceWindowsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewMaintenanceWindowsClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Sets maintenance windows settings for a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database to set maintenance windows for. -// maintenanceWindowName - Maintenance window name. -// options - MaintenanceWindowsClientCreateOrUpdateOptions contains the optional parameters for the MaintenanceWindowsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database to set maintenance windows for. +// - maintenanceWindowName - Maintenance window name. +// - options - MaintenanceWindowsClientCreateOrUpdateOptions contains the optional parameters for the MaintenanceWindowsClient.CreateOrUpdate +// method. func (client *MaintenanceWindowsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, maintenanceWindowName string, parameters MaintenanceWindows, options *MaintenanceWindowsClientCreateOrUpdateOptions) (MaintenanceWindowsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, maintenanceWindowName, parameters, options) if err != nil { @@ -104,20 +106,21 @@ func (client *MaintenanceWindowsClient) createOrUpdateCreateRequest(ctx context. } reqQP := req.Raw().URL.Query() reqQP.Set("maintenanceWindowName", maintenanceWindowName) - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, parameters) } // Get - Gets maintenance windows settings for a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database to get maintenance windows for. -// maintenanceWindowName - Maintenance window name. -// options - MaintenanceWindowsClientGetOptions contains the optional parameters for the MaintenanceWindowsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database to get maintenance windows for. +// - maintenanceWindowName - Maintenance window name. +// - options - MaintenanceWindowsClientGetOptions contains the optional parameters for the MaintenanceWindowsClient.Get method. func (client *MaintenanceWindowsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, maintenanceWindowName string, options *MaintenanceWindowsClientGetOptions) (MaintenanceWindowsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, maintenanceWindowName, options) if err != nil { @@ -158,7 +161,7 @@ func (client *MaintenanceWindowsClient) getCreateRequest(ctx context.Context, re } reqQP := req.Raw().URL.Query() reqQP.Set("maintenanceWindowName", maintenanceWindowName) - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedbackupshorttermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedbackupshorttermretentionpolicies_client.go rename to sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_client.go index f94532a73759..8c2c43906e5f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedbackupshorttermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedbackupshorttermretentionpolicies_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 armsql @@ -31,9 +32,9 @@ type ManagedBackupShortTermRetentionPoliciesClient struct { } // NewManagedBackupShortTermRetentionPoliciesClient creates a new instance of ManagedBackupShortTermRetentionPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedBackupShortTermRetentionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedBackupShortTermRetentionPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewManagedBackupShortTermRetentionPoliciesClient(subscriptionID string, cre // BeginCreateOrUpdate - Updates a managed database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// policyName - The policy name. Should always be "default". -// parameters - The short term retention policy info. -// options - ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for -// the ManagedBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - policyName - The policy name. Should always be "default". +// - parameters - The short term retention policy info. +// - options - ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for +// the ManagedBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate method. func (client *ManagedBackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, parameters, options) @@ -79,7 +81,8 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate // CreateOrUpdate - Updates a managed database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedBackupShortTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, parameters, options) if err != nil { @@ -123,7 +126,7 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) createOrUpdateCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -131,14 +134,15 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) createOrUpdateCreat // Get - Gets a managed database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// policyName - The policy name. -// options - ManagedBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - policyName - The policy name. +// - options - ManagedBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.Get +// method. func (client *ManagedBackupShortTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedShortTermRetentionPolicyName, options *ManagedBackupShortTermRetentionPoliciesClientGetOptions) (ManagedBackupShortTermRetentionPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, options) if err != nil { @@ -182,7 +186,7 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,14 +202,14 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) getHandleResponse(r } // NewListByDatabasePager - Gets a managed database's short term retention policy list. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// options - ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.NewListByDatabasePager +// method. func (client *ManagedBackupShortTermRetentionPoliciesClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions) *runtime.Pager[ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResponse]{ More: func(page ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResponse) bool { @@ -258,7 +262,7 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) listByDatabaseCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,15 +279,16 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) listByDatabaseHandl // BeginUpdate - Updates a managed database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// policyName - The policy name. Should always be "default". -// parameters - The short term retention policy info. -// options - ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - policyName - The policy name. Should always be "default". +// - parameters - The short term retention policy info. +// - options - ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.BeginUpdate +// method. func (client *ManagedBackupShortTermRetentionPoliciesClient) BeginUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions) (*runtime.Poller[ManagedBackupShortTermRetentionPoliciesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, parameters, options) @@ -298,7 +303,8 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) BeginUpdate(ctx con // Update - Updates a managed database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedBackupShortTermRetentionPoliciesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedBackupShortTermRetentionPoliciesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, parameters, options) if err != nil { @@ -342,7 +348,7 @@ func (client *ManagedBackupShortTermRetentionPoliciesClient) updateCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go new file mode 100644 index 000000000000..75bac33140d4 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/manageddatabaseadvancedthreatprotectionsettings_client.go @@ -0,0 +1,271 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedDatabaseAdvancedThreatProtectionSettingsClient contains the methods for the ManagedDatabaseAdvancedThreatProtectionSettings group. +// Don't use this type directly, use NewManagedDatabaseAdvancedThreatProtectionSettingsClient() instead. +type ManagedDatabaseAdvancedThreatProtectionSettingsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedDatabaseAdvancedThreatProtectionSettingsClient creates a new instance of ManagedDatabaseAdvancedThreatProtectionSettingsClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagedDatabaseAdvancedThreatProtectionSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseAdvancedThreatProtectionSettingsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedDatabaseAdvancedThreatProtectionSettingsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a managed database's Advanced Threat Protection state. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - advancedThreatProtectionName - The name of the Advanced Threat Protection state. +// - parameters - The managed database Advanced Threat Protection state. +// - options - ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions contains the optional parameters for +// the ManagedDatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate method. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ManagedDatabaseAdvancedThreatProtection, options *ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions) (ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, advancedThreatProtectionName, parameters, options) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ManagedDatabaseAdvancedThreatProtection, options *ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if advancedThreatProtectionName == "" { + return nil, errors.New("parameter advancedThreatProtectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{advancedThreatProtectionName}", url.PathEscape(string(advancedThreatProtectionName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) createOrUpdateHandleResponse(resp *http.Response) (ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse, error) { + result := ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedDatabaseAdvancedThreatProtection); err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Get - Gets a managed database's Advanced Threat Protection state. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - advancedThreatProtectionName - The name of the Advanced Threat Protection state. +// - options - ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ManagedDatabaseAdvancedThreatProtectionSettingsClient.Get +// method. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions) (ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, advancedThreatProtectionName, options) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if advancedThreatProtectionName == "" { + return nil, errors.New("parameter advancedThreatProtectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{advancedThreatProtectionName}", url.PathEscape(string(advancedThreatProtectionName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) getHandleResponse(resp *http.Response) (ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse, error) { + result := ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedDatabaseAdvancedThreatProtection); err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + return result, nil +} + +// NewListByDatabasePager - Gets a list of managed database's Advanced Threat Protection states. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions contains the optional parameters for +// the ManagedDatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager method. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse]{ + More: func(page ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse) (ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseHandleResponse(resp) + }, + }) +} + +// listByDatabaseCreateRequest creates the ListByDatabase request. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/advancedThreatProtectionSettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByDatabaseHandleResponse handles the ListByDatabase response. +func (client *ManagedDatabaseAdvancedThreatProtectionSettingsClient) listByDatabaseHandleResponse(resp *http.Response) (ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse, error) { + result := ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedDatabaseAdvancedThreatProtectionListResult); err != nil { + return ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasecolumns_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasecolumns_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasecolumns_client.go index 3b6ac4c97f5d..de56f4cbe6e0 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasecolumns_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasecolumns_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 armsql @@ -31,9 +32,9 @@ type ManagedDatabaseColumnsClient struct { } // NewManagedDatabaseColumnsClient creates a new instance of ManagedDatabaseColumnsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseColumnsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseColumnsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,16 +57,17 @@ func NewManagedDatabaseColumnsClient(subscriptionID string, credential azcore.To // Get - Get managed database column // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// columnName - The name of the column. -// options - ManagedDatabaseColumnsClientGetOptions contains the optional parameters for the ManagedDatabaseColumnsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - columnName - The name of the column. +// - options - ManagedDatabaseColumnsClientGetOptions contains the optional parameters for the ManagedDatabaseColumnsClient.Get +// method. func (client *ManagedDatabaseColumnsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, options *ManagedDatabaseColumnsClientGetOptions) (ManagedDatabaseColumnsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, options) if err != nil { @@ -117,7 +119,7 @@ func (client *ManagedDatabaseColumnsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -133,14 +135,14 @@ func (client *ManagedDatabaseColumnsClient) getHandleResponse(resp *http.Respons } // NewListByDatabasePager - List managed database columns -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// options - ManagedDatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseColumnsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseColumnsClient.NewListByDatabasePager +// method. func (client *ManagedDatabaseColumnsClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseColumnsClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseColumnsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseColumnsClientListByDatabaseResponse]{ More: func(page ManagedDatabaseColumnsClientListByDatabaseResponse) bool { @@ -216,7 +218,7 @@ func (client *ManagedDatabaseColumnsClient) listByDatabaseCreateRequest(ctx cont if options != nil && options.Skiptoken != nil { reqQP.Set("$skiptoken", *options.Skiptoken) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -232,16 +234,16 @@ func (client *ManagedDatabaseColumnsClient) listByDatabaseHandleResponse(resp *h } // NewListByTablePager - List managed database columns -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// options - ManagedDatabaseColumnsClientListByTableOptions contains the optional parameters for the ManagedDatabaseColumnsClient.ListByTable -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - options - ManagedDatabaseColumnsClientListByTableOptions contains the optional parameters for the ManagedDatabaseColumnsClient.NewListByTablePager +// method. func (client *ManagedDatabaseColumnsClient) NewListByTablePager(resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, options *ManagedDatabaseColumnsClientListByTableOptions) *runtime.Pager[ManagedDatabaseColumnsClientListByTableResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseColumnsClientListByTableResponse]{ More: func(page ManagedDatabaseColumnsClientListByTableResponse) bool { @@ -305,7 +307,7 @@ func (client *ManagedDatabaseColumnsClient) listByTableCreateRequest(ctx context if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client.go new file mode 100644 index 000000000000..0fef7963e6cf --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/manageddatabasemoveoperations_client.go @@ -0,0 +1,192 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// ManagedDatabaseMoveOperationsClient contains the methods for the ManagedDatabaseMoveOperations group. +// Don't use this type directly, use NewManagedDatabaseMoveOperationsClient() instead. +type ManagedDatabaseMoveOperationsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedDatabaseMoveOperationsClient creates a new instance of ManagedDatabaseMoveOperationsClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagedDatabaseMoveOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseMoveOperationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedDatabaseMoveOperationsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Get - Gets a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - options - ManagedDatabaseMoveOperationsClientGetOptions contains the optional parameters for the ManagedDatabaseMoveOperationsClient.Get +// method. +func (client *ManagedDatabaseMoveOperationsClient) Get(ctx context.Context, resourceGroupName string, locationName string, operationID string, options *ManagedDatabaseMoveOperationsClientGetOptions) (ManagedDatabaseMoveOperationsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, locationName, operationID, options) + if err != nil { + return ManagedDatabaseMoveOperationsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedDatabaseMoveOperationsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedDatabaseMoveOperationsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedDatabaseMoveOperationsClient) getCreateRequest(ctx context.Context, resourceGroupName string, locationName string, operationID string, options *ManagedDatabaseMoveOperationsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults/{operationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if locationName == "" { + return nil, errors.New("parameter locationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) + urlPath = strings.ReplaceAll(urlPath, "{operationId}", url.PathEscape(operationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedDatabaseMoveOperationsClient) getHandleResponse(resp *http.Response) (ManagedDatabaseMoveOperationsClientGetResponse, error) { + result := ManagedDatabaseMoveOperationsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedDatabaseMoveOperationResult); err != nil { + return ManagedDatabaseMoveOperationsClientGetResponse{}, err + } + return result, nil +} + +// NewListByLocationPager - Lists managed database move operations. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - options - ManagedDatabaseMoveOperationsClientListByLocationOptions contains the optional parameters for the ManagedDatabaseMoveOperationsClient.NewListByLocationPager +// method. +func (client *ManagedDatabaseMoveOperationsClient) NewListByLocationPager(resourceGroupName string, locationName string, options *ManagedDatabaseMoveOperationsClientListByLocationOptions) *runtime.Pager[ManagedDatabaseMoveOperationsClientListByLocationResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseMoveOperationsClientListByLocationResponse]{ + More: func(page ManagedDatabaseMoveOperationsClientListByLocationResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedDatabaseMoveOperationsClientListByLocationResponse) (ManagedDatabaseMoveOperationsClientListByLocationResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByLocationCreateRequest(ctx, resourceGroupName, locationName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedDatabaseMoveOperationsClientListByLocationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedDatabaseMoveOperationsClientListByLocationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedDatabaseMoveOperationsClientListByLocationResponse{}, runtime.NewResponseError(resp) + } + return client.listByLocationHandleResponse(resp) + }, + }) +} + +// listByLocationCreateRequest creates the ListByLocation request. +func (client *ManagedDatabaseMoveOperationsClient) listByLocationCreateRequest(ctx context.Context, resourceGroupName string, locationName string, options *ManagedDatabaseMoveOperationsClientListByLocationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/locations/{locationName}/managedDatabaseMoveOperationResults" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if locationName == "" { + return nil, errors.New("parameter locationName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{locationName}", url.PathEscape(locationName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.OnlyLatestPerDatabase != nil { + reqQP.Set("onlyLatestPerDatabase", strconv.FormatBool(*options.OnlyLatestPerDatabase)) + } + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByLocationHandleResponse handles the ListByLocation response. +func (client *ManagedDatabaseMoveOperationsClient) listByLocationHandleResponse(resp *http.Response) (ManagedDatabaseMoveOperationsClientListByLocationResponse, error) { + result := ManagedDatabaseMoveOperationsClientListByLocationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedDatabaseMoveOperationListResult); err != nil { + return ManagedDatabaseMoveOperationsClientListByLocationResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasequeries_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasequeries_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasequeries_client.go index cccb0fdfc3cc..79cefdb4b97c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasequeries_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasequeries_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 armsql @@ -31,9 +32,9 @@ type ManagedDatabaseQueriesClient struct { } // NewManagedDatabaseQueriesClient creates a new instance of ManagedDatabaseQueriesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseQueriesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseQueriesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewManagedDatabaseQueriesClient(subscriptionID string, credential azcore.To // Get - Get query by query id. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// options - ManagedDatabaseQueriesClientGetOptions contains the optional parameters for the ManagedDatabaseQueriesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabaseQueriesClientGetOptions contains the optional parameters for the ManagedDatabaseQueriesClient.Get +// method. func (client *ManagedDatabaseQueriesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, queryID string, options *ManagedDatabaseQueriesClientGetOptions) (ManagedDatabaseQueriesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, queryID, options) if err != nil { @@ -106,7 +108,7 @@ func (client *ManagedDatabaseQueriesClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -122,14 +124,14 @@ func (client *ManagedDatabaseQueriesClient) getHandleResponse(resp *http.Respons } // NewListByQueryPager - Get query execution statistics by query id. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// options - ManagedDatabaseQueriesClientListByQueryOptions contains the optional parameters for the ManagedDatabaseQueriesClient.ListByQuery -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabaseQueriesClientListByQueryOptions contains the optional parameters for the ManagedDatabaseQueriesClient.NewListByQueryPager +// method. func (client *ManagedDatabaseQueriesClient) NewListByQueryPager(resourceGroupName string, managedInstanceName string, databaseName string, queryID string, options *ManagedDatabaseQueriesClientListByQueryOptions) *runtime.Pager[ManagedDatabaseQueriesClientListByQueryResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseQueriesClientListByQueryResponse]{ More: func(page ManagedDatabaseQueriesClientListByQueryResponse) bool { @@ -195,7 +197,7 @@ func (client *ManagedDatabaseQueriesClient) listByQueryCreateRequest(ctx context if options != nil && options.Interval != nil { reqQP.Set("interval", string(*options.Interval)) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaserecommendedsensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaserecommendedsensitivitylabels_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_client.go index f6cfde71a5ee..d2e47aa86fde 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaserecommendedsensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaserecommendedsensitivitylabels_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 armsql @@ -31,9 +32,9 @@ type ManagedDatabaseRecommendedSensitivityLabelsClient struct { } // NewManagedDatabaseRecommendedSensitivityLabelsClient creates a new instance of ManagedDatabaseRecommendedSensitivityLabelsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseRecommendedSensitivityLabelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseRecommendedSensitivityLabelsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewManagedDatabaseRecommendedSensitivityLabelsClient(subscriptionID string, // Update - Update recommended sensitivity labels states of a given database using an operations batch. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// options - ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseRecommendedSensitivityLabelsClient.Update -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseRecommendedSensitivityLabelsClient.Update +// method. func (client *ManagedDatabaseRecommendedSensitivityLabelsClient) Update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters RecommendedSensitivityLabelUpdateList, options *ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions) (ManagedDatabaseRecommendedSensitivityLabelsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { @@ -102,7 +104,7 @@ func (client *ManagedDatabaseRecommendedSensitivityLabelsClient) updateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, parameters) } diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaserestoredetails_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaserestoredetails_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_client.go index 53bba2a3d278..bddc8a9ea02e 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaserestoredetails_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaserestoredetails_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 armsql @@ -31,9 +32,9 @@ type ManagedDatabaseRestoreDetailsClient struct { } // NewManagedDatabaseRestoreDetailsClient creates a new instance of ManagedDatabaseRestoreDetailsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseRestoreDetailsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseRestoreDetailsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewManagedDatabaseRestoreDetailsClient(subscriptionID string, credential az // Get - Gets managed database restore details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// restoreDetailsName - The name of the restore details to retrieve. -// options - ManagedDatabaseRestoreDetailsClientGetOptions contains the optional parameters for the ManagedDatabaseRestoreDetailsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - restoreDetailsName - The name of the restore details to retrieve. +// - options - ManagedDatabaseRestoreDetailsClientGetOptions contains the optional parameters for the ManagedDatabaseRestoreDetailsClient.Get +// method. func (client *ManagedDatabaseRestoreDetailsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, restoreDetailsName RestoreDetailsName, options *ManagedDatabaseRestoreDetailsClientGetOptions) (ManagedDatabaseRestoreDetailsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, restoreDetailsName, options) if err != nil { @@ -107,7 +109,7 @@ func (client *ManagedDatabaseRestoreDetailsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabases_client.go b/sdk/resourcemanager/sql/armsql/manageddatabases_client.go similarity index 60% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabases_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabases_client.go index 999721c6e13a..b1012f08a05c 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabases_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 armsql @@ -31,9 +32,9 @@ type ManagedDatabasesClient struct { } // NewManagedDatabasesClient creates a new instance of ManagedDatabasesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabasesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,16 +55,159 @@ func NewManagedDatabasesClient(subscriptionID string, credential azcore.TokenCre return client, nil } +// BeginCancelMove - Cancels a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - parameters - Parameters of the cancel managed database move operation. +// - options - ManagedDatabasesClientBeginCancelMoveOptions contains the optional parameters for the ManagedDatabasesClient.BeginCancelMove +// method. +func (client *ManagedDatabasesClient) BeginCancelMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCancelMoveOptions) (*runtime.Poller[ManagedDatabasesClientCancelMoveResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.cancelMove(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedDatabasesClientCancelMoveResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedDatabasesClientCancelMoveResponse](options.ResumeToken, client.pl, nil) + } +} + +// CancelMove - Cancels a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedDatabasesClient) cancelMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCancelMoveOptions) (*http.Response, error) { + req, err := client.cancelMoveCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// cancelMoveCreateRequest creates the CancelMove request. +func (client *ManagedDatabasesClient) cancelMoveCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCancelMoveOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/cancelMove" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginCompleteMove - Completes a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - parameters - Parameters of the complete managed database move operation. +// - options - ManagedDatabasesClientBeginCompleteMoveOptions contains the optional parameters for the ManagedDatabasesClient.BeginCompleteMove +// method. +func (client *ManagedDatabasesClient) BeginCompleteMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCompleteMoveOptions) (*runtime.Poller[ManagedDatabasesClientCompleteMoveResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.completeMove(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedDatabasesClientCompleteMoveResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedDatabasesClientCompleteMoveResponse](options.ResumeToken, client.pl, nil) + } +} + +// CompleteMove - Completes a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedDatabasesClient) completeMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCompleteMoveOptions) (*http.Response, error) { + req, err := client.completeMoveCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// completeMoveCreateRequest creates the CompleteMove request. +func (client *ManagedDatabasesClient) completeMoveCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseMoveDefinition, options *ManagedDatabasesClientBeginCompleteMoveOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/completeMove" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, parameters) +} + // BeginCompleteRestore - Completes the restore operation on a managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// parameters - The definition for completing the restore of this managed database. -// options - ManagedDatabasesClientBeginCompleteRestoreOptions contains the optional parameters for the ManagedDatabasesClient.BeginCompleteRestore -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - parameters - The definition for completing the restore of this managed database. +// - options - ManagedDatabasesClientBeginCompleteRestoreOptions contains the optional parameters for the ManagedDatabasesClient.BeginCompleteRestore +// method. func (client *ManagedDatabasesClient) BeginCompleteRestore(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters CompleteDatabaseRestoreDefinition, options *ManagedDatabasesClientBeginCompleteRestoreOptions) (*runtime.Poller[ManagedDatabasesClientCompleteRestoreResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.completeRestore(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) @@ -78,7 +222,8 @@ func (client *ManagedDatabasesClient) BeginCompleteRestore(ctx context.Context, // CompleteRestore - Completes the restore operation on a managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedDatabasesClient) completeRestore(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters CompleteDatabaseRestoreDefinition, options *ManagedDatabasesClientBeginCompleteRestoreOptions) (*http.Response, error) { req, err := client.completeRestoreCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { @@ -118,21 +263,22 @@ func (client *ManagedDatabasesClient) completeRestoreCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, parameters) } // BeginCreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// parameters - The requested database resource state. -// options - ManagedDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedDatabasesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - parameters - The requested database resource state. +// - options - ManagedDatabasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedDatabasesClient.BeginCreateOrUpdate +// method. func (client *ManagedDatabasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabase, options *ManagedDatabasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedDatabasesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) @@ -147,7 +293,8 @@ func (client *ManagedDatabasesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates a new database or updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedDatabasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabase, options *ManagedDatabasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { @@ -187,7 +334,7 @@ func (client *ManagedDatabasesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -195,13 +342,14 @@ func (client *ManagedDatabasesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes a managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// options - ManagedDatabasesClientBeginDeleteOptions contains the optional parameters for the ManagedDatabasesClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabasesClientBeginDeleteOptions contains the optional parameters for the ManagedDatabasesClient.BeginDelete +// method. func (client *ManagedDatabasesClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabasesClientBeginDeleteOptions) (*runtime.Poller[ManagedDatabasesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, managedInstanceName, databaseName, options) @@ -216,7 +364,8 @@ func (client *ManagedDatabasesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes a managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedDatabasesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabasesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, options) if err != nil { @@ -256,19 +405,20 @@ func (client *ManagedDatabasesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// options - ManagedDatabasesClientGetOptions contains the optional parameters for the ManagedDatabasesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabasesClientGetOptions contains the optional parameters for the ManagedDatabasesClient.Get method. func (client *ManagedDatabasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabasesClientGetOptions) (ManagedDatabasesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, options) if err != nil { @@ -308,7 +458,7 @@ func (client *ManagedDatabasesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,13 +474,13 @@ func (client *ManagedDatabasesClient) getHandleResponse(resp *http.Response) (Ma } // NewListByInstancePager - Gets a list of managed databases. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedDatabasesClientListByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedDatabasesClientListByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.NewListByInstancePager +// method. func (client *ManagedDatabasesClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedDatabasesClientListByInstanceOptions) *runtime.Pager[ManagedDatabasesClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabasesClientListByInstanceResponse]{ More: func(page ManagedDatabasesClientListByInstanceResponse) bool { @@ -379,7 +529,7 @@ func (client *ManagedDatabasesClient) listByInstanceCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -395,13 +545,13 @@ func (client *ManagedDatabasesClient) listByInstanceHandleResponse(resp *http.Re } // NewListInaccessibleByInstancePager - Gets a list of inaccessible managed databases in a managed instance -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedDatabasesClientListInaccessibleByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.ListInaccessibleByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedDatabasesClientListInaccessibleByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.NewListInaccessibleByInstancePager +// method. func (client *ManagedDatabasesClient) NewListInaccessibleByInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedDatabasesClientListInaccessibleByInstanceOptions) *runtime.Pager[ManagedDatabasesClientListInaccessibleByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabasesClientListInaccessibleByInstanceResponse]{ More: func(page ManagedDatabasesClientListInaccessibleByInstanceResponse) bool { @@ -450,7 +600,7 @@ func (client *ManagedDatabasesClient) listInaccessibleByInstanceCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -465,16 +615,88 @@ func (client *ManagedDatabasesClient) listInaccessibleByInstanceHandleResponse(r return result, nil } +// BeginStartMove - Starts a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - parameters - Parameters of the start managed database move operation. +// - options - ManagedDatabasesClientBeginStartMoveOptions contains the optional parameters for the ManagedDatabasesClient.BeginStartMove +// method. +func (client *ManagedDatabasesClient) BeginStartMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseStartMoveDefinition, options *ManagedDatabasesClientBeginStartMoveOptions) (*runtime.Poller[ManagedDatabasesClientStartMoveResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.startMove(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedDatabasesClientStartMoveResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedDatabasesClientStartMoveResponse](options.ResumeToken, client.pl, nil) + } +} + +// StartMove - Starts a managed database move operation. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedDatabasesClient) startMove(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseStartMoveDefinition, options *ManagedDatabasesClientBeginStartMoveOptions) (*http.Response, error) { + req, err := client.startMoveCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startMoveCreateRequest creates the StartMove request. +func (client *ManagedDatabasesClient) startMoveCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseStartMoveDefinition, options *ManagedDatabasesClientBeginStartMoveOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/startMove" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, runtime.MarshalAsJSON(req, parameters) +} + // BeginUpdate - Updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// parameters - The requested database resource state. -// options - ManagedDatabasesClientBeginUpdateOptions contains the optional parameters for the ManagedDatabasesClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - parameters - The requested database resource state. +// - options - ManagedDatabasesClientBeginUpdateOptions contains the optional parameters for the ManagedDatabasesClient.BeginUpdate +// method. func (client *ManagedDatabasesClient) BeginUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseUpdate, options *ManagedDatabasesClientBeginUpdateOptions) (*runtime.Poller[ManagedDatabasesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) @@ -489,7 +711,8 @@ func (client *ManagedDatabasesClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates an existing database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedDatabasesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters ManagedDatabaseUpdate, options *ManagedDatabasesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { @@ -529,7 +752,7 @@ func (client *ManagedDatabasesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaseschemas_client.go b/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaseschemas_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabaseschemas_client.go index 06c783fc88f4..dc9de0cd6f50 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabaseschemas_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabaseschemas_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 armsql @@ -31,9 +32,9 @@ type ManagedDatabaseSchemasClient struct { } // NewManagedDatabaseSchemasClient creates a new instance of ManagedDatabaseSchemasClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseSchemasClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseSchemasClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewManagedDatabaseSchemasClient(subscriptionID string, credential azcore.To // Get - Get managed database schema // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// options - ManagedDatabaseSchemasClientGetOptions contains the optional parameters for the ManagedDatabaseSchemasClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - options - ManagedDatabaseSchemasClientGetOptions contains the optional parameters for the ManagedDatabaseSchemasClient.Get +// method. func (client *ManagedDatabaseSchemasClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, options *ManagedDatabaseSchemasClientGetOptions) (ManagedDatabaseSchemasClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, options) if err != nil { @@ -107,7 +109,7 @@ func (client *ManagedDatabaseSchemasClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,14 +125,14 @@ func (client *ManagedDatabaseSchemasClient) getHandleResponse(resp *http.Respons } // NewListByDatabasePager - List managed database schemas -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// options - ManagedDatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSchemasClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSchemasClient.NewListByDatabasePager +// method. func (client *ManagedDatabaseSchemasClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseSchemasClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseSchemasClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseSchemasClientListByDatabaseResponse]{ More: func(page ManagedDatabaseSchemasClientListByDatabaseResponse) bool { @@ -186,7 +188,7 @@ func (client *ManagedDatabaseSchemasClient) listByDatabaseCreateRequest(ctx cont if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesecurityalertpolicies_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_client.go index 1020dcad779e..2fb030ff9000 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityalertpolicies_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 armsql @@ -31,9 +32,9 @@ type ManagedDatabaseSecurityAlertPoliciesClient struct { } // NewManagedDatabaseSecurityAlertPoliciesClient creates a new instance of ManagedDatabaseSecurityAlertPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseSecurityAlertPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseSecurityAlertPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewManagedDatabaseSecurityAlertPoliciesClient(subscriptionID string, creden // CreateOrUpdate - Creates or updates a database's security alert policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database for which the security alert policy is defined. -// securityAlertPolicyName - The name of the security alert policy. -// parameters - The database security alert policy. -// options - ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database for which the security alert policy is defined. +// - securityAlertPolicyName - The name of the security alert policy. +// - parameters - The database security alert policy. +// - options - ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.CreateOrUpdate +// method. func (client *ManagedDatabaseSecurityAlertPoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ManagedDatabaseSecurityAlertPolicy, options *ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateOptions) (ManagedDatabaseSecurityAlertPoliciesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, securityAlertPolicyName, parameters, options) if err != nil { @@ -108,7 +110,7 @@ func (client *ManagedDatabaseSecurityAlertPoliciesClient) createOrUpdateCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,14 +127,15 @@ func (client *ManagedDatabaseSecurityAlertPoliciesClient) createOrUpdateHandleRe // Get - Gets a managed database's security alert policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database for which the security alert policy is defined. -// securityAlertPolicyName - The name of the security alert policy. -// options - ManagedDatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database for which the security alert policy is defined. +// - securityAlertPolicyName - The name of the security alert policy. +// - options - ManagedDatabaseSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.Get +// method. func (client *ManagedDatabaseSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, securityAlertPolicyName SecurityAlertPolicyName, options *ManagedDatabaseSecurityAlertPoliciesClientGetOptions) (ManagedDatabaseSecurityAlertPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, securityAlertPolicyName, options) if err != nil { @@ -176,7 +179,7 @@ func (client *ManagedDatabaseSecurityAlertPoliciesClient) getCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,14 +195,14 @@ func (client *ManagedDatabaseSecurityAlertPoliciesClient) getHandleResponse(resp } // NewListByDatabasePager - Gets a list of managed database's security alert policies. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database for which the security alert policies are defined. -// options - ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database for which the security alert policies are defined. +// - options - ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.NewListByDatabasePager +// method. func (client *ManagedDatabaseSecurityAlertPoliciesClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResponse]{ More: func(page ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResponse) bool { @@ -252,7 +255,7 @@ func (client *ManagedDatabaseSecurityAlertPoliciesClient) listByDatabaseCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesecurityevents_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesecurityevents_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_client.go index 5916a34411c8..fbc469ed379f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesecurityevents_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesecurityevents_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 armsql @@ -32,9 +33,9 @@ type ManagedDatabaseSecurityEventsClient struct { } // NewManagedDatabaseSecurityEventsClient creates a new instance of ManagedDatabaseSecurityEventsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseSecurityEventsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseSecurityEventsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,14 @@ func NewManagedDatabaseSecurityEventsClient(subscriptionID string, credential az } // NewListByDatabasePager - Gets a list of security events. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database for which the security events are retrieved. -// options - ManagedDatabaseSecurityEventsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityEventsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database for which the security events are retrieved. +// - options - ManagedDatabaseSecurityEventsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityEventsClient.NewListByDatabasePager +// method. func (client *ManagedDatabaseSecurityEventsClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseSecurityEventsClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseSecurityEventsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseSecurityEventsClientListByDatabaseResponse]{ More: func(page ManagedDatabaseSecurityEventsClientListByDatabaseResponse) bool { @@ -120,15 +121,15 @@ func (client *ManagedDatabaseSecurityEventsClient) listByDatabaseCreateRequest(c reqQP.Set("$filter", *options.Filter) } if options != nil && options.Skip != nil { - reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + reqQP.Set("$skip", strconv.FormatInt(*options.Skip, 10)) } if options != nil && options.Top != nil { - reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + reqQP.Set("$top", strconv.FormatInt(*options.Top, 10)) } if options != nil && options.Skiptoken != nil { reqQP.Set("$skiptoken", *options.Skiptoken) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go similarity index 76% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesensitivitylabels_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_client.go index c3adae17d500..c306285dc246 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasesensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasesensitivitylabels_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 armsql @@ -32,9 +33,9 @@ type ManagedDatabaseSensitivityLabelsClient struct { } // NewManagedDatabaseSensitivityLabelsClient creates a new instance of ManagedDatabaseSensitivityLabelsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseSensitivityLabelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseSensitivityLabelsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,17 +58,18 @@ func NewManagedDatabaseSensitivityLabelsClient(subscriptionID string, credential // CreateOrUpdate - Creates or updates the sensitivity label of a given column // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// columnName - The name of the column. -// parameters - The column sensitivity label resource. -// options - ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - columnName - The name of the column. +// - parameters - The column sensitivity label resource. +// - options - ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.CreateOrUpdate +// method. func (client *ManagedDatabaseSensitivityLabelsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, parameters SensitivityLabel, options *ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions) (ManagedDatabaseSensitivityLabelsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, parameters, options) if err != nil { @@ -120,7 +122,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -137,16 +139,17 @@ func (client *ManagedDatabaseSensitivityLabelsClient) createOrUpdateHandleRespon // Delete - Deletes the sensitivity label of a given column // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// columnName - The name of the column. -// options - ManagedDatabaseSensitivityLabelsClientDeleteOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - columnName - The name of the column. +// - options - ManagedDatabaseSensitivityLabelsClientDeleteOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Delete +// method. func (client *ManagedDatabaseSensitivityLabelsClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, options *ManagedDatabaseSensitivityLabelsClientDeleteOptions) (ManagedDatabaseSensitivityLabelsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, options) if err != nil { @@ -199,23 +202,24 @@ func (client *ManagedDatabaseSensitivityLabelsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // DisableRecommendation - Disables sensitivity recommendations on a given column // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// columnName - The name of the column. -// options - ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.DisableRecommendation -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - columnName - The name of the column. +// - options - ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.DisableRecommendation +// method. func (client *ManagedDatabaseSensitivityLabelsClient) DisableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, options *ManagedDatabaseSensitivityLabelsClientDisableRecommendationOptions) (ManagedDatabaseSensitivityLabelsClientDisableRecommendationResponse, error) { req, err := client.disableRecommendationCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, options) if err != nil { @@ -268,7 +272,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) disableRecommendationCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -276,16 +280,17 @@ func (client *ManagedDatabaseSensitivityLabelsClient) disableRecommendationCreat // EnableRecommendation - Enables sensitivity recommendations on a given column (recommendations are enabled by default on // all columns) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// columnName - The name of the column. -// options - ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.EnableRecommendation -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - columnName - The name of the column. +// - options - ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.EnableRecommendation +// method. func (client *ManagedDatabaseSensitivityLabelsClient) EnableRecommendation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, options *ManagedDatabaseSensitivityLabelsClientEnableRecommendationOptions) (ManagedDatabaseSensitivityLabelsClientEnableRecommendationResponse, error) { req, err := client.enableRecommendationCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, options) if err != nil { @@ -338,24 +343,25 @@ func (client *ManagedDatabaseSensitivityLabelsClient) enableRecommendationCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets the sensitivity label of a given column // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// columnName - The name of the column. -// sensitivityLabelSource - The source of the sensitivity label. -// options - ManagedDatabaseSensitivityLabelsClientGetOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - columnName - The name of the column. +// - sensitivityLabelSource - The source of the sensitivity label. +// - options - ManagedDatabaseSensitivityLabelsClientGetOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Get +// method. func (client *ManagedDatabaseSensitivityLabelsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource SensitivityLabelSource, options *ManagedDatabaseSensitivityLabelsClientGetOptions) (ManagedDatabaseSensitivityLabelsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, options) if err != nil { @@ -411,7 +417,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -426,15 +432,94 @@ func (client *ManagedDatabaseSensitivityLabelsClient) getHandleResponse(resp *ht return result, nil } +// NewListByDatabasePager - Gets the sensitivity labels of a given database +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabaseSensitivityLabelsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.NewListByDatabasePager +// method. +func (client *ManagedDatabaseSensitivityLabelsClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseSensitivityLabelsClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse]{ + More: func(page ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse) (ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseHandleResponse(resp) + }, + }) +} + +// listByDatabaseCreateRequest creates the ListByDatabase request. +func (client *ManagedDatabaseSensitivityLabelsClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseSensitivityLabelsClientListByDatabaseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/sensitivityLabels" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByDatabaseHandleResponse handles the ListByDatabase response. +func (client *ManagedDatabaseSensitivityLabelsClient) listByDatabaseHandleResponse(resp *http.Response) (ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse, error) { + result := ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SensitivityLabelListResult); err != nil { + return ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse{}, err + } + return result, nil +} + // NewListCurrentByDatabasePager - Gets the sensitivity labels of a given database -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// options - ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.ListCurrentByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.NewListCurrentByDatabasePager +// method. func (client *ManagedDatabaseSensitivityLabelsClient) NewListCurrentByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions) *runtime.Pager[ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse]{ More: func(page ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse) bool { @@ -496,7 +581,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) listCurrentByDatabaseCreat if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -512,14 +597,14 @@ func (client *ManagedDatabaseSensitivityLabelsClient) listCurrentByDatabaseHandl } // NewListRecommendedByDatabasePager - Gets the sensitivity labels of a given database -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// options - ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the -// ManagedDatabaseSensitivityLabelsClient.ListRecommendedByDatabase method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the +// ManagedDatabaseSensitivityLabelsClient.NewListRecommendedByDatabasePager method. func (client *ManagedDatabaseSensitivityLabelsClient) NewListRecommendedByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions) *runtime.Pager[ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResponse]{ More: func(page ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResponse) bool { @@ -581,7 +666,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) listRecommendedByDatabaseC if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -598,13 +683,14 @@ func (client *ManagedDatabaseSensitivityLabelsClient) listRecommendedByDatabaseH // Update - Update sensitivity labels of a given database using an operations batch. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// options - ManagedDatabaseSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Update -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedDatabaseSensitivityLabelsClientUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.Update +// method. func (client *ManagedDatabaseSensitivityLabelsClient) Update(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, parameters SensitivityLabelUpdateList, options *ManagedDatabaseSensitivityLabelsClientUpdateOptions) (ManagedDatabaseSensitivityLabelsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, parameters, options) if err != nil { @@ -644,7 +730,7 @@ func (client *ManagedDatabaseSensitivityLabelsClient) updateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, parameters) } diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasetables_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasetables_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasetables_client.go index 5a822ede418b..d936fbc50f88 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasetables_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasetables_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 armsql @@ -31,9 +32,9 @@ type ManagedDatabaseTablesClient struct { } // NewManagedDatabaseTablesClient creates a new instance of ManagedDatabaseTablesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseTablesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseTablesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewManagedDatabaseTablesClient(subscriptionID string, credential azcore.Tok // Get - Get managed database table // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// options - ManagedDatabaseTablesClientGetOptions contains the optional parameters for the ManagedDatabaseTablesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - options - ManagedDatabaseTablesClientGetOptions contains the optional parameters for the ManagedDatabaseTablesClient.Get +// method. func (client *ManagedDatabaseTablesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, tableName string, options *ManagedDatabaseTablesClientGetOptions) (ManagedDatabaseTablesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, schemaName, tableName, options) if err != nil { @@ -112,7 +114,7 @@ func (client *ManagedDatabaseTablesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -128,15 +130,15 @@ func (client *ManagedDatabaseTablesClient) getHandleResponse(resp *http.Response } // NewListBySchemaPager - List managed database tables -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// options - ManagedDatabaseTablesClientListBySchemaOptions contains the optional parameters for the ManagedDatabaseTablesClient.ListBySchema -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - options - ManagedDatabaseTablesClientListBySchemaOptions contains the optional parameters for the ManagedDatabaseTablesClient.NewListBySchemaPager +// method. func (client *ManagedDatabaseTablesClient) NewListBySchemaPager(resourceGroupName string, managedInstanceName string, databaseName string, schemaName string, options *ManagedDatabaseTablesClientListBySchemaOptions) *runtime.Pager[ManagedDatabaseTablesClientListBySchemaResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseTablesClientListBySchemaResponse]{ More: func(page ManagedDatabaseTablesClientListBySchemaResponse) bool { @@ -196,7 +198,7 @@ func (client *ManagedDatabaseTablesClient) listBySchemaCreateRequest(ctx context if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasetransparentdataencryption_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasetransparentdataencryption_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_client.go index a7022a0b652d..5a2960b2ab73 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasetransparentdataencryption_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasetransparentdataencryption_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 armsql @@ -31,9 +32,9 @@ type ManagedDatabaseTransparentDataEncryptionClient struct { } // NewManagedDatabaseTransparentDataEncryptionClient creates a new instance of ManagedDatabaseTransparentDataEncryptionClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseTransparentDataEncryptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseTransparentDataEncryptionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewManagedDatabaseTransparentDataEncryptionClient(subscriptionID string, cr // CreateOrUpdate - Updates a database's transparent data encryption configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database for which the security alert policy is defined. -// tdeName - The name of the transparent data encryption configuration. -// parameters - The database transparent data encryption. -// options - ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions contains the optional parameters for the -// ManagedDatabaseTransparentDataEncryptionClient.CreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database for which the security alert policy is defined. +// - tdeName - The name of the transparent data encryption configuration. +// - parameters - The database transparent data encryption. +// - options - ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions contains the optional parameters for the +// ManagedDatabaseTransparentDataEncryptionClient.CreateOrUpdate method. func (client *ManagedDatabaseTransparentDataEncryptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, tdeName TransparentDataEncryptionName, parameters ManagedTransparentDataEncryption, options *ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateOptions) (ManagedDatabaseTransparentDataEncryptionClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, tdeName, parameters, options) if err != nil { @@ -108,7 +110,7 @@ func (client *ManagedDatabaseTransparentDataEncryptionClient) createOrUpdateCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,14 +127,15 @@ func (client *ManagedDatabaseTransparentDataEncryptionClient) createOrUpdateHand // Get - Gets a managed database's transparent data encryption. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database for which the transparent data encryption is defined. -// tdeName - The name of the transparent data encryption configuration. -// options - ManagedDatabaseTransparentDataEncryptionClientGetOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database for which the transparent data encryption is defined. +// - tdeName - The name of the transparent data encryption configuration. +// - options - ManagedDatabaseTransparentDataEncryptionClientGetOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.Get +// method. func (client *ManagedDatabaseTransparentDataEncryptionClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, tdeName TransparentDataEncryptionName, options *ManagedDatabaseTransparentDataEncryptionClientGetOptions) (ManagedDatabaseTransparentDataEncryptionClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, tdeName, options) if err != nil { @@ -176,7 +179,7 @@ func (client *ManagedDatabaseTransparentDataEncryptionClient) getCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,14 +195,14 @@ func (client *ManagedDatabaseTransparentDataEncryptionClient) getHandleResponse( } // NewListByDatabasePager - Gets a list of managed database's transparent data encryptions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the managed database for which the transparent data encryption is defined. -// options - ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions contains the optional parameters for the -// ManagedDatabaseTransparentDataEncryptionClient.ListByDatabase method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the managed database for which the transparent data encryption is defined. +// - options - ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions contains the optional parameters for the +// ManagedDatabaseTransparentDataEncryptionClient.NewListByDatabasePager method. func (client *ManagedDatabaseTransparentDataEncryptionClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResponse]{ More: func(page ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResponse) bool { @@ -252,7 +255,7 @@ func (client *ManagedDatabaseTransparentDataEncryptionClient) listByDatabaseCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go similarity index 81% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessmentrulebaselines_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_client.go index 4625751a457a..898c5b9692bb 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessmentrulebaselines_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentrulebaselines_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 armsql @@ -31,9 +32,9 @@ type ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient struct { } // NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient creates a new instance of ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,18 +57,19 @@ func NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient(subscriptionID // CreateOrUpdate - Creates or updates a database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// ruleID - The vulnerability assessment rule ID. -// baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule -// and master for server level rule). -// parameters - The requested rule baseline resource. -// options - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters -// for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule +// and master for server level rule). +// - parameters - The requested rule baseline resource. +// - options - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters +// for the ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate method. func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, parameters DatabaseVulnerabilityAssessmentRuleBaseline, options *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions) (ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, ruleID, baselineName, parameters, options) if err != nil { @@ -119,7 +121,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) createO return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -136,17 +138,18 @@ func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) createO // Delete - Removes the database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// ruleID - The vulnerability assessment rule ID. -// baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule -// and master for server level rule). -// options - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the -// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule +// and master for server level rule). +// - options - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the +// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Delete method. func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, options *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, ruleID, baselineName, options) if err != nil { @@ -198,24 +201,25 @@ func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) deleteC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a database's vulnerability assessment rule baseline. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// ruleID - The vulnerability assessment rule ID. -// baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule -// and master for server level rule). -// options - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the -// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database for which the vulnerability assessment rule baseline is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - baselineName - The name of the vulnerability assessment rule baseline (default implies a baseline on a database level rule +// and master for server level rule). +// - options - ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the +// ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient.Get method. func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, ruleID string, baselineName VulnerabilityAssessmentPolicyBaselineName, options *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetOptions) (ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, ruleID, baselineName, options) if err != nil { @@ -267,7 +271,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient) getCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessments_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_client.go index 4bdbe828d262..e5cb544bab38 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessments_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 armsql @@ -31,9 +32,9 @@ type ManagedDatabaseVulnerabilityAssessmentsClient struct { } // NewManagedDatabaseVulnerabilityAssessmentsClient creates a new instance of ManagedDatabaseVulnerabilityAssessmentsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseVulnerabilityAssessmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseVulnerabilityAssessmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewManagedDatabaseVulnerabilityAssessmentsClient(subscriptionID string, cre // CreateOrUpdate - Creates or updates the database's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database for which the vulnerability assessment is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// parameters - The requested resource. -// options - ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database for which the vulnerability assessment is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - parameters - The requested resource. +// - options - ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.CreateOrUpdate +// method. func (client *ManagedDatabaseVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, parameters DatabaseVulnerabilityAssessment, options *ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateOptions) (ManagedDatabaseVulnerabilityAssessmentsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, parameters, options) if err != nil { @@ -108,7 +110,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) createOrUpdateCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,14 +127,15 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) createOrUpdateHandl // Delete - Removes the database's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database for which the vulnerability assessment is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// options - ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database for which the vulnerability assessment is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Delete +// method. func (client *ManagedDatabaseVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ManagedDatabaseVulnerabilityAssessmentsClientDeleteOptions) (ManagedDatabaseVulnerabilityAssessmentsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, options) if err != nil { @@ -176,21 +179,22 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) deleteCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets the database's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database for which the vulnerability assessment is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// options - ManagedDatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database for which the vulnerability assessment is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - ManagedDatabaseVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.Get +// method. func (client *ManagedDatabaseVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ManagedDatabaseVulnerabilityAssessmentsClientGetOptions) (ManagedDatabaseVulnerabilityAssessmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, options) if err != nil { @@ -234,7 +238,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,14 +254,14 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) getHandleResponse(r } // NewListByDatabasePager - Lists the vulnerability assessments of a managed database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database for which the vulnerability assessment is defined. -// options - ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database for which the vulnerability assessment is defined. +// - options - ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.NewListByDatabasePager +// method. func (client *ManagedDatabaseVulnerabilityAssessmentsClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse]{ More: func(page ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse) bool { @@ -310,7 +314,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentsClient) listByDatabaseCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessmentscans_client.go rename to sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_client.go index b4d3e5bf4764..bd160e98e44f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_manageddatabasevulnerabilityassessmentscans_client.go +++ b/sdk/resourcemanager/sql/armsql/manageddatabasevulnerabilityassessmentscans_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 armsql @@ -31,9 +32,9 @@ type ManagedDatabaseVulnerabilityAssessmentScansClient struct { } // NewManagedDatabaseVulnerabilityAssessmentScansClient creates a new instance of ManagedDatabaseVulnerabilityAssessmentScansClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedDatabaseVulnerabilityAssessmentScansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedDatabaseVulnerabilityAssessmentScansClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewManagedDatabaseVulnerabilityAssessmentScansClient(subscriptionID string, // Export - Convert an existing scan result to a human readable format. If already exists nothing happens // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the scanned database. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// scanID - The vulnerability assessment scan Id. -// options - ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Export -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the scanned database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - scanID - The vulnerability assessment scan Id. +// - options - ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Export +// method. func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) Export(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *ManagedDatabaseVulnerabilityAssessmentScansClientExportOptions) (ManagedDatabaseVulnerabilityAssessmentScansClientExportResponse, error) { req, err := client.exportCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, scanID, options) if err != nil { @@ -112,7 +114,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) exportCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -129,15 +131,16 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) exportHandleRes // Get - Gets a vulnerability assessment scan record of a database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// scanID - The vulnerability assessment scan Id of the scan to retrieve. -// options - ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - scanID - The vulnerability assessment scan Id of the scan to retrieve. +// - options - ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.Get +// method. func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions) (ManagedDatabaseVulnerabilityAssessmentScansClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, scanID, options) if err != nil { @@ -185,7 +188,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) getCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -202,15 +205,16 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) getHandleRespon // BeginInitiateScan - Executes a Vulnerability Assessment database scan. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// scanID - The vulnerability assessment scan Id of the scan to retrieve. -// options - ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions contains the optional parameters for -// the ManagedDatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - scanID - The vulnerability assessment scan Id of the scan to retrieve. +// - options - ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions contains the optional parameters for +// the ManagedDatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan method. func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) BeginInitiateScan(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions) (*runtime.Poller[ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.initiateScan(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, scanID, options) @@ -225,7 +229,8 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) BeginInitiateSc // InitiateScan - Executes a Vulnerability Assessment database scan. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) initiateScan(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *ManagedDatabaseVulnerabilityAssessmentScansClientBeginInitiateScanOptions) (*http.Response, error) { req, err := client.initiateScanCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, vulnerabilityAssessmentName, scanID, options) if err != nil { @@ -273,21 +278,21 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) initiateScanCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // NewListByDatabasePager - Lists the vulnerability assessment scans of a database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// options - ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the -// ManagedDatabaseVulnerabilityAssessmentScansClient.ListByDatabase method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the +// ManagedDatabaseVulnerabilityAssessmentScansClient.NewListByDatabasePager method. func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions) *runtime.Pager[ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse]{ More: func(page ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse) bool { @@ -344,7 +349,7 @@ func (client *ManagedDatabaseVulnerabilityAssessmentScansClient) listByDatabaseC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceadministrators_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceadministrators_client.go rename to sdk/resourcemanager/sql/armsql/managedinstanceadministrators_client.go index 128fc222a8b0..22c63d7c37f8 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceadministrators_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceadministrators_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 armsql @@ -31,9 +32,9 @@ type ManagedInstanceAdministratorsClient struct { } // NewManagedInstanceAdministratorsClient creates a new instance of ManagedInstanceAdministratorsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedInstanceAdministratorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstanceAdministratorsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewManagedInstanceAdministratorsClient(subscriptionID string, credential az // BeginCreateOrUpdate - Creates or updates a managed instance administrator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// parameters - The requested administrator parameters. -// options - ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - parameters - The requested administrator parameters. +// - options - ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.BeginCreateOrUpdate +// method. func (client *ManagedInstanceAdministratorsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName AdministratorName, parameters ManagedInstanceAdministrator, options *ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceAdministratorsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, administratorName, parameters, options) @@ -77,7 +79,8 @@ func (client *ManagedInstanceAdministratorsClient) BeginCreateOrUpdate(ctx conte // CreateOrUpdate - Creates or updates a managed instance administrator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstanceAdministratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName AdministratorName, parameters ManagedInstanceAdministrator, options *ManagedInstanceAdministratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, administratorName, parameters, options) if err != nil { @@ -117,7 +120,7 @@ func (client *ManagedInstanceAdministratorsClient) createOrUpdateCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,12 +128,13 @@ func (client *ManagedInstanceAdministratorsClient) createOrUpdateCreateRequest(c // BeginDelete - Deletes a managed instance administrator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstanceAdministratorsClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstanceAdministratorsClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.BeginDelete +// method. func (client *ManagedInstanceAdministratorsClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName AdministratorName, options *ManagedInstanceAdministratorsClientBeginDeleteOptions) (*runtime.Poller[ManagedInstanceAdministratorsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, managedInstanceName, administratorName, options) @@ -145,7 +149,8 @@ func (client *ManagedInstanceAdministratorsClient) BeginDelete(ctx context.Conte // Delete - Deletes a managed instance administrator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstanceAdministratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName AdministratorName, options *ManagedInstanceAdministratorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, administratorName, options) if err != nil { @@ -185,19 +190,20 @@ func (client *ManagedInstanceAdministratorsClient) deleteCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a managed instance administrator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstanceAdministratorsClientGetOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstanceAdministratorsClientGetOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.Get +// method. func (client *ManagedInstanceAdministratorsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, administratorName AdministratorName, options *ManagedInstanceAdministratorsClientGetOptions) (ManagedInstanceAdministratorsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, administratorName, options) if err != nil { @@ -237,7 +243,7 @@ func (client *ManagedInstanceAdministratorsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,13 +259,13 @@ func (client *ManagedInstanceAdministratorsClient) getHandleResponse(resp *http. } // NewListByInstancePager - Gets a list of managed instance administrators. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstanceAdministratorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstanceAdministratorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.NewListByInstancePager +// method. func (client *ManagedInstanceAdministratorsClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstanceAdministratorsClientListByInstanceOptions) *runtime.Pager[ManagedInstanceAdministratorsClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstanceAdministratorsClientListByInstanceResponse]{ More: func(page ManagedInstanceAdministratorsClientListByInstanceResponse) bool { @@ -308,7 +314,7 @@ func (client *ManagedInstanceAdministratorsClient) listByInstanceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go new file mode 100644 index 000000000000..e0370240c9ed --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedinstanceadvancedthreatprotectionsettings_client.go @@ -0,0 +1,263 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedInstanceAdvancedThreatProtectionSettingsClient contains the methods for the ManagedInstanceAdvancedThreatProtectionSettings group. +// Don't use this type directly, use NewManagedInstanceAdvancedThreatProtectionSettingsClient() instead. +type ManagedInstanceAdvancedThreatProtectionSettingsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedInstanceAdvancedThreatProtectionSettingsClient creates a new instance of ManagedInstanceAdvancedThreatProtectionSettingsClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagedInstanceAdvancedThreatProtectionSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstanceAdvancedThreatProtectionSettingsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedInstanceAdvancedThreatProtectionSettingsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates Advanced Threat Protection settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - advancedThreatProtectionName - The name of the Advanced Threat Protection state. +// - parameters - The managed instance Advanced Threat Protection state. +// - options - ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters +// for the ManagedInstanceAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate method. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ManagedInstanceAdvancedThreatProtection, options *ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, advancedThreatProtectionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Creates or updates Advanced Threat Protection settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ManagedInstanceAdvancedThreatProtection, options *ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, advancedThreatProtectionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ManagedInstanceAdvancedThreatProtection, options *ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if advancedThreatProtectionName == "" { + return nil, errors.New("parameter advancedThreatProtectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{advancedThreatProtectionName}", url.PathEscape(string(advancedThreatProtectionName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// Get - Get a managed instance's Advanced Threat Protection state. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - advancedThreatProtectionName - The name of the Advanced Threat Protection state. +// - options - ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ManagedInstanceAdvancedThreatProtectionSettingsClient.Get +// method. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions) (ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, advancedThreatProtectionName, options) + if err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings/{advancedThreatProtectionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if advancedThreatProtectionName == "" { + return nil, errors.New("parameter advancedThreatProtectionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{advancedThreatProtectionName}", url.PathEscape(string(advancedThreatProtectionName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) getHandleResponse(resp *http.Response) (ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse, error) { + result := ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceAdvancedThreatProtection); err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse{}, err + } + return result, nil +} + +// NewListByInstancePager - Get the managed instance's Advanced Threat Protection settings. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions contains the optional parameters for +// the ManagedInstanceAdvancedThreatProtectionSettingsClient.NewListByInstancePager method. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions) *runtime.Pager[ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse]{ + More: func(page ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse) (ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByInstanceCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse{}, runtime.NewResponseError(resp) + } + return client.listByInstanceHandleResponse(resp) + }, + }) +} + +// listByInstanceCreateRequest creates the ListByInstance request. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) listByInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/advancedThreatProtectionSettings" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByInstanceHandleResponse handles the ListByInstance response. +func (client *ManagedInstanceAdvancedThreatProtectionSettingsClient) listByInstanceHandleResponse(resp *http.Response) (ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse, error) { + result := ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceAdvancedThreatProtectionListResult); err != nil { + return ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceazureadonlyauthentications_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceazureadonlyauthentications_client.go rename to sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_client.go index 4fd02c100f29..986f48a6b3f2 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceazureadonlyauthentications_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceazureadonlyauthentications_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 armsql @@ -31,9 +32,9 @@ type ManagedInstanceAzureADOnlyAuthenticationsClient struct { } // NewManagedInstanceAzureADOnlyAuthenticationsClient creates a new instance of ManagedInstanceAzureADOnlyAuthenticationsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedInstanceAzureADOnlyAuthenticationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstanceAzureADOnlyAuthenticationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +58,15 @@ func NewManagedInstanceAzureADOnlyAuthenticationsClient(subscriptionID string, c // BeginCreateOrUpdate - Sets Server Active Directory only authentication property or updates an existing server Active Directory // only authentication property. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// authenticationName - The name of server azure active directory only authentication. -// parameters - The required parameters for creating or updating an Active Directory only authentication property. -// options - ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions contains the optional parameters for -// the ManagedInstanceAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - authenticationName - The name of server azure active directory only authentication. +// - parameters - The required parameters for creating or updating an Active Directory only authentication property. +// - options - ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions contains the optional parameters for +// the ManagedInstanceAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate method. func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, authenticationName AuthenticationName, parameters ManagedInstanceAzureADOnlyAuthentication, options *ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, authenticationName, parameters, options) @@ -80,7 +82,8 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) BeginCreateOrUpda // CreateOrUpdate - Sets Server Active Directory only authentication property or updates an existing server Active Directory // only authentication property. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, authenticationName AuthenticationName, parameters ManagedInstanceAzureADOnlyAuthentication, options *ManagedInstanceAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, authenticationName, parameters, options) if err != nil { @@ -120,7 +123,7 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) createOrUpdateCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -128,13 +131,14 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) createOrUpdateCre // BeginDelete - Deletes an existing server Active Directory only authentication property. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// authenticationName - The name of server azure active directory only authentication. -// options - ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - authenticationName - The name of server azure active directory only authentication. +// - options - ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.BeginDelete +// method. func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, authenticationName AuthenticationName, options *ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions) (*runtime.Poller[ManagedInstanceAzureADOnlyAuthenticationsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, managedInstanceName, authenticationName, options) @@ -149,7 +153,8 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) BeginDelete(ctx c // Delete - Deletes an existing server Active Directory only authentication property. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, authenticationName AuthenticationName, options *ManagedInstanceAzureADOnlyAuthenticationsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, authenticationName, options) if err != nil { @@ -189,20 +194,21 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) deleteCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a specific Azure Active Directory only authentication property. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// authenticationName - The name of server azure active directory only authentication. -// options - ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - authenticationName - The name of server azure active directory only authentication. +// - options - ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.Get +// method. func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, authenticationName AuthenticationName, options *ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions) (ManagedInstanceAzureADOnlyAuthenticationsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, authenticationName, options) if err != nil { @@ -242,7 +248,7 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) getCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,13 +264,13 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) getHandleResponse } // NewListByInstancePager - Gets a list of server Azure Active Directory only authentications. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions contains the optional parameters for the -// ManagedInstanceAzureADOnlyAuthenticationsClient.ListByInstance method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions contains the optional parameters for the +// ManagedInstanceAzureADOnlyAuthenticationsClient.NewListByInstancePager method. func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions) *runtime.Pager[ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse]{ More: func(page ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse) bool { @@ -313,7 +319,7 @@ func (client *ManagedInstanceAzureADOnlyAuthenticationsClient) listByInstanceCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go b/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go new file mode 100644 index 000000000000..1d0ee99aa558 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedinstancedtcs_client.go @@ -0,0 +1,262 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedInstanceDtcsClient contains the methods for the ManagedInstanceDtcs group. +// Don't use this type directly, use NewManagedInstanceDtcsClient() instead. +type ManagedInstanceDtcsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedInstanceDtcsClient creates a new instance of ManagedInstanceDtcsClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagedInstanceDtcsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstanceDtcsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedInstanceDtcsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Updates managed instance DTC settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - dtcName - The name of the managed instance DTC. +// - parameters - Managed instance DTC settings. +// - options - ManagedInstanceDtcsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceDtcsClient.BeginCreateOrUpdate +// method. +func (client *ManagedInstanceDtcsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, dtcName DtcName, parameters ManagedInstanceDtc, options *ManagedInstanceDtcsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceDtcsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, dtcName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedInstanceDtcsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedInstanceDtcsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Updates managed instance DTC settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedInstanceDtcsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, dtcName DtcName, parameters ManagedInstanceDtc, options *ManagedInstanceDtcsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, dtcName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedInstanceDtcsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, dtcName DtcName, parameters ManagedInstanceDtc, options *ManagedInstanceDtcsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if dtcName == "" { + return nil, errors.New("parameter dtcName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dtcName}", url.PathEscape(string(dtcName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// Get - Gets managed instance DTC settings. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - dtcName - The name of the managed instance DTC. +// - options - ManagedInstanceDtcsClientGetOptions contains the optional parameters for the ManagedInstanceDtcsClient.Get method. +func (client *ManagedInstanceDtcsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, dtcName DtcName, options *ManagedInstanceDtcsClientGetOptions) (ManagedInstanceDtcsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, dtcName, options) + if err != nil { + return ManagedInstanceDtcsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedInstanceDtcsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedInstanceDtcsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedInstanceDtcsClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, dtcName DtcName, options *ManagedInstanceDtcsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc/{dtcName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if dtcName == "" { + return nil, errors.New("parameter dtcName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dtcName}", url.PathEscape(string(dtcName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedInstanceDtcsClient) getHandleResponse(resp *http.Response) (ManagedInstanceDtcsClientGetResponse, error) { + result := ManagedInstanceDtcsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceDtc); err != nil { + return ManagedInstanceDtcsClientGetResponse{}, err + } + return result, nil +} + +// NewListByManagedInstancePager - Gets a list of managed instance DTC settings. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstanceDtcsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstanceDtcsClient.NewListByManagedInstancePager +// method. +func (client *ManagedInstanceDtcsClient) NewListByManagedInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstanceDtcsClientListByManagedInstanceOptions) *runtime.Pager[ManagedInstanceDtcsClientListByManagedInstanceResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedInstanceDtcsClientListByManagedInstanceResponse]{ + More: func(page ManagedInstanceDtcsClientListByManagedInstanceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedInstanceDtcsClientListByManagedInstanceResponse) (ManagedInstanceDtcsClientListByManagedInstanceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByManagedInstanceCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedInstanceDtcsClientListByManagedInstanceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedInstanceDtcsClientListByManagedInstanceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedInstanceDtcsClientListByManagedInstanceResponse{}, runtime.NewResponseError(resp) + } + return client.listByManagedInstanceHandleResponse(resp) + }, + }) +} + +// listByManagedInstanceCreateRequest creates the ListByManagedInstance request. +func (client *ManagedInstanceDtcsClient) listByManagedInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstanceDtcsClientListByManagedInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dtc" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByManagedInstanceHandleResponse handles the ListByManagedInstance response. +func (client *ManagedInstanceDtcsClient) listByManagedInstanceHandleResponse(resp *http.Response) (ManagedInstanceDtcsClientListByManagedInstanceResponse, error) { + result := ManagedInstanceDtcsClientListByManagedInstanceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedInstanceDtcListResult); err != nil { + return ManagedInstanceDtcsClientListByManagedInstanceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceencryptionprotectors_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceencryptionprotectors_client.go rename to sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_client.go index 98a7b9a2eb69..cf287cd0be53 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceencryptionprotectors_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceencryptionprotectors_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 armsql @@ -31,9 +32,9 @@ type ManagedInstanceEncryptionProtectorsClient struct { } // NewManagedInstanceEncryptionProtectorsClient creates a new instance of ManagedInstanceEncryptionProtectorsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedInstanceEncryptionProtectorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstanceEncryptionProtectorsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewManagedInstanceEncryptionProtectorsClient(subscriptionID string, credent // BeginCreateOrUpdate - Updates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// encryptionProtectorName - The name of the encryption protector to be updated. -// parameters - The requested encryption protector resource state. -// options - ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the -// ManagedInstanceEncryptionProtectorsClient.BeginCreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - encryptionProtectorName - The name of the encryption protector to be updated. +// - parameters - The requested encryption protector resource state. +// - options - ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions contains the optional parameters for the +// ManagedInstanceEncryptionProtectorsClient.BeginCreateOrUpdate method. func (client *ManagedInstanceEncryptionProtectorsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, encryptionProtectorName EncryptionProtectorName, parameters ManagedInstanceEncryptionProtector, options *ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, encryptionProtectorName, parameters, options) @@ -78,7 +80,8 @@ func (client *ManagedInstanceEncryptionProtectorsClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - Updates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstanceEncryptionProtectorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, encryptionProtectorName EncryptionProtectorName, parameters ManagedInstanceEncryptionProtector, options *ManagedInstanceEncryptionProtectorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, encryptionProtectorName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *ManagedInstanceEncryptionProtectorsClient) createOrUpdateCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *ManagedInstanceEncryptionProtectorsClient) createOrUpdateCreateReq // Get - Gets a managed instance encryption protector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// encryptionProtectorName - The name of the encryption protector to be retrieved. -// options - ManagedInstanceEncryptionProtectorsClientGetOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - encryptionProtectorName - The name of the encryption protector to be retrieved. +// - options - ManagedInstanceEncryptionProtectorsClientGetOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.Get +// method. func (client *ManagedInstanceEncryptionProtectorsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, encryptionProtectorName EncryptionProtectorName, options *ManagedInstanceEncryptionProtectorsClientGetOptions) (ManagedInstanceEncryptionProtectorsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, encryptionProtectorName, options) if err != nil { @@ -172,7 +176,7 @@ func (client *ManagedInstanceEncryptionProtectorsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,13 +192,13 @@ func (client *ManagedInstanceEncryptionProtectorsClient) getHandleResponse(resp } // NewListByInstancePager - Gets a list of managed instance encryption protectors -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstanceEncryptionProtectorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstanceEncryptionProtectorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.NewListByInstancePager +// method. func (client *ManagedInstanceEncryptionProtectorsClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstanceEncryptionProtectorsClientListByInstanceOptions) *runtime.Pager[ManagedInstanceEncryptionProtectorsClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstanceEncryptionProtectorsClientListByInstanceResponse]{ More: func(page ManagedInstanceEncryptionProtectorsClientListByInstanceResponse) bool { @@ -243,7 +247,7 @@ func (client *ManagedInstanceEncryptionProtectorsClient) listByInstanceCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,13 +264,14 @@ func (client *ManagedInstanceEncryptionProtectorsClient) listByInstanceHandleRes // BeginRevalidate - Revalidates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// encryptionProtectorName - The name of the encryption protector to be updated. -// options - ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.BeginRevalidate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - encryptionProtectorName - The name of the encryption protector to be updated. +// - options - ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.BeginRevalidate +// method. func (client *ManagedInstanceEncryptionProtectorsClient) BeginRevalidate(ctx context.Context, resourceGroupName string, managedInstanceName string, encryptionProtectorName EncryptionProtectorName, options *ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions) (*runtime.Poller[ManagedInstanceEncryptionProtectorsClientRevalidateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.revalidate(ctx, resourceGroupName, managedInstanceName, encryptionProtectorName, options) @@ -281,7 +286,8 @@ func (client *ManagedInstanceEncryptionProtectorsClient) BeginRevalidate(ctx con // Revalidate - Revalidates an existing encryption protector. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstanceEncryptionProtectorsClient) revalidate(ctx context.Context, resourceGroupName string, managedInstanceName string, encryptionProtectorName EncryptionProtectorName, options *ManagedInstanceEncryptionProtectorsClientBeginRevalidateOptions) (*http.Response, error) { req, err := client.revalidateCreateRequest(ctx, resourceGroupName, managedInstanceName, encryptionProtectorName, options) if err != nil { @@ -321,7 +327,7 @@ func (client *ManagedInstanceEncryptionProtectorsClient) revalidateCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancekeys_client.go b/sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstancekeys_client.go rename to sdk/resourcemanager/sql/armsql/managedinstancekeys_client.go index 8acf714bfc7c..73b726360619 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancekeys_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancekeys_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 armsql @@ -31,9 +32,9 @@ type ManagedInstanceKeysClient struct { } // NewManagedInstanceKeysClient creates a new instance of ManagedInstanceKeysClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedInstanceKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstanceKeysClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewManagedInstanceKeysClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates a managed instance key. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// keyName - The name of the managed instance key to be operated on (updated or created). -// parameters - The requested managed instance key resource state. -// options - ManagedInstanceKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceKeysClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - keyName - The name of the managed instance key to be operated on (updated or created). +// - parameters - The requested managed instance key resource state. +// - options - ManagedInstanceKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceKeysClient.BeginCreateOrUpdate +// method. func (client *ManagedInstanceKeysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, parameters ManagedInstanceKey, options *ManagedInstanceKeysClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceKeysClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, keyName, parameters, options) @@ -78,7 +80,8 @@ func (client *ManagedInstanceKeysClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates a managed instance key. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstanceKeysClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, parameters ManagedInstanceKey, options *ManagedInstanceKeysClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, keyName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *ManagedInstanceKeysClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *ManagedInstanceKeysClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes the managed instance key with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// keyName - The name of the managed instance key to be deleted. -// options - ManagedInstanceKeysClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceKeysClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - keyName - The name of the managed instance key to be deleted. +// - options - ManagedInstanceKeysClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceKeysClient.BeginDelete +// method. func (client *ManagedInstanceKeysClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, options *ManagedInstanceKeysClientBeginDeleteOptions) (*runtime.Poller[ManagedInstanceKeysClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, managedInstanceName, keyName, options) @@ -147,7 +151,8 @@ func (client *ManagedInstanceKeysClient) BeginDelete(ctx context.Context, resour // Delete - Deletes the managed instance key with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstanceKeysClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, options *ManagedInstanceKeysClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, keyName, options) if err != nil { @@ -187,19 +192,20 @@ func (client *ManagedInstanceKeysClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a managed instance key. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// keyName - The name of the managed instance key to be retrieved. -// options - ManagedInstanceKeysClientGetOptions contains the optional parameters for the ManagedInstanceKeysClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - keyName - The name of the managed instance key to be retrieved. +// - options - ManagedInstanceKeysClientGetOptions contains the optional parameters for the ManagedInstanceKeysClient.Get method. func (client *ManagedInstanceKeysClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, keyName string, options *ManagedInstanceKeysClientGetOptions) (ManagedInstanceKeysClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, keyName, options) if err != nil { @@ -239,7 +245,7 @@ func (client *ManagedInstanceKeysClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,13 +261,13 @@ func (client *ManagedInstanceKeysClient) getHandleResponse(resp *http.Response) } // NewListByInstancePager - Gets a list of managed instance keys. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstanceKeysClientListByInstanceOptions contains the optional parameters for the ManagedInstanceKeysClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstanceKeysClientListByInstanceOptions contains the optional parameters for the ManagedInstanceKeysClient.NewListByInstancePager +// method. func (client *ManagedInstanceKeysClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstanceKeysClientListByInstanceOptions) *runtime.Pager[ManagedInstanceKeysClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstanceKeysClientListByInstanceResponse]{ More: func(page ManagedInstanceKeysClientListByInstanceResponse) bool { @@ -313,7 +319,7 @@ func (client *ManagedInstanceKeysClient) listByInstanceCreateRequest(ctx context if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancelongtermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client.go similarity index 66% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstancelongtermretentionpolicies_client.go rename to sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_client.go index edb5734dde03..3684de383ed0 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancelongtermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancelongtermretentionpolicies_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 armsql @@ -31,9 +32,9 @@ type ManagedInstanceLongTermRetentionPoliciesClient struct { } // NewManagedInstanceLongTermRetentionPoliciesClient creates a new instance of ManagedInstanceLongTermRetentionPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedInstanceLongTermRetentionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstanceLongTermRetentionPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewManagedInstanceLongTermRetentionPoliciesClient(subscriptionID string, cr // BeginCreateOrUpdate - Sets a managed database's long term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// policyName - The policy name. Should always be Default. -// parameters - The long term retention policy info. -// options - ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for -// the ManagedInstanceLongTermRetentionPoliciesClient.BeginCreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - policyName - The policy name. Should always be Default. +// - parameters - The long term retention policy info. +// - options - ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for +// the ManagedInstanceLongTermRetentionPoliciesClient.BeginCreateOrUpdate method. func (client *ManagedInstanceLongTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedInstanceLongTermRetentionPolicyName, parameters ManagedInstanceLongTermRetentionPolicy, options *ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, parameters, options) @@ -79,7 +81,8 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) BeginCreateOrUpdat // CreateOrUpdate - Sets a managed database's long term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstanceLongTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedInstanceLongTermRetentionPolicyName, parameters ManagedInstanceLongTermRetentionPolicy, options *ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, parameters, options) if err != nil { @@ -123,22 +126,99 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) createOrUpdateCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } +// BeginDelete - Deletes a managed database's long term retention policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - policyName - The policy name. Should always be Default. +// - options - ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.BeginDelete +// method. +func (client *ManagedInstanceLongTermRetentionPoliciesClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedInstanceLongTermRetentionPolicyName, options *ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions) (*runtime.Poller[ManagedInstanceLongTermRetentionPoliciesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedInstanceLongTermRetentionPoliciesClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedInstanceLongTermRetentionPoliciesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes a managed database's long term retention policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedInstanceLongTermRetentionPoliciesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedInstanceLongTermRetentionPolicyName, options *ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ManagedInstanceLongTermRetentionPoliciesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedInstanceLongTermRetentionPolicyName, options *ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/backupLongTermRetentionPolicies/{policyName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if policyName == "" { + return nil, errors.New("parameter policyName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyName}", url.PathEscape(string(policyName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // Get - Gets a managed database's long term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// policyName - The policy name. Should always be Default. -// options - ManagedInstanceLongTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - policyName - The policy name. Should always be Default. +// - options - ManagedInstanceLongTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.Get +// method. func (client *ManagedInstanceLongTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, policyName ManagedInstanceLongTermRetentionPolicyName, options *ManagedInstanceLongTermRetentionPoliciesClientGetOptions) (ManagedInstanceLongTermRetentionPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, policyName, options) if err != nil { @@ -182,7 +262,7 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) getCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -198,14 +278,14 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) getHandleResponse( } // NewListByDatabasePager - Gets a database's long term retention policy. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// databaseName - The name of the database. -// options - ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the -// ManagedInstanceLongTermRetentionPoliciesClient.ListByDatabase method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the +// ManagedInstanceLongTermRetentionPoliciesClient.NewListByDatabasePager method. func (client *ManagedInstanceLongTermRetentionPoliciesClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions) *runtime.Pager[ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResponse]{ More: func(page ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResponse) bool { @@ -258,7 +338,7 @@ func (client *ManagedInstanceLongTermRetentionPoliciesClient) listByDatabaseCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceoperations_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceoperations_client.go rename to sdk/resourcemanager/sql/armsql/managedinstanceoperations_client.go index ddb86da1973a..e715b117a3b4 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceoperations_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceoperations_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 armsql @@ -31,9 +32,9 @@ type ManagedInstanceOperationsClient struct { } // NewManagedInstanceOperationsClient creates a new instance of ManagedInstanceOperationsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedInstanceOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstanceOperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewManagedInstanceOperationsClient(subscriptionID string, credential azcore // Cancel - Cancels the asynchronous operation on the managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstanceOperationsClientCancelOptions contains the optional parameters for the ManagedInstanceOperationsClient.Cancel -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstanceOperationsClientCancelOptions contains the optional parameters for the ManagedInstanceOperationsClient.Cancel +// method. func (client *ManagedInstanceOperationsClient) Cancel(ctx context.Context, resourceGroupName string, managedInstanceName string, operationID string, options *ManagedInstanceOperationsClientCancelOptions) (ManagedInstanceOperationsClientCancelResponse, error) { req, err := client.cancelCreateRequest(ctx, resourceGroupName, managedInstanceName, operationID, options) if err != nil { @@ -98,19 +100,20 @@ func (client *ManagedInstanceOperationsClient) cancelCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a management operation on a managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstanceOperationsClientGetOptions contains the optional parameters for the ManagedInstanceOperationsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstanceOperationsClientGetOptions contains the optional parameters for the ManagedInstanceOperationsClient.Get +// method. func (client *ManagedInstanceOperationsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, operationID string, options *ManagedInstanceOperationsClientGetOptions) (ManagedInstanceOperationsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, operationID, options) if err != nil { @@ -147,7 +150,7 @@ func (client *ManagedInstanceOperationsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -163,13 +166,13 @@ func (client *ManagedInstanceOperationsClient) getHandleResponse(resp *http.Resp } // NewListByManagedInstancePager - Gets a list of operations performed on the managed instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstanceOperationsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstanceOperationsClient.ListByManagedInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstanceOperationsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstanceOperationsClient.NewListByManagedInstancePager +// method. func (client *ManagedInstanceOperationsClient) NewListByManagedInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstanceOperationsClientListByManagedInstanceOptions) *runtime.Pager[ManagedInstanceOperationsClientListByManagedInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstanceOperationsClientListByManagedInstanceResponse]{ More: func(page ManagedInstanceOperationsClientListByManagedInstanceResponse) bool { @@ -218,7 +221,7 @@ func (client *ManagedInstanceOperationsClient) listByManagedInstanceCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceprivateendpointconnections_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceprivateendpointconnections_client.go rename to sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_client.go index de59cfb5a929..8652276fbf39 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceprivateendpointconnections_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceprivateendpointconnections_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 armsql @@ -31,9 +32,9 @@ type ManagedInstancePrivateEndpointConnectionsClient struct { } // NewManagedInstancePrivateEndpointConnectionsClient creates a new instance of ManagedInstancePrivateEndpointConnectionsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedInstancePrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstancePrivateEndpointConnectionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewManagedInstancePrivateEndpointConnectionsClient(subscriptionID string, c // BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for -// the ManagedInstancePrivateEndpointConnectionsClient.BeginCreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for +// the ManagedInstancePrivateEndpointConnectionsClient.BeginCreateOrUpdate method. func (client *ManagedInstancePrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, privateEndpointConnectionName string, parameters ManagedInstancePrivateEndpointConnection, options *ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, privateEndpointConnectionName, parameters, options) @@ -76,7 +78,8 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) BeginCreateOrUpda // CreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstancePrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, privateEndpointConnectionName string, parameters ManagedInstancePrivateEndpointConnection, options *ManagedInstancePrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, privateEndpointConnectionName, parameters, options) if err != nil { @@ -116,7 +119,7 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) createOrUpdateCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -124,12 +127,13 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) createOrUpdateCre // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.BeginDelete +// method. func (client *ManagedInstancePrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, privateEndpointConnectionName string, options *ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[ManagedInstancePrivateEndpointConnectionsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, managedInstanceName, privateEndpointConnectionName, options) @@ -144,7 +148,8 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) BeginDelete(ctx c // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstancePrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, privateEndpointConnectionName string, options *ManagedInstancePrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, privateEndpointConnectionName, options) if err != nil { @@ -184,20 +189,21 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) deleteCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// privateEndpointConnectionName - The name of the private endpoint connection. -// options - ManagedInstancePrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - privateEndpointConnectionName - The name of the private endpoint connection. +// - options - ManagedInstancePrivateEndpointConnectionsClientGetOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.Get +// method. func (client *ManagedInstancePrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, privateEndpointConnectionName string, options *ManagedInstancePrivateEndpointConnectionsClientGetOptions) (ManagedInstancePrivateEndpointConnectionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, privateEndpointConnectionName, options) if err != nil { @@ -237,7 +243,7 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) getCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,13 +259,13 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) getHandleResponse } // NewListByManagedInstancePager - Gets all private endpoint connections on a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions contains the optional parameters -// for the ManagedInstancePrivateEndpointConnectionsClient.ListByManagedInstance method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions contains the optional parameters +// for the ManagedInstancePrivateEndpointConnectionsClient.NewListByManagedInstancePager method. func (client *ManagedInstancePrivateEndpointConnectionsClient) NewListByManagedInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions) *runtime.Pager[ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResponse]{ More: func(page ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResponse) bool { @@ -308,7 +314,7 @@ func (client *ManagedInstancePrivateEndpointConnectionsClient) listByManagedInst return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceprivatelinkresources_client.go b/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceprivatelinkresources_client.go rename to sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_client.go index 90df751d8f5f..2519d1b67bb2 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstanceprivatelinkresources_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstanceprivatelinkresources_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 armsql @@ -31,9 +32,9 @@ type ManagedInstancePrivateLinkResourcesClient struct { } // NewManagedInstancePrivateLinkResourcesClient creates a new instance of ManagedInstancePrivateLinkResourcesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedInstancePrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstancePrivateLinkResourcesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewManagedInstancePrivateLinkResourcesClient(subscriptionID string, credent // Get - Gets a private link resource for SQL server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// groupName - The name of the private link resource. -// options - ManagedInstancePrivateLinkResourcesClientGetOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - groupName - The name of the private link resource. +// - options - ManagedInstancePrivateLinkResourcesClientGetOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.Get +// method. func (client *ManagedInstancePrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, groupName string, options *ManagedInstancePrivateLinkResourcesClientGetOptions) (ManagedInstancePrivateLinkResourcesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, groupName, options) if err != nil { @@ -102,7 +104,7 @@ func (client *ManagedInstancePrivateLinkResourcesClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,13 +120,13 @@ func (client *ManagedInstancePrivateLinkResourcesClient) getHandleResponse(resp } // NewListByManagedInstancePager - Gets the private link resources for SQL server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions contains the optional parameters for the -// ManagedInstancePrivateLinkResourcesClient.ListByManagedInstance method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions contains the optional parameters for the +// ManagedInstancePrivateLinkResourcesClient.NewListByManagedInstancePager method. func (client *ManagedInstancePrivateLinkResourcesClient) NewListByManagedInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions) *runtime.Pager[ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResponse]{ More: func(page ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResponse) bool { @@ -173,7 +175,7 @@ func (client *ManagedInstancePrivateLinkResourcesClient) listByManagedInstanceCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstances_client.go b/sdk/resourcemanager/sql/armsql/managedinstances_client.go similarity index 65% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstances_client.go rename to sdk/resourcemanager/sql/armsql/managedinstances_client.go index e5d6e50b092e..7d08d528c421 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstances_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstances_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 armsql @@ -32,9 +33,9 @@ type ManagedInstancesClient struct { } // NewManagedInstancesClient creates a new instance of ManagedInstancesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstancesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +58,14 @@ func NewManagedInstancesClient(subscriptionID string, credential azcore.TokenCre // BeginCreateOrUpdate - Creates or updates a managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// parameters - The requested managed instance resource state. -// options - ManagedInstancesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - parameters - The requested managed instance resource state. +// - options - ManagedInstancesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginCreateOrUpdate +// method. func (client *ManagedInstancesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstance, options *ManagedInstancesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedInstancesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, parameters, options) @@ -78,7 +80,8 @@ func (client *ManagedInstancesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates or updates a managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstance, options *ManagedInstancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, parameters, options) if err != nil { @@ -114,7 +117,7 @@ func (client *ManagedInstancesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,12 +125,13 @@ func (client *ManagedInstancesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes a managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstancesClientBeginDeleteOptions contains the optional parameters for the ManagedInstancesClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstancesClientBeginDeleteOptions contains the optional parameters for the ManagedInstancesClient.BeginDelete +// method. func (client *ManagedInstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginDeleteOptions) (*runtime.Poller[ManagedInstancesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, managedInstanceName, options) @@ -142,7 +146,8 @@ func (client *ManagedInstancesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes a managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, options) if err != nil { @@ -178,19 +183,20 @@ func (client *ManagedInstancesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginFailover - Failovers a managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance to failover. -// options - ManagedInstancesClientBeginFailoverOptions contains the optional parameters for the ManagedInstancesClient.BeginFailover -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance to failover. +// - options - ManagedInstancesClientBeginFailoverOptions contains the optional parameters for the ManagedInstancesClient.BeginFailover +// method. func (client *ManagedInstancesClient) BeginFailover(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginFailoverOptions) (*runtime.Poller[ManagedInstancesClientFailoverResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.failover(ctx, resourceGroupName, managedInstanceName, options) @@ -205,7 +211,8 @@ func (client *ManagedInstancesClient) BeginFailover(ctx context.Context, resourc // Failover - Failovers a managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstancesClient) failover(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginFailoverOptions) (*http.Response, error) { req, err := client.failoverCreateRequest(ctx, resourceGroupName, managedInstanceName, options) if err != nil { @@ -244,18 +251,19 @@ func (client *ManagedInstancesClient) failoverCreateRequest(ctx context.Context, if options != nil && options.ReplicaType != nil { reqQP.Set("replicaType", string(*options.ReplicaType)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstancesClientGetOptions contains the optional parameters for the ManagedInstancesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstancesClientGetOptions contains the optional parameters for the ManagedInstancesClient.Get method. func (client *ManagedInstancesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientGetOptions) (ManagedInstancesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, options) if err != nil { @@ -294,7 +302,7 @@ func (client *ManagedInstancesClient) getCreateRequest(ctx context.Context, reso if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -310,9 +318,10 @@ func (client *ManagedInstancesClient) getHandleResponse(resp *http.Response) (Ma } // NewListPager - Gets a list of all managed instances in the subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// options - ManagedInstancesClientListOptions contains the optional parameters for the ManagedInstancesClient.List method. +// +// Generated from API version 2022-11-01-preview +// - options - ManagedInstancesClientListOptions contains the optional parameters for the ManagedInstancesClient.NewListPager +// method. func (client *ManagedInstancesClient) NewListPager(options *ManagedInstancesClientListOptions) *runtime.Pager[ManagedInstancesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstancesClientListResponse]{ More: func(page ManagedInstancesClientListResponse) bool { @@ -356,7 +365,7 @@ func (client *ManagedInstancesClient) listCreateRequest(ctx context.Context, opt if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -372,13 +381,13 @@ func (client *ManagedInstancesClient) listHandleResponse(resp *http.Response) (M } // NewListByInstancePoolPager - Gets a list of all managed instances in an instance pool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// instancePoolName - The instance pool name. -// options - ManagedInstancesClientListByInstancePoolOptions contains the optional parameters for the ManagedInstancesClient.ListByInstancePool -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - instancePoolName - The instance pool name. +// - options - ManagedInstancesClientListByInstancePoolOptions contains the optional parameters for the ManagedInstancesClient.NewListByInstancePoolPager +// method. func (client *ManagedInstancesClient) NewListByInstancePoolPager(resourceGroupName string, instancePoolName string, options *ManagedInstancesClientListByInstancePoolOptions) *runtime.Pager[ManagedInstancesClientListByInstancePoolResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstancesClientListByInstancePoolResponse]{ More: func(page ManagedInstancesClientListByInstancePoolResponse) bool { @@ -430,7 +439,7 @@ func (client *ManagedInstancesClient) listByInstancePoolCreateRequest(ctx contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -446,13 +455,13 @@ func (client *ManagedInstancesClient) listByInstancePoolHandleResponse(resp *htt } // NewListByManagedInstancePager - Get top resource consuming queries of a managed instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedInstancesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancesClient.ListByManagedInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstancesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancesClient.NewListByManagedInstancePager +// method. func (client *ManagedInstancesClient) NewListByManagedInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientListByManagedInstanceOptions) *runtime.Pager[ManagedInstancesClientListByManagedInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstancesClientListByManagedInstanceResponse]{ More: func(page ManagedInstancesClientListByManagedInstanceResponse) bool { @@ -522,7 +531,7 @@ func (client *ManagedInstancesClient) listByManagedInstanceCreateRequest(ctx con if options != nil && options.ObservationMetric != nil { reqQP.Set("observationMetric", string(*options.ObservationMetric)) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -538,12 +547,12 @@ func (client *ManagedInstancesClient) listByManagedInstanceHandleResponse(resp * } // NewListByResourceGroupPager - Gets a list of managed instances in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// options - ManagedInstancesClientListByResourceGroupOptions contains the optional parameters for the ManagedInstancesClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - options - ManagedInstancesClientListByResourceGroupOptions contains the optional parameters for the ManagedInstancesClient.NewListByResourceGroupPager +// method. func (client *ManagedInstancesClient) NewListByResourceGroupPager(resourceGroupName string, options *ManagedInstancesClientListByResourceGroupOptions) *runtime.Pager[ManagedInstancesClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstancesClientListByResourceGroupResponse]{ More: func(page ManagedInstancesClientListByResourceGroupResponse) bool { @@ -591,7 +600,7 @@ func (client *ManagedInstancesClient) listByResourceGroupCreateRequest(ctx conte if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -606,15 +615,222 @@ func (client *ManagedInstancesClient) listByResourceGroupHandleResponse(resp *ht return result, nil } +// NewListOutboundNetworkDependenciesByManagedInstancePager - Gets the collection of outbound network dependencies for the +// given managed instance. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions contains the optional parameters +// for the ManagedInstancesClient.NewListOutboundNetworkDependenciesByManagedInstancePager method. +func (client *ManagedInstancesClient) NewListOutboundNetworkDependenciesByManagedInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions) *runtime.Pager[ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse]{ + More: func(page ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse) (ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listOutboundNetworkDependenciesByManagedInstanceCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse{}, runtime.NewResponseError(resp) + } + return client.listOutboundNetworkDependenciesByManagedInstanceHandleResponse(resp) + }, + }) +} + +// listOutboundNetworkDependenciesByManagedInstanceCreateRequest creates the ListOutboundNetworkDependenciesByManagedInstance request. +func (client *ManagedInstancesClient) listOutboundNetworkDependenciesByManagedInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/outboundNetworkDependenciesEndpoints" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listOutboundNetworkDependenciesByManagedInstanceHandleResponse handles the ListOutboundNetworkDependenciesByManagedInstance response. +func (client *ManagedInstancesClient) listOutboundNetworkDependenciesByManagedInstanceHandleResponse(resp *http.Response) (ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse, error) { + result := ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.OutboundEnvironmentEndpointCollection); err != nil { + return ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse{}, err + } + return result, nil +} + +// BeginStart - Starts the managed instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstancesClientBeginStartOptions contains the optional parameters for the ManagedInstancesClient.BeginStart +// method. +func (client *ManagedInstancesClient) BeginStart(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStartOptions) (*runtime.Poller[ManagedInstancesClientStartResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.start(ctx, resourceGroupName, managedInstanceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ManagedInstancesClientStartResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ManagedInstancesClientStartResponse](options.ResumeToken, client.pl, nil) + } +} + +// Start - Starts the managed instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedInstancesClient) start(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStartOptions) (*http.Response, error) { + req, err := client.startCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// startCreateRequest creates the Start request. +func (client *ManagedInstancesClient) startCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStartOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/start" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// BeginStop - Stops the managed instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedInstancesClientBeginStopOptions contains the optional parameters for the ManagedInstancesClient.BeginStop +// method. +func (client *ManagedInstancesClient) BeginStop(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStopOptions) (*runtime.Poller[ManagedInstancesClientStopResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.stop(ctx, resourceGroupName, managedInstanceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ManagedInstancesClientStopResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ManagedInstancesClientStopResponse](options.ResumeToken, client.pl, nil) + } +} + +// Stop - Stops the managed instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedInstancesClient) stop(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStopOptions) (*http.Response, error) { + req, err := client.stopCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// stopCreateRequest creates the Stop request. +func (client *ManagedInstancesClient) stopCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedInstancesClientBeginStopOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/stop" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + // BeginUpdate - Updates a managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// parameters - The requested managed instance resource state. -// options - ManagedInstancesClientBeginUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - parameters - The requested managed instance resource state. +// - options - ManagedInstancesClientBeginUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginUpdate +// method. func (client *ManagedInstancesClient) BeginUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceUpdate, options *ManagedInstancesClientBeginUpdateOptions) (*runtime.Poller[ManagedInstancesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, managedInstanceName, parameters, options) @@ -629,7 +845,8 @@ func (client *ManagedInstancesClient) BeginUpdate(ctx context.Context, resourceG // Update - Updates a managed instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstancesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters ManagedInstanceUpdate, options *ManagedInstancesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, parameters, options) if err != nil { @@ -665,7 +882,7 @@ func (client *ManagedInstancesClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancetdecertificates_client.go b/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstancetdecertificates_client.go rename to sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_client.go index 9f3162f1d405..d01ad2507b4f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancetdecertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancetdecertificates_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 armsql @@ -31,9 +32,9 @@ type ManagedInstanceTdeCertificatesClient struct { } // NewManagedInstanceTdeCertificatesClient creates a new instance of ManagedInstanceTdeCertificatesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedInstanceTdeCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstanceTdeCertificatesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewManagedInstanceTdeCertificatesClient(subscriptionID string, credential a // BeginCreate - Creates a TDE certificate for a given server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// parameters - The requested TDE certificate to be created or updated. -// options - ManagedInstanceTdeCertificatesClientBeginCreateOptions contains the optional parameters for the ManagedInstanceTdeCertificatesClient.BeginCreate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - parameters - The requested TDE certificate to be created or updated. +// - options - ManagedInstanceTdeCertificatesClientBeginCreateOptions contains the optional parameters for the ManagedInstanceTdeCertificatesClient.BeginCreate +// method. func (client *ManagedInstanceTdeCertificatesClient) BeginCreate(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters TdeCertificate, options *ManagedInstanceTdeCertificatesClientBeginCreateOptions) (*runtime.Poller[ManagedInstanceTdeCertificatesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, managedInstanceName, parameters, options) @@ -77,7 +79,8 @@ func (client *ManagedInstanceTdeCertificatesClient) BeginCreate(ctx context.Cont // Create - Creates a TDE certificate for a given server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedInstanceTdeCertificatesClient) create(ctx context.Context, resourceGroupName string, managedInstanceName string, parameters TdeCertificate, options *ManagedInstanceTdeCertificatesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, managedInstanceName, parameters, options) if err != nil { @@ -113,7 +116,7 @@ func (client *ManagedInstanceTdeCertificatesClient) createCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, parameters) } diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancevulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedinstancevulnerabilityassessments_client.go rename to sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_client.go index bcfa2e4e93dc..e84ffc399893 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedinstancevulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/managedinstancevulnerabilityassessments_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 armsql @@ -31,9 +32,9 @@ type ManagedInstanceVulnerabilityAssessmentsClient struct { } // NewManagedInstanceVulnerabilityAssessmentsClient creates a new instance of ManagedInstanceVulnerabilityAssessmentsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedInstanceVulnerabilityAssessmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedInstanceVulnerabilityAssessmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +59,15 @@ func NewManagedInstanceVulnerabilityAssessmentsClient(subscriptionID string, cre // assessment with managed identity - // https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance for which the vulnerability assessment is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// parameters - The requested resource. -// options - ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance for which the vulnerability assessment is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - parameters - The requested resource. +// - options - ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.CreateOrUpdate +// method. func (client *ManagedInstanceVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, parameters ManagedInstanceVulnerabilityAssessment, options *ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateOptions) (ManagedInstanceVulnerabilityAssessmentsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, vulnerabilityAssessmentName, parameters, options) if err != nil { @@ -105,7 +107,7 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) createOrUpdateCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,13 +124,14 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) createOrUpdateHandl // Delete - Removes the managed instance's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance for which the vulnerability assessment is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// options - ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance for which the vulnerability assessment is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Delete +// method. func (client *ManagedInstanceVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ManagedInstanceVulnerabilityAssessmentsClientDeleteOptions) (ManagedInstanceVulnerabilityAssessmentsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, vulnerabilityAssessmentName, options) if err != nil { @@ -168,20 +171,21 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) deleteCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets the managed instance's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance for which the vulnerability assessment is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// options - ManagedInstanceVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance for which the vulnerability assessment is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - ManagedInstanceVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.Get +// method. func (client *ManagedInstanceVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ManagedInstanceVulnerabilityAssessmentsClientGetOptions) (ManagedInstanceVulnerabilityAssessmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, vulnerabilityAssessmentName, options) if err != nil { @@ -221,7 +225,7 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) getCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,13 +241,13 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) getHandleResponse(r } // NewListByInstancePager - Gets the managed instance's vulnerability assessment policies. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance for which the vulnerability assessments is defined. -// options - ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance for which the vulnerability assessments is defined. +// - options - ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.NewListByInstancePager +// method. func (client *ManagedInstanceVulnerabilityAssessmentsClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions) *runtime.Pager[ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResponse]{ More: func(page ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResponse) bool { @@ -292,7 +296,7 @@ func (client *ManagedInstanceVulnerabilityAssessmentsClient) listByInstanceCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client.go b/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client.go new file mode 100644 index 000000000000..0226589a7236 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedledgerdigestuploads_client.go @@ -0,0 +1,352 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedLedgerDigestUploadsClient contains the methods for the ManagedLedgerDigestUploads group. +// Don't use this type directly, use NewManagedLedgerDigestUploadsClient() instead. +type ManagedLedgerDigestUploadsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedLedgerDigestUploadsClient creates a new instance of ManagedLedgerDigestUploadsClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagedLedgerDigestUploadsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedLedgerDigestUploadsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedLedgerDigestUploadsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - ledgerDigestUploads - The name of the Ledger Digest Upload Configurations. +// - parameters - The Ledger Digest Storage Endpoint. +// - options - ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.BeginCreateOrUpdate +// method. +func (client *ManagedLedgerDigestUploadsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, parameters ManagedLedgerDigestUploads, options *ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedLedgerDigestUploadsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, databaseName, ledgerDigestUploads, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedLedgerDigestUploadsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedLedgerDigestUploadsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Enables upload ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedLedgerDigestUploadsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, parameters ManagedLedgerDigestUploads, options *ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, ledgerDigestUploads, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedLedgerDigestUploadsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, parameters ManagedLedgerDigestUploads, options *ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if ledgerDigestUploads == "" { + return nil, errors.New("parameter ledgerDigestUploads cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ledgerDigestUploads}", url.PathEscape(string(ledgerDigestUploads))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDisable - Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedLedgerDigestUploadsClientBeginDisableOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.BeginDisable +// method. +func (client *ManagedLedgerDigestUploadsClient) BeginDisable(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, options *ManagedLedgerDigestUploadsClientBeginDisableOptions) (*runtime.Poller[ManagedLedgerDigestUploadsClientDisableResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.disable(ctx, resourceGroupName, managedInstanceName, databaseName, ledgerDigestUploads, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedLedgerDigestUploadsClientDisableResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedLedgerDigestUploadsClientDisableResponse](options.ResumeToken, client.pl, nil) + } +} + +// Disable - Disables uploading ledger digests to an Azure Storage account or an Azure Confidential Ledger instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedLedgerDigestUploadsClient) disable(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, options *ManagedLedgerDigestUploadsClientBeginDisableOptions) (*http.Response, error) { + req, err := client.disableCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, ledgerDigestUploads, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// disableCreateRequest creates the Disable request. +func (client *ManagedLedgerDigestUploadsClient) disableCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, options *ManagedLedgerDigestUploadsClientBeginDisableOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}/disable" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if ledgerDigestUploads == "" { + return nil, errors.New("parameter ledgerDigestUploads cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ledgerDigestUploads}", url.PathEscape(string(ledgerDigestUploads))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the current ledger digest upload configuration for a database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedLedgerDigestUploadsClientGetOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.Get +// method. +func (client *ManagedLedgerDigestUploadsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, options *ManagedLedgerDigestUploadsClientGetOptions) (ManagedLedgerDigestUploadsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, ledgerDigestUploads, options) + if err != nil { + return ManagedLedgerDigestUploadsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedLedgerDigestUploadsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedLedgerDigestUploadsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedLedgerDigestUploadsClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, ledgerDigestUploads ManagedLedgerDigestUploadsName, options *ManagedLedgerDigestUploadsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads/{ledgerDigestUploads}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if ledgerDigestUploads == "" { + return nil, errors.New("parameter ledgerDigestUploads cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ledgerDigestUploads}", url.PathEscape(string(ledgerDigestUploads))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedLedgerDigestUploadsClient) getHandleResponse(resp *http.Response) (ManagedLedgerDigestUploadsClientGetResponse, error) { + result := ManagedLedgerDigestUploadsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedLedgerDigestUploads); err != nil { + return ManagedLedgerDigestUploadsClientGetResponse{}, err + } + return result, nil +} + +// NewListByDatabasePager - Gets all ledger digest upload settings on a database. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - databaseName - The name of the database. +// - options - ManagedLedgerDigestUploadsClientListByDatabaseOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.NewListByDatabasePager +// method. +func (client *ManagedLedgerDigestUploadsClient) NewListByDatabasePager(resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedLedgerDigestUploadsClientListByDatabaseOptions) *runtime.Pager[ManagedLedgerDigestUploadsClientListByDatabaseResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedLedgerDigestUploadsClientListByDatabaseResponse]{ + More: func(page ManagedLedgerDigestUploadsClientListByDatabaseResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedLedgerDigestUploadsClientListByDatabaseResponse) (ManagedLedgerDigestUploadsClientListByDatabaseResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, managedInstanceName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedLedgerDigestUploadsClientListByDatabaseResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedLedgerDigestUploadsClientListByDatabaseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedLedgerDigestUploadsClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseHandleResponse(resp) + }, + }) +} + +// listByDatabaseCreateRequest creates the ListByDatabase request. +func (client *ManagedLedgerDigestUploadsClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, databaseName string, options *ManagedLedgerDigestUploadsClientListByDatabaseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/databases/{databaseName}/ledgerDigestUploads" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByDatabaseHandleResponse handles the ListByDatabase response. +func (client *ManagedLedgerDigestUploadsClient) listByDatabaseHandleResponse(resp *http.Response) (ManagedLedgerDigestUploadsClientListByDatabaseResponse, error) { + result := ManagedLedgerDigestUploadsClientListByDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedLedgerDigestUploadsListResult); err != nil { + return ManagedLedgerDigestUploadsClientListByDatabaseResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go rename to sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go index 63050781e5a8..5a496651b036 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedrestorabledroppeddatabasebackupshorttermretentionpolicies_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 armsql @@ -31,9 +32,9 @@ type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient stru } // NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient creates a new instance of ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient(s // BeginCreateOrUpdate - Sets a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// policyName - The policy name. Should always be "default". -// parameters - The short term retention policy info. -// options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the -// optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - policyName - The policy name. Should always be "default". +// - parameters - The short term retention policy info. +// - options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the +// optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate +// method. func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, policyName, parameters, options) @@ -79,7 +81,8 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl // CreateOrUpdate - Sets a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, policyName, parameters, options) if err != nil { @@ -123,7 +126,7 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -131,13 +134,14 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl // Get - Gets a dropped database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// policyName - The policy name. -// options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters -// for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - policyName - The policy name. +// - options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters +// for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Get method. func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, policyName ManagedShortTermRetentionPolicyName, options *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions) (ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, policyName, options) if err != nil { @@ -181,7 +185,7 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -197,14 +201,14 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl } // NewListByRestorableDroppedDatabasePager - Gets a dropped database's short term retention policy list. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions -// contains the optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.ListByRestorableDroppedDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions +// contains the optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.NewListByRestorableDroppedDatabasePager +// method. func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) NewListByRestorableDroppedDatabasePager(resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, options *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions) *runtime.Pager[ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResponse]{ More: func(page ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResponse) bool { @@ -257,7 +261,7 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -274,14 +278,15 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl // BeginUpdate - Sets a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// policyName - The policy name. Should always be "default". -// parameters - The short term retention policy info. -// options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional -// parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - policyName - The policy name. Should always be "default". +// - parameters - The short term retention policy info. +// - options - ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional +// parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginUpdate method. func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) BeginUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions) (*runtime.Poller[ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, policyName, parameters, options) @@ -296,7 +301,8 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl // Update - Sets a database's short term retention policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient) update(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, policyName ManagedShortTermRetentionPolicyName, parameters ManagedBackupShortTermRetentionPolicy, options *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, policyName, parameters, options) if err != nil { @@ -340,7 +346,7 @@ func (client *ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go b/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go new file mode 100644 index 000000000000..8ff1aa4b22d3 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/managedserverdnsaliases_client.go @@ -0,0 +1,399 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ManagedServerDNSAliasesClient contains the methods for the ManagedServerDNSAliases group. +// Don't use this type directly, use NewManagedServerDNSAliasesClient() instead. +type ManagedServerDNSAliasesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewManagedServerDNSAliasesClient creates a new instance of ManagedServerDNSAliasesClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewManagedServerDNSAliasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedServerDNSAliasesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ManagedServerDNSAliasesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginAcquire - Acquires managed server DNS alias from another managed server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedServerDNSAliasesClientBeginAcquireOptions contains the optional parameters for the ManagedServerDNSAliasesClient.BeginAcquire +// method. +func (client *ManagedServerDNSAliasesClient) BeginAcquire(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasAcquisition, options *ManagedServerDNSAliasesClientBeginAcquireOptions) (*runtime.Poller[ManagedServerDNSAliasesClientAcquireResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.acquire(ctx, resourceGroupName, managedInstanceName, dnsAliasName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedServerDNSAliasesClientAcquireResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedServerDNSAliasesClientAcquireResponse](options.ResumeToken, client.pl, nil) + } +} + +// Acquire - Acquires managed server DNS alias from another managed server. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedServerDNSAliasesClient) acquire(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasAcquisition, options *ManagedServerDNSAliasesClientBeginAcquireOptions) (*http.Response, error) { + req, err := client.acquireCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// acquireCreateRequest creates the Acquire request. +func (client *ManagedServerDNSAliasesClient) acquireCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasAcquisition, options *ManagedServerDNSAliasesClientBeginAcquireOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}/acquire" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if dnsAliasName == "" { + return nil, errors.New("parameter dnsAliasName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dnsAliasName}", url.PathEscape(dnsAliasName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginCreateOrUpdate - Creates a managed server DNS alias. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerDNSAliasesClient.BeginCreateOrUpdate +// method. +func (client *ManagedServerDNSAliasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasCreation, options *ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedServerDNSAliasesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, dnsAliasName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedServerDNSAliasesClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedServerDNSAliasesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Creates a managed server DNS alias. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedServerDNSAliasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasCreation, options *ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ManagedServerDNSAliasesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, parameters ManagedServerDNSAliasCreation, options *ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if dnsAliasName == "" { + return nil, errors.New("parameter dnsAliasName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dnsAliasName}", url.PathEscape(dnsAliasName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// BeginDelete - Deletes the managed server DNS alias with the given name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedServerDNSAliasesClientBeginDeleteOptions contains the optional parameters for the ManagedServerDNSAliasesClient.BeginDelete +// method. +func (client *ManagedServerDNSAliasesClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, options *ManagedServerDNSAliasesClientBeginDeleteOptions) (*runtime.Poller[ManagedServerDNSAliasesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, managedInstanceName, dnsAliasName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ManagedServerDNSAliasesClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ManagedServerDNSAliasesClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Delete - Deletes the managed server DNS alias with the given name. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ManagedServerDNSAliasesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, options *ManagedServerDNSAliasesClientBeginDeleteOptions) (*http.Response, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ManagedServerDNSAliasesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, options *ManagedServerDNSAliasesClientBeginDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if dnsAliasName == "" { + return nil, errors.New("parameter dnsAliasName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dnsAliasName}", url.PathEscape(dnsAliasName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Gets a server DNS alias. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedServerDNSAliasesClientGetOptions contains the optional parameters for the ManagedServerDNSAliasesClient.Get +// method. +func (client *ManagedServerDNSAliasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, options *ManagedServerDNSAliasesClientGetOptions) (ManagedServerDNSAliasesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, dnsAliasName, options) + if err != nil { + return ManagedServerDNSAliasesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedServerDNSAliasesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedServerDNSAliasesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ManagedServerDNSAliasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, dnsAliasName string, options *ManagedServerDNSAliasesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases/{dnsAliasName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if dnsAliasName == "" { + return nil, errors.New("parameter dnsAliasName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{dnsAliasName}", url.PathEscape(dnsAliasName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ManagedServerDNSAliasesClient) getHandleResponse(resp *http.Response) (ManagedServerDNSAliasesClientGetResponse, error) { + result := ManagedServerDNSAliasesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedServerDNSAlias); err != nil { + return ManagedServerDNSAliasesClientGetResponse{}, err + } + return result, nil +} + +// NewListByManagedInstancePager - Gets a list of managed server DNS aliases for a managed server. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedServerDNSAliasesClientListByManagedInstanceOptions contains the optional parameters for the ManagedServerDNSAliasesClient.NewListByManagedInstancePager +// method. +func (client *ManagedServerDNSAliasesClient) NewListByManagedInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedServerDNSAliasesClientListByManagedInstanceOptions) *runtime.Pager[ManagedServerDNSAliasesClientListByManagedInstanceResponse] { + return runtime.NewPager(runtime.PagingHandler[ManagedServerDNSAliasesClientListByManagedInstanceResponse]{ + More: func(page ManagedServerDNSAliasesClientListByManagedInstanceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ManagedServerDNSAliasesClientListByManagedInstanceResponse) (ManagedServerDNSAliasesClientListByManagedInstanceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByManagedInstanceCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ManagedServerDNSAliasesClientListByManagedInstanceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ManagedServerDNSAliasesClientListByManagedInstanceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ManagedServerDNSAliasesClientListByManagedInstanceResponse{}, runtime.NewResponseError(resp) + } + return client.listByManagedInstanceHandleResponse(resp) + }, + }) +} + +// listByManagedInstanceCreateRequest creates the ListByManagedInstance request. +func (client *ManagedServerDNSAliasesClient) listByManagedInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ManagedServerDNSAliasesClientListByManagedInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/dnsAliases" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByManagedInstanceHandleResponse handles the ListByManagedInstance response. +func (client *ManagedServerDNSAliasesClient) listByManagedInstanceHandleResponse(resp *http.Response) (ManagedServerDNSAliasesClientListByManagedInstanceResponse, error) { + result := ManagedServerDNSAliasesClientListByManagedInstanceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ManagedServerDNSAliasListResult); err != nil { + return ManagedServerDNSAliasesClientListByManagedInstanceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_managedserversecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go similarity index 79% rename from sdk/resourcemanager/sql/armsql/zz_generated_managedserversecurityalertpolicies_client.go rename to sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_client.go index 18cdfcfc68b0..20310c8a78cf 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_managedserversecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/managedserversecurityalertpolicies_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 armsql @@ -31,9 +32,9 @@ type ManagedServerSecurityAlertPoliciesClient struct { } // NewManagedServerSecurityAlertPoliciesClient creates a new instance of ManagedServerSecurityAlertPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewManagedServerSecurityAlertPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ManagedServerSecurityAlertPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewManagedServerSecurityAlertPoliciesClient(subscriptionID string, credenti // BeginCreateOrUpdate - Creates or updates a threat detection policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// securityAlertPolicyName - The name of the security alert policy. -// parameters - The managed server security alert policy. -// options - ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate -// method. -func (client *ManagedServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse], error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - securityAlertPolicyName - The name of the security alert policy. +// - parameters - The managed server security alert policy. +// - options - ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate +// method. +func (client *ManagedServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, securityAlertPolicyName, parameters, options) if err != nil { @@ -78,8 +80,9 @@ func (client *ManagedServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx // CreateOrUpdate - Creates or updates a threat detection policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { +// +// Generated from API version 2022-11-01-preview +func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, securityAlertPolicyName, parameters, options) if err != nil { return nil, err @@ -95,7 +98,7 @@ func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdate(ctx conte } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, parameters ManagedServerSecurityAlertPolicy, options *ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -118,7 +121,7 @@ func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdateCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,14 +129,15 @@ func (client *ManagedServerSecurityAlertPoliciesClient) createOrUpdateCreateRequ // Get - Get a managed server's threat detection policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// securityAlertPolicyName - The name of the security alert policy. -// options - ManagedServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.Get -// method. -func (client *ManagedServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyName, options *ManagedServerSecurityAlertPoliciesClientGetOptions) (ManagedServerSecurityAlertPoliciesClientGetResponse, error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - securityAlertPolicyName - The name of the security alert policy. +// - options - ManagedServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.Get +// method. +func (client *ManagedServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, options *ManagedServerSecurityAlertPoliciesClientGetOptions) (ManagedServerSecurityAlertPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, securityAlertPolicyName, options) if err != nil { return ManagedServerSecurityAlertPoliciesClientGetResponse{}, err @@ -149,7 +153,7 @@ func (client *ManagedServerSecurityAlertPoliciesClient) Get(ctx context.Context, } // getCreateRequest creates the Get request. -func (client *ManagedServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyName, options *ManagedServerSecurityAlertPoliciesClientGetOptions) (*policy.Request, error) { +func (client *ManagedServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, options *ManagedServerSecurityAlertPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/securityAlertPolicies/{securityAlertPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -172,7 +176,7 @@ func (client *ManagedServerSecurityAlertPoliciesClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,13 +192,13 @@ func (client *ManagedServerSecurityAlertPoliciesClient) getHandleResponse(resp * } // NewListByInstancePager - Get the managed server's threat detection policies. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ManagedServerSecurityAlertPoliciesClientListByInstanceOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ManagedServerSecurityAlertPoliciesClientListByInstanceOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.NewListByInstancePager +// method. func (client *ManagedServerSecurityAlertPoliciesClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *ManagedServerSecurityAlertPoliciesClientListByInstanceOptions) *runtime.Pager[ManagedServerSecurityAlertPoliciesClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ManagedServerSecurityAlertPoliciesClientListByInstanceResponse]{ More: func(page ManagedServerSecurityAlertPoliciesClientListByInstanceResponse) bool { @@ -243,7 +247,7 @@ func (client *ManagedServerSecurityAlertPoliciesClient) listByInstanceCreateRequ return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_models.go b/sdk/resourcemanager/sql/armsql/models.go similarity index 83% rename from sdk/resourcemanager/sql/armsql/zz_generated_models.go rename to sdk/resourcemanager/sql/armsql/models.go index e9c86a89ef86..611cffcc9b47 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_models.go +++ b/sdk/resourcemanager/sql/armsql/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 armsql @@ -224,7 +225,7 @@ type BackupShortTermRetentionPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// BackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.ListByDatabase +// BackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the BackupShortTermRetentionPoliciesClient.NewListByDatabasePager // method. type BackupShortTermRetentionPoliciesClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -279,6 +280,39 @@ type BaseLongTermRetentionPolicyProperties struct { YearlyRetention *string `json:"yearlyRetention,omitempty"` } +// Baseline - SQL Vulnerability Assessment baseline Details +type Baseline struct { + // READ-ONLY; SQL Vulnerability Assessment baseline expected results + ExpectedResults [][]*string `json:"expectedResults,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment baseline update time (UTC) + UpdatedTime *time.Time `json:"updatedTime,omitempty" azure:"ro"` +} + +// BaselineAdjustedResult - SQL Vulnerability Assessment baseline adjusted results +type BaselineAdjustedResult struct { + // READ-ONLY; SQL Vulnerability Assessment baseline details + Baseline *Baseline `json:"baseline,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment results that are not in baseline + ResultsNotInBaseline [][]*string `json:"resultsNotInBaseline,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment results that are in baseline. + ResultsOnlyInBaseline [][]*string `json:"resultsOnlyInBaseline,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment baseline status + Status *RuleStatus `json:"status,omitempty" azure:"ro"` +} + +// BenchmarkReference - SQL Vulnerability Assessment benchmark reference +type BenchmarkReference struct { + // READ-ONLY; SQL Vulnerability Assessment benchmark name + Benchmark *string `json:"benchmark,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment benchmark reference. + Reference *string `json:"reference,omitempty" azure:"ro"` +} + // CapabilitiesClientListByLocationOptions contains the optional parameters for the CapabilitiesClient.ListByLocation method. type CapabilitiesClientListByLocationOptions struct { // If specified, restricts the response to only include the selected item. @@ -290,7 +324,7 @@ type CheckNameAvailabilityRequest struct { // REQUIRED Name *string `json:"name,omitempty"` - // REQUIRED + // CONSTANT; Field has constant value "Microsoft.Sql/servers", any specified value is ignored. Type *string `json:"type,omitempty"` } @@ -348,12 +382,6 @@ type CreateDatabaseRestorePointDefinition struct { RestorePointLabel *string `json:"restorePointLabel,omitempty"` } -// DNSRefreshConfigurationProperties - DNS refresh configuration properties. -type DNSRefreshConfigurationProperties struct { - // READ-ONLY; The status of the DNS refresh operation. - Status *DNSRefreshConfigurationPropertiesStatus `json:"status,omitempty" azure:"ro"` -} - // DataMaskingPoliciesClientCreateOrUpdateOptions contains the optional parameters for the DataMaskingPoliciesClient.CreateOrUpdate // method. type DataMaskingPoliciesClientCreateOrUpdateOptions struct { @@ -365,15 +393,15 @@ type DataMaskingPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// DataMaskingPolicy - Represents a database data masking policy. +// DataMaskingPolicy - A database data masking policy. type DataMaskingPolicy struct { - // The properties of the data masking policy. + // Resource properties. Properties *DataMaskingPolicyProperties `json:"properties,omitempty"` // READ-ONLY; Resource ID. ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; The kind of data masking policy. Metadata, used for Azure portal. + // READ-ONLY; The kind of Data Masking Policy. Metadata, used for Azure portal. Kind *string `json:"kind,omitempty" azure:"ro"` // READ-ONLY; The location of the data masking policy. @@ -403,9 +431,9 @@ type DataMaskingPolicyProperties struct { MaskingLevel *string `json:"maskingLevel,omitempty" azure:"ro"` } -// DataMaskingRule - Represents a database data masking rule. +// DataMaskingRule - A database data masking rule. type DataMaskingRule struct { - // The properties of the resource. + // Resource properties. Properties *DataMaskingRuleProperties `json:"properties,omitempty"` // READ-ONLY; Resource ID. @@ -424,10 +452,13 @@ type DataMaskingRule struct { Type *string `json:"type,omitempty" azure:"ro"` } -// DataMaskingRuleListResult - The response to a list data masking rules request. +// DataMaskingRuleListResult - The list of database data masking rules. type DataMaskingRuleListResult struct { - // The list of database data masking rules. - Value []*DataMaskingRule `json:"value,omitempty"` + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*DataMaskingRule `json:"value,omitempty" azure:"ro"` } // DataMaskingRuleProperties - The properties of a database data masking rule. @@ -482,7 +513,7 @@ type DataMaskingRulesClientCreateOrUpdateOptions struct { // placeholder for future optional parameters } -// DataMaskingRulesClientListByDatabaseOptions contains the optional parameters for the DataMaskingRulesClient.ListByDatabase +// DataMaskingRulesClientListByDatabaseOptions contains the optional parameters for the DataMaskingRulesClient.NewListByDatabasePager // method. type DataMaskingRulesClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -509,7 +540,7 @@ type DataWarehouseUserActivitiesClientGetOptions struct { // placeholder for future optional parameters } -// DataWarehouseUserActivitiesClientListByDatabaseOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.ListByDatabase +// DataWarehouseUserActivitiesClientListByDatabaseOptions contains the optional parameters for the DataWarehouseUserActivitiesClient.NewListByDatabasePager // method. type DataWarehouseUserActivitiesClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -610,7 +641,7 @@ type DatabaseAdvancedThreatProtectionSettingsClientGetOptions struct { // placeholder for future optional parameters } -// DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions contains the optional parameters for the DatabaseAdvancedThreatProtectionSettingsClient.ListByDatabase +// DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions contains the optional parameters for the DatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager // method. type DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -683,7 +714,7 @@ type DatabaseBlobAuditingPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// DatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.ListByDatabase +// DatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseBlobAuditingPoliciesClient.NewListByDatabasePager // method. type DatabaseBlobAuditingPoliciesClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -836,7 +867,7 @@ type DatabaseColumnsClientGetOptions struct { // placeholder for future optional parameters } -// DatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the DatabaseColumnsClient.ListByDatabase +// DatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the DatabaseColumnsClient.NewListByDatabasePager // method. type DatabaseColumnsClientListByDatabaseOptions struct { Column []string @@ -847,13 +878,28 @@ type DatabaseColumnsClientListByDatabaseOptions struct { Table []string } -// DatabaseColumnsClientListByTableOptions contains the optional parameters for the DatabaseColumnsClient.ListByTable method. +// DatabaseColumnsClientListByTableOptions contains the optional parameters for the DatabaseColumnsClient.NewListByTablePager +// method. type DatabaseColumnsClientListByTableOptions struct { // An OData filter expression that filters elements in the collection. Filter *string } -// DatabaseExtensions - An export managed database operation result resource. +// DatabaseEncryptionProtectorsClientBeginRevalidateOptions contains the optional parameters for the DatabaseEncryptionProtectorsClient.BeginRevalidate +// method. +type DatabaseEncryptionProtectorsClientBeginRevalidateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseEncryptionProtectorsClientBeginRevertOptions contains the optional parameters for the DatabaseEncryptionProtectorsClient.BeginRevert +// method. +type DatabaseEncryptionProtectorsClientBeginRevertOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseExtensions - An Import, Export, or PolybaseImport resource. type DatabaseExtensions struct { // Resource properties. Properties *DatabaseExtensionsProperties `json:"properties,omitempty"` @@ -880,25 +926,46 @@ type DatabaseExtensionsClientGetOptions struct { // placeholder for future optional parameters } -// DatabaseExtensionsClientListByDatabaseOptions contains the optional parameters for the DatabaseExtensionsClient.ListByDatabase +// DatabaseExtensionsClientListByDatabaseOptions contains the optional parameters for the DatabaseExtensionsClient.NewListByDatabasePager // method. type DatabaseExtensionsClientListByDatabaseOptions struct { // placeholder for future optional parameters } -// DatabaseExtensionsProperties - Contains the database information after successful export. +// DatabaseExtensionsProperties - Contains the database information after a successful Import, Export, or PolybaseImport type DatabaseExtensionsProperties struct { - // REQUIRED; Operation Mode. + // REQUIRED; Operation mode of the operation: Import, Export, or PolybaseImport. OperationMode *OperationMode `json:"operationMode,omitempty"` - // REQUIRED; Storage key. + // REQUIRED; Storage key for the storage account. StorageKey *string `json:"storageKey,omitempty"` - // REQUIRED; Storage key type. + // REQUIRED; Storage key type: StorageAccessKey or SharedAccessKey. StorageKeyType *StorageKeyType `json:"storageKeyType,omitempty"` - // REQUIRED; Storage Uri. + // REQUIRED; Storage Uri for the storage account. StorageURI *string `json:"storageUri,omitempty"` + + // Administrator login name. + AdministratorLogin *string `json:"administratorLogin,omitempty"` + + // Administrator login password. + AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` + + // Authentication type: SQL authentication or AD password. + AuthenticationType *string `json:"authenticationType,omitempty"` + + // Database edition for the newly created database in the case of an import operation. + DatabaseEdition *string `json:"databaseEdition,omitempty"` + + // Database max size in bytes for the newly created database in the case of an import operation. + MaxSizeBytes *string `json:"maxSizeBytes,omitempty"` + + // Optional resource information to enable network isolation for request. + NetworkIsolation *NetworkIsolationSettings `json:"networkIsolation,omitempty"` + + // Database service level objective for the newly created database in the case of an import operation. + ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty"` } // DatabaseIdentity - Azure Active Directory identity configuration for a resource. @@ -913,6 +980,21 @@ type DatabaseIdentity struct { TenantID *string `json:"tenantId,omitempty" azure:"ro"` } +// DatabaseKey - Database level key used for encryption at rest. +type DatabaseKey struct { + // READ-ONLY; The database key creation date. + CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + + // READ-ONLY; Subregion of the server key. + Subregion *string `json:"subregion,omitempty" azure:"ro"` + + // READ-ONLY; Thumbprint of the database key. + Thumbprint *string `json:"thumbprint,omitempty" azure:"ro"` + + // READ-ONLY; The database key type. Only supported value is 'AzureKeyVault'. + Type *DatabaseKeyType `json:"type,omitempty" azure:"ro"` +} + // DatabaseListResult - A list of databases. type DatabaseListResult struct { // READ-ONLY; Link to retrieve next page of results. @@ -978,6 +1060,9 @@ type DatabaseOperationProperties struct { // READ-ONLY; The friendly name of operation. OperationFriendlyName *string `json:"operationFriendlyName,omitempty" azure:"ro"` + // READ-ONLY; The operation phase details. + OperationPhaseDetails *PhaseDetails `json:"operationPhaseDetails,omitempty" azure:"ro"` + // READ-ONLY; The percentage of the operation completed. PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"` @@ -996,7 +1081,7 @@ type DatabaseOperationsClientCancelOptions struct { // placeholder for future optional parameters } -// DatabaseOperationsClientListByDatabaseOptions contains the optional parameters for the DatabaseOperationsClient.ListByDatabase +// DatabaseOperationsClientListByDatabaseOptions contains the optional parameters for the DatabaseOperationsClient.NewListByDatabasePager // method. type DatabaseOperationsClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -1007,6 +1092,9 @@ type DatabaseProperties struct { // Time in minutes after which database is automatically paused. A value of -1 means that automatic pause is disabled AutoPauseDelay *int32 `json:"autoPauseDelay,omitempty"` + // Specifies the availability zone the database is pinned to. + AvailabilityZone *AvailabilityZoneType `json:"availabilityZone,omitempty"` + // Collation of the metadata catalog. CatalogCollation *CatalogCollationType `json:"catalogCollation,omitempty"` @@ -1037,6 +1125,9 @@ type DatabaseProperties struct { // The resource identifier of the elastic pool containing this database. ElasticPoolID *string `json:"elasticPoolId,omitempty"` + // The azure key vault URI of the database if it's configured with per Database Customer Managed Keys. + EncryptionProtector *string `json:"encryptionProtector,omitempty"` + // The Client id used for cross tenant per database CMK scenario FederatedClientID *string `json:"federatedClientId,omitempty"` @@ -1048,6 +1139,9 @@ type DatabaseProperties struct { // value of this property cannot be changed after the database has been created. IsLedgerOn *bool `json:"isLedgerOn,omitempty"` + // The resource ids of the user assigned identities to use + Keys map[string]*DatabaseKey `json:"keys,omitempty"` + // The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license // and are eligible for the Azure Hybrid Benefit. LicenseType *DatabaseLicenseType `json:"licenseType,omitempty"` @@ -1059,12 +1153,29 @@ type DatabaseProperties struct { // will occur. MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + // Whether or not customer controlled manual cutover needs to be done during Update Database operation to Hyperscale tier. + // This property is only applicable when scaling database from Business Critical/General Purpose/Premium/Standard tier to + // Hyperscale tier. + // When manualCutover is specified, the scaling operation will wait for user input to trigger cutover to Hyperscale database. + // To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in Waiting state. + ManualCutover *bool `json:"manualCutover,omitempty"` + // The max size of the database expressed in bytes. MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` // Minimal capacity that database will always have allocated, if not paused MinCapacity *float64 `json:"minCapacity,omitempty"` + // To trigger customer controlled manual cutover during the wait state while Scaling operation is in progress. + // This property parameter is only applicable for scaling operations that are initiated along with 'manualCutover' parameter. + // This property is only applicable when scaling database from Business Critical/General Purpose/Premium/Standard tier to + // Hyperscale tier is already in progress. + // When performCutover is specified, the scaling operation will trigger cutover and perform role-change to Hyperscale database. + PerformCutover *bool `json:"performCutover,omitempty"` + + // Type of enclave requested on the database i.e. Default or VBS enclaves. + PreferredEnclaveType *AlwaysEncryptedEnclaveType `json:"preferredEnclaveType,omitempty"` + // The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection // string may be routed to a readonly secondary replica in the same region. Not // applicable to a Hyperscale database within an elastic pool. @@ -1088,7 +1199,7 @@ type DatabaseProperties struct { // The name of the sample schema to apply when creating this database. SampleName *SampleName `json:"sampleName,omitempty"` - // The secondary type of the database if it is a secondary. Valid values are Geo and Named. + // The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. SecondaryType *SecondaryType `json:"secondaryType,omitempty"` // Specifies the time that the database was deleted. @@ -1098,15 +1209,15 @@ type DatabaseProperties struct { SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` // The resource identifier of the source associated with the create operation of this database. + // This property is only supported for DataWarehouse edition and allows to restore across subscriptions. // When sourceResourceId is specified, sourceDatabaseId, recoverableDatabaseId, restorableDroppedDatabaseId and sourceDatabaseDeletionDate // must not be specified and CreateMode must be PointInTimeRestore, // Restore or Recover. - // When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of an existing database or existing sql + // When createMode is PointInTimeRestore, sourceResourceId must be the resource ID of the existing database or existing sql // pool, and restorePointInTime must be specified. // When createMode is Restore, sourceResourceId must be the resource ID of restorable dropped database or restorable dropped // sql pool. // When createMode is Recover, sourceResourceId must be the resource ID of recoverable database or recoverable sql pool. - // This property allows to restore across subscriptions which is only supported for DataWarehouse edition. // When source subscription belongs to a different tenant than target subscription, “x-ms-authorization-auxiliary” header // must contain authentication token for the source tenant. For more details about // “x-ms-authorization-auxiliary” header see https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/authenticate-multi-tenant @@ -1178,6 +1289,214 @@ type DatabaseRecommendedActionsClientUpdateOptions struct { // placeholder for future optional parameters } +// DatabaseSQLVulnerabilityAssessmentBaselineSet - A database sql vulnerability assessment baseline set. +type DatabaseSQLVulnerabilityAssessmentBaselineSet struct { + // Resource properties. + Properties *DatabaseSQLVulnerabilityAssessmentBaselineSetProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; SystemData of DatabaseSqlVulnerabilityAssessmentBaselineSetResource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DatabaseSQLVulnerabilityAssessmentBaselineSetListResult - A list of SQL Vulnerability Assessments baseline set. +type DatabaseSQLVulnerabilityAssessmentBaselineSetListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*DatabaseSQLVulnerabilityAssessmentBaselineSet `json:"value,omitempty" azure:"ro"` +} + +// DatabaseSQLVulnerabilityAssessmentBaselineSetProperties - Properties of a database Sql Vulnerability Assessment baseline +// set. +type DatabaseSQLVulnerabilityAssessmentBaselineSetProperties struct { + // REQUIRED; The baseline set result + Results map[string][][]*string `json:"results,omitempty"` +} + +// DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentBaselinesClient.CreateOrUpdate +// method. +type DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentBaselinesClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentBaselinesClient.Get +// method. +type DatabaseSQLVulnerabilityAssessmentBaselinesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentOptions contains the optional parameters +// for the DatabaseSQLVulnerabilityAssessmentBaselinesClient.NewListBySQLVulnerabilityAssessmentPager method. +type DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentExecuteScanClient.BeginExecute +// method. +type DatabaseSQLVulnerabilityAssessmentExecuteScanClientBeginExecuteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaseline - A database sql vulnerability assessment rule baseline. +type DatabaseSQLVulnerabilityAssessmentRuleBaseline struct { + // Resource properties. + Properties *DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; SystemData of DatabaseSqlVulnerabilityAssessmentRuleBaselineResource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselineInput - A database sql vulnerability assessment rule baseline input. +type DatabaseSQLVulnerabilityAssessmentRuleBaselineInput struct { + // Resource properties. + Properties *DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; SystemData of DatabaseSqlVulnerabilityAssessmentRuleBaselineInputResource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties - Properties of a database Sql Vulnerability Assessment rule +// baseline. +type DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties struct { + // REQUIRED; The latest scan flag + LatestScan *bool `json:"latestScan,omitempty"` + + // REQUIRED; The rule baseline result + Results [][]*string `json:"results,omitempty"` +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput - A database sql vulnerability assessment rule baseline list input. +type DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput struct { + // Resource properties. + Properties *DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; SystemData of DatabaseSqlVulnerabilityAssessmentRuleBaselineListInputResource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties - Properties of a database Sql Vulnerability Assessment +// rule baseline. +type DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties struct { + // REQUIRED; The latest scan flag + LatestScan *bool `json:"latestScan,omitempty"` + + // REQUIRED; The rule baseline result list + Results map[string][][]*string `json:"results,omitempty"` +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult - A list of SQL Vulnerability Assessments rule baseline. +type DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*DatabaseSQLVulnerabilityAssessmentRuleBaseline `json:"value,omitempty" azure:"ro"` +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties - Properties of a database Sql Vulnerability Assessment rule baseline. +type DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties struct { + // REQUIRED; The rule baseline result + Results [][]*string `json:"results,omitempty"` +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate +// method. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Delete +// method. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Get +// method. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.NewListByBaselinePager +// method. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentScanResultClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentScanResultClient.Get +// method. +type DatabaseSQLVulnerabilityAssessmentScanResultClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentScanResultClient.NewListByScanPager +// method. +type DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentScansClient.Get +// method. +type DatabaseSQLVulnerabilityAssessmentScansClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions contains the optional parameters +// for the DatabaseSQLVulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager method. +type DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentsSettingsClientGetOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentsSettingsClient.Get +// method. +type DatabaseSQLVulnerabilityAssessmentsSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseOptions contains the optional parameters for the DatabaseSQLVulnerabilityAssessmentsSettingsClient.NewListByDatabasePager +// method. +type DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + // DatabaseSchema - A database schema resource. type DatabaseSchema struct { // READ-ONLY; Resource ID. @@ -1204,7 +1523,7 @@ type DatabaseSchemasClientGetOptions struct { // placeholder for future optional parameters } -// DatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the DatabaseSchemasClient.ListByDatabase +// DatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the DatabaseSchemasClient.NewListByDatabasePager // method. type DatabaseSchemasClientListByDatabaseOptions struct { // An OData filter expression that filters elements in the collection. @@ -1232,7 +1551,7 @@ type DatabaseSecurityAlertPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// DatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.ListByDatabase +// DatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the DatabaseSecurityAlertPoliciesClient.NewListByDatabasePager // method. type DatabaseSecurityAlertPoliciesClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -1294,7 +1613,8 @@ type DatabaseTablesClientGetOptions struct { // placeholder for future optional parameters } -// DatabaseTablesClientListBySchemaOptions contains the optional parameters for the DatabaseTablesClient.ListBySchema method. +// DatabaseTablesClientListBySchemaOptions contains the optional parameters for the DatabaseTablesClient.NewListBySchemaPager +// method. type DatabaseTablesClientListBySchemaOptions struct { // An OData filter expression that filters elements in the collection. Filter *string @@ -1350,6 +1670,9 @@ type DatabaseUpdateProperties struct { // The resource identifier of the elastic pool containing this database. ElasticPoolID *string `json:"elasticPoolId,omitempty"` + // The azure key vault URI of the database if it's configured with per Database Customer Managed Keys. + EncryptionProtector *string `json:"encryptionProtector,omitempty"` + // The Client id used for cross tenant per database CMK scenario FederatedClientID *string `json:"federatedClientId,omitempty"` @@ -1361,6 +1684,9 @@ type DatabaseUpdateProperties struct { // value of this property cannot be changed after the database has been created. IsLedgerOn *bool `json:"isLedgerOn,omitempty"` + // The resource ids of the user assigned identities to use + Keys map[string]*DatabaseKey `json:"keys,omitempty"` + // The license type to apply for this database. LicenseIncluded if you need a license, or BasePrice if you have a license // and are eligible for the Azure Hybrid Benefit. LicenseType *DatabaseLicenseType `json:"licenseType,omitempty"` @@ -1372,12 +1698,29 @@ type DatabaseUpdateProperties struct { // will occur. MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + // Whether or not customer controlled manual cutover needs to be done during Update Database operation to Hyperscale tier. + // This property is only applicable when scaling database from Business Critical/General Purpose/Premium/Standard tier to + // Hyperscale tier. + // When manualCutover is specified, the scaling operation will wait for user input to trigger cutover to Hyperscale database. + // To trigger cutover, please provide 'performCutover' parameter when the Scaling operation is in Waiting state. + ManualCutover *bool `json:"manualCutover,omitempty"` + // The max size of the database expressed in bytes. MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` // Minimal capacity that database will always have allocated, if not paused MinCapacity *float64 `json:"minCapacity,omitempty"` + // To trigger customer controlled manual cutover during the wait state while Scaling operation is in progress. + // This property parameter is only applicable for scaling operations that are initiated along with 'manualCutover' parameter. + // This property is only applicable when scaling database from Business Critical/General Purpose/Premium/Standard tier to + // Hyperscale tier is already in progress. + // When performCutover is specified, the scaling operation will trigger cutover and perform role-change to Hyperscale database. + PerformCutover *bool `json:"performCutover,omitempty"` + + // Type of enclave requested on the database i.e. Default or VBS enclaves. + PreferredEnclaveType *AlwaysEncryptedEnclaveType `json:"preferredEnclaveType,omitempty"` + // The state of read-only routing. If enabled, connections that have application intent set to readonly in their connection // string may be routed to a readonly secondary replica in the same region. Not // applicable to a Hyperscale database within an elastic pool. @@ -1401,7 +1744,7 @@ type DatabaseUpdateProperties struct { // The name of the sample schema to apply when creating this database. SampleName *SampleName `json:"sampleName,omitempty"` - // The secondary type of the database if it is a secondary. Valid values are Geo and Named. + // The secondary type of the database if it is a secondary. Valid values are Geo, Named and Standby. SecondaryType *SecondaryType `json:"secondaryType,omitempty"` // Specifies the time that the database was deleted. @@ -1497,7 +1840,7 @@ type DatabaseUsageProperties struct { Unit *string `json:"unit,omitempty" azure:"ro"` } -// DatabaseUsagesClientListByDatabaseOptions contains the optional parameters for the DatabaseUsagesClient.ListByDatabase +// DatabaseUsagesClientListByDatabaseOptions contains the optional parameters for the DatabaseUsagesClient.NewListByDatabasePager // method. type DatabaseUsagesClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -1542,7 +1885,8 @@ type DatabaseVulnerabilityAssessmentProperties struct { RecurringScans *VulnerabilityAssessmentRecurringScansProperties `json:"recurringScans,omitempty"` // Specifies the identifier key of the storage account for vulnerability assessment scan results. If 'StorageContainerSasKey' - // isn't specified, storageAccountAccessKey is required. + // isn't specified, storageAccountAccessKey is required. Applies only if the + // storage account is not behind a Vnet or a firewall StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // A blob storage container path to hold the scan results (e.g. https://myStorage.blob.core.windows.net/VaScans/). It is required @@ -1551,7 +1895,7 @@ type DatabaseVulnerabilityAssessmentProperties struct { // A shared access signature (SAS Key) that has write access to the blob container specified in 'storageContainerPath' parameter. // If 'storageAccountAccessKey' isn't specified, StorageContainerSasKey is - // required. + // required. Applies only if the storage account is not behind a Vnet or a firewall StorageContainerSasKey *string `json:"storageContainerSasKey,omitempty"` } @@ -1626,7 +1970,7 @@ type DatabaseVulnerabilityAssessmentScansClientGetOptions struct { // placeholder for future optional parameters } -// DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.ListByDatabase +// DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentScansClient.NewListByDatabasePager // method. type DatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -1665,7 +2009,7 @@ type DatabaseVulnerabilityAssessmentsClientGetOptions struct { // placeholder for future optional parameters } -// DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.ListByDatabase +// DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the DatabaseVulnerabilityAssessmentsClient.NewListByDatabasePager // method. type DatabaseVulnerabilityAssessmentsClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -1731,36 +2075,29 @@ type DatabasesClientBeginUpgradeDataWarehouseOptions struct { // DatabasesClientGetOptions contains the optional parameters for the DatabasesClient.Get method. type DatabasesClientGetOptions struct { - // placeholder for future optional parameters + // The child resources to include in the response. + Expand *string + // An OData filter expression that filters elements in the collection. + Filter *string } -// DatabasesClientListByElasticPoolOptions contains the optional parameters for the DatabasesClient.ListByElasticPool method. +// DatabasesClientListByElasticPoolOptions contains the optional parameters for the DatabasesClient.NewListByElasticPoolPager +// method. type DatabasesClientListByElasticPoolOptions struct { // placeholder for future optional parameters } -// DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.ListByServer method. +// DatabasesClientListByServerOptions contains the optional parameters for the DatabasesClient.NewListByServerPager method. type DatabasesClientListByServerOptions struct { SkipToken *string } -// DatabasesClientListInaccessibleByServerOptions contains the optional parameters for the DatabasesClient.ListInaccessibleByServer +// DatabasesClientListInaccessibleByServerOptions contains the optional parameters for the DatabasesClient.NewListInaccessibleByServerPager // method. type DatabasesClientListInaccessibleByServerOptions struct { // placeholder for future optional parameters } -// DatabasesClientListMetricDefinitionsOptions contains the optional parameters for the DatabasesClient.ListMetricDefinitions -// method. -type DatabasesClientListMetricDefinitionsOptions struct { - // placeholder for future optional parameters -} - -// DatabasesClientListMetricsOptions contains the optional parameters for the DatabasesClient.ListMetrics method. -type DatabasesClientListMetricsOptions struct { - // placeholder for future optional parameters -} - // DatabasesClientRenameOptions contains the optional parameters for the DatabasesClient.Rename method. type DatabasesClientRenameOptions struct { // placeholder for future optional parameters @@ -1816,13 +2153,13 @@ type DeletedServersClientGetOptions struct { // placeholder for future optional parameters } -// DeletedServersClientListByLocationOptions contains the optional parameters for the DeletedServersClient.ListByLocation +// DeletedServersClientListByLocationOptions contains the optional parameters for the DeletedServersClient.NewListByLocationPager // method. type DeletedServersClientListByLocationOptions struct { // placeholder for future optional parameters } -// DeletedServersClientListOptions contains the optional parameters for the DeletedServersClient.List method. +// DeletedServersClientListOptions contains the optional parameters for the DeletedServersClient.NewListPager method. type DeletedServersClientListOptions struct { // placeholder for future optional parameters } @@ -1862,6 +2199,9 @@ type DistributedAvailabilityGroupProperties struct { // READ-ONLY; The distributed availability group id DistributedAvailabilityGroupID *string `json:"distributedAvailabilityGroupId,omitempty" azure:"ro"` + // READ-ONLY; Role of managed instance + InstanceRole *string `json:"instanceRole,omitempty" azure:"ro"` + // READ-ONLY; The last hardened lsn LastHardenedLsn *string `json:"lastHardenedLsn,omitempty" azure:"ro"` @@ -1875,6 +2215,15 @@ type DistributedAvailabilityGroupProperties struct { TargetReplicaID *string `json:"targetReplicaId,omitempty" azure:"ro"` } +// DistributedAvailabilityGroupSetRole - Distributed availability group failover request. +type DistributedAvailabilityGroupSetRole struct { + // REQUIRED; New role of managed instance in a distributed availability group, can be Primary or Secondary. + InstanceRole *InstanceRole `json:"instanceRole,omitempty"` + + // REQUIRED; The type of the role change, can be Planned or Forced. + RoleChangeType *RoleChangeType `json:"roleChangeType,omitempty"` +} + // DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginCreateOrUpdate // method. type DistributedAvailabilityGroupsClientBeginCreateOrUpdateOptions struct { @@ -1889,6 +2238,13 @@ type DistributedAvailabilityGroupsClientBeginDeleteOptions struct { ResumeToken string } +// DistributedAvailabilityGroupsClientBeginSetRoleOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginSetRole +// method. +type DistributedAvailabilityGroupsClientBeginSetRoleOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // DistributedAvailabilityGroupsClientBeginUpdateOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.BeginUpdate // method. type DistributedAvailabilityGroupsClientBeginUpdateOptions struct { @@ -1902,7 +2258,7 @@ type DistributedAvailabilityGroupsClientGetOptions struct { // placeholder for future optional parameters } -// DistributedAvailabilityGroupsClientListByInstanceOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.ListByInstance +// DistributedAvailabilityGroupsClientListByInstanceOptions contains the optional parameters for the DistributedAvailabilityGroupsClient.NewListByInstancePager // method. type DistributedAvailabilityGroupsClientListByInstanceOptions struct { // placeholder for future optional parameters @@ -1937,6 +2293,9 @@ type EditionCapability struct { // READ-ONLY; The list of supported storage capabilities for this edition SupportedStorageCapabilities []*StorageCapability `json:"supportedStorageCapabilities,omitempty" azure:"ro"` + // READ-ONLY; Whether or not zone pinning is supported for the edition. + ZonePinning *bool `json:"zonePinning,omitempty" azure:"ro"` + // READ-ONLY; Whether or not zone redundancy is supported for the edition. ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"` } @@ -1973,193 +2332,25 @@ type ElasticPool struct { Type *string `json:"type,omitempty" azure:"ro"` } -// ElasticPoolActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolActivitiesClient.ListByElasticPool -// method. -type ElasticPoolActivitiesClientListByElasticPoolOptions struct { - // placeholder for future optional parameters -} +// ElasticPoolEditionCapability - The elastic pool edition capability. +type ElasticPoolEditionCapability struct { + // The reason for the capability not being available. + Reason *string `json:"reason,omitempty"` -// ElasticPoolActivity - Represents the activity on an elastic pool. -type ElasticPoolActivity struct { - // The geo-location where the resource lives - Location *string `json:"location,omitempty"` + // READ-ONLY; The elastic pool edition name. + Name *string `json:"name,omitempty" azure:"ro"` - // The properties representing the resource. - Properties *ElasticPoolActivityProperties `json:"properties,omitempty"` + // READ-ONLY; The status of the capability. + Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` + // READ-ONLY; The list of supported elastic pool DTU levels for the edition. + SupportedElasticPoolPerformanceLevels []*ElasticPoolPerformanceLevelCapability `json:"supportedElasticPoolPerformanceLevels,omitempty" azure:"ro"` - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Whether or not zone pinning is supported for the edition. + ZonePinning *bool `json:"zonePinning,omitempty" azure:"ro"` - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ElasticPoolActivityListResult - Represents the response to a list elastic pool activity request. -type ElasticPoolActivityListResult struct { - // REQUIRED; The list of elastic pool activities. - Value []*ElasticPoolActivity `json:"value,omitempty"` -} - -// ElasticPoolActivityProperties - Represents the properties of an elastic pool. -type ElasticPoolActivityProperties struct { - // READ-ONLY; The name of the elastic pool. - ElasticPoolName *string `json:"elasticPoolName,omitempty" azure:"ro"` - - // READ-ONLY; The time the operation finished (ISO8601 format). - EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` - - // READ-ONLY; The error code if available. - ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"` - - // READ-ONLY; The error message if available. - ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"` - - // READ-ONLY; The error severity if available. - ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"` - - // READ-ONLY; The operation name. - Operation *string `json:"operation,omitempty" azure:"ro"` - - // READ-ONLY; The unique operation ID. - OperationID *string `json:"operationId,omitempty" azure:"ro"` - - // READ-ONLY; The percentage complete if available. - PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"` - - // READ-ONLY; The requested per database DTU cap. - RequestedDatabaseDtuCap *int32 `json:"requestedDatabaseDtuCap,omitempty" azure:"ro"` - - // READ-ONLY; The requested per database DTU guarantee. - RequestedDatabaseDtuGuarantee *int32 `json:"requestedDatabaseDtuGuarantee,omitempty" azure:"ro"` - - // READ-ONLY; The requested max DTU per database if available. - RequestedDatabaseDtuMax *int32 `json:"requestedDatabaseDtuMax,omitempty" azure:"ro"` - - // READ-ONLY; The requested min DTU per database if available. - RequestedDatabaseDtuMin *int32 `json:"requestedDatabaseDtuMin,omitempty" azure:"ro"` - - // READ-ONLY; The requested DTU for the pool if available. - RequestedDtu *int32 `json:"requestedDtu,omitempty" azure:"ro"` - - // READ-ONLY; The requested DTU guarantee. - RequestedDtuGuarantee *int32 `json:"requestedDtuGuarantee,omitempty" azure:"ro"` - - // READ-ONLY; The requested name for the elastic pool if available. - RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty" azure:"ro"` - - // READ-ONLY; The requested storage limit for the pool in GB if available. - RequestedStorageLimitInGB *int64 `json:"requestedStorageLimitInGB,omitempty" azure:"ro"` - - // READ-ONLY; The requested storage limit in MB. - RequestedStorageLimitInMB *int32 `json:"requestedStorageLimitInMB,omitempty" azure:"ro"` - - // READ-ONLY; The name of the server the elastic pool is in. - ServerName *string `json:"serverName,omitempty" azure:"ro"` - - // READ-ONLY; The time the operation started (ISO8601 format). - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` - - // READ-ONLY; The current state of the operation. - State *string `json:"state,omitempty" azure:"ro"` -} - -// ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolDatabaseActivitiesClient.ListByElasticPool -// method. -type ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions struct { - // placeholder for future optional parameters -} - -// ElasticPoolDatabaseActivity - Represents the activity on an elastic pool. -type ElasticPoolDatabaseActivity struct { - // The geo-location where the resource lives - Location *string `json:"location,omitempty"` - - // The properties representing the resource. - Properties *ElasticPoolDatabaseActivityProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - -// ElasticPoolDatabaseActivityListResult - Represents the response to a list elastic pool database activity request. -type ElasticPoolDatabaseActivityListResult struct { - // REQUIRED; The list of elastic pool database activities. - Value []*ElasticPoolDatabaseActivity `json:"value,omitempty"` -} - -// ElasticPoolDatabaseActivityProperties - Represents the properties of an elastic pool database activity. -type ElasticPoolDatabaseActivityProperties struct { - // READ-ONLY; The name of the current elastic pool the database is in if available. - CurrentElasticPoolName *string `json:"currentElasticPoolName,omitempty" azure:"ro"` - - // READ-ONLY; The name of the current service objective if available. - CurrentServiceObjective *string `json:"currentServiceObjective,omitempty" azure:"ro"` - - // READ-ONLY; The database name. - DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` - - // READ-ONLY; The time the operation finished (ISO8601 format). - EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` - - // READ-ONLY; The error code if available. - ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"` - - // READ-ONLY; The error message if available. - ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"` - - // READ-ONLY; The error severity if available. - ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"` - - // READ-ONLY; The operation name. - Operation *string `json:"operation,omitempty" azure:"ro"` - - // READ-ONLY; The unique operation ID. - OperationID *string `json:"operationId,omitempty" azure:"ro"` - - // READ-ONLY; The percentage complete if available. - PercentComplete *int32 `json:"percentComplete,omitempty" azure:"ro"` - - // READ-ONLY; The name for the elastic pool the database is moving into if available. - RequestedElasticPoolName *string `json:"requestedElasticPoolName,omitempty" azure:"ro"` - - // READ-ONLY; The name of the requested service objective if available. - RequestedServiceObjective *string `json:"requestedServiceObjective,omitempty" azure:"ro"` - - // READ-ONLY; The name of the server the elastic pool is in. - ServerName *string `json:"serverName,omitempty" azure:"ro"` - - // READ-ONLY; The time the operation started (ISO8601 format). - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` - - // READ-ONLY; The current state of the operation. - State *string `json:"state,omitempty" azure:"ro"` -} - -// ElasticPoolEditionCapability - The elastic pool edition capability. -type ElasticPoolEditionCapability struct { - // The reason for the capability not being available. - Reason *string `json:"reason,omitempty"` - - // READ-ONLY; The elastic pool edition name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The status of the capability. - Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` - - // READ-ONLY; The list of supported elastic pool DTU levels for the edition. - SupportedElasticPoolPerformanceLevels []*ElasticPoolPerformanceLevelCapability `json:"supportedElasticPoolPerformanceLevels,omitempty" azure:"ro"` - - // READ-ONLY; Whether or not zone redundancy is supported for the edition. - ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"` + // READ-ONLY; Whether or not zone redundancy is supported for the edition. + ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"` } // ElasticPoolListResult - The result of an elastic pool list request. @@ -2245,7 +2436,7 @@ type ElasticPoolOperationsClientCancelOptions struct { // placeholder for future optional parameters } -// ElasticPoolOperationsClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolOperationsClient.ListByElasticPool +// ElasticPoolOperationsClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolOperationsClient.NewListByElasticPoolPager // method. type ElasticPoolOperationsClientListByElasticPoolOptions struct { // placeholder for future optional parameters @@ -2334,7 +2525,11 @@ type ElasticPoolPerformanceLevelCapability struct { // ElasticPoolProperties - Properties of an elastic pool type ElasticPoolProperties struct { - // The number of secondary replicas associated with the elastic pool that are used to provide high availability. + // Specifies the availability zone the pool's primary replica is pinned to. + AvailabilityZone *AvailabilityZoneType `json:"availabilityZone,omitempty"` + + // The number of secondary replicas associated with the elastic pool that are used to provide high availability. Applicable + // only to Hyperscale elastic pools. HighAvailabilityReplicaCount *int32 `json:"highAvailabilityReplicaCount,omitempty"` // The license type to apply for this elastic pool. @@ -2347,9 +2542,15 @@ type ElasticPoolProperties struct { // The storage limit for the database elastic pool in bytes. MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` + // Minimal capacity that serverless pool will not shrink below, if not paused + MinCapacity *float64 `json:"minCapacity,omitempty"` + // The per database settings for the elastic pool. PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"` + // Type of enclave requested on the elastic pool. + PreferredEnclaveType *AlwaysEncryptedEnclaveType `json:"preferredEnclaveType,omitempty"` + // Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across // multiple availability zones. ZoneRedundant *bool `json:"zoneRedundant,omitempty"` @@ -2375,6 +2576,9 @@ type ElasticPoolUpdate struct { // ElasticPoolUpdateProperties - Properties of an elastic pool type ElasticPoolUpdateProperties struct { + // Specifies the availability zone the pool's primary replica is pinned to. + AvailabilityZone *AvailabilityZoneType `json:"availabilityZone,omitempty"` + // The number of secondary replicas associated with the elastic pool that are used to provide high availability. Applicable // only to Hyperscale elastic pools. HighAvailabilityReplicaCount *int32 `json:"highAvailabilityReplicaCount,omitempty"` @@ -2389,9 +2593,15 @@ type ElasticPoolUpdateProperties struct { // The storage limit for the database elastic pool in bytes. MaxSizeBytes *int64 `json:"maxSizeBytes,omitempty"` + // Minimal capacity that serverless pool will not shrink below, if not paused + MinCapacity *float64 `json:"minCapacity,omitempty"` + // The per database settings for the elastic pool. PerDatabaseSettings *ElasticPoolPerDatabaseSettings `json:"perDatabaseSettings,omitempty"` + // Type of enclave requested on the elastic pool. + PreferredEnclaveType *AlwaysEncryptedEnclaveType `json:"preferredEnclaveType,omitempty"` + // Whether or not this elastic pool is zone redundant, which means the replicas of this elastic pool will be spread across // multiple availability zones. ZoneRedundant *bool `json:"zoneRedundant,omitempty"` @@ -2427,23 +2637,13 @@ type ElasticPoolsClientGetOptions struct { // placeholder for future optional parameters } -// ElasticPoolsClientListByServerOptions contains the optional parameters for the ElasticPoolsClient.ListByServer method. +// ElasticPoolsClientListByServerOptions contains the optional parameters for the ElasticPoolsClient.NewListByServerPager +// method. type ElasticPoolsClientListByServerOptions struct { // The number of elements in the collection to skip. Skip *int64 } -// ElasticPoolsClientListMetricDefinitionsOptions contains the optional parameters for the ElasticPoolsClient.ListMetricDefinitions -// method. -type ElasticPoolsClientListMetricDefinitionsOptions struct { - // placeholder for future optional parameters -} - -// ElasticPoolsClientListMetricsOptions contains the optional parameters for the ElasticPoolsClient.ListMetrics method. -type ElasticPoolsClientListMetricsOptions struct { - // placeholder for future optional parameters -} - // EncryptionProtector - The server encryption protector. type EncryptionProtector struct { // Resource properties. @@ -2514,7 +2714,7 @@ type EncryptionProtectorsClientGetOptions struct { // placeholder for future optional parameters } -// EncryptionProtectorsClientListByServerOptions contains the optional parameters for the EncryptionProtectorsClient.ListByServer +// EncryptionProtectorsClientListByServerOptions contains the optional parameters for the EncryptionProtectorsClient.NewListByServerPager // method. type EncryptionProtectorsClientListByServerOptions struct { // placeholder for future optional parameters @@ -2555,12 +2755,27 @@ type EndpointCertificatesClientGetOptions struct { // placeholder for future optional parameters } -// EndpointCertificatesClientListByInstanceOptions contains the optional parameters for the EndpointCertificatesClient.ListByInstance +// EndpointCertificatesClientListByInstanceOptions contains the optional parameters for the EndpointCertificatesClient.NewListByInstancePager // method. type EndpointCertificatesClientListByInstanceOptions struct { // placeholder for future optional parameters } +// EndpointDependency - A domain name that the managed instance service needs to communicate with, along with additional details. +type EndpointDependency struct { + // READ-ONLY; The domain name of the dependency. + DomainName *string `json:"domainName,omitempty" azure:"ro"` + + // READ-ONLY; The IP Addresses and Ports used when connecting to DomainName. + EndpointDetails []*EndpointDetail `json:"endpointDetails,omitempty" azure:"ro"` +} + +// EndpointDetail - A domain name that the managed instance service needs to communicate with, along with additional details. +type EndpointDetail struct { + // READ-ONLY; The port an endpoint is connected to. + Port *int32 `json:"port,omitempty" azure:"ro"` +} + // ExportDatabaseDefinition - Contains the information necessary to perform export database operation. type ExportDatabaseDefinition struct { // REQUIRED; Administrator login name. @@ -2597,7 +2812,7 @@ type ExtendedDatabaseBlobAuditingPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.ListByDatabase +// ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions contains the optional parameters for the ExtendedDatabaseBlobAuditingPoliciesClient.NewListByDatabasePager // method. type ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -2719,7 +2934,7 @@ type ExtendedServerBlobAuditingPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// ExtendedServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.ListByServer +// ExtendedServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ExtendedServerBlobAuditingPoliciesClient.NewListByServerPager // method. type ExtendedServerBlobAuditingPoliciesClientListByServerOptions struct { // placeholder for future optional parameters @@ -2907,6 +3122,21 @@ type FailoverGroupReadWriteEndpoint struct { FailoverWithDataLossGracePeriodMinutes *int32 `json:"failoverWithDataLossGracePeriodMinutes,omitempty"` } +// FailoverGroupTryPlannedBeforeForcedFailover - A failover group try planned before force failover request. +type FailoverGroupTryPlannedBeforeForcedFailover struct { + // Resource properties. + Properties any `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + // FailoverGroupUpdate - A failover group update request. type FailoverGroupUpdate struct { // Resource properties. @@ -2954,6 +3184,13 @@ type FailoverGroupsClientBeginForceFailoverAllowDataLossOptions struct { ResumeToken string } +// FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions contains the optional parameters for the FailoverGroupsClient.BeginTryPlannedBeforeForcedFailover +// method. +type FailoverGroupsClientBeginTryPlannedBeforeForcedFailoverOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // FailoverGroupsClientBeginUpdateOptions contains the optional parameters for the FailoverGroupsClient.BeginUpdate method. type FailoverGroupsClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. @@ -2965,7 +3202,8 @@ type FailoverGroupsClientGetOptions struct { // placeholder for future optional parameters } -// FailoverGroupsClientListByServerOptions contains the optional parameters for the FailoverGroupsClient.ListByServer method. +// FailoverGroupsClientListByServerOptions contains the optional parameters for the FailoverGroupsClient.NewListByServerPager +// method. type FailoverGroupsClientListByServerOptions struct { // placeholder for future optional parameters } @@ -3014,7 +3252,8 @@ type FirewallRulesClientGetOptions struct { // placeholder for future optional parameters } -// FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.ListByServer method. +// FirewallRulesClientListByServerOptions contains the optional parameters for the FirewallRulesClient.NewListByServerPager +// method. type FirewallRulesClientListByServerOptions struct { // placeholder for future optional parameters } @@ -3035,15 +3274,14 @@ type GeoBackupPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// GeoBackupPoliciesClientListByDatabaseOptions contains the optional parameters for the GeoBackupPoliciesClient.ListByDatabase -// method. -type GeoBackupPoliciesClientListByDatabaseOptions struct { +// GeoBackupPoliciesClientListOptions contains the optional parameters for the GeoBackupPoliciesClient.NewListPager method. +type GeoBackupPoliciesClientListOptions struct { // placeholder for future optional parameters } -// GeoBackupPolicy - A database geo backup policy. +// GeoBackupPolicy - A Geo backup policy. type GeoBackupPolicy struct { - // REQUIRED; The properties of the geo backup policy. + // Resource properties. Properties *GeoBackupPolicyProperties `json:"properties,omitempty"` // READ-ONLY; Resource ID. @@ -3062,10 +3300,13 @@ type GeoBackupPolicy struct { Type *string `json:"type,omitempty" azure:"ro"` } -// GeoBackupPolicyListResult - The response to a list geo backup policies request. +// GeoBackupPolicyListResult - The list of geo backup policies. type GeoBackupPolicyListResult struct { - // The list of geo backup policies. - Value []*GeoBackupPolicy `json:"value,omitempty"` + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*GeoBackupPolicy `json:"value,omitempty" azure:"ro"` } // GeoBackupPolicyProperties - The properties of the geo backup policy. @@ -3117,7 +3358,7 @@ type IPv6FirewallRulesClientGetOptions struct { // placeholder for future optional parameters } -// IPv6FirewallRulesClientListByServerOptions contains the optional parameters for the IPv6FirewallRulesClient.ListByServer +// IPv6FirewallRulesClientListByServerOptions contains the optional parameters for the IPv6FirewallRulesClient.NewListByServerPager // method. type IPv6FirewallRulesClientListByServerOptions struct { // placeholder for future optional parameters @@ -3182,6 +3423,9 @@ type ImportExportExtensionsOperationResult struct { // ImportExportExtensionsOperationResultProperties - Contains the operation result properties for import/export operation. type ImportExportExtensionsOperationResultProperties struct { + // READ-ONLY; Blob URI. + BlobURI *string `json:"blobUri,omitempty" azure:"ro"` + // READ-ONLY; Database name. DatabaseName *string `json:"databaseName,omitempty" azure:"ro"` @@ -3191,6 +3435,12 @@ type ImportExportExtensionsOperationResultProperties struct { // READ-ONLY; Last modified time. LastModifiedTime *string `json:"lastModifiedTime,omitempty" azure:"ro"` + // READ-ONLY; Gets the status of private endpoints associated with this request. + PrivateEndpointConnections []*PrivateEndpointConnectionRequestStatus `json:"privateEndpointConnections,omitempty" azure:"ro"` + + // READ-ONLY; Queued time. + QueuedTime *string `json:"queuedTime,omitempty" azure:"ro"` + // READ-ONLY; Request Id. RequestID *string `json:"requestId,omitempty" azure:"ro"` @@ -3326,6 +3576,9 @@ type InstanceFailoverGroupProperties struct { // Read-only endpoint of the failover group instance. ReadOnlyEndpoint *InstanceFailoverGroupReadOnlyEndpoint `json:"readOnlyEndpoint,omitempty"` + // Type of the geo-secondary instance. Set 'Standby' if the instance is used as a DR option only. + SecondaryType *SecondaryInstanceType `json:"secondaryType,omitempty"` + // READ-ONLY; Local replication role of the failover group instance. ReplicationRole *InstanceFailoverGroupReplicationRole `json:"replicationRole,omitempty" azure:"ro"` @@ -3383,7 +3636,7 @@ type InstanceFailoverGroupsClientGetOptions struct { // placeholder for future optional parameters } -// InstanceFailoverGroupsClientListByLocationOptions contains the optional parameters for the InstanceFailoverGroupsClient.ListByLocation +// InstanceFailoverGroupsClientListByLocationOptions contains the optional parameters for the InstanceFailoverGroupsClient.NewListByLocationPager // method. type InstanceFailoverGroupsClientListByLocationOptions struct { // placeholder for future optional parameters @@ -3516,13 +3769,13 @@ type InstancePoolsClientGetOptions struct { // placeholder for future optional parameters } -// InstancePoolsClientListByResourceGroupOptions contains the optional parameters for the InstancePoolsClient.ListByResourceGroup +// InstancePoolsClientListByResourceGroupOptions contains the optional parameters for the InstancePoolsClient.NewListByResourceGroupPager // method. type InstancePoolsClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// InstancePoolsClientListOptions contains the optional parameters for the InstancePoolsClient.List method. +// InstancePoolsClientListOptions contains the optional parameters for the InstancePoolsClient.NewListPager method. type InstancePoolsClientListOptions struct { // placeholder for future optional parameters } @@ -3614,7 +3867,7 @@ type JobAgentsClientGetOptions struct { // placeholder for future optional parameters } -// JobAgentsClientListByServerOptions contains the optional parameters for the JobAgentsClient.ListByServer method. +// JobAgentsClientListByServerOptions contains the optional parameters for the JobAgentsClient.NewListByServerPager method. type JobAgentsClientListByServerOptions struct { // placeholder for future optional parameters } @@ -3668,7 +3921,8 @@ type JobCredentialsClientGetOptions struct { // placeholder for future optional parameters } -// JobCredentialsClientListByAgentOptions contains the optional parameters for the JobCredentialsClient.ListByAgent method. +// JobCredentialsClientListByAgentOptions contains the optional parameters for the JobCredentialsClient.NewListByAgentPager +// method. type JobCredentialsClientListByAgentOptions struct { // placeholder for future optional parameters } @@ -3774,7 +4028,8 @@ type JobExecutionsClientGetOptions struct { // placeholder for future optional parameters } -// JobExecutionsClientListByAgentOptions contains the optional parameters for the JobExecutionsClient.ListByAgent method. +// JobExecutionsClientListByAgentOptions contains the optional parameters for the JobExecutionsClient.NewListByAgentPager +// method. type JobExecutionsClientListByAgentOptions struct { // If specified, only job executions created before the specified time are included. CreateTimeMax *time.Time @@ -3787,12 +4042,12 @@ type JobExecutionsClientListByAgentOptions struct { // If specified, only active or only completed job executions are included. IsActive *bool // The number of elements in the collection to skip. - Skip *int32 + Skip *int64 // The number of elements to return from the collection. - Top *int32 + Top *int64 } -// JobExecutionsClientListByJobOptions contains the optional parameters for the JobExecutionsClient.ListByJob method. +// JobExecutionsClientListByJobOptions contains the optional parameters for the JobExecutionsClient.NewListByJobPager method. type JobExecutionsClientListByJobOptions struct { // If specified, only job executions created before the specified time are included. CreateTimeMax *time.Time @@ -3805,9 +4060,9 @@ type JobExecutionsClientListByJobOptions struct { // If specified, only active or only completed job executions are included. IsActive *bool // The number of elements in the collection to skip. - Skip *int32 + Skip *int64 // The number of elements to return from the collection. - Top *int32 + Top *int64 } // JobListResult - A list of jobs. @@ -3899,7 +4154,7 @@ type JobStepExecutionsClientGetOptions struct { // placeholder for future optional parameters } -// JobStepExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobStepExecutionsClient.ListByJobExecution +// JobStepExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobStepExecutionsClient.NewListByJobExecutionPager // method. type JobStepExecutionsClientListByJobExecutionOptions struct { // If specified, only job executions created before the specified time are included. @@ -3913,9 +4168,9 @@ type JobStepExecutionsClientListByJobExecutionOptions struct { // If specified, only active or only completed job executions are included. IsActive *bool // The number of elements in the collection to skip. - Skip *int32 + Skip *int64 // The number of elements to return from the collection. - Top *int32 + Top *int64 } // JobStepListResult - A list of job steps. @@ -3996,12 +4251,12 @@ type JobStepsClientGetOptions struct { // placeholder for future optional parameters } -// JobStepsClientListByJobOptions contains the optional parameters for the JobStepsClient.ListByJob method. +// JobStepsClientListByJobOptions contains the optional parameters for the JobStepsClient.NewListByJobPager method. type JobStepsClientListByJobOptions struct { // placeholder for future optional parameters } -// JobStepsClientListByVersionOptions contains the optional parameters for the JobStepsClient.ListByVersion method. +// JobStepsClientListByVersionOptions contains the optional parameters for the JobStepsClient.NewListByVersionPager method. type JobStepsClientListByVersionOptions struct { // placeholder for future optional parameters } @@ -4036,7 +4291,7 @@ type JobTargetExecutionsClientGetOptions struct { // placeholder for future optional parameters } -// JobTargetExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobTargetExecutionsClient.ListByJobExecution +// JobTargetExecutionsClientListByJobExecutionOptions contains the optional parameters for the JobTargetExecutionsClient.NewListByJobExecutionPager // method. type JobTargetExecutionsClientListByJobExecutionOptions struct { // If specified, only job executions created before the specified time are included. @@ -4050,12 +4305,12 @@ type JobTargetExecutionsClientListByJobExecutionOptions struct { // If specified, only active or only completed job executions are included. IsActive *bool // The number of elements in the collection to skip. - Skip *int32 + Skip *int64 // The number of elements to return from the collection. - Top *int32 + Top *int64 } -// JobTargetExecutionsClientListByStepOptions contains the optional parameters for the JobTargetExecutionsClient.ListByStep +// JobTargetExecutionsClientListByStepOptions contains the optional parameters for the JobTargetExecutionsClient.NewListByStepPager // method. type JobTargetExecutionsClientListByStepOptions struct { // If specified, only job executions created before the specified time are included. @@ -4069,9 +4324,9 @@ type JobTargetExecutionsClientListByStepOptions struct { // If specified, only active or only completed job executions are included. IsActive *bool // The number of elements in the collection to skip. - Skip *int32 + Skip *int64 // The number of elements to return from the collection. - Top *int32 + Top *int64 } // JobTargetGroup - A group of job targets. @@ -4120,7 +4375,8 @@ type JobTargetGroupsClientGetOptions struct { // placeholder for future optional parameters } -// JobTargetGroupsClientListByAgentOptions contains the optional parameters for the JobTargetGroupsClient.ListByAgent method. +// JobTargetGroupsClientListByAgentOptions contains the optional parameters for the JobTargetGroupsClient.NewListByAgentPager +// method. type JobTargetGroupsClientListByAgentOptions struct { // placeholder for future optional parameters } @@ -4151,7 +4407,7 @@ type JobVersionsClientGetOptions struct { // placeholder for future optional parameters } -// JobVersionsClientListByJobOptions contains the optional parameters for the JobVersionsClient.ListByJob method. +// JobVersionsClientListByJobOptions contains the optional parameters for the JobVersionsClient.NewListByJobPager method. type JobVersionsClientListByJobOptions struct { // placeholder for future optional parameters } @@ -4171,7 +4427,7 @@ type JobsClientGetOptions struct { // placeholder for future optional parameters } -// JobsClientListByAgentOptions contains the optional parameters for the JobsClient.ListByAgent method. +// JobsClientListByAgentOptions contains the optional parameters for the JobsClient.NewListByAgentPager method. type JobsClientListByAgentOptions struct { // placeholder for future optional parameters } @@ -4210,7 +4466,7 @@ type LedgerDigestUploadsClientGetOptions struct { // placeholder for future optional parameters } -// LedgerDigestUploadsClientListByDatabaseOptions contains the optional parameters for the LedgerDigestUploadsClient.ListByDatabase +// LedgerDigestUploadsClientListByDatabaseOptions contains the optional parameters for the LedgerDigestUploadsClient.NewListByDatabasePager // method. type LedgerDigestUploadsClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -4434,7 +4690,7 @@ type LongTermRetentionBackupsClientGetOptions struct { // placeholder for future optional parameters } -// LongTermRetentionBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByDatabase +// LongTermRetentionBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByDatabasePager // method. type LongTermRetentionBackupsClientListByDatabaseOptions struct { // Whether to query against just live databases, just deleted databases, or all databases. @@ -4443,7 +4699,7 @@ type LongTermRetentionBackupsClientListByDatabaseOptions struct { OnlyLatestPerDatabase *bool } -// LongTermRetentionBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByLocation +// LongTermRetentionBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByLocationPager // method. type LongTermRetentionBackupsClientListByLocationOptions struct { // Whether to query against just live databases, just deleted databases, or all databases. @@ -4452,7 +4708,7 @@ type LongTermRetentionBackupsClientListByLocationOptions struct { OnlyLatestPerDatabase *bool } -// LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByResourceGroupDatabase +// LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByResourceGroupDatabasePager // method. type LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions struct { // Whether to query against just live databases, just deleted databases, or all databases. @@ -4461,7 +4717,7 @@ type LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions struct { OnlyLatestPerDatabase *bool } -// LongTermRetentionBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByResourceGroupLocation +// LongTermRetentionBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByResourceGroupLocationPager // method. type LongTermRetentionBackupsClientListByResourceGroupLocationOptions struct { // Whether to query against just live databases, just deleted databases, or all databases. @@ -4470,7 +4726,7 @@ type LongTermRetentionBackupsClientListByResourceGroupLocationOptions struct { OnlyLatestPerDatabase *bool } -// LongTermRetentionBackupsClientListByResourceGroupServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByResourceGroupServer +// LongTermRetentionBackupsClientListByResourceGroupServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByResourceGroupServerPager // method. type LongTermRetentionBackupsClientListByResourceGroupServerOptions struct { // Whether to query against just live databases, just deleted databases, or all databases. @@ -4479,7 +4735,7 @@ type LongTermRetentionBackupsClientListByResourceGroupServerOptions struct { OnlyLatestPerDatabase *bool } -// LongTermRetentionBackupsClientListByServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.ListByServer +// LongTermRetentionBackupsClientListByServerOptions contains the optional parameters for the LongTermRetentionBackupsClient.NewListByServerPager // method. type LongTermRetentionBackupsClientListByServerOptions struct { // Whether to query against just live databases, just deleted databases, or all databases. @@ -4514,7 +4770,7 @@ type LongTermRetentionManagedInstanceBackupsClientGetOptions struct { // placeholder for future optional parameters } -// LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByDatabase +// LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByDatabasePager // method. type LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions struct { // Whether to query against just live databases, just deleted databases, or all databases. @@ -4523,7 +4779,7 @@ type LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions struct { OnlyLatestPerDatabase *bool } -// LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByInstance +// LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByInstancePager // method. type LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions struct { // Whether to query against just live databases, just deleted databases, or all databases. @@ -4532,7 +4788,7 @@ type LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions struct { OnlyLatestPerDatabase *bool } -// LongTermRetentionManagedInstanceBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.ListByLocation +// LongTermRetentionManagedInstanceBackupsClientListByLocationOptions contains the optional parameters for the LongTermRetentionManagedInstanceBackupsClient.NewListByLocationPager // method. type LongTermRetentionManagedInstanceBackupsClientListByLocationOptions struct { // Whether to query against just live databases, just deleted databases, or all databases. @@ -4542,7 +4798,7 @@ type LongTermRetentionManagedInstanceBackupsClientListByLocationOptions struct { } // LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions contains the optional parameters for the -// LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupDatabase method. +// LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupDatabasePager method. type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions struct { // Whether to query against just live databases, just deleted databases, or all databases. DatabaseState *DatabaseState @@ -4551,7 +4807,7 @@ type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOpt } // LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions contains the optional parameters for the -// LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupInstance method. +// LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupInstancePager method. type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions struct { // Whether to query against just live databases, just deleted databases, or all databases. DatabaseState *DatabaseState @@ -4560,7 +4816,7 @@ type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOpt } // LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions contains the optional parameters for the -// LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupLocation method. +// LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupLocationPager method. type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions struct { // Whether to query against just live databases, just deleted databases, or all databases. DatabaseState *DatabaseState @@ -4605,7 +4861,7 @@ type LongTermRetentionPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// LongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionPoliciesClient.ListByDatabase +// LongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the LongTermRetentionPoliciesClient.NewListByDatabasePager // method. type LongTermRetentionPoliciesClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -4757,7 +5013,7 @@ type ManagedBackupShortTermRetentionPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.ListByDatabase +// ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedBackupShortTermRetentionPoliciesClient.NewListByDatabasePager // method. type ManagedBackupShortTermRetentionPoliciesClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -4814,12 +5070,57 @@ type ManagedDatabase struct { Type *string `json:"type,omitempty" azure:"ro"` } +// ManagedDatabaseAdvancedThreatProtection - A managed database Advanced Threat Protection. +type ManagedDatabaseAdvancedThreatProtection struct { + // Resource properties. + Properties *AdvancedThreatProtectionProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; SystemData of AdvancedThreatProtectionResource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedDatabaseAdvancedThreatProtectionListResult - A list of the managed database's Advanced Threat Protection settings. +type ManagedDatabaseAdvancedThreatProtectionListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*ManagedDatabaseAdvancedThreatProtection `json:"value,omitempty" azure:"ro"` +} + +// ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate +// method. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ManagedDatabaseAdvancedThreatProtectionSettingsClient.Get +// method. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager +// method. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + // ManagedDatabaseColumnsClientGetOptions contains the optional parameters for the ManagedDatabaseColumnsClient.Get method. type ManagedDatabaseColumnsClientGetOptions struct { // placeholder for future optional parameters } -// ManagedDatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseColumnsClient.ListByDatabase +// ManagedDatabaseColumnsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseColumnsClient.NewListByDatabasePager // method. type ManagedDatabaseColumnsClientListByDatabaseOptions struct { Column []string @@ -4830,7 +5131,7 @@ type ManagedDatabaseColumnsClientListByDatabaseOptions struct { Table []string } -// ManagedDatabaseColumnsClientListByTableOptions contains the optional parameters for the ManagedDatabaseColumnsClient.ListByTable +// ManagedDatabaseColumnsClientListByTableOptions contains the optional parameters for the ManagedDatabaseColumnsClient.NewListByTablePager // method. type ManagedDatabaseColumnsClientListByTableOptions struct { // An OData filter expression that filters elements in the collection. @@ -4846,56 +5147,171 @@ type ManagedDatabaseListResult struct { Value []*ManagedDatabase `json:"value,omitempty" azure:"ro"` } -// ManagedDatabaseProperties - The managed database's properties. -type ManagedDatabaseProperties struct { - // Whether to auto complete restore of this managed database. - AutoCompleteRestore *bool `json:"autoCompleteRestore,omitempty"` +// ManagedDatabaseMoveDefinition - Contains the information necessary to perform a managed database move. +type ManagedDatabaseMoveDefinition struct { + // REQUIRED; The destination managed database ID + DestinationManagedDatabaseID *string `json:"destinationManagedDatabaseId,omitempty"` +} - // Collation of the metadata catalog. - CatalogCollation *CatalogCollationType `json:"catalogCollation,omitempty"` +// ManagedDatabaseMoveOperationListResult - List of managed database move operations. +type ManagedDatabaseMoveOperationListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` - // Collation of the managed database. - Collation *string `json:"collation,omitempty"` + // READ-ONLY; Array of results. + Value []*ManagedDatabaseMoveOperationResult `json:"value,omitempty" azure:"ro"` +} - // Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing - // database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be - // specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri - // and StorageContainerSasToken must be specified. Recovery: Creates a database - // by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to - // restore. RestoreLongTermRetentionBackup: Create a database by restoring from a - // long term retention backup (longTermRetentionBackupResourceId required). - CreateMode *ManagedDatabaseCreateMode `json:"createMode,omitempty"` +// ManagedDatabaseMoveOperationResult - A managed database move operation. +type ManagedDatabaseMoveOperationResult struct { + // Resource properties. + Properties *ManagedDatabaseMoveOperationResultProperties `json:"properties,omitempty"` - // Last backup file name for restore of this managed database. - LastBackupName *string `json:"lastBackupName,omitempty"` + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` - // The name of the Long Term Retention backup to be used for restore of this managed database. - LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"` + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` - // The resource identifier of the recoverable database associated with create operation of this database. - RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"` + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} - // The restorable dropped database resource id to restore when creating this database. - RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"` +// ManagedDatabaseMoveOperationResultProperties - Contains the operation result properties for managed database move operation. +type ManagedDatabaseMoveOperationResultProperties struct { + // READ-ONLY; The operation error code. + ErrorCode *int32 `json:"errorCode,omitempty" azure:"ro"` - // Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format) - // of the source database that will be restored to create the new database. - RestorePointInTime *time.Time `json:"restorePointInTime,omitempty"` + // READ-ONLY; The operation error description. + ErrorDescription *string `json:"errorDescription,omitempty" azure:"ro"` - // The resource identifier of the source database associated with create operation of this database. - SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` + // READ-ONLY; The operation error severity. + ErrorSeverity *int32 `json:"errorSeverity,omitempty" azure:"ro"` - // Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the storage container sas token. - StorageContainerSasToken *string `json:"storageContainerSasToken,omitempty"` + // READ-ONLY; Is move operation cancellable. + IsCancellable *bool `json:"isCancellable,omitempty" azure:"ro"` - // Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container - // where backups for this restore are stored. - StorageContainerURI *string `json:"storageContainerUri,omitempty"` + // READ-ONLY; Whether or not the error is a user error. + IsUserError *bool `json:"isUserError,omitempty" azure:"ro"` - // READ-ONLY; Creation date of the database. - CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + // READ-ONLY; The name of operation. + Operation *string `json:"operation,omitempty" azure:"ro"` - // READ-ONLY; Geo paired region. + // READ-ONLY; The friendly name of operation. + OperationFriendlyName *string `json:"operationFriendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Operation mode. + OperationMode *MoveOperationMode `json:"operationMode,omitempty" azure:"ro"` + + // READ-ONLY; Source database name. + SourceDatabaseName *string `json:"sourceDatabaseName,omitempty" azure:"ro"` + + // READ-ONLY; Source Managed Instance resource id. + SourceManagedInstanceID *string `json:"sourceManagedInstanceId,omitempty" azure:"ro"` + + // READ-ONLY; Source Managed Instance name. + SourceManagedInstanceName *string `json:"sourceManagedInstanceName,omitempty" azure:"ro"` + + // READ-ONLY; The operation start time. + StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` + + // READ-ONLY; The operation state. + State *ManagementOperationState `json:"state,omitempty" azure:"ro"` + + // READ-ONLY; Target database name. + TargetDatabaseName *string `json:"targetDatabaseName,omitempty" azure:"ro"` + + // READ-ONLY; Target Managed instance resource id. + TargetManagedInstanceID *string `json:"targetManagedInstanceId,omitempty" azure:"ro"` + + // READ-ONLY; Target Managed Instance name. + TargetManagedInstanceName *string `json:"targetManagedInstanceName,omitempty" azure:"ro"` +} + +// ManagedDatabaseMoveOperationsClientGetOptions contains the optional parameters for the ManagedDatabaseMoveOperationsClient.Get +// method. +type ManagedDatabaseMoveOperationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedDatabaseMoveOperationsClientListByLocationOptions contains the optional parameters for the ManagedDatabaseMoveOperationsClient.NewListByLocationPager +// method. +type ManagedDatabaseMoveOperationsClientListByLocationOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string + // Whether or not to only get the latest operation for each database. Has higher priority than $filter. + OnlyLatestPerDatabase *bool +} + +// ManagedDatabaseProperties - The managed database's properties. +type ManagedDatabaseProperties struct { + // Whether to auto complete restore of this managed database. + AutoCompleteRestore *bool `json:"autoCompleteRestore,omitempty"` + + // Collation of the metadata catalog. + CatalogCollation *CatalogCollationType `json:"catalogCollation,omitempty"` + + // Collation of the managed database. + Collation *string `json:"collation,omitempty"` + + // Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing + // database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be + // specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri + // and StorageContainerSasToken must be specified. Recovery: Creates a database + // by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to + // restore. RestoreLongTermRetentionBackup: Create a database by restoring from a + // long term retention backup (longTermRetentionBackupResourceId required). + CreateMode *ManagedDatabaseCreateMode `json:"createMode,omitempty"` + + // The restorable cross-subscription dropped database resource id to restore when creating this database. + CrossSubscriptionRestorableDroppedDatabaseID *string `json:"crossSubscriptionRestorableDroppedDatabaseId,omitempty"` + + // The resource identifier of the cross-subscription source database associated with create operation of this database. + CrossSubscriptionSourceDatabaseID *string `json:"crossSubscriptionSourceDatabaseId,omitempty"` + + // Target managed instance id used in cross-subscription restore. + CrossSubscriptionTargetManagedInstanceID *string `json:"crossSubscriptionTargetManagedInstanceId,omitempty"` + + // Whether or not this database is a ledger database, which means all tables in the database are ledger tables. Note: the + // value of this property cannot be changed after the database has been created. + IsLedgerOn *bool `json:"isLedgerOn,omitempty"` + + // Last backup file name for restore of this managed database. + LastBackupName *string `json:"lastBackupName,omitempty"` + + // The name of the Long Term Retention backup to be used for restore of this managed database. + LongTermRetentionBackupResourceID *string `json:"longTermRetentionBackupResourceId,omitempty"` + + // The resource identifier of the recoverable database associated with create operation of this database. + RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"` + + // The restorable dropped database resource id to restore when creating this database. + RestorableDroppedDatabaseID *string `json:"restorableDroppedDatabaseId,omitempty"` + + // Conditional. If createMode is PointInTimeRestore, this value is required. Specifies the point in time (ISO8601 format) + // of the source database that will be restored to create the new database. + RestorePointInTime *time.Time `json:"restorePointInTime,omitempty"` + + // The resource identifier of the source database associated with create operation of this database. + SourceDatabaseID *string `json:"sourceDatabaseId,omitempty"` + + // Conditional. If createMode is RestoreExternalBackup, this value is used. Specifies the identity used for storage container + // authentication. Can be 'SharedAccessSignature' or 'ManagedIdentity'; if not + // specified 'SharedAccessSignature' is assumed. + StorageContainerIdentity *string `json:"storageContainerIdentity,omitempty"` + + // Conditional. If createMode is RestoreExternalBackup and storageContainerIdentity is not ManagedIdentity, this value is + // required. Specifies the storage container sas token. + StorageContainerSasToken *string `json:"storageContainerSasToken,omitempty"` + + // Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container + // where backups for this restore are stored. + StorageContainerURI *string `json:"storageContainerUri,omitempty"` + + // READ-ONLY; Creation date of the database. + CreationDate *time.Time `json:"creationDate,omitempty" azure:"ro"` + + // READ-ONLY; Geo paired region. DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty" azure:"ro"` // READ-ONLY; Earliest restore point in time for point in time restore. @@ -4913,7 +5329,7 @@ type ManagedDatabaseQueriesClientGetOptions struct { // placeholder for future optional parameters } -// ManagedDatabaseQueriesClientListByQueryOptions contains the optional parameters for the ManagedDatabaseQueriesClient.ListByQuery +// ManagedDatabaseQueriesClientListByQueryOptions contains the optional parameters for the ManagedDatabaseQueriesClient.NewListByQueryPager // method. type ManagedDatabaseQueriesClientListByQueryOptions struct { // End time for observed period. @@ -4930,6 +5346,27 @@ type ManagedDatabaseRecommendedSensitivityLabelsClientUpdateOptions struct { // placeholder for future optional parameters } +// ManagedDatabaseRestoreDetailsBackupSetProperties - The managed database's restore details backup set properties. +type ManagedDatabaseRestoreDetailsBackupSetProperties struct { + // READ-ONLY; Backup size. + BackupSizeMB *int32 `json:"backupSizeMB,omitempty" azure:"ro"` + + // READ-ONLY; First stripe name. + FirstStripeName *string `json:"firstStripeName,omitempty" azure:"ro"` + + // READ-ONLY; Number of stripes. + NumberOfStripes *int32 `json:"numberOfStripes,omitempty" azure:"ro"` + + // READ-ONLY; Last restored file time. + RestoreFinishedTimestampUTC *time.Time `json:"restoreFinishedTimestampUtc,omitempty" azure:"ro"` + + // READ-ONLY; Last restored file time. + RestoreStartedTimestampUTC *time.Time `json:"restoreStartedTimestampUtc,omitempty" azure:"ro"` + + // READ-ONLY; Backup set status. + Status *string `json:"status,omitempty" azure:"ro"` +} + // ManagedDatabaseRestoreDetailsClientGetOptions contains the optional parameters for the ManagedDatabaseRestoreDetailsClient.Get // method. type ManagedDatabaseRestoreDetailsClientGetOptions struct { @@ -4941,9 +5378,24 @@ type ManagedDatabaseRestoreDetailsProperties struct { // READ-ONLY; The reason why restore is in Blocked state. BlockReason *string `json:"blockReason,omitempty" azure:"ro"` + // READ-ONLY; Current backup type. + CurrentBackupType *string `json:"currentBackupType,omitempty" azure:"ro"` + + // READ-ONLY; Current restore plan size MB. + CurrentRestorePlanSizeMB *int32 `json:"currentRestorePlanSizeMB,omitempty" azure:"ro"` + + // READ-ONLY; Current restored size MB. + CurrentRestoredSizeMB *int32 `json:"currentRestoredSizeMB,omitempty" azure:"ro"` + // READ-ONLY; Current restoring file name. CurrentRestoringFileName *string `json:"currentRestoringFileName,omitempty" azure:"ro"` + // READ-ONLY; Diff backup sets. + DiffBackupSets []*ManagedDatabaseRestoreDetailsBackupSetProperties `json:"diffBackupSets,omitempty" azure:"ro"` + + // READ-ONLY; Full backup sets. + FullBackupSets []*ManagedDatabaseRestoreDetailsBackupSetProperties `json:"fullBackupSets,omitempty" azure:"ro"` + // READ-ONLY; Last restored file name. LastRestoredFileName *string `json:"lastRestoredFileName,omitempty" azure:"ro"` @@ -4956,17 +5408,38 @@ type ManagedDatabaseRestoreDetailsProperties struct { // READ-ONLY; Last uploaded file time. LastUploadedFileTime *time.Time `json:"lastUploadedFileTime,omitempty" azure:"ro"` + // READ-ONLY; Log backup sets. + LogBackupSets []*ManagedDatabaseRestoreDetailsBackupSetProperties `json:"logBackupSets,omitempty" azure:"ro"` + // READ-ONLY; Number of files detected. - NumberOfFilesDetected *int64 `json:"numberOfFilesDetected,omitempty" azure:"ro"` + NumberOfFilesDetected *int32 `json:"numberOfFilesDetected,omitempty" azure:"ro"` + + // READ-ONLY; Number of files queued. + NumberOfFilesQueued *int32 `json:"numberOfFilesQueued,omitempty" azure:"ro"` + + // READ-ONLY; Number of files restored. + NumberOfFilesRestored *int32 `json:"numberOfFilesRestored,omitempty" azure:"ro"` + + // READ-ONLY; Number of files restoring. + NumberOfFilesRestoring *int32 `json:"numberOfFilesRestoring,omitempty" azure:"ro"` + + // READ-ONLY; Number of files skipped. + NumberOfFilesSkipped *int32 `json:"numberOfFilesSkipped,omitempty" azure:"ro"` + + // READ-ONLY; Number of files unrestorable. + NumberOfFilesUnrestorable *int32 `json:"numberOfFilesUnrestorable,omitempty" azure:"ro"` // READ-ONLY; Percent completed. - PercentCompleted *float64 `json:"percentCompleted,omitempty" azure:"ro"` + PercentCompleted *int32 `json:"percentCompleted,omitempty" azure:"ro"` // READ-ONLY; Restore status. Status *string `json:"status,omitempty" azure:"ro"` - // READ-ONLY; List of unrestorable files. - UnrestorableFiles []*string `json:"unrestorableFiles,omitempty" azure:"ro"` + // READ-ONLY; Restore type. + Type *string `json:"type,omitempty" azure:"ro"` + + // READ-ONLY; Unrestorable files. + UnrestorableFiles []*ManagedDatabaseRestoreDetailsUnrestorableFileProperties `json:"unrestorableFiles,omitempty" azure:"ro"` } // ManagedDatabaseRestoreDetailsResult - A managed database restore details. @@ -4984,12 +5457,18 @@ type ManagedDatabaseRestoreDetailsResult struct { Type *string `json:"type,omitempty" azure:"ro"` } +// ManagedDatabaseRestoreDetailsUnrestorableFileProperties - The managed database's restore details unrestorable file properties. +type ManagedDatabaseRestoreDetailsUnrestorableFileProperties struct { + // READ-ONLY; File name. + Name *string `json:"name,omitempty" azure:"ro"` +} + // ManagedDatabaseSchemasClientGetOptions contains the optional parameters for the ManagedDatabaseSchemasClient.Get method. type ManagedDatabaseSchemasClientGetOptions struct { // placeholder for future optional parameters } -// ManagedDatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSchemasClient.ListByDatabase +// ManagedDatabaseSchemasClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSchemasClient.NewListByDatabasePager // method. type ManagedDatabaseSchemasClientListByDatabaseOptions struct { // An OData filter expression that filters elements in the collection. @@ -5008,7 +5487,7 @@ type ManagedDatabaseSecurityAlertPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.ListByDatabase +// ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityAlertPoliciesClient.NewListByDatabasePager // method. type ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -5038,17 +5517,17 @@ type ManagedDatabaseSecurityAlertPolicyListResult struct { Value []*ManagedDatabaseSecurityAlertPolicy `json:"value,omitempty" azure:"ro"` } -// ManagedDatabaseSecurityEventsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityEventsClient.ListByDatabase +// ManagedDatabaseSecurityEventsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSecurityEventsClient.NewListByDatabasePager // method. type ManagedDatabaseSecurityEventsClientListByDatabaseOptions struct { // An OData filter expression that filters elements in the collection. Filter *string // The number of elements in the collection to skip. - Skip *int32 + Skip *int64 // An opaque token that identifies a starting point in the collection. Skiptoken *string // The number of elements to return from the collection. - Top *int32 + Top *int64 } // ManagedDatabaseSensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.CreateOrUpdate @@ -5081,7 +5560,14 @@ type ManagedDatabaseSensitivityLabelsClientGetOptions struct { // placeholder for future optional parameters } -// ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.ListCurrentByDatabase +// ManagedDatabaseSensitivityLabelsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.NewListByDatabasePager +// method. +type ManagedDatabaseSensitivityLabelsClientListByDatabaseOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string +} + +// ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.NewListCurrentByDatabasePager // method. type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions struct { Count *bool @@ -5090,7 +5576,7 @@ type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions struct { SkipToken *string } -// ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.ListRecommendedByDatabase +// ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the ManagedDatabaseSensitivityLabelsClient.NewListRecommendedByDatabasePager // method. type ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions struct { // An OData filter expression that filters elements in the collection. @@ -5106,12 +5592,21 @@ type ManagedDatabaseSensitivityLabelsClientUpdateOptions struct { // placeholder for future optional parameters } +// ManagedDatabaseStartMoveDefinition - Contains the information necessary to start a managed database move. +type ManagedDatabaseStartMoveDefinition struct { + // REQUIRED; The destination managed database ID + DestinationManagedDatabaseID *string `json:"destinationManagedDatabaseId,omitempty"` + + // The move operation mode. + OperationMode *MoveOperationMode `json:"operationMode,omitempty"` +} + // ManagedDatabaseTablesClientGetOptions contains the optional parameters for the ManagedDatabaseTablesClient.Get method. type ManagedDatabaseTablesClientGetOptions struct { // placeholder for future optional parameters } -// ManagedDatabaseTablesClientListBySchemaOptions contains the optional parameters for the ManagedDatabaseTablesClient.ListBySchema +// ManagedDatabaseTablesClientListBySchemaOptions contains the optional parameters for the ManagedDatabaseTablesClient.NewListBySchemaPager // method. type ManagedDatabaseTablesClientListBySchemaOptions struct { // An OData filter expression that filters elements in the collection. @@ -5130,7 +5625,7 @@ type ManagedDatabaseTransparentDataEncryptionClientGetOptions struct { // placeholder for future optional parameters } -// ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.ListByDatabase +// ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseTransparentDataEncryptionClient.NewListByDatabasePager // method. type ManagedDatabaseTransparentDataEncryptionClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -5182,7 +5677,7 @@ type ManagedDatabaseVulnerabilityAssessmentScansClientGetOptions struct { // placeholder for future optional parameters } -// ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.ListByDatabase +// ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentScansClient.NewListByDatabasePager // method. type ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -5206,12 +5701,26 @@ type ManagedDatabaseVulnerabilityAssessmentsClientGetOptions struct { // placeholder for future optional parameters } -// ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.ListByDatabase +// ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions contains the optional parameters for the ManagedDatabaseVulnerabilityAssessmentsClient.NewListByDatabasePager // method. type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseOptions struct { // placeholder for future optional parameters } +// ManagedDatabasesClientBeginCancelMoveOptions contains the optional parameters for the ManagedDatabasesClient.BeginCancelMove +// method. +type ManagedDatabasesClientBeginCancelMoveOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedDatabasesClientBeginCompleteMoveOptions contains the optional parameters for the ManagedDatabasesClient.BeginCompleteMove +// method. +type ManagedDatabasesClientBeginCompleteMoveOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ManagedDatabasesClientBeginCompleteRestoreOptions contains the optional parameters for the ManagedDatabasesClient.BeginCompleteRestore // method. type ManagedDatabasesClientBeginCompleteRestoreOptions struct { @@ -5232,6 +5741,13 @@ type ManagedDatabasesClientBeginDeleteOptions struct { ResumeToken string } +// ManagedDatabasesClientBeginStartMoveOptions contains the optional parameters for the ManagedDatabasesClient.BeginStartMove +// method. +type ManagedDatabasesClientBeginStartMoveOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ManagedDatabasesClientBeginUpdateOptions contains the optional parameters for the ManagedDatabasesClient.BeginUpdate method. type ManagedDatabasesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. @@ -5243,13 +5759,13 @@ type ManagedDatabasesClientGetOptions struct { // placeholder for future optional parameters } -// ManagedDatabasesClientListByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.ListByInstance +// ManagedDatabasesClientListByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.NewListByInstancePager // method. type ManagedDatabasesClientListByInstanceOptions struct { // placeholder for future optional parameters } -// ManagedDatabasesClientListInaccessibleByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.ListInaccessibleByInstance +// ManagedDatabasesClientListInaccessibleByInstanceOptions contains the optional parameters for the ManagedDatabasesClient.NewListInaccessibleByInstancePager // method. type ManagedDatabasesClientListInaccessibleByInstanceOptions struct { // placeholder for future optional parameters @@ -5266,7 +5782,7 @@ type ManagedInstance struct { // Resource properties. Properties *ManagedInstanceProperties `json:"properties,omitempty"` - // Managed instance SKU. Allowed values for sku.name: GPGen4, GPGen5, BCGen4, BCGen5 + // Managed instance SKU. Allowed values for sku.name: GPGen5, GPG8IM, GPG8IH, BCGen5, BCG8IM, BCG8IH SKU *SKU `json:"sku,omitempty"` // Resource tags. @@ -5341,12 +5857,58 @@ type ManagedInstanceAdministratorsClientGetOptions struct { // placeholder for future optional parameters } -// ManagedInstanceAdministratorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.ListByInstance +// ManagedInstanceAdministratorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAdministratorsClient.NewListByInstancePager // method. type ManagedInstanceAdministratorsClientListByInstanceOptions struct { // placeholder for future optional parameters } +// ManagedInstanceAdvancedThreatProtection - A managed instance Advanced Threat Protection. +type ManagedInstanceAdvancedThreatProtection struct { + // Resource properties. + Properties *AdvancedThreatProtectionProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; SystemData of AdvancedThreatProtectionResource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedInstanceAdvancedThreatProtectionListResult - A list of the managed instance's Advanced Threat Protection settings. +type ManagedInstanceAdvancedThreatProtectionListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*ManagedInstanceAdvancedThreatProtection `json:"value,omitempty" azure:"ro"` +} + +// ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the +// ManagedInstanceAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate method. +type ManagedInstanceAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ManagedInstanceAdvancedThreatProtectionSettingsClient.Get +// method. +type ManagedInstanceAdvancedThreatProtectionSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAdvancedThreatProtectionSettingsClient.NewListByInstancePager +// method. +type ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceOptions struct { + // placeholder for future optional parameters +} + // ManagedInstanceAzureADOnlyAuthListResult - A list of active directory only authentications. type ManagedInstanceAzureADOnlyAuthListResult struct { // READ-ONLY; Link to retrieve next page of results. @@ -5397,12 +5959,103 @@ type ManagedInstanceAzureADOnlyAuthenticationsClientGetOptions struct { // placeholder for future optional parameters } -// ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.ListByInstance +// ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceAzureADOnlyAuthenticationsClient.NewListByInstancePager // method. type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceOptions struct { // placeholder for future optional parameters } +// ManagedInstanceDtc - SQL Managed Instance DTC +type ManagedInstanceDtc struct { + // Resource properties. + Properties *ManagedInstanceDtcProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedInstanceDtcListResult - A list of managed instance's DTCs. +type ManagedInstanceDtcListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*ManagedInstanceDtc `json:"value,omitempty" azure:"ro"` +} + +// ManagedInstanceDtcProperties - The properties of managed instance DTC. +type ManagedInstanceDtcProperties struct { + // Active status of managed instance DTC. + DtcEnabled *bool `json:"dtcEnabled,omitempty"` + + // External dns suffix search list of managed instance DTC. + ExternalDNSSuffixSearchList []*string `json:"externalDnsSuffixSearchList,omitempty"` + + // Security settings of managed instance DTC. + SecuritySettings *ManagedInstanceDtcSecuritySettings `json:"securitySettings,omitempty"` + + // READ-ONLY; Host name dns suffix of managed instance DTC. + DtcHostNameDNSSuffix *string `json:"dtcHostNameDnsSuffix,omitempty" azure:"ro"` + + // READ-ONLY; Provisioning state of managed instance DTC. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` +} + +// ManagedInstanceDtcSecuritySettings - The Security Settings of managed instance DTC. +type ManagedInstanceDtcSecuritySettings struct { + // Allow SNA LU 6.2 Transactions to managed instance DTC. + SnaLu6Point2TransactionsEnabled *bool `json:"snaLu6point2TransactionsEnabled,omitempty"` + + // Transaction Manager communication settings of managed instance DTC. + TransactionManagerCommunicationSettings *ManagedInstanceDtcTransactionManagerCommunicationSettings `json:"transactionManagerCommunicationSettings,omitempty"` + + // Default timeout for XA Transactions (in seconds). + XaTransactionsDefaultTimeout *int32 `json:"xaTransactionsDefaultTimeout,omitempty"` + + // Allow XA Transactions to managed instance DTC. + XaTransactionsEnabled *bool `json:"xaTransactionsEnabled,omitempty"` + + // Maximum timeout for XA Transactions (in seconds). + XaTransactionsMaximumTimeout *int32 `json:"xaTransactionsMaximumTimeout,omitempty"` +} + +// ManagedInstanceDtcTransactionManagerCommunicationSettings - The Transaction Manager Communication Settings of managed instance +// DTC. +type ManagedInstanceDtcTransactionManagerCommunicationSettings struct { + // Allow Inbound traffic to managed instance DTC. + AllowInboundEnabled *bool `json:"allowInboundEnabled,omitempty"` + + // Allow Outbound traffic of managed instance DTC. + AllowOutboundEnabled *bool `json:"allowOutboundEnabled,omitempty"` + + // Authentication type of managed instance DTC. + Authentication *string `json:"authentication,omitempty"` +} + +// ManagedInstanceDtcsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedInstanceDtcsClient.BeginCreateOrUpdate +// method. +type ManagedInstanceDtcsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstanceDtcsClientGetOptions contains the optional parameters for the ManagedInstanceDtcsClient.Get method. +type ManagedInstanceDtcsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedInstanceDtcsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstanceDtcsClient.NewListByManagedInstancePager +// method. +type ManagedInstanceDtcsClientListByManagedInstanceOptions struct { + // placeholder for future optional parameters +} + // ManagedInstanceEditionCapability - The managed server capability type ManagedInstanceEditionCapability struct { // The reason for the capability not being available. @@ -5489,7 +6142,7 @@ type ManagedInstanceEncryptionProtectorsClientGetOptions struct { // placeholder for future optional parameters } -// ManagedInstanceEncryptionProtectorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.ListByInstance +// ManagedInstanceEncryptionProtectorsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceEncryptionProtectorsClient.NewListByInstancePager // method. type ManagedInstanceEncryptionProtectorsClientListByInstanceOptions struct { // placeholder for future optional parameters @@ -5601,7 +6254,7 @@ type ManagedInstanceKeysClientGetOptions struct { // placeholder for future optional parameters } -// ManagedInstanceKeysClientListByInstanceOptions contains the optional parameters for the ManagedInstanceKeysClient.ListByInstance +// ManagedInstanceKeysClientListByInstanceOptions contains the optional parameters for the ManagedInstanceKeysClient.NewListByInstancePager // method. type ManagedInstanceKeysClientListByInstanceOptions struct { // An OData filter expression that filters elements in the collection. @@ -5672,13 +6325,20 @@ type ManagedInstanceLongTermRetentionPoliciesClientBeginCreateOrUpdateOptions st ResumeToken string } +// ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.BeginDelete +// method. +type ManagedInstanceLongTermRetentionPoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ManagedInstanceLongTermRetentionPoliciesClientGetOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.Get // method. type ManagedInstanceLongTermRetentionPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.ListByDatabase +// ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions contains the optional parameters for the ManagedInstanceLongTermRetentionPoliciesClient.NewListByDatabasePager // method. type ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -5807,7 +6467,7 @@ type ManagedInstanceOperationSteps struct { CurrentStep *int32 `json:"currentStep,omitempty" azure:"ro"` // READ-ONLY; The operation steps list. - StepsList []*UpsertManagedServerOperationStep `json:"stepsList,omitempty" azure:"ro"` + StepsList []*UpsertManagedServerOperationStepWithEstimatesAndDuration `json:"stepsList,omitempty" azure:"ro"` // READ-ONLY; The total number of operation steps. TotalSteps *string `json:"totalSteps,omitempty" azure:"ro"` @@ -5825,7 +6485,7 @@ type ManagedInstanceOperationsClientGetOptions struct { // placeholder for future optional parameters } -// ManagedInstanceOperationsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstanceOperationsClient.ListByManagedInstance +// ManagedInstanceOperationsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstanceOperationsClient.NewListByManagedInstancePager // method. type ManagedInstanceOperationsClientListByManagedInstanceOptions struct { // placeholder for future optional parameters @@ -5905,7 +6565,7 @@ type ManagedInstancePrivateEndpointConnectionsClientGetOptions struct { // placeholder for future optional parameters } -// ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.ListByManagedInstance +// ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancePrivateEndpointConnectionsClient.NewListByManagedInstancePager // method. type ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceOptions struct { // placeholder for future optional parameters @@ -5947,6 +6607,9 @@ type ManagedInstancePrivateLinkProperties struct { // READ-ONLY; The private link resource required member names. RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` + + // READ-ONLY; The private link resource required zone names. + RequiredZoneNames []*string `json:"requiredZoneNames,omitempty" azure:"ro"` } // ManagedInstancePrivateLinkResourcesClientGetOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.Get @@ -5955,7 +6618,7 @@ type ManagedInstancePrivateLinkResourcesClientGetOptions struct { // placeholder for future optional parameters } -// ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.ListByManagedInstance +// ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancePrivateLinkResourcesClient.NewListByManagedInstancePager // method. type ManagedInstancePrivateLinkResourcesClientListByManagedInstanceOptions struct { // placeholder for future optional parameters @@ -5981,7 +6644,9 @@ type ManagedInstanceProperties struct { // The administrator login password (required for managed instance creation). AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // The Azure Active Directory administrator of the server. + // The Azure Active Directory administrator of the instance. This can only be used at instance create time. If used for instance + // update, it will be ignored or it will result in an error. For updates + // individual APIs will need to be used. Administrators *ManagedInstanceExternalAdministrator `json:"administrators,omitempty"` // Collation of the managed instance. @@ -6035,7 +6700,8 @@ type ManagedInstanceProperties struct { // The resource identifier of the source managed instance associated with create operation of this instance. SourceManagedInstanceID *string `json:"sourceManagedInstanceId,omitempty"` - // Storage size in GB. Minimum value: 32. Maximum value: 8192. Increments of 32 GB allowed only. + // Storage size in GB. Minimum value: 32. Maximum value: 16384. Increments of 32 GB allowed only. Maximum value depends on + // the selected hardware family and number of vCores. StorageSizeInGB *int32 `json:"storageSizeInGB,omitempty"` // Subnet resource ID for the managed instance. @@ -6231,7 +6897,7 @@ type ManagedInstanceVulnerabilityAssessmentsClientGetOptions struct { // placeholder for future optional parameters } -// ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.ListByInstance +// ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions contains the optional parameters for the ManagedInstanceVulnerabilityAssessmentsClient.NewListByInstancePager // method. type ManagedInstanceVulnerabilityAssessmentsClientListByInstanceOptions struct { // placeholder for future optional parameters @@ -6259,6 +6925,18 @@ type ManagedInstancesClientBeginFailoverOptions struct { ResumeToken string } +// ManagedInstancesClientBeginStartOptions contains the optional parameters for the ManagedInstancesClient.BeginStart method. +type ManagedInstancesClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedInstancesClientBeginStopOptions contains the optional parameters for the ManagedInstancesClient.BeginStop method. +type ManagedInstancesClientBeginStopOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ManagedInstancesClientBeginUpdateOptions contains the optional parameters for the ManagedInstancesClient.BeginUpdate method. type ManagedInstancesClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. @@ -6271,14 +6949,14 @@ type ManagedInstancesClientGetOptions struct { Expand *string } -// ManagedInstancesClientListByInstancePoolOptions contains the optional parameters for the ManagedInstancesClient.ListByInstancePool +// ManagedInstancesClientListByInstancePoolOptions contains the optional parameters for the ManagedInstancesClient.NewListByInstancePoolPager // method. type ManagedInstancesClientListByInstancePoolOptions struct { // The child resources to include in the response. Expand *string } -// ManagedInstancesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancesClient.ListByManagedInstance +// ManagedInstancesClientListByManagedInstanceOptions contains the optional parameters for the ManagedInstancesClient.NewListByManagedInstancePager // method. type ManagedInstancesClientListByManagedInstanceOptions struct { // Aggregation function to be used, default value is 'sum' @@ -6297,46 +6975,188 @@ type ManagedInstancesClientListByManagedInstanceOptions struct { StartTime *string } -// ManagedInstancesClientListByResourceGroupOptions contains the optional parameters for the ManagedInstancesClient.ListByResourceGroup +// ManagedInstancesClientListByResourceGroupOptions contains the optional parameters for the ManagedInstancesClient.NewListByResourceGroupPager // method. type ManagedInstancesClientListByResourceGroupOptions struct { // The child resources to include in the response. Expand *string } -// ManagedInstancesClientListOptions contains the optional parameters for the ManagedInstancesClient.List method. +// ManagedInstancesClientListOptions contains the optional parameters for the ManagedInstancesClient.NewListPager method. type ManagedInstancesClientListOptions struct { // The child resources to include in the response. Expand *string } -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional -// parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate method. -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct { +// ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions contains the optional parameters for the +// ManagedInstancesClient.NewListOutboundNetworkDependenciesByManagedInstancePager method. +type ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceOptions struct { + // placeholder for future optional parameters +} + +// ManagedLedgerDigestUploads - Azure SQL Database ledger digest upload settings. +type ManagedLedgerDigestUploads struct { + // Resource properties. + Properties *ManagedLedgerDigestUploadsProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.BeginCreateOrUpdate +// method. +type ManagedLedgerDigestUploadsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters -// for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginUpdate method. -type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions struct { +// ManagedLedgerDigestUploadsClientBeginDisableOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.BeginDisable +// method. +type ManagedLedgerDigestUploadsClientBeginDisableOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Get method. +// ManagedLedgerDigestUploadsClientGetOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.Get +// method. +type ManagedLedgerDigestUploadsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedLedgerDigestUploadsClientListByDatabaseOptions contains the optional parameters for the ManagedLedgerDigestUploadsClient.NewListByDatabasePager +// method. +type ManagedLedgerDigestUploadsClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + +// ManagedLedgerDigestUploadsListResult - A list of ledger digest upload settings. +type ManagedLedgerDigestUploadsListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*ManagedLedgerDigestUploads `json:"value,omitempty" azure:"ro"` +} + +// ManagedLedgerDigestUploadsProperties - The properties of a database ledger digest upload settings. +type ManagedLedgerDigestUploadsProperties struct { + // The digest storage endpoint, which must be either an Azure blob storage endpoint or an URI for Azure Confidential Ledger. + DigestStorageEndpoint *string `json:"digestStorageEndpoint,omitempty"` + + // READ-ONLY; Specifies the state of ledger digest upload. + State *ManagedLedgerDigestUploadsState `json:"state,omitempty" azure:"ro"` +} + +// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions contains the optional +// parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate method. +type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions contains the optional parameters +// for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginUpdate method. +type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions contains the optional parameters for the +// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Get method. type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetOptions struct { // placeholder for future optional parameters } // ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions contains the -// optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.ListByRestorableDroppedDatabase +// optional parameters for the ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.NewListByRestorableDroppedDatabasePager // method. type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseOptions struct { // placeholder for future optional parameters } +// ManagedServerDNSAlias - A managed server DNS alias. +type ManagedServerDNSAlias struct { + // Resource properties. + Properties *ManagedServerDNSAliasProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ManagedServerDNSAliasAcquisition - A managed server DNS alias acquisition request. +type ManagedServerDNSAliasAcquisition struct { + // REQUIRED; The resource ID of the managed server DNS alias that will be acquired to point to this managed server instead. + OldManagedServerDNSAliasResourceID *string `json:"oldManagedServerDnsAliasResourceId,omitempty"` +} + +// ManagedServerDNSAliasCreation - A managed server dns alias creation request. +type ManagedServerDNSAliasCreation struct { + // Whether or not DNS record should be created for this alias. + CreateDNSRecord *bool `json:"createDnsRecord,omitempty"` +} + +// ManagedServerDNSAliasListResult - A list of managed server DNS aliases. +type ManagedServerDNSAliasListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*ManagedServerDNSAlias `json:"value,omitempty" azure:"ro"` +} + +// ManagedServerDNSAliasProperties - Properties of a managed server DNS alias. +type ManagedServerDNSAliasProperties struct { + // READ-ONLY; The fully qualified DNS record for managed server alias + AzureDNSRecord *string `json:"azureDnsRecord,omitempty" azure:"ro"` + + // READ-ONLY; The fully qualified public DNS record for managed server alias + PublicAzureDNSRecord *string `json:"publicAzureDnsRecord,omitempty" azure:"ro"` +} + +// ManagedServerDNSAliasesClientBeginAcquireOptions contains the optional parameters for the ManagedServerDNSAliasesClient.BeginAcquire +// method. +type ManagedServerDNSAliasesClientBeginAcquireOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerDNSAliasesClient.BeginCreateOrUpdate +// method. +type ManagedServerDNSAliasesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedServerDNSAliasesClientBeginDeleteOptions contains the optional parameters for the ManagedServerDNSAliasesClient.BeginDelete +// method. +type ManagedServerDNSAliasesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ManagedServerDNSAliasesClientGetOptions contains the optional parameters for the ManagedServerDNSAliasesClient.Get method. +type ManagedServerDNSAliasesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ManagedServerDNSAliasesClientListByManagedInstanceOptions contains the optional parameters for the ManagedServerDNSAliasesClient.NewListByManagedInstancePager +// method. +type ManagedServerDNSAliasesClientListByManagedInstanceOptions struct { + // placeholder for future optional parameters +} + // ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate // method. type ManagedServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions struct { @@ -6350,7 +7170,7 @@ type ManagedServerSecurityAlertPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// ManagedServerSecurityAlertPoliciesClientListByInstanceOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.ListByInstance +// ManagedServerSecurityAlertPoliciesClientListByInstanceOptions contains the optional parameters for the ManagedServerSecurityAlertPoliciesClient.NewListByInstancePager // method. type ManagedServerSecurityAlertPoliciesClientListByInstanceOptions struct { // placeholder for future optional parameters @@ -6443,96 +7263,6 @@ type MaxSizeRangeCapability struct { Status *CapabilityStatus `json:"status,omitempty" azure:"ro"` } -// Metric - Database metrics. -type Metric struct { - // READ-ONLY; The end time for the metric (ISO-8601 format). - EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` - - // READ-ONLY; The metric values for the specified time window and timestep. - MetricValues []*MetricValue `json:"metricValues,omitempty" azure:"ro"` - - // READ-ONLY; The name information for the metric. - Name *MetricName `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The start time for the metric (ISO-8601 format). - StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` - - // READ-ONLY; The time step to be used to summarize the metric values. - TimeGrain *string `json:"timeGrain,omitempty" azure:"ro"` - - // READ-ONLY; The unit of the metric. - Unit *UnitType `json:"unit,omitempty" azure:"ro"` -} - -// MetricAvailability - A metric availability value. -type MetricAvailability struct { - // READ-ONLY; The length of retention for the database metric. - Retention *string `json:"retention,omitempty" azure:"ro"` - - // READ-ONLY; The granularity of the database metric. - TimeGrain *string `json:"timeGrain,omitempty" azure:"ro"` -} - -// MetricDefinition - A database metric definition. -type MetricDefinition struct { - // READ-ONLY; The list of database metric availabilities for the metric. - MetricAvailabilities []*MetricAvailability `json:"metricAvailabilities,omitempty" azure:"ro"` - - // READ-ONLY; The name information for the metric. - Name *MetricName `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The primary aggregation type defining how metric values are displayed. - PrimaryAggregationType *PrimaryAggregationType `json:"primaryAggregationType,omitempty" azure:"ro"` - - // READ-ONLY; The resource uri of the database. - ResourceURI *string `json:"resourceUri,omitempty" azure:"ro"` - - // READ-ONLY; The unit of the metric. - Unit *UnitDefinitionType `json:"unit,omitempty" azure:"ro"` -} - -// MetricDefinitionListResult - The response to a list database metric definitions request. -type MetricDefinitionListResult struct { - // REQUIRED; The list of metric definitions for the database. - Value []*MetricDefinition `json:"value,omitempty"` -} - -// MetricListResult - The response to a list database metrics request. -type MetricListResult struct { - // REQUIRED; The list of metrics for the database. - Value []*Metric `json:"value,omitempty"` -} - -// MetricName - A database metric name. -type MetricName struct { - // READ-ONLY; The friendly name of the database metric. - LocalizedValue *string `json:"localizedValue,omitempty" azure:"ro"` - - // READ-ONLY; The name of the database metric. - Value *string `json:"value,omitempty" azure:"ro"` -} - -// MetricValue - Represents database metrics. -type MetricValue struct { - // READ-ONLY; The average value of the metric. - Average *float64 `json:"average,omitempty" azure:"ro"` - - // READ-ONLY; The number of values for the metric. - Count *int32 `json:"count,omitempty" azure:"ro"` - - // READ-ONLY; The max value of the metric. - Maximum *float64 `json:"maximum,omitempty" azure:"ro"` - - // READ-ONLY; The min value of the metric. - Minimum *float64 `json:"minimum,omitempty" azure:"ro"` - - // READ-ONLY; The metric timestamp (ISO-8601 format). - Timestamp *time.Time `json:"timestamp,omitempty" azure:"ro"` - - // READ-ONLY; The total value of the metric. - Total *float64 `json:"total,omitempty" azure:"ro"` -} - // MinCapacityCapability - The min capacity capability type MinCapacityCapability struct { // The reason for the capability not being available. @@ -6578,7 +7308,7 @@ type Operation struct { Origin *OperationOrigin `json:"origin,omitempty" azure:"ro"` // READ-ONLY; Additional descriptions for the operation. - Properties map[string]interface{} `json:"properties,omitempty" azure:"ro"` + Properties map[string]any `json:"properties,omitempty" azure:"ro"` } // OperationDisplay - Display metadata associated with the operation. @@ -6596,21 +7326,6 @@ type OperationDisplay struct { Resource *string `json:"resource,omitempty" azure:"ro"` } -// OperationImpact - The impact of an operation, both in absolute and relative terms. -type OperationImpact struct { - // READ-ONLY; The absolute impact to dimension. - ChangeValueAbsolute *float64 `json:"changeValueAbsolute,omitempty" azure:"ro"` - - // READ-ONLY; The relative impact to dimension (null if not applicable) - ChangeValueRelative *float64 `json:"changeValueRelative,omitempty" azure:"ro"` - - // READ-ONLY; The name of the impact dimension. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; The unit in which estimated impact to dimension is measured. - Unit *string `json:"unit,omitempty" azure:"ro"` -} - // OperationListResult - Result of the request to list SQL operations. type OperationListResult struct { // READ-ONLY; Link to retrieve next page of results. @@ -6620,11 +7335,30 @@ type OperationListResult struct { Value []*Operation `json:"value,omitempty" azure:"ro"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } +// OutboundEnvironmentEndpoint - An endpoint that the managed instance service requires outbound network access to. +type OutboundEnvironmentEndpoint struct { + // READ-ONLY; The type of service accessed by the managed instance service, e.g., Azure Storage, Azure Active Directory, etc. + Category *string `json:"category,omitempty" azure:"ro"` + + // READ-ONLY; The endpoints that the managed instance service communicates with in order to function correctly. + Endpoints []*EndpointDependency `json:"endpoints,omitempty" azure:"ro"` +} + +// OutboundEnvironmentEndpointCollection - A collection of endpoints that the managed instance service requires outbound network +// access to. +type OutboundEnvironmentEndpointCollection struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*OutboundEnvironmentEndpoint `json:"value,omitempty" azure:"ro"` +} + // OutboundFirewallRule - An Azure SQL DB Server Outbound Firewall Rule. type OutboundFirewallRule struct { // Resource properties. @@ -6674,7 +7408,7 @@ type OutboundFirewallRulesClientGetOptions struct { // placeholder for future optional parameters } -// OutboundFirewallRulesClientListByServerOptions contains the optional parameters for the OutboundFirewallRulesClient.ListByServer +// OutboundFirewallRulesClientListByServerOptions contains the optional parameters for the OutboundFirewallRulesClient.NewListByServerPager // method. type OutboundFirewallRulesClientListByServerOptions struct { // placeholder for future optional parameters @@ -6710,6 +7444,15 @@ type PerformanceLevelCapability struct { Value *float64 `json:"value,omitempty" azure:"ro"` } +// PhaseDetails - The phase details properties of a database operation. +type PhaseDetails struct { + // READ-ONLY; The operation phase. + Phase *Phase `json:"phase,omitempty" azure:"ro"` + + // READ-ONLY; The operation phase information. + PhaseInformation map[string]*string `json:"phaseInformation,omitempty" azure:"ro"` +} + // PrivateEndpointConnection - A private endpoint connection type PrivateEndpointConnection struct { // Resource properties. @@ -6742,6 +7485,9 @@ type PrivateEndpointConnectionProperties struct { // Connection state of the private endpoint connection. PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionStateProperty `json:"privateLinkServiceConnectionState,omitempty"` + // READ-ONLY; Group IDs. + GroupIDs []*string `json:"groupIds,omitempty" azure:"ro"` + // READ-ONLY; State of the private endpoint connection. ProvisioningState *PrivateEndpointProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } @@ -6778,7 +7524,7 @@ type PrivateEndpointConnectionsClientGetOptions struct { // placeholder for future optional parameters } -// PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByServer +// PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServerPager // method. type PrivateEndpointConnectionsClientListByServerOptions struct { // placeholder for future optional parameters @@ -6830,7 +7576,7 @@ type PrivateLinkResourcesClientGetOptions struct { // placeholder for future optional parameters } -// PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByServer +// PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByServerPager // method. type PrivateLinkResourcesClientListByServerOptions struct { // placeholder for future optional parameters @@ -6871,6 +7617,18 @@ type ProxyResourceWithWritableName struct { Type *string `json:"type,omitempty" azure:"ro"` } +// QueryCheck - SQL Vulnerability Assessment query check object. +type QueryCheck struct { + // READ-ONLY; SQL Vulnerability Assessment column names of query expected result. + ColumnNames []*string `json:"columnNames,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment query expected result. + ExpectedResult [][]*string `json:"expectedResult,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment rule query. + Query *string `json:"query,omitempty" azure:"ro"` +} + // QueryMetricInterval - Properties of a query metrics interval. type QueryMetricInterval struct { // List of metric objects for this interval @@ -7050,7 +7808,7 @@ type RecommendedActionProperties struct { State *RecommendedActionStateInfo `json:"state,omitempty"` // READ-ONLY; Gets additional details specific to this recommended action. - Details map[string]interface{} `json:"details,omitempty" azure:"ro"` + Details map[string]any `json:"details,omitempty" azure:"ro"` // READ-ONLY; Gets the error details if and why this recommended action is put to error state. ErrorDetails *RecommendedActionErrorInfo `json:"errorDetails,omitempty" azure:"ro"` @@ -7185,9 +7943,9 @@ type RecommendedSensitivityLabelsClientUpdateOptions struct { // placeholder for future optional parameters } -// RecoverableDatabase - A recoverable database +// RecoverableDatabase - A recoverable database resource. type RecoverableDatabase struct { - // The properties of a recoverable database + // Resource properties. Properties *RecoverableDatabaseProperties `json:"properties,omitempty"` // READ-ONLY; Resource ID. @@ -7200,33 +7958,42 @@ type RecoverableDatabase struct { Type *string `json:"type,omitempty" azure:"ro"` } -// RecoverableDatabaseListResult - The response to a list recoverable databases request +// RecoverableDatabaseListResult - A list of recoverable databases. type RecoverableDatabaseListResult struct { - // REQUIRED; A list of recoverable databases - Value []*RecoverableDatabase `json:"value,omitempty"` + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*RecoverableDatabase `json:"value,omitempty" azure:"ro"` } -// RecoverableDatabaseProperties - The properties of a recoverable database +// RecoverableDatabaseProperties - The recoverable database's properties. type RecoverableDatabaseProperties struct { - // READ-ONLY; The edition of the database + // The resource ids of the user assigned identities to use + Keys map[string]*DatabaseKey `json:"keys,omitempty"` + + // READ-ONLY; The edition of the database. Edition *string `json:"edition,omitempty" azure:"ro"` // READ-ONLY; The elastic pool name of the database ElasticPoolName *string `json:"elasticPoolName,omitempty" azure:"ro"` - // READ-ONLY; The last available backup date of the database (ISO8601 format) + // READ-ONLY; The last available backup date. LastAvailableBackupDate *time.Time `json:"lastAvailableBackupDate,omitempty" azure:"ro"` - // READ-ONLY; The service level objective name of the database + // READ-ONLY; The service level objective name of the database. ServiceLevelObjective *string `json:"serviceLevelObjective,omitempty" azure:"ro"` } // RecoverableDatabasesClientGetOptions contains the optional parameters for the RecoverableDatabasesClient.Get method. type RecoverableDatabasesClientGetOptions struct { - // placeholder for future optional parameters + // The child resources to include in the response. + Expand *string + // An OData filter expression that filters elements in the collection. + Filter *string } -// RecoverableDatabasesClientListByServerOptions contains the optional parameters for the RecoverableDatabasesClient.ListByServer +// RecoverableDatabasesClientListByServerOptions contains the optional parameters for the RecoverableDatabasesClient.NewListByServerPager // method. type RecoverableDatabasesClientListByServerOptions struct { // placeholder for future optional parameters @@ -7268,12 +8035,64 @@ type RecoverableManagedDatabasesClientGetOptions struct { // placeholder for future optional parameters } -// RecoverableManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RecoverableManagedDatabasesClient.ListByInstance +// RecoverableManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RecoverableManagedDatabasesClient.NewListByInstancePager // method. type RecoverableManagedDatabasesClientListByInstanceOptions struct { // placeholder for future optional parameters } +// RefreshExternalGovernanceStatusOperationResult - An RefreshExternalGovernanceStatus operation result resource. +type RefreshExternalGovernanceStatusOperationResult struct { + // Resource properties. + Properties *RefreshExternalGovernanceStatusOperationResultProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// RefreshExternalGovernanceStatusOperationResultProperties - Contains the operation result properties for refresh external +// governance status operation. +type RefreshExternalGovernanceStatusOperationResultProperties struct { + // READ-ONLY; Error message. + ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"` + + // READ-ONLY; Queued time. + QueuedTime *string `json:"queuedTime,omitempty" azure:"ro"` + + // READ-ONLY; Request Id. + RequestID *string `json:"requestId,omitempty" azure:"ro"` + + // READ-ONLY; Request type. + RequestType *string `json:"requestType,omitempty" azure:"ro"` + + // READ-ONLY; Server name. + ServerName *string `json:"serverName,omitempty" azure:"ro"` + + // READ-ONLY; Operation status. + Status *string `json:"status,omitempty" azure:"ro"` +} + +// Remediation - SQL Vulnerability Assessment remediation Details. +type Remediation struct { + // READ-ONLY; SQL Vulnerability Assessment is remediation automated. + Automated *bool `json:"automated,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment remediation description. + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment optional link to remediate in Azure Portal. + PortalLink *string `json:"portalLink,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment remediation script. + Scripts []*string `json:"scripts,omitempty" azure:"ro"` +} + // ReplicationLink - A replication link. type ReplicationLink struct { // Resource properties. @@ -7303,12 +8122,15 @@ type ReplicationLinkProperties struct { // READ-ONLY; Whether the user is currently allowed to terminate the link. IsTerminationAllowed *bool `json:"isTerminationAllowed,omitempty" azure:"ro"` - // READ-ONLY; Link type (GEO, NAMED). + // READ-ONLY; Link type (GEO, NAMED, STANDBY). LinkType *ReplicationLinkType `json:"linkType,omitempty" azure:"ro"` // READ-ONLY; Resource partner database. PartnerDatabase *string `json:"partnerDatabase,omitempty" azure:"ro"` + // READ-ONLY; Resource partner database Id. + PartnerDatabaseID *string `json:"partnerDatabaseId,omitempty" azure:"ro"` + // READ-ONLY; Resource partner location. PartnerLocation *string `json:"partnerLocation,omitempty" azure:"ro"` @@ -7334,6 +8156,12 @@ type ReplicationLinkProperties struct { StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` } +// ReplicationLinksClientBeginDeleteOptions contains the optional parameters for the ReplicationLinksClient.BeginDelete method. +type ReplicationLinksClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ReplicationLinksClientBeginFailoverAllowDataLossOptions contains the optional parameters for the ReplicationLinksClient.BeginFailoverAllowDataLoss // method. type ReplicationLinksClientBeginFailoverAllowDataLossOptions struct { @@ -7348,23 +8176,18 @@ type ReplicationLinksClientBeginFailoverOptions struct { ResumeToken string } -// ReplicationLinksClientDeleteOptions contains the optional parameters for the ReplicationLinksClient.Delete method. -type ReplicationLinksClientDeleteOptions struct { - // placeholder for future optional parameters -} - // ReplicationLinksClientGetOptions contains the optional parameters for the ReplicationLinksClient.Get method. type ReplicationLinksClientGetOptions struct { // placeholder for future optional parameters } -// ReplicationLinksClientListByDatabaseOptions contains the optional parameters for the ReplicationLinksClient.ListByDatabase +// ReplicationLinksClientListByDatabaseOptions contains the optional parameters for the ReplicationLinksClient.NewListByDatabasePager // method. type ReplicationLinksClientListByDatabaseOptions struct { // placeholder for future optional parameters } -// ReplicationLinksClientListByServerOptions contains the optional parameters for the ReplicationLinksClient.ListByServer +// ReplicationLinksClientListByServerOptions contains the optional parameters for the ReplicationLinksClient.NewListByServerPager // method. type ReplicationLinksClientListByServerOptions struct { // placeholder for future optional parameters @@ -7451,6 +8274,9 @@ type RestorableDroppedDatabaseListResult struct { // RestorableDroppedDatabaseProperties - The restorable dropped database's properties. type RestorableDroppedDatabaseProperties struct { + // The resource ids of the user assigned identities to use + Keys map[string]*DatabaseKey `json:"keys,omitempty"` + // READ-ONLY; The storage account type used to store backups for this database. BackupStorageRedundancy *BackupStorageRedundancy `json:"backupStorageRedundancy,omitempty" azure:"ro"` @@ -7473,10 +8299,13 @@ type RestorableDroppedDatabaseProperties struct { // RestorableDroppedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedDatabasesClient.Get // method. type RestorableDroppedDatabasesClientGetOptions struct { - // placeholder for future optional parameters + // The child resources to include in the response. + Expand *string + // An OData filter expression that filters elements in the collection. + Filter *string } -// RestorableDroppedDatabasesClientListByServerOptions contains the optional parameters for the RestorableDroppedDatabasesClient.ListByServer +// RestorableDroppedDatabasesClientListByServerOptions contains the optional parameters for the RestorableDroppedDatabasesClient.NewListByServerPager // method. type RestorableDroppedDatabasesClientListByServerOptions struct { // placeholder for future optional parameters @@ -7533,7 +8362,7 @@ type RestorableDroppedManagedDatabasesClientGetOptions struct { // placeholder for future optional parameters } -// RestorableDroppedManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.ListByInstance +// RestorableDroppedManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.NewListByInstancePager // method. type RestorableDroppedManagedDatabasesClientListByInstanceOptions struct { // placeholder for future optional parameters @@ -7597,7 +8426,8 @@ type RestorePointsClientGetOptions struct { // placeholder for future optional parameters } -// RestorePointsClientListByDatabaseOptions contains the optional parameters for the RestorePointsClient.ListByDatabase method. +// RestorePointsClientListByDatabaseOptions contains the optional parameters for the RestorePointsClient.NewListByDatabasePager +// method. type RestorePointsClientListByDatabaseOptions struct { // placeholder for future optional parameters } @@ -7620,6 +8450,21 @@ type SKU struct { Tier *string `json:"tier,omitempty"` } +// ScheduleItem - Schedule info describing when the server should be started or stopped. +type ScheduleItem struct { + // REQUIRED; Start day. + StartDay *DayOfWeek `json:"startDay,omitempty"` + + // REQUIRED; Start time. + StartTime *string `json:"startTime,omitempty"` + + // REQUIRED; Stop day. + StopDay *DayOfWeek `json:"stopDay,omitempty"` + + // REQUIRED; Stop time. + StopTime *string `json:"stopTime,omitempty"` +} + // SecurityAlertPolicyProperties - Properties of a security alert policy. type SecurityAlertPolicyProperties struct { // REQUIRED; Specifies the state of the policy, whether it is enabled or disabled or a policy has not been applied yet on @@ -7889,7 +8734,14 @@ type SensitivityLabelsClientGetOptions struct { // placeholder for future optional parameters } -// SensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.ListCurrentByDatabase +// SensitivityLabelsClientListByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListByDatabasePager +// method. +type SensitivityLabelsClientListByDatabaseOptions struct { + // An OData filter expression that filters elements in the collection. + Filter *string +} + +// SensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListCurrentByDatabasePager // method. type SensitivityLabelsClientListCurrentByDatabaseOptions struct { Count *bool @@ -7898,7 +8750,7 @@ type SensitivityLabelsClientListCurrentByDatabaseOptions struct { SkipToken *string } -// SensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.ListRecommendedByDatabase +// SensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListRecommendedByDatabasePager // method. type SensitivityLabelsClientListRecommendedByDatabaseOptions struct { // An OData filter expression that filters elements in the collection. @@ -7971,7 +8823,7 @@ type ServerAdvancedThreatProtectionSettingsClientGetOptions struct { // placeholder for future optional parameters } -// ServerAdvancedThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.ListByServer +// ServerAdvancedThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.NewListByServerPager // method. type ServerAdvancedThreatProtectionSettingsClientListByServerOptions struct { // placeholder for future optional parameters @@ -8053,7 +8905,7 @@ type ServerAzureADAdministratorsClientGetOptions struct { // placeholder for future optional parameters } -// ServerAzureADAdministratorsClientListByServerOptions contains the optional parameters for the ServerAzureADAdministratorsClient.ListByServer +// ServerAzureADAdministratorsClientListByServerOptions contains the optional parameters for the ServerAzureADAdministratorsClient.NewListByServerPager // method. type ServerAzureADAdministratorsClientListByServerOptions struct { // placeholder for future optional parameters @@ -8094,7 +8946,7 @@ type ServerAzureADOnlyAuthenticationsClientGetOptions struct { // placeholder for future optional parameters } -// ServerAzureADOnlyAuthenticationsClientListByServerOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.ListByServer +// ServerAzureADOnlyAuthenticationsClientListByServerOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.NewListByServerPager // method. type ServerAzureADOnlyAuthenticationsClientListByServerOptions struct { // placeholder for future optional parameters @@ -8113,7 +8965,7 @@ type ServerBlobAuditingPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// ServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.ListByServer +// ServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.NewListByServerPager // method. type ServerBlobAuditingPoliciesClientListByServerOptions struct { // placeholder for future optional parameters @@ -8230,20 +9082,14 @@ type ServerBlobAuditingPolicyProperties struct { StorageEndpoint *string `json:"storageEndpoint,omitempty"` } -// ServerCommunicationLink - Server communication link. -type ServerCommunicationLink struct { - // The properties of resource. - Properties *ServerCommunicationLinkProperties `json:"properties,omitempty"` +// ServerConfigurationOption - A server configuration option +type ServerConfigurationOption struct { + // Resource properties. + Properties *ServerConfigurationOptionProperties `json:"properties,omitempty"` // READ-ONLY; Resource ID. ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; Communication link kind. This property is used for Azure Portal metadata. - Kind *string `json:"kind,omitempty" azure:"ro"` - - // READ-ONLY; Communication link location. - Location *string `json:"location,omitempty" azure:"ro"` - // READ-ONLY; Resource name. Name *string `json:"name,omitempty" azure:"ro"` @@ -8251,42 +9097,40 @@ type ServerCommunicationLink struct { Type *string `json:"type,omitempty" azure:"ro"` } -// ServerCommunicationLinkListResult - A list of server communication links. -type ServerCommunicationLinkListResult struct { - // The list of server communication links. - Value []*ServerCommunicationLink `json:"value,omitempty"` +// ServerConfigurationOptionListResult - A list of server configuration options. +type ServerConfigurationOptionListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*ServerConfigurationOption `json:"value,omitempty" azure:"ro"` } -// ServerCommunicationLinkProperties - The properties of a server communication link. -type ServerCommunicationLinkProperties struct { - // REQUIRED; The name of the partner server. - PartnerServer *string `json:"partnerServer,omitempty"` +// ServerConfigurationOptionProperties - The properties of server configuration option. +type ServerConfigurationOptionProperties struct { + // REQUIRED; Value of the server configuration option. + ServerConfigurationOptionValue *int32 `json:"serverConfigurationOptionValue,omitempty"` - // READ-ONLY; The state. - State *string `json:"state,omitempty" azure:"ro"` + // READ-ONLY; Provisioning state of server configuration option. + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } -// ServerCommunicationLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerCommunicationLinksClient.BeginCreateOrUpdate +// ServerConfigurationOptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerConfigurationOptionsClient.BeginCreateOrUpdate // method. -type ServerCommunicationLinksClientBeginCreateOrUpdateOptions struct { +type ServerConfigurationOptionsClientBeginCreateOrUpdateOptions struct { // Resumes the LRO from the provided token. ResumeToken string } -// ServerCommunicationLinksClientDeleteOptions contains the optional parameters for the ServerCommunicationLinksClient.Delete +// ServerConfigurationOptionsClientGetOptions contains the optional parameters for the ServerConfigurationOptionsClient.Get // method. -type ServerCommunicationLinksClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ServerCommunicationLinksClientGetOptions contains the optional parameters for the ServerCommunicationLinksClient.Get method. -type ServerCommunicationLinksClientGetOptions struct { +type ServerConfigurationOptionsClientGetOptions struct { // placeholder for future optional parameters } -// ServerCommunicationLinksClientListByServerOptions contains the optional parameters for the ServerCommunicationLinksClient.ListByServer +// ServerConfigurationOptionsClientListByManagedInstanceOptions contains the optional parameters for the ServerConfigurationOptionsClient.NewListByManagedInstancePager // method. -type ServerCommunicationLinksClientListByServerOptions struct { +type ServerConfigurationOptionsClientListByManagedInstanceOptions struct { // placeholder for future optional parameters } @@ -8302,7 +9146,7 @@ type ServerConnectionPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// ServerConnectionPoliciesClientListByServerOptions contains the optional parameters for the ServerConnectionPoliciesClient.ListByServer +// ServerConnectionPoliciesClientListByServerOptions contains the optional parameters for the ServerConnectionPoliciesClient.NewListByServerPager // method. type ServerConnectionPoliciesClientListByServerOptions struct { // placeholder for future optional parameters @@ -8405,7 +9249,7 @@ type ServerDNSAliasesClientGetOptions struct { // placeholder for future optional parameters } -// ServerDNSAliasesClientListByServerOptions contains the optional parameters for the ServerDNSAliasesClient.ListByServer +// ServerDNSAliasesClientListByServerOptions contains the optional parameters for the ServerDNSAliasesClient.NewListByServerPager // method. type ServerDNSAliasesClientListByServerOptions struct { // placeholder for future optional parameters @@ -8424,7 +9268,7 @@ type ServerDevOpsAuditSettingsClientGetOptions struct { // placeholder for future optional parameters } -// ServerDevOpsAuditSettingsClientListByServerOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.ListByServer +// ServerDevOpsAuditSettingsClientListByServerOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.NewListByServerPager // method. type ServerDevOpsAuditSettingsClientListByServerOptions struct { // placeholder for future optional parameters @@ -8454,6 +9298,9 @@ type ServerDevOpsAuditSettingsProperties struct { // PowerShell [https://go.microsoft.com/fwlink/?linkid=2033043] IsAzureMonitorTargetEnabled *bool `json:"isAzureMonitorTargetEnabled,omitempty"` + // Specifies whether Managed Identity is used to access blob storage + IsManagedIdentityInUse *bool `json:"isManagedIdentityInUse,omitempty"` + // Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, not // specifying the storageAccountAccessKey will use SQL server system-assigned // managed identity to access the storage. Prerequisites for using managed identity authentication: @@ -8561,7 +9408,9 @@ type ServerKeyProperties struct { // REQUIRED; The server key type like 'ServiceManaged', 'AzureKeyVault'. ServerKeyType *ServerKeyType `json:"serverKeyType,omitempty"` - // The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required. + // The URI of the server key. If the ServerKeyType is AzureKeyVault, then the URI is required. The AKV URI is required to + // be in this format: + // 'https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion' URI *string `json:"uri,omitempty"` // READ-ONLY; Key auto rotation opt-in flag. Either true or false. @@ -8595,7 +9444,7 @@ type ServerKeysClientGetOptions struct { // placeholder for future optional parameters } -// ServerKeysClientListByServerOptions contains the optional parameters for the ServerKeysClient.ListByServer method. +// ServerKeysClientListByServerOptions contains the optional parameters for the ServerKeysClient.NewListByServerPager method. type ServerKeysClientListByServerOptions struct { // placeholder for future optional parameters } @@ -8675,7 +9524,7 @@ type ServerOperationProperties struct { State *ManagementOperationState `json:"state,omitempty" azure:"ro"` } -// ServerOperationsClientListByServerOptions contains the optional parameters for the ServerOperationsClient.ListByServer +// ServerOperationsClientListByServerOptions contains the optional parameters for the ServerOperationsClient.NewListByServerPager // method. type ServerOperationsClientListByServerOptions struct { // placeholder for future optional parameters @@ -8698,7 +9547,9 @@ type ServerProperties struct { // The administrator login password (required for server creation). AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - // The Azure Active Directory identity of the server. + // The Azure Active Directory administrator of the server. This can only be used at server create time. If used for server + // update, it will be ignored or it will result in an error. For updates individual + // APIs will need to be used. Administrators *ServerExternalAdministrator `json:"administrators,omitempty"` // The Client id used for cross tenant CMK scenario @@ -8714,8 +9565,8 @@ type ServerProperties struct { PrimaryUserAssignedIdentityID *string `json:"primaryUserAssignedIdentityId,omitempty"` // Whether or not public endpoint access is allowed for this server. Value is optional but if passed in, must be 'Enabled' - // or 'Disabled' - PublicNetworkAccess *ServerNetworkAccessFlag `json:"publicNetworkAccess,omitempty"` + // or 'Disabled' or 'SecuredByPerimeter' + PublicNetworkAccess *ServerPublicNetworkAccessFlag `json:"publicNetworkAccess,omitempty"` // Whether or not to restrict outbound network access for this server. Value is optional but if passed in, must be 'Enabled' // or 'Disabled' @@ -8724,6 +9575,9 @@ type ServerProperties struct { // The version of the server. Version *string `json:"version,omitempty"` + // READ-ONLY; Status of external governance. + ExternalGovernanceStatus *ExternalGovernanceStatus `json:"externalGovernanceStatus,omitempty" azure:"ro"` + // READ-ONLY; The fully qualified domain name of the server. FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty" azure:"ro"` @@ -8750,7 +9604,7 @@ type ServerSecurityAlertPoliciesClientGetOptions struct { // placeholder for future optional parameters } -// ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.ListByServer +// ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.NewListByServerPager // method. type ServerSecurityAlertPoliciesClientListByServerOptions struct { // placeholder for future optional parameters @@ -8820,7 +9674,7 @@ type ServerTrustCertificatesClientGetOptions struct { // placeholder for future optional parameters } -// ServerTrustCertificatesClientListByInstanceOptions contains the optional parameters for the ServerTrustCertificatesClient.ListByInstance +// ServerTrustCertificatesClientListByInstanceOptions contains the optional parameters for the ServerTrustCertificatesClient.NewListByInstancePager // method. type ServerTrustCertificatesClientListByInstanceOptions struct { // placeholder for future optional parameters @@ -8887,13 +9741,13 @@ type ServerTrustGroupsClientGetOptions struct { // placeholder for future optional parameters } -// ServerTrustGroupsClientListByInstanceOptions contains the optional parameters for the ServerTrustGroupsClient.ListByInstance +// ServerTrustGroupsClientListByInstanceOptions contains the optional parameters for the ServerTrustGroupsClient.NewListByInstancePager // method. type ServerTrustGroupsClientListByInstanceOptions struct { // placeholder for future optional parameters } -// ServerTrustGroupsClientListByLocationOptions contains the optional parameters for the ServerTrustGroupsClient.ListByLocation +// ServerTrustGroupsClientListByLocationOptions contains the optional parameters for the ServerTrustGroupsClient.NewListByLocationPager // method. type ServerTrustGroupsClientListByLocationOptions struct { // placeholder for future optional parameters @@ -8911,37 +9765,47 @@ type ServerUpdate struct { Tags map[string]*string `json:"tags,omitempty"` } -// ServerUsage - Represents server metrics. +// ServerUsage - Usage metric of a server. type ServerUsage struct { - // READ-ONLY; The current value of the metric. - CurrentValue *float64 `json:"currentValue,omitempty" azure:"ro"` - - // READ-ONLY; The metric display name. - DisplayName *string `json:"displayName,omitempty" azure:"ro"` + // Resource properties. + Properties *ServerUsageProperties `json:"properties,omitempty"` - // READ-ONLY; The current limit of the metric. - Limit *float64 `json:"limit,omitempty" azure:"ro"` + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; Name of the server usage metric. + // READ-ONLY; Resource name. Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The next reset time for the metric (ISO8601 format). - NextResetTime *time.Time `json:"nextResetTime,omitempty" azure:"ro"` + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} - // READ-ONLY; The name of the resource. - ResourceName *string `json:"resourceName,omitempty" azure:"ro"` +// ServerUsageListResult - A list of server usage metrics. +type ServerUsageListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` - // READ-ONLY; The units of the metric. - Unit *string `json:"unit,omitempty" azure:"ro"` + // READ-ONLY; Array of results. + Value []*ServerUsage `json:"value,omitempty" azure:"ro"` } -// ServerUsageListResult - Represents the response to a list server metrics request. -type ServerUsageListResult struct { - // REQUIRED; The list of server metrics for the server. - Value []*ServerUsage `json:"value,omitempty"` +// ServerUsageProperties - Properties of a server usage. +type ServerUsageProperties struct { + // READ-ONLY; Current value of the metric. + CurrentValue *float64 `json:"currentValue,omitempty" azure:"ro"` + + // READ-ONLY; User-readable name of the metric. + DisplayName *string `json:"displayName,omitempty" azure:"ro"` + + // READ-ONLY; Boundary value of the metric. + Limit *float64 `json:"limit,omitempty" azure:"ro"` + + // READ-ONLY; Unit of the metric. + Unit *string `json:"unit,omitempty" azure:"ro"` } -// ServerUsagesClientListByServerOptions contains the optional parameters for the ServerUsagesClient.ListByServer method. +// ServerUsagesClientListByServerOptions contains the optional parameters for the ServerUsagesClient.NewListByServerPager +// method. type ServerUsagesClientListByServerOptions struct { // placeholder for future optional parameters } @@ -9025,7 +9889,7 @@ type ServerVulnerabilityAssessmentsClientGetOptions struct { // placeholder for future optional parameters } -// ServerVulnerabilityAssessmentsClientListByServerOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.ListByServer +// ServerVulnerabilityAssessmentsClientListByServerOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.NewListByServerPager // method. type ServerVulnerabilityAssessmentsClientListByServerOptions struct { // placeholder for future optional parameters @@ -9049,6 +9913,12 @@ type ServersClientBeginImportDatabaseOptions struct { ResumeToken string } +// ServersClientBeginRefreshStatusOptions contains the optional parameters for the ServersClient.BeginRefreshStatus method. +type ServersClientBeginRefreshStatusOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method. type ServersClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. @@ -9067,33 +9937,19 @@ type ServersClientGetOptions struct { Expand *string } -// ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.ListByResourceGroup method. +// ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager +// method. type ServersClientListByResourceGroupOptions struct { // The child resources to include in the response. Expand *string } -// ServersClientListOptions contains the optional parameters for the ServersClient.List method. +// ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method. type ServersClientListOptions struct { // The child resources to include in the response. Expand *string } -// ServiceObjective - Represents a database service objective. -type ServiceObjective struct { - // Represents the properties of the resource. - Properties *ServiceObjectiveProperties `json:"properties,omitempty"` - - // READ-ONLY; Resource ID. - ID *string `json:"id,omitempty" azure:"ro"` - - // READ-ONLY; Resource name. - Name *string `json:"name,omitempty" azure:"ro"` - - // READ-ONLY; Resource type. - Type *string `json:"type,omitempty" azure:"ro"` -} - // ServiceObjectiveCapability - The service objectives capability. type ServiceObjectiveCapability struct { // The reason for the capability not being available. @@ -9135,70 +9991,95 @@ type ServiceObjectiveCapability struct { // READ-ONLY; List of supported min capacities SupportedMinCapacities []*MinCapacityCapability `json:"supportedMinCapacities,omitempty" azure:"ro"` + // READ-ONLY; Whether or not zone pinning is supported. + ZonePinning *bool `json:"zonePinning,omitempty" azure:"ro"` + // READ-ONLY; Whether or not zone redundancy is supported for the service objective. ZoneRedundant *bool `json:"zoneRedundant,omitempty" azure:"ro"` } -// ServiceObjectiveListResult - Represents the response to a get database service objectives request. -type ServiceObjectiveListResult struct { - // REQUIRED; The list of database service objectives. - Value []*ServiceObjective `json:"value,omitempty"` +// ServicePrincipal - The managed instance's service principal configuration for a resource. +type ServicePrincipal struct { + // Service principal type. + Type *ServicePrincipalType `json:"type,omitempty"` + + // READ-ONLY; The Azure Active Directory application client id. + ClientID *string `json:"clientId,omitempty" azure:"ro"` + + // READ-ONLY; The Azure Active Directory application object id. + PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + + // READ-ONLY; The Azure Active Directory tenant id. + TenantID *string `json:"tenantId,omitempty" azure:"ro"` } -// ServiceObjectiveProperties - Represents the properties of a database service objective. -type ServiceObjectiveProperties struct { - // READ-ONLY; The description for the service level objective. - Description *string `json:"description,omitempty" azure:"ro"` +// StartStopManagedInstanceSchedule - Managed instance's Start/Stop schedule. +type StartStopManagedInstanceSchedule struct { + // Resource properties. + Properties *StartStopManagedInstanceScheduleProperties `json:"properties,omitempty"` - // READ-ONLY; Gets whether the service level objective is enabled. - Enabled *bool `json:"enabled,omitempty" azure:"ro"` + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` - // READ-ONLY; Gets whether the service level objective is the default service objective. - IsDefault *bool `json:"isDefault,omitempty" azure:"ro"` + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; Gets whether the service level objective is a system service objective. - IsSystem *bool `json:"isSystem,omitempty" azure:"ro"` + // READ-ONLY; System data of the scheduled resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` - // READ-ONLY; The name for the service objective. - ServiceObjectiveName *string `json:"serviceObjectiveName,omitempty" azure:"ro"` + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` } -// ServiceObjectivesClientGetOptions contains the optional parameters for the ServiceObjectivesClient.Get method. -type ServiceObjectivesClientGetOptions struct { - // placeholder for future optional parameters -} +// StartStopManagedInstanceScheduleListResult - Managed instance's Start/Stop schedule list result. +type StartStopManagedInstanceScheduleListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` -// ServiceObjectivesClientListByServerOptions contains the optional parameters for the ServiceObjectivesClient.ListByServer -// method. -type ServiceObjectivesClientListByServerOptions struct { - // placeholder for future optional parameters + // READ-ONLY; Array of results. + Value []*StartStopManagedInstanceSchedule `json:"value,omitempty" azure:"ro"` } -// ServicePrincipal - The managed instance's service principal configuration for a resource. -type ServicePrincipal struct { - // Service principal type. - Type *ServicePrincipalType `json:"type,omitempty"` +// StartStopManagedInstanceScheduleProperties - Properties of managed instance's Start/Stop schedule. +type StartStopManagedInstanceScheduleProperties struct { + // REQUIRED; Schedule list. + ScheduleList []*ScheduleItem `json:"scheduleList,omitempty"` - // READ-ONLY; The Azure Active Directory application client id. - ClientID *string `json:"clientId,omitempty" azure:"ro"` + // The description of the schedule. + Description *string `json:"description,omitempty"` - // READ-ONLY; The Azure Active Directory application object id. - PrincipalID *string `json:"principalId,omitempty" azure:"ro"` + // The time zone of the schedule. + TimeZoneID *string `json:"timeZoneId,omitempty"` - // READ-ONLY; The Azure Active Directory tenant id. - TenantID *string `json:"tenantId,omitempty" azure:"ro"` + // READ-ONLY; Timestamp when the next action will be executed in the corresponding schedule time zone. + NextExecutionTime *string `json:"nextExecutionTime,omitempty" azure:"ro"` + + // READ-ONLY; Next action to be executed (Start or Stop) + NextRunAction *string `json:"nextRunAction,omitempty" azure:"ro"` +} + +// StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.CreateOrUpdate +// method. +type StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters } -// SloUsageMetric - A Slo Usage Metric. -type SloUsageMetric struct { - // READ-ONLY; Gets or sets inRangeTimeRatio for SLO usage metric. - InRangeTimeRatio *float64 `json:"inRangeTimeRatio,omitempty" azure:"ro"` +// StartStopManagedInstanceSchedulesClientDeleteOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.Delete +// method. +type StartStopManagedInstanceSchedulesClientDeleteOptions struct { + // placeholder for future optional parameters +} - // READ-ONLY; The serviceLevelObjective for SLO usage metric. - ServiceLevelObjective *ServiceObjectiveName `json:"serviceLevelObjective,omitempty" azure:"ro"` +// StartStopManagedInstanceSchedulesClientGetOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.Get +// method. +type StartStopManagedInstanceSchedulesClientGetOptions struct { + // placeholder for future optional parameters +} - // READ-ONLY; The serviceLevelObjectiveId for SLO usage metric. - ServiceLevelObjectiveID *string `json:"serviceLevelObjectiveId,omitempty" azure:"ro"` +// StartStopManagedInstanceSchedulesClientListByInstanceOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.NewListByInstancePager +// method. +type StartStopManagedInstanceSchedulesClientListByInstanceOptions struct { + // placeholder for future optional parameters } // StorageCapability - The storage account type capability. @@ -9257,12 +10138,57 @@ type SubscriptionUsagesClientGetOptions struct { // placeholder for future optional parameters } -// SubscriptionUsagesClientListByLocationOptions contains the optional parameters for the SubscriptionUsagesClient.ListByLocation +// SubscriptionUsagesClientListByLocationOptions contains the optional parameters for the SubscriptionUsagesClient.NewListByLocationPager // method. type SubscriptionUsagesClientListByLocationOptions struct { // placeholder for future optional parameters } +// SynapseLinkWorkspace - Synapse link workspace resource +type SynapseLinkWorkspace struct { + // Resource properties. + Properties *SynapseLinkWorkspaceProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// SynapseLinkWorkspaceInfoProperties - Properties of a Synapse link workspaces +type SynapseLinkWorkspaceInfoProperties struct { + // Link connection name. + LinkConnectionName *string `json:"linkConnectionName,omitempty"` + + // Synapse link workspace id. + WorkspaceID *string `json:"workspaceId,omitempty"` +} + +// SynapseLinkWorkspaceListResult - A list of synapselink workspaces +type SynapseLinkWorkspaceListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*SynapseLinkWorkspace `json:"value,omitempty" azure:"ro"` +} + +// SynapseLinkWorkspaceProperties - Properties of a Synapse link workspaces +type SynapseLinkWorkspaceProperties struct { + // List of all synapselink workspaces + Workspaces []*SynapseLinkWorkspaceInfoProperties `json:"workspaces,omitempty"` +} + +// SynapseLinkWorkspacesClientListByDatabaseOptions contains the optional parameters for the SynapseLinkWorkspacesClient.NewListByDatabasePager +// method. +type SynapseLinkWorkspacesClientListByDatabaseOptions struct { + // placeholder for future optional parameters +} + // SyncAgent - An Azure SQL Database sync agent. type SyncAgent struct { // Resource properties. @@ -9385,12 +10311,12 @@ type SyncAgentsClientGetOptions struct { // placeholder for future optional parameters } -// SyncAgentsClientListByServerOptions contains the optional parameters for the SyncAgentsClient.ListByServer method. +// SyncAgentsClientListByServerOptions contains the optional parameters for the SyncAgentsClient.NewListByServerPager method. type SyncAgentsClientListByServerOptions struct { // placeholder for future optional parameters } -// SyncAgentsClientListLinkedDatabasesOptions contains the optional parameters for the SyncAgentsClient.ListLinkedDatabases +// SyncAgentsClientListLinkedDatabasesOptions contains the optional parameters for the SyncAgentsClient.NewListLinkedDatabasesPager // method. type SyncAgentsClientListLinkedDatabasesOptions struct { // placeholder for future optional parameters @@ -9633,23 +10559,25 @@ type SyncGroupsClientGetOptions struct { // placeholder for future optional parameters } -// SyncGroupsClientListByDatabaseOptions contains the optional parameters for the SyncGroupsClient.ListByDatabase method. +// SyncGroupsClientListByDatabaseOptions contains the optional parameters for the SyncGroupsClient.NewListByDatabasePager +// method. type SyncGroupsClientListByDatabaseOptions struct { // placeholder for future optional parameters } -// SyncGroupsClientListHubSchemasOptions contains the optional parameters for the SyncGroupsClient.ListHubSchemas method. +// SyncGroupsClientListHubSchemasOptions contains the optional parameters for the SyncGroupsClient.NewListHubSchemasPager +// method. type SyncGroupsClientListHubSchemasOptions struct { // placeholder for future optional parameters } -// SyncGroupsClientListLogsOptions contains the optional parameters for the SyncGroupsClient.ListLogs method. +// SyncGroupsClientListLogsOptions contains the optional parameters for the SyncGroupsClient.NewListLogsPager method. type SyncGroupsClientListLogsOptions struct { // The continuation token for this operation. ContinuationToken *string } -// SyncGroupsClientListSyncDatabaseIDsOptions contains the optional parameters for the SyncGroupsClient.ListSyncDatabaseIDs +// SyncGroupsClientListSyncDatabaseIDsOptions contains the optional parameters for the SyncGroupsClient.NewListSyncDatabaseIDsPager // method. type SyncGroupsClientListSyncDatabaseIDsOptions struct { // placeholder for future optional parameters @@ -9754,12 +10682,13 @@ type SyncMembersClientGetOptions struct { // placeholder for future optional parameters } -// SyncMembersClientListBySyncGroupOptions contains the optional parameters for the SyncMembersClient.ListBySyncGroup method. +// SyncMembersClientListBySyncGroupOptions contains the optional parameters for the SyncMembersClient.NewListBySyncGroupPager +// method. type SyncMembersClientListBySyncGroupOptions struct { // placeholder for future optional parameters } -// SyncMembersClientListMemberSchemasOptions contains the optional parameters for the SyncMembersClient.ListMemberSchemas +// SyncMembersClientListMemberSchemasOptions contains the optional parameters for the SyncMembersClient.NewListMemberSchemasPager // method. type SyncMembersClientListMemberSchemasOptions struct { // placeholder for future optional parameters @@ -9816,7 +10745,7 @@ type TdeCertificatesClientBeginCreateOptions struct { ResumeToken string } -// TimeZone - Time Zone. +// TimeZone - Time Zone property. type TimeZone struct { // Resource properties. Properties *TimeZoneProperties `json:"properties,omitempty"` @@ -9854,7 +10783,7 @@ type TimeZonesClientGetOptions struct { // placeholder for future optional parameters } -// TimeZonesClientListByLocationOptions contains the optional parameters for the TimeZonesClient.ListByLocation method. +// TimeZonesClientListByLocationOptions contains the optional parameters for the TimeZonesClient.NewListByLocationPager method. type TimeZonesClientListByLocationOptions struct { // placeholder for future optional parameters } @@ -9915,10 +10844,11 @@ type TransparentDataEncryptionProperties struct { State *TransparentDataEncryptionState `json:"state,omitempty"` } -// TransparentDataEncryptionsClientCreateOrUpdateOptions contains the optional parameters for the TransparentDataEncryptionsClient.CreateOrUpdate +// TransparentDataEncryptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the TransparentDataEncryptionsClient.BeginCreateOrUpdate // method. -type TransparentDataEncryptionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters +type TransparentDataEncryptionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string } // TransparentDataEncryptionsClientGetOptions contains the optional parameters for the TransparentDataEncryptionsClient.Get @@ -9927,7 +10857,7 @@ type TransparentDataEncryptionsClientGetOptions struct { // placeholder for future optional parameters } -// TransparentDataEncryptionsClientListByDatabaseOptions contains the optional parameters for the TransparentDataEncryptionsClient.ListByDatabase +// TransparentDataEncryptionsClientListByDatabaseOptions contains the optional parameters for the TransparentDataEncryptionsClient.NewListByDatabasePager // method. type TransparentDataEncryptionsClientListByDatabaseOptions struct { // placeholder for future optional parameters @@ -9947,10 +10877,10 @@ type UpdateLongTermRetentionBackupParametersProperties struct { RequestedBackupStorageRedundancy *BackupStorageRedundancy `json:"requestedBackupStorageRedundancy,omitempty"` } -// UpdateManagedInstanceDNSServersOperation - A recoverable managed database resource. -type UpdateManagedInstanceDNSServersOperation struct { +// UpdateVirtualClusterDNSServersOperation - A refresh DNS servers operation. +type UpdateVirtualClusterDNSServersOperation struct { // Resource properties. - Properties *DNSRefreshConfigurationProperties `json:"properties,omitempty"` + Properties *VirtualClusterDNSServersProperties `json:"properties,omitempty"` // READ-ONLY; Resource ID. ID *string `json:"id,omitempty" azure:"ro"` @@ -9969,10 +10899,13 @@ type UpsertManagedServerOperationParameters struct { VCores *int32 `json:"vCores,omitempty"` } -type UpsertManagedServerOperationStep struct { - Name *string `json:"name,omitempty"` - Order *int32 `json:"order,omitempty"` - Status *UpsertManagedServerOperationStepStatus `json:"status,omitempty"` +type UpsertManagedServerOperationStepWithEstimatesAndDuration struct { + Name *string `json:"name,omitempty"` + Order *int32 `json:"order,omitempty"` + Status *Status `json:"status,omitempty"` + StepEndTime *time.Time `json:"stepEndTime,omitempty"` + StepStartTime *time.Time `json:"stepStartTime,omitempty"` + TimeElapsed *string `json:"timeElapsed,omitempty"` } // Usage - ARM usage. @@ -10008,7 +10941,8 @@ type UsageListResult struct { Value []*Usage `json:"value,omitempty" azure:"ro"` } -// UsagesClientListByInstancePoolOptions contains the optional parameters for the UsagesClient.ListByInstancePool method. +// UsagesClientListByInstancePoolOptions contains the optional parameters for the UsagesClient.NewListByInstancePoolPager +// method. type UsagesClientListByInstancePoolOptions struct { // Optional request parameter to include managed instance usages within the instance pool. ExpandChildren *bool @@ -10023,6 +10957,36 @@ type UserIdentity struct { PrincipalID *string `json:"principalId,omitempty" azure:"ro"` } +// VaRule - SQL Vulnerability Assessment rule metadata details. +type VaRule struct { + // READ-ONLY; SQL Vulnerability Assessment benchmark references. + BenchmarkReferences []*BenchmarkReference `json:"benchmarkReferences,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment rule category. + Category *string `json:"category,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment rule description. + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment rule query details. + QueryCheck *QueryCheck `json:"queryCheck,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment rule rationale. + Rationale *string `json:"rationale,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment rule Id. + RuleID *string `json:"ruleId,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment rule type. + RuleType *RuleType `json:"ruleType,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment rule severity. + Severity *RuleSeverity `json:"severity,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment rule title. + Title *string `json:"title,omitempty" azure:"ro"` +} + // VirtualCluster - An Azure SQL virtual cluster. type VirtualCluster struct { // REQUIRED; Resource location. @@ -10044,6 +11008,12 @@ type VirtualCluster struct { Type *string `json:"type,omitempty" azure:"ro"` } +// VirtualClusterDNSServersProperties - The properties of dns servers on virtual cluster. +type VirtualClusterDNSServersProperties struct { + // READ-ONLY; The status of the DNS refresh operation. + Status *DNSRefreshOperationStatus `json:"status,omitempty" azure:"ro"` +} + // VirtualClusterListResult - A list of virtual clusters. type VirtualClusterListResult struct { // READ-ONLY; Link to retrieve next page of results. @@ -10055,11 +11025,8 @@ type VirtualClusterListResult struct { // VirtualClusterProperties - The properties of a virtual cluster. type VirtualClusterProperties struct { - // If the service has different generations of hardware, for the same SKU, then that can be captured here. - Family *string `json:"family,omitempty"` - - // Specifies maintenance configuration id to apply to this virtual cluster. - MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` + // Virtual cluster version. + Version *string `json:"version,omitempty"` // READ-ONLY; List of resources in this virtual cluster. ChildResources []*string `json:"childResources,omitempty" azure:"ro"` @@ -10068,7 +11035,7 @@ type VirtualClusterProperties struct { SubnetID *string `json:"subnetId,omitempty" azure:"ro"` } -// VirtualClusterUpdate - An update request for an Azure SQL Database virtual cluster. +// VirtualClusterUpdate - An update request for virtual cluster. type VirtualClusterUpdate struct { // Resource properties. Properties *VirtualClusterProperties `json:"properties,omitempty"` @@ -10083,6 +11050,13 @@ type VirtualClustersClientBeginDeleteOptions struct { ResumeToken string } +// VirtualClustersClientBeginUpdateDNSServersOptions contains the optional parameters for the VirtualClustersClient.BeginUpdateDNSServers +// method. +type VirtualClustersClientBeginUpdateDNSServersOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // VirtualClustersClientBeginUpdateOptions contains the optional parameters for the VirtualClustersClient.BeginUpdate method. type VirtualClustersClientBeginUpdateOptions struct { // Resumes the LRO from the provided token. @@ -10094,23 +11068,17 @@ type VirtualClustersClientGetOptions struct { // placeholder for future optional parameters } -// VirtualClustersClientListByResourceGroupOptions contains the optional parameters for the VirtualClustersClient.ListByResourceGroup +// VirtualClustersClientListByResourceGroupOptions contains the optional parameters for the VirtualClustersClient.NewListByResourceGroupPager // method. type VirtualClustersClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// VirtualClustersClientListOptions contains the optional parameters for the VirtualClustersClient.List method. +// VirtualClustersClientListOptions contains the optional parameters for the VirtualClustersClient.NewListPager method. type VirtualClustersClientListOptions struct { // placeholder for future optional parameters } -// VirtualClustersClientUpdateDNSServersOptions contains the optional parameters for the VirtualClustersClient.UpdateDNSServers -// method. -type VirtualClustersClientUpdateDNSServersOptions struct { - // placeholder for future optional parameters -} - // VirtualNetworkRule - A virtual network rule. type VirtualNetworkRule struct { // Resource properties. @@ -10166,12 +11134,70 @@ type VirtualNetworkRulesClientGetOptions struct { // placeholder for future optional parameters } -// VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.ListByServer +// VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.NewListByServerPager // method. type VirtualNetworkRulesClientListByServerOptions struct { // placeholder for future optional parameters } +// VulnerabilityAssessment - A SQL Vulnerability Assessment. +type VulnerabilityAssessment struct { + // Resource properties. + Properties *VulnerabilityAssessmentPolicyProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; SystemData of SqlVulnerabilityAssessmentResource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// VulnerabilityAssessmentBaselineClientGetOptions contains the optional parameters for the VulnerabilityAssessmentBaselineClient.Get +// method. +type VulnerabilityAssessmentBaselineClientGetOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentOptions contains the optional parameters for the VulnerabilityAssessmentBaselineClient.NewListBySQLVulnerabilityAssessmentPager +// method. +type VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions contains the optional parameters for the VulnerabilityAssessmentBaselinesClient.CreateOrUpdate +// method. +type VulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions contains the optional parameters for the VulnerabilityAssessmentExecuteScanClient.BeginExecute +// method. +type VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VulnerabilityAssessmentListResult - A list of SQL Vulnerability Assessments. +type VulnerabilityAssessmentListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*VulnerabilityAssessment `json:"value,omitempty" azure:"ro"` +} + +type VulnerabilityAssessmentPolicyProperties struct { + // Specifies the state of the SQL Vulnerability Assessment, whether it is enabled or disabled or a state has not been applied + // yet on the specific database or server. + State *SQLVulnerabilityAssessmentState `json:"state,omitempty"` +} + // VulnerabilityAssessmentRecurringScansProperties - Properties of a Vulnerability Assessment recurring scans. type VulnerabilityAssessmentRecurringScansProperties struct { // Specifies that the schedule scan notification will be is sent to the subscription administrators. @@ -10184,6 +11210,30 @@ type VulnerabilityAssessmentRecurringScansProperties struct { IsEnabled *bool `json:"isEnabled,omitempty"` } +// VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselineClient.CreateOrUpdate +// method. +type VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentRuleBaselineClientGetOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselineClient.Get +// method. +type VulnerabilityAssessmentRuleBaselineClientGetOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentRuleBaselineClientListByBaselineOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselineClient.NewListByBaselinePager +// method. +type VulnerabilityAssessmentRuleBaselineClientListByBaselineOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselinesClient.Delete +// method. +type VulnerabilityAssessmentRuleBaselinesClientDeleteOptions struct { + // placeholder for future optional parameters +} + // VulnerabilityAssessmentScanError - Properties of a vulnerability assessment scan error. type VulnerabilityAssessmentScanError struct { // READ-ONLY; The error code. @@ -10193,6 +11243,24 @@ type VulnerabilityAssessmentScanError struct { Message *string `json:"message,omitempty" azure:"ro"` } +// VulnerabilityAssessmentScanForSQLError - Properties of a vulnerability assessment scan error. +type VulnerabilityAssessmentScanForSQLError struct { + // READ-ONLY; The error code. + Code *string `json:"code,omitempty" azure:"ro"` + + // READ-ONLY; The error message. + Message *string `json:"message,omitempty" azure:"ro"` +} + +// VulnerabilityAssessmentScanListResult - A list of vulnerability assessment scan results. +type VulnerabilityAssessmentScanListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*VulnerabilityAssessmentScanResults `json:"value,omitempty" azure:"ro"` +} + // VulnerabilityAssessmentScanRecord - A vulnerability assessment scan record. type VulnerabilityAssessmentScanRecord struct { // Resource properties. @@ -10208,6 +11276,87 @@ type VulnerabilityAssessmentScanRecord struct { Type *string `json:"type,omitempty" azure:"ro"` } +// VulnerabilityAssessmentScanRecordForSQL - A vulnerability assessment scan record. +type VulnerabilityAssessmentScanRecordForSQL struct { + // Resource properties. + Properties *VulnerabilityAssessmentScanRecordForSQLProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; SystemData of SqlVulnerabilityAssessmentScanRecordResource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// VulnerabilityAssessmentScanRecordForSQLListResult - A list of vulnerability assessment scan records. +type VulnerabilityAssessmentScanRecordForSQLListResult struct { + // READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Array of results. + Value []*VulnerabilityAssessmentScanRecordForSQL `json:"value,omitempty" azure:"ro"` +} + +// VulnerabilityAssessmentScanRecordForSQLProperties - Properties of a vulnerability assessment scan record. +type VulnerabilityAssessmentScanRecordForSQLProperties struct { + // READ-ONLY; The database name. + Database *string `json:"database,omitempty" azure:"ro"` + + // READ-ONLY; The scan end time (UTC). + EndTime *time.Time `json:"endTime,omitempty" azure:"ro"` + + // READ-ONLY; The scan errors. + Errors []*VulnerabilityAssessmentScanForSQLError `json:"errors,omitempty" azure:"ro"` + + // READ-ONLY; The number of failed rules with high severity. + HighSeverityFailedRulesCount *int32 `json:"highSeverityFailedRulesCount,omitempty" azure:"ro"` + + // READ-ONLY; Baseline created for this database, and has one or more rules. + IsBaselineApplied *bool `json:"isBaselineApplied,omitempty" azure:"ro"` + + // READ-ONLY; The last scan time. + LastScanTime *time.Time `json:"lastScanTime,omitempty" azure:"ro"` + + // READ-ONLY; The number of failed rules with low severity. + LowSeverityFailedRulesCount *int32 `json:"lowSeverityFailedRulesCount,omitempty" azure:"ro"` + + // READ-ONLY; The number of failed rules with medium severity. + MediumSeverityFailedRulesCount *int32 `json:"mediumSeverityFailedRulesCount,omitempty" azure:"ro"` + + // READ-ONLY; The SQL version. + SQLVersion *string `json:"sqlVersion,omitempty" azure:"ro"` + + // READ-ONLY; The scan ID. + ScanID *string `json:"scanId,omitempty" azure:"ro"` + + // READ-ONLY; The server name. + Server *string `json:"server,omitempty" azure:"ro"` + + // READ-ONLY; The scan start time (UTC). + StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` + + // READ-ONLY; The scan status. + State *VulnerabilityAssessmentScanState `json:"state,omitempty" azure:"ro"` + + // READ-ONLY; The number of total failed rules. + TotalFailedRulesCount *int32 `json:"totalFailedRulesCount,omitempty" azure:"ro"` + + // READ-ONLY; The number of total passed rules. + TotalPassedRulesCount *int32 `json:"totalPassedRulesCount,omitempty" azure:"ro"` + + // READ-ONLY; The number of total rules assessed. + TotalRulesCount *int32 `json:"totalRulesCount,omitempty" azure:"ro"` + + // READ-ONLY; The scan trigger type. + TriggerType *VulnerabilityAssessmentScanTriggerType `json:"triggerType,omitempty" azure:"ro"` +} + // VulnerabilityAssessmentScanRecordListResult - A list of vulnerability assessment scan records. type VulnerabilityAssessmentScanRecordListResult struct { // READ-ONLY; Link to retrieve next page of results. @@ -10244,6 +11393,98 @@ type VulnerabilityAssessmentScanRecordProperties struct { TriggerType *VulnerabilityAssessmentScanTriggerType `json:"triggerType,omitempty" azure:"ro"` } +// VulnerabilityAssessmentScanResultClientGetOptions contains the optional parameters for the VulnerabilityAssessmentScanResultClient.Get +// method. +type VulnerabilityAssessmentScanResultClientGetOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentScanResultClientListByScanOptions contains the optional parameters for the VulnerabilityAssessmentScanResultClient.NewListByScanPager +// method. +type VulnerabilityAssessmentScanResultClientListByScanOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentScanResultProperties - SQL Vulnerability Assessment scan result properties for a single rule. +type VulnerabilityAssessmentScanResultProperties struct { + // READ-ONLY; SQL Vulnerability Assessment rule result adjusted with baseline. + BaselineAdjustedResult *BaselineAdjustedResult `json:"baselineAdjustedResult,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment error message. + ErrorMessage *string `json:"errorMessage,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment is the query results trimmed. + IsTrimmed *bool `json:"isTrimmed,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment query results that was run. + QueryResults [][]*string `json:"queryResults,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment the remediation details. + Remediation *Remediation `json:"remediation,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment rule Id. + RuleID *string `json:"ruleId,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment rule metadata. + RuleMetadata *VaRule `json:"ruleMetadata,omitempty" azure:"ro"` + + // READ-ONLY; SQL Vulnerability Assessment rule result status. + Status *RuleStatus `json:"status,omitempty" azure:"ro"` +} + +type VulnerabilityAssessmentScanResults struct { + // Resource properties. + Properties *VulnerabilityAssessmentScanResultProperties `json:"properties,omitempty"` + + // READ-ONLY; Resource ID. + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; Resource name. + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; SystemData of AdvancedThreatProtectionResource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + + // READ-ONLY; Resource type. + Type *string `json:"type,omitempty" azure:"ro"` +} + +// VulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the VulnerabilityAssessmentScansClient.Get +// method. +type VulnerabilityAssessmentScansClientGetOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions contains the optional parameters for the VulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager +// method. +type VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the VulnerabilityAssessmentsClient.Delete +// method. +type VulnerabilityAssessmentsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions contains the optional parameters for the VulnerabilityAssessmentsSettingsClient.CreateOrUpdate +// method. +type VulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentsSettingsClientGetOptions contains the optional parameters for the VulnerabilityAssessmentsSettingsClient.Get +// method. +type VulnerabilityAssessmentsSettingsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VulnerabilityAssessmentsSettingsClientListByServerOptions contains the optional parameters for the VulnerabilityAssessmentsSettingsClient.NewListByServerPager +// method. +type VulnerabilityAssessmentsSettingsClientListByServerOptions struct { + // placeholder for future optional parameters +} + // WorkloadClassifier - Workload classifier operations for a data warehouse type WorkloadClassifier struct { // Resource properties. @@ -10309,7 +11550,7 @@ type WorkloadClassifiersClientGetOptions struct { // placeholder for future optional parameters } -// WorkloadClassifiersClientListByWorkloadGroupOptions contains the optional parameters for the WorkloadClassifiersClient.ListByWorkloadGroup +// WorkloadClassifiersClientListByWorkloadGroupOptions contains the optional parameters for the WorkloadClassifiersClient.NewListByWorkloadGroupPager // method. type WorkloadClassifiersClientListByWorkloadGroupOptions struct { // placeholder for future optional parameters @@ -10379,7 +11620,7 @@ type WorkloadGroupsClientGetOptions struct { // placeholder for future optional parameters } -// WorkloadGroupsClientListByDatabaseOptions contains the optional parameters for the WorkloadGroupsClient.ListByDatabase +// WorkloadGroupsClientListByDatabaseOptions contains the optional parameters for the WorkloadGroupsClient.NewListByDatabasePager // method. type WorkloadGroupsClientListByDatabaseOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/sql/armsql/models_serde.go b/sdk/resourcemanager/sql/armsql/models_serde.go new file mode 100644 index 000000000000..53ee5a7d113e --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/models_serde.go @@ -0,0 +1,20365 @@ +//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 armsql + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AdministratorListResult. +func (a AdministratorListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorListResult. +func (a *AdministratorListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AdministratorProperties. +func (a AdministratorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorType", a.AdministratorType) + populate(objectMap, "azureADOnlyAuthentication", a.AzureADOnlyAuthentication) + populate(objectMap, "login", a.Login) + populate(objectMap, "sid", a.Sid) + populate(objectMap, "tenantId", a.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdministratorProperties. +func (a *AdministratorProperties) UnmarshalJSON(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 "administratorType": + err = unpopulate(val, "AdministratorType", &a.AdministratorType) + delete(rawMsg, key) + case "azureADOnlyAuthentication": + err = unpopulate(val, "AzureADOnlyAuthentication", &a.AzureADOnlyAuthentication) + delete(rawMsg, key) + case "login": + err = unpopulate(val, "Login", &a.Login) + delete(rawMsg, key) + case "sid": + err = unpopulate(val, "Sid", &a.Sid) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &a.TenantID) + 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 AdvancedThreatProtectionProperties. +func (a AdvancedThreatProtectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "creationTime", a.CreationTime) + populate(objectMap, "state", a.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedThreatProtectionProperties. +func (a *AdvancedThreatProtectionProperties) UnmarshalJSON(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 "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &a.CreationTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &a.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Advisor. +func (a Advisor) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "kind", a.Kind) + populate(objectMap, "location", a.Location) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Advisor. +func (a *Advisor) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &a.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "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 AdvisorProperties. +func (a AdvisorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "advisorStatus", a.AdvisorStatus) + populate(objectMap, "autoExecuteStatus", a.AutoExecuteStatus) + populate(objectMap, "autoExecuteStatusInheritedFrom", a.AutoExecuteStatusInheritedFrom) + populateTimeRFC3339(objectMap, "lastChecked", a.LastChecked) + populate(objectMap, "recommendationsStatus", a.RecommendationsStatus) + populate(objectMap, "recommendedActions", a.RecommendedActions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdvisorProperties. +func (a *AdvisorProperties) UnmarshalJSON(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 "advisorStatus": + err = unpopulate(val, "AdvisorStatus", &a.AdvisorStatus) + delete(rawMsg, key) + case "autoExecuteStatus": + err = unpopulate(val, "AutoExecuteStatus", &a.AutoExecuteStatus) + delete(rawMsg, key) + case "autoExecuteStatusInheritedFrom": + err = unpopulate(val, "AutoExecuteStatusInheritedFrom", &a.AutoExecuteStatusInheritedFrom) + delete(rawMsg, key) + case "lastChecked": + err = unpopulateTimeRFC3339(val, "LastChecked", &a.LastChecked) + delete(rawMsg, key) + case "recommendationsStatus": + err = unpopulate(val, "RecommendationsStatus", &a.RecommendationsStatus) + delete(rawMsg, key) + case "recommendedActions": + err = unpopulate(val, "RecommendedActions", &a.RecommendedActions) + 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 AgentConfiguration. +func (a AgentConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentConfiguration. +func (a *AgentConfiguration) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "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 AgentConfigurationProperties. +func (a AgentConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "state", a.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AgentConfigurationProperties. +func (a *AgentConfigurationProperties) UnmarshalJSON(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 "state": + err = unpopulate(val, "State", &a.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AutoPauseDelayTimeRange. +func (a AutoPauseDelayTimeRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "default", a.Default) + populate(objectMap, "doNotPauseValue", a.DoNotPauseValue) + populate(objectMap, "maxValue", a.MaxValue) + populate(objectMap, "minValue", a.MinValue) + populate(objectMap, "stepSize", a.StepSize) + populate(objectMap, "unit", a.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutoPauseDelayTimeRange. +func (a *AutoPauseDelayTimeRange) UnmarshalJSON(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 "default": + err = unpopulate(val, "Default", &a.Default) + delete(rawMsg, key) + case "doNotPauseValue": + err = unpopulate(val, "DoNotPauseValue", &a.DoNotPauseValue) + delete(rawMsg, key) + case "maxValue": + err = unpopulate(val, "MaxValue", &a.MaxValue) + delete(rawMsg, key) + case "minValue": + err = unpopulate(val, "MinValue", &a.MinValue) + delete(rawMsg, key) + case "stepSize": + err = unpopulate(val, "StepSize", &a.StepSize) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &a.Unit) + 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 AutomaticTuningOptions. +func (a AutomaticTuningOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actualState", a.ActualState) + populate(objectMap, "desiredState", a.DesiredState) + populate(objectMap, "reasonCode", a.ReasonCode) + populate(objectMap, "reasonDesc", a.ReasonDesc) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticTuningOptions. +func (a *AutomaticTuningOptions) UnmarshalJSON(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 "actualState": + err = unpopulate(val, "ActualState", &a.ActualState) + delete(rawMsg, key) + case "desiredState": + err = unpopulate(val, "DesiredState", &a.DesiredState) + delete(rawMsg, key) + case "reasonCode": + err = unpopulate(val, "ReasonCode", &a.ReasonCode) + delete(rawMsg, key) + case "reasonDesc": + err = unpopulate(val, "ReasonDesc", &a.ReasonDesc) + 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 AutomaticTuningServerOptions. +func (a AutomaticTuningServerOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actualState", a.ActualState) + populate(objectMap, "desiredState", a.DesiredState) + populate(objectMap, "reasonCode", a.ReasonCode) + populate(objectMap, "reasonDesc", a.ReasonDesc) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticTuningServerOptions. +func (a *AutomaticTuningServerOptions) UnmarshalJSON(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 "actualState": + err = unpopulate(val, "ActualState", &a.ActualState) + delete(rawMsg, key) + case "desiredState": + err = unpopulate(val, "DesiredState", &a.DesiredState) + delete(rawMsg, key) + case "reasonCode": + err = unpopulate(val, "ReasonCode", &a.ReasonCode) + delete(rawMsg, key) + case "reasonDesc": + err = unpopulate(val, "ReasonDesc", &a.ReasonDesc) + 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 AutomaticTuningServerProperties. +func (a AutomaticTuningServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actualState", a.ActualState) + populate(objectMap, "desiredState", a.DesiredState) + populate(objectMap, "options", a.Options) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AutomaticTuningServerProperties. +func (a *AutomaticTuningServerProperties) UnmarshalJSON(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 "actualState": + err = unpopulate(val, "ActualState", &a.ActualState) + delete(rawMsg, key) + case "desiredState": + err = unpopulate(val, "DesiredState", &a.DesiredState) + delete(rawMsg, key) + case "options": + err = unpopulate(val, "Options", &a.Options) + 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 AzureADOnlyAuthListResult. +func (a AzureADOnlyAuthListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureADOnlyAuthListResult. +func (a *AzureADOnlyAuthListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AzureADOnlyAuthProperties. +func (a AzureADOnlyAuthProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureADOnlyAuthentication", a.AzureADOnlyAuthentication) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureADOnlyAuthProperties. +func (a *AzureADOnlyAuthProperties) UnmarshalJSON(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 "azureADOnlyAuthentication": + err = unpopulate(val, "AzureADOnlyAuthentication", &a.AzureADOnlyAuthentication) + 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 BackupShortTermRetentionPolicy. +func (b BackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupShortTermRetentionPolicy. +func (b *BackupShortTermRetentionPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupShortTermRetentionPolicyListResult. +func (b BackupShortTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupShortTermRetentionPolicyListResult. +func (b *BackupShortTermRetentionPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &b.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &b.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupShortTermRetentionPolicyProperties. +func (b BackupShortTermRetentionPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "diffBackupIntervalInHours", b.DiffBackupIntervalInHours) + populate(objectMap, "retentionDays", b.RetentionDays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupShortTermRetentionPolicyProperties. +func (b *BackupShortTermRetentionPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "diffBackupIntervalInHours": + err = unpopulate(val, "DiffBackupIntervalInHours", &b.DiffBackupIntervalInHours) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &b.RetentionDays) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BaseLongTermRetentionPolicyProperties. +func (b BaseLongTermRetentionPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "monthlyRetention", b.MonthlyRetention) + populate(objectMap, "weekOfYear", b.WeekOfYear) + populate(objectMap, "weeklyRetention", b.WeeklyRetention) + populate(objectMap, "yearlyRetention", b.YearlyRetention) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BaseLongTermRetentionPolicyProperties. +func (b *BaseLongTermRetentionPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "monthlyRetention": + err = unpopulate(val, "MonthlyRetention", &b.MonthlyRetention) + delete(rawMsg, key) + case "weekOfYear": + err = unpopulate(val, "WeekOfYear", &b.WeekOfYear) + delete(rawMsg, key) + case "weeklyRetention": + err = unpopulate(val, "WeeklyRetention", &b.WeeklyRetention) + delete(rawMsg, key) + case "yearlyRetention": + err = unpopulate(val, "YearlyRetention", &b.YearlyRetention) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Baseline. +func (b Baseline) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "expectedResults", b.ExpectedResults) + populateTimeRFC3339(objectMap, "updatedTime", b.UpdatedTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Baseline. +func (b *Baseline) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "expectedResults": + err = unpopulate(val, "ExpectedResults", &b.ExpectedResults) + delete(rawMsg, key) + case "updatedTime": + err = unpopulateTimeRFC3339(val, "UpdatedTime", &b.UpdatedTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BaselineAdjustedResult. +func (b BaselineAdjustedResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "baseline", b.Baseline) + populate(objectMap, "resultsNotInBaseline", b.ResultsNotInBaseline) + populate(objectMap, "resultsOnlyInBaseline", b.ResultsOnlyInBaseline) + populate(objectMap, "status", b.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BaselineAdjustedResult. +func (b *BaselineAdjustedResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "baseline": + err = unpopulate(val, "Baseline", &b.Baseline) + delete(rawMsg, key) + case "resultsNotInBaseline": + err = unpopulate(val, "ResultsNotInBaseline", &b.ResultsNotInBaseline) + delete(rawMsg, key) + case "resultsOnlyInBaseline": + err = unpopulate(val, "ResultsOnlyInBaseline", &b.ResultsOnlyInBaseline) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &b.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BenchmarkReference. +func (b BenchmarkReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "benchmark", b.Benchmark) + populate(objectMap, "reference", b.Reference) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BenchmarkReference. +func (b *BenchmarkReference) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "benchmark": + err = unpopulate(val, "Benchmark", &b.Benchmark) + delete(rawMsg, key) + case "reference": + err = unpopulate(val, "Reference", &b.Reference) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CheckNameAvailabilityRequest. +func (c CheckNameAvailabilityRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", c.Name) + objectMap["type"] = "Microsoft.Sql/servers" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityRequest. +func (c *CheckNameAvailabilityRequest) UnmarshalJSON(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 "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 CheckNameAvailabilityResponse. +func (c CheckNameAvailabilityResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "available", c.Available) + populate(objectMap, "message", c.Message) + populate(objectMap, "name", c.Name) + populate(objectMap, "reason", c.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CheckNameAvailabilityResponse. +func (c *CheckNameAvailabilityResponse) UnmarshalJSON(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 "available": + err = unpopulate(val, "Available", &c.Available) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &c.Message) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &c.Reason) + 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 CompleteDatabaseRestoreDefinition. +func (c CompleteDatabaseRestoreDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "lastBackupName", c.LastBackupName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CompleteDatabaseRestoreDefinition. +func (c *CompleteDatabaseRestoreDefinition) UnmarshalJSON(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 "lastBackupName": + err = unpopulate(val, "LastBackupName", &c.LastBackupName) + 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 CopyLongTermRetentionBackupParameters. +func (c CopyLongTermRetentionBackupParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CopyLongTermRetentionBackupParameters. +func (c *CopyLongTermRetentionBackupParameters) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &c.Properties) + 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 CopyLongTermRetentionBackupParametersProperties. +func (c CopyLongTermRetentionBackupParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "targetBackupStorageRedundancy", c.TargetBackupStorageRedundancy) + populate(objectMap, "targetDatabaseName", c.TargetDatabaseName) + populate(objectMap, "targetResourceGroup", c.TargetResourceGroup) + populate(objectMap, "targetServerFullyQualifiedDomainName", c.TargetServerFullyQualifiedDomainName) + populate(objectMap, "targetServerResourceId", c.TargetServerResourceID) + populate(objectMap, "targetSubscriptionId", c.TargetSubscriptionID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CopyLongTermRetentionBackupParametersProperties. +func (c *CopyLongTermRetentionBackupParametersProperties) UnmarshalJSON(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 "targetBackupStorageRedundancy": + err = unpopulate(val, "TargetBackupStorageRedundancy", &c.TargetBackupStorageRedundancy) + delete(rawMsg, key) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &c.TargetDatabaseName) + delete(rawMsg, key) + case "targetResourceGroup": + err = unpopulate(val, "TargetResourceGroup", &c.TargetResourceGroup) + delete(rawMsg, key) + case "targetServerFullyQualifiedDomainName": + err = unpopulate(val, "TargetServerFullyQualifiedDomainName", &c.TargetServerFullyQualifiedDomainName) + delete(rawMsg, key) + case "targetServerResourceId": + err = unpopulate(val, "TargetServerResourceID", &c.TargetServerResourceID) + delete(rawMsg, key) + case "targetSubscriptionId": + err = unpopulate(val, "TargetSubscriptionID", &c.TargetSubscriptionID) + 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 CreateDatabaseRestorePointDefinition. +func (c CreateDatabaseRestorePointDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "restorePointLabel", c.RestorePointLabel) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CreateDatabaseRestorePointDefinition. +func (c *CreateDatabaseRestorePointDefinition) UnmarshalJSON(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 "restorePointLabel": + err = unpopulate(val, "RestorePointLabel", &c.RestorePointLabel) + 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 DataMaskingPolicy. +func (d DataMaskingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "location", d.Location) + 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 DataMaskingPolicy. +func (d *DataMaskingPolicy) UnmarshalJSON(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 "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "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 DataMaskingPolicyProperties. +func (d DataMaskingPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationPrincipals", d.ApplicationPrincipals) + populate(objectMap, "dataMaskingState", d.DataMaskingState) + populate(objectMap, "exemptPrincipals", d.ExemptPrincipals) + populate(objectMap, "maskingLevel", d.MaskingLevel) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataMaskingPolicyProperties. +func (d *DataMaskingPolicyProperties) UnmarshalJSON(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 "applicationPrincipals": + err = unpopulate(val, "ApplicationPrincipals", &d.ApplicationPrincipals) + delete(rawMsg, key) + case "dataMaskingState": + err = unpopulate(val, "DataMaskingState", &d.DataMaskingState) + delete(rawMsg, key) + case "exemptPrincipals": + err = unpopulate(val, "ExemptPrincipals", &d.ExemptPrincipals) + delete(rawMsg, key) + case "maskingLevel": + err = unpopulate(val, "MaskingLevel", &d.MaskingLevel) + 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 DataMaskingRule. +func (d DataMaskingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "location", d.Location) + 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 DataMaskingRule. +func (d *DataMaskingRule) UnmarshalJSON(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 "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "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 DataMaskingRuleListResult. +func (d DataMaskingRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataMaskingRuleListResult. +func (d *DataMaskingRuleListResult) UnmarshalJSON(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 DataMaskingRuleProperties. +func (d DataMaskingRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aliasName", d.AliasName) + populate(objectMap, "columnName", d.ColumnName) + populate(objectMap, "id", d.ID) + populate(objectMap, "maskingFunction", d.MaskingFunction) + populate(objectMap, "numberFrom", d.NumberFrom) + populate(objectMap, "numberTo", d.NumberTo) + populate(objectMap, "prefixSize", d.PrefixSize) + populate(objectMap, "replacementString", d.ReplacementString) + populate(objectMap, "ruleState", d.RuleState) + populate(objectMap, "schemaName", d.SchemaName) + populate(objectMap, "suffixSize", d.SuffixSize) + populate(objectMap, "tableName", d.TableName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataMaskingRuleProperties. +func (d *DataMaskingRuleProperties) UnmarshalJSON(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 "aliasName": + err = unpopulate(val, "AliasName", &d.AliasName) + delete(rawMsg, key) + case "columnName": + err = unpopulate(val, "ColumnName", &d.ColumnName) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "maskingFunction": + err = unpopulate(val, "MaskingFunction", &d.MaskingFunction) + delete(rawMsg, key) + case "numberFrom": + err = unpopulate(val, "NumberFrom", &d.NumberFrom) + delete(rawMsg, key) + case "numberTo": + err = unpopulate(val, "NumberTo", &d.NumberTo) + delete(rawMsg, key) + case "prefixSize": + err = unpopulate(val, "PrefixSize", &d.PrefixSize) + delete(rawMsg, key) + case "replacementString": + err = unpopulate(val, "ReplacementString", &d.ReplacementString) + delete(rawMsg, key) + case "ruleState": + err = unpopulate(val, "RuleState", &d.RuleState) + delete(rawMsg, key) + case "schemaName": + err = unpopulate(val, "SchemaName", &d.SchemaName) + delete(rawMsg, key) + case "suffixSize": + err = unpopulate(val, "SuffixSize", &d.SuffixSize) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &d.TableName) + 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 DataWarehouseUserActivities. +func (d DataWarehouseUserActivities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataWarehouseUserActivities. +func (d *DataWarehouseUserActivities) UnmarshalJSON(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 DataWarehouseUserActivitiesListResult. +func (d DataWarehouseUserActivitiesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataWarehouseUserActivitiesListResult. +func (d *DataWarehouseUserActivitiesListResult) UnmarshalJSON(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 DataWarehouseUserActivitiesProperties. +func (d DataWarehouseUserActivitiesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "activeQueriesCount", d.ActiveQueriesCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataWarehouseUserActivitiesProperties. +func (d *DataWarehouseUserActivitiesProperties) UnmarshalJSON(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 "activeQueriesCount": + err = unpopulate(val, "ActiveQueriesCount", &d.ActiveQueriesCount) + 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 Database. +func (d Database) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "identity", d.Identity) + populate(objectMap, "kind", d.Kind) + populate(objectMap, "location", d.Location) + populate(objectMap, "managedBy", d.ManagedBy) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "tags", d.Tags) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Database. +func (d *Database) UnmarshalJSON(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 "identity": + err = unpopulate(val, "Identity", &d.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &d.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "managedBy": + err = unpopulate(val, "ManagedBy", &d.ManagedBy) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "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 DatabaseAdvancedThreatProtection. +func (d DatabaseAdvancedThreatProtection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAdvancedThreatProtection. +func (d *DatabaseAdvancedThreatProtection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseAdvancedThreatProtectionListResult. +func (d DatabaseAdvancedThreatProtectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAdvancedThreatProtectionListResult. +func (d *DatabaseAdvancedThreatProtectionListResult) UnmarshalJSON(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 DatabaseAutomaticTuning. +func (d DatabaseAutomaticTuning) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAutomaticTuning. +func (d *DatabaseAutomaticTuning) UnmarshalJSON(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 DatabaseAutomaticTuningProperties. +func (d DatabaseAutomaticTuningProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actualState", d.ActualState) + populate(objectMap, "desiredState", d.DesiredState) + populate(objectMap, "options", d.Options) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseAutomaticTuningProperties. +func (d *DatabaseAutomaticTuningProperties) UnmarshalJSON(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 "actualState": + err = unpopulate(val, "ActualState", &d.ActualState) + delete(rawMsg, key) + case "desiredState": + err = unpopulate(val, "DesiredState", &d.DesiredState) + delete(rawMsg, key) + case "options": + err = unpopulate(val, "Options", &d.Options) + 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 DatabaseBlobAuditingPolicy. +func (d DatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "kind", d.Kind) + 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 DatabaseBlobAuditingPolicy. +func (d *DatabaseBlobAuditingPolicy) UnmarshalJSON(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 "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 "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 DatabaseBlobAuditingPolicyListResult. +func (d DatabaseBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseBlobAuditingPolicyListResult. +func (d *DatabaseBlobAuditingPolicyListResult) UnmarshalJSON(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 DatabaseBlobAuditingPolicyProperties. +func (d DatabaseBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "auditActionsAndGroups", d.AuditActionsAndGroups) + populate(objectMap, "isAzureMonitorTargetEnabled", d.IsAzureMonitorTargetEnabled) + populate(objectMap, "isManagedIdentityInUse", d.IsManagedIdentityInUse) + populate(objectMap, "isStorageSecondaryKeyInUse", d.IsStorageSecondaryKeyInUse) + populate(objectMap, "queueDelayMs", d.QueueDelayMs) + populate(objectMap, "retentionDays", d.RetentionDays) + populate(objectMap, "state", d.State) + populate(objectMap, "storageAccountAccessKey", d.StorageAccountAccessKey) + populate(objectMap, "storageAccountSubscriptionId", d.StorageAccountSubscriptionID) + populate(objectMap, "storageEndpoint", d.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseBlobAuditingPolicyProperties. +func (d *DatabaseBlobAuditingPolicyProperties) UnmarshalJSON(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 "auditActionsAndGroups": + err = unpopulate(val, "AuditActionsAndGroups", &d.AuditActionsAndGroups) + delete(rawMsg, key) + case "isAzureMonitorTargetEnabled": + err = unpopulate(val, "IsAzureMonitorTargetEnabled", &d.IsAzureMonitorTargetEnabled) + delete(rawMsg, key) + case "isManagedIdentityInUse": + err = unpopulate(val, "IsManagedIdentityInUse", &d.IsManagedIdentityInUse) + delete(rawMsg, key) + case "isStorageSecondaryKeyInUse": + err = unpopulate(val, "IsStorageSecondaryKeyInUse", &d.IsStorageSecondaryKeyInUse) + delete(rawMsg, key) + case "queueDelayMs": + err = unpopulate(val, "QueueDelayMs", &d.QueueDelayMs) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &d.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &d.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &d.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageAccountSubscriptionId": + err = unpopulate(val, "StorageAccountSubscriptionID", &d.StorageAccountSubscriptionID) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &d.StorageEndpoint) + 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 DatabaseColumn. +func (d DatabaseColumn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseColumn. +func (d *DatabaseColumn) UnmarshalJSON(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 DatabaseColumnListResult. +func (d DatabaseColumnListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseColumnListResult. +func (d *DatabaseColumnListResult) UnmarshalJSON(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 DatabaseColumnProperties. +func (d DatabaseColumnProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "columnType", d.ColumnType) + populate(objectMap, "isComputed", d.IsComputed) + populate(objectMap, "memoryOptimized", d.MemoryOptimized) + populate(objectMap, "temporalType", d.TemporalType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseColumnProperties. +func (d *DatabaseColumnProperties) UnmarshalJSON(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 "columnType": + err = unpopulate(val, "ColumnType", &d.ColumnType) + delete(rawMsg, key) + case "isComputed": + err = unpopulate(val, "IsComputed", &d.IsComputed) + delete(rawMsg, key) + case "memoryOptimized": + err = unpopulate(val, "MemoryOptimized", &d.MemoryOptimized) + delete(rawMsg, key) + case "temporalType": + err = unpopulate(val, "TemporalType", &d.TemporalType) + 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 DatabaseExtensions. +func (d DatabaseExtensions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseExtensions. +func (d *DatabaseExtensions) UnmarshalJSON(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 DatabaseExtensionsProperties. +func (d DatabaseExtensionsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorLogin", d.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", d.AdministratorLoginPassword) + populate(objectMap, "authenticationType", d.AuthenticationType) + populate(objectMap, "databaseEdition", d.DatabaseEdition) + populate(objectMap, "maxSizeBytes", d.MaxSizeBytes) + populate(objectMap, "networkIsolation", d.NetworkIsolation) + populate(objectMap, "operationMode", d.OperationMode) + populate(objectMap, "serviceObjectiveName", d.ServiceObjectiveName) + populate(objectMap, "storageKey", d.StorageKey) + populate(objectMap, "storageKeyType", d.StorageKeyType) + populate(objectMap, "storageUri", d.StorageURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseExtensionsProperties. +func (d *DatabaseExtensionsProperties) UnmarshalJSON(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 "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &d.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &d.AdministratorLoginPassword) + delete(rawMsg, key) + case "authenticationType": + err = unpopulate(val, "AuthenticationType", &d.AuthenticationType) + delete(rawMsg, key) + case "databaseEdition": + err = unpopulate(val, "DatabaseEdition", &d.DatabaseEdition) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &d.MaxSizeBytes) + delete(rawMsg, key) + case "networkIsolation": + err = unpopulate(val, "NetworkIsolation", &d.NetworkIsolation) + delete(rawMsg, key) + case "operationMode": + err = unpopulate(val, "OperationMode", &d.OperationMode) + delete(rawMsg, key) + case "serviceObjectiveName": + err = unpopulate(val, "ServiceObjectiveName", &d.ServiceObjectiveName) + delete(rawMsg, key) + case "storageKey": + err = unpopulate(val, "StorageKey", &d.StorageKey) + delete(rawMsg, key) + case "storageKeyType": + err = unpopulate(val, "StorageKeyType", &d.StorageKeyType) + delete(rawMsg, key) + case "storageUri": + err = unpopulate(val, "StorageURI", &d.StorageURI) + 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 DatabaseIdentity. +func (d DatabaseIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tenantId", d.TenantID) + populate(objectMap, "type", d.Type) + populate(objectMap, "userAssignedIdentities", d.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseIdentity. +func (d *DatabaseIdentity) UnmarshalJSON(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 "tenantId": + err = unpopulate(val, "TenantID", &d.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &d.UserAssignedIdentities) + 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 DatabaseKey. +func (d DatabaseKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "creationDate", d.CreationDate) + populate(objectMap, "subregion", d.Subregion) + populate(objectMap, "thumbprint", d.Thumbprint) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseKey. +func (d *DatabaseKey) UnmarshalJSON(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 "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &d.CreationDate) + delete(rawMsg, key) + case "subregion": + err = unpopulate(val, "Subregion", &d.Subregion) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &d.Thumbprint) + 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 DatabaseListResult. +func (d DatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseListResult. +func (d *DatabaseListResult) UnmarshalJSON(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 DatabaseOperation. +func (d DatabaseOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseOperation. +func (d *DatabaseOperation) UnmarshalJSON(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 DatabaseOperationListResult. +func (d DatabaseOperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseOperationListResult. +func (d *DatabaseOperationListResult) UnmarshalJSON(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 DatabaseOperationProperties. +func (d DatabaseOperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", d.DatabaseName) + populate(objectMap, "description", d.Description) + populate(objectMap, "errorCode", d.ErrorCode) + populate(objectMap, "errorDescription", d.ErrorDescription) + populate(objectMap, "errorSeverity", d.ErrorSeverity) + populateTimeRFC3339(objectMap, "estimatedCompletionTime", d.EstimatedCompletionTime) + populate(objectMap, "isCancellable", d.IsCancellable) + populate(objectMap, "isUserError", d.IsUserError) + populate(objectMap, "operation", d.Operation) + populate(objectMap, "operationFriendlyName", d.OperationFriendlyName) + populate(objectMap, "operationPhaseDetails", d.OperationPhaseDetails) + populate(objectMap, "percentComplete", d.PercentComplete) + populate(objectMap, "serverName", d.ServerName) + populateTimeRFC3339(objectMap, "startTime", d.StartTime) + populate(objectMap, "state", d.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseOperationProperties. +func (d *DatabaseOperationProperties) UnmarshalJSON(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 "databaseName": + err = unpopulate(val, "DatabaseName", &d.DatabaseName) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &d.Description) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &d.ErrorCode) + delete(rawMsg, key) + case "errorDescription": + err = unpopulate(val, "ErrorDescription", &d.ErrorDescription) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &d.ErrorSeverity) + delete(rawMsg, key) + case "estimatedCompletionTime": + err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &d.EstimatedCompletionTime) + delete(rawMsg, key) + case "isCancellable": + err = unpopulate(val, "IsCancellable", &d.IsCancellable) + delete(rawMsg, key) + case "isUserError": + err = unpopulate(val, "IsUserError", &d.IsUserError) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &d.Operation) + delete(rawMsg, key) + case "operationFriendlyName": + err = unpopulate(val, "OperationFriendlyName", &d.OperationFriendlyName) + delete(rawMsg, key) + case "operationPhaseDetails": + err = unpopulate(val, "OperationPhaseDetails", &d.OperationPhaseDetails) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &d.PercentComplete) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &d.ServerName) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &d.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &d.State) + 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 DatabaseProperties. +func (d DatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoPauseDelay", d.AutoPauseDelay) + populate(objectMap, "availabilityZone", d.AvailabilityZone) + populate(objectMap, "catalogCollation", d.CatalogCollation) + populate(objectMap, "collation", d.Collation) + populate(objectMap, "createMode", d.CreateMode) + populateTimeRFC3339(objectMap, "creationDate", d.CreationDate) + populate(objectMap, "currentBackupStorageRedundancy", d.CurrentBackupStorageRedundancy) + populate(objectMap, "currentSku", d.CurrentSKU) + populate(objectMap, "currentServiceObjectiveName", d.CurrentServiceObjectiveName) + populate(objectMap, "databaseId", d.DatabaseID) + populate(objectMap, "defaultSecondaryLocation", d.DefaultSecondaryLocation) + populateTimeRFC3339(objectMap, "earliestRestoreDate", d.EarliestRestoreDate) + populate(objectMap, "elasticPoolId", d.ElasticPoolID) + populate(objectMap, "encryptionProtector", d.EncryptionProtector) + populate(objectMap, "failoverGroupId", d.FailoverGroupID) + populate(objectMap, "federatedClientId", d.FederatedClientID) + populate(objectMap, "highAvailabilityReplicaCount", d.HighAvailabilityReplicaCount) + populate(objectMap, "isInfraEncryptionEnabled", d.IsInfraEncryptionEnabled) + populate(objectMap, "isLedgerOn", d.IsLedgerOn) + populate(objectMap, "keys", d.Keys) + populate(objectMap, "licenseType", d.LicenseType) + populate(objectMap, "longTermRetentionBackupResourceId", d.LongTermRetentionBackupResourceID) + populate(objectMap, "maintenanceConfigurationId", d.MaintenanceConfigurationID) + populate(objectMap, "manualCutover", d.ManualCutover) + populate(objectMap, "maxLogSizeBytes", d.MaxLogSizeBytes) + populate(objectMap, "maxSizeBytes", d.MaxSizeBytes) + populate(objectMap, "minCapacity", d.MinCapacity) + populateTimeRFC3339(objectMap, "pausedDate", d.PausedDate) + populate(objectMap, "performCutover", d.PerformCutover) + populate(objectMap, "preferredEnclaveType", d.PreferredEnclaveType) + populate(objectMap, "readScale", d.ReadScale) + populate(objectMap, "recoverableDatabaseId", d.RecoverableDatabaseID) + populate(objectMap, "recoveryServicesRecoveryPointId", d.RecoveryServicesRecoveryPointID) + populate(objectMap, "requestedBackupStorageRedundancy", d.RequestedBackupStorageRedundancy) + populate(objectMap, "requestedServiceObjectiveName", d.RequestedServiceObjectiveName) + populate(objectMap, "restorableDroppedDatabaseId", d.RestorableDroppedDatabaseID) + populateTimeRFC3339(objectMap, "restorePointInTime", d.RestorePointInTime) + populateTimeRFC3339(objectMap, "resumedDate", d.ResumedDate) + populate(objectMap, "sampleName", d.SampleName) + populate(objectMap, "secondaryType", d.SecondaryType) + populateTimeRFC3339(objectMap, "sourceDatabaseDeletionDate", d.SourceDatabaseDeletionDate) + populate(objectMap, "sourceDatabaseId", d.SourceDatabaseID) + populate(objectMap, "sourceResourceId", d.SourceResourceID) + populate(objectMap, "status", d.Status) + populate(objectMap, "zoneRedundant", d.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseProperties. +func (d *DatabaseProperties) UnmarshalJSON(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 "autoPauseDelay": + err = unpopulate(val, "AutoPauseDelay", &d.AutoPauseDelay) + delete(rawMsg, key) + case "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &d.AvailabilityZone) + delete(rawMsg, key) + case "catalogCollation": + err = unpopulate(val, "CatalogCollation", &d.CatalogCollation) + delete(rawMsg, key) + case "collation": + err = unpopulate(val, "Collation", &d.Collation) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &d.CreateMode) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &d.CreationDate) + delete(rawMsg, key) + case "currentBackupStorageRedundancy": + err = unpopulate(val, "CurrentBackupStorageRedundancy", &d.CurrentBackupStorageRedundancy) + delete(rawMsg, key) + case "currentSku": + err = unpopulate(val, "CurrentSKU", &d.CurrentSKU) + delete(rawMsg, key) + case "currentServiceObjectiveName": + err = unpopulate(val, "CurrentServiceObjectiveName", &d.CurrentServiceObjectiveName) + delete(rawMsg, key) + case "databaseId": + err = unpopulate(val, "DatabaseID", &d.DatabaseID) + delete(rawMsg, key) + case "defaultSecondaryLocation": + err = unpopulate(val, "DefaultSecondaryLocation", &d.DefaultSecondaryLocation) + delete(rawMsg, key) + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &d.EarliestRestoreDate) + delete(rawMsg, key) + case "elasticPoolId": + err = unpopulate(val, "ElasticPoolID", &d.ElasticPoolID) + delete(rawMsg, key) + case "encryptionProtector": + err = unpopulate(val, "EncryptionProtector", &d.EncryptionProtector) + delete(rawMsg, key) + case "failoverGroupId": + err = unpopulate(val, "FailoverGroupID", &d.FailoverGroupID) + delete(rawMsg, key) + case "federatedClientId": + err = unpopulate(val, "FederatedClientID", &d.FederatedClientID) + delete(rawMsg, key) + case "highAvailabilityReplicaCount": + err = unpopulate(val, "HighAvailabilityReplicaCount", &d.HighAvailabilityReplicaCount) + delete(rawMsg, key) + case "isInfraEncryptionEnabled": + err = unpopulate(val, "IsInfraEncryptionEnabled", &d.IsInfraEncryptionEnabled) + delete(rawMsg, key) + case "isLedgerOn": + err = unpopulate(val, "IsLedgerOn", &d.IsLedgerOn) + delete(rawMsg, key) + case "keys": + err = unpopulate(val, "Keys", &d.Keys) + delete(rawMsg, key) + case "licenseType": + err = unpopulate(val, "LicenseType", &d.LicenseType) + delete(rawMsg, key) + case "longTermRetentionBackupResourceId": + err = unpopulate(val, "LongTermRetentionBackupResourceID", &d.LongTermRetentionBackupResourceID) + delete(rawMsg, key) + case "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &d.MaintenanceConfigurationID) + delete(rawMsg, key) + case "manualCutover": + err = unpopulate(val, "ManualCutover", &d.ManualCutover) + delete(rawMsg, key) + case "maxLogSizeBytes": + err = unpopulate(val, "MaxLogSizeBytes", &d.MaxLogSizeBytes) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &d.MaxSizeBytes) + delete(rawMsg, key) + case "minCapacity": + err = unpopulate(val, "MinCapacity", &d.MinCapacity) + delete(rawMsg, key) + case "pausedDate": + err = unpopulateTimeRFC3339(val, "PausedDate", &d.PausedDate) + delete(rawMsg, key) + case "performCutover": + err = unpopulate(val, "PerformCutover", &d.PerformCutover) + delete(rawMsg, key) + case "preferredEnclaveType": + err = unpopulate(val, "PreferredEnclaveType", &d.PreferredEnclaveType) + delete(rawMsg, key) + case "readScale": + err = unpopulate(val, "ReadScale", &d.ReadScale) + delete(rawMsg, key) + case "recoverableDatabaseId": + err = unpopulate(val, "RecoverableDatabaseID", &d.RecoverableDatabaseID) + delete(rawMsg, key) + case "recoveryServicesRecoveryPointId": + err = unpopulate(val, "RecoveryServicesRecoveryPointID", &d.RecoveryServicesRecoveryPointID) + delete(rawMsg, key) + case "requestedBackupStorageRedundancy": + err = unpopulate(val, "RequestedBackupStorageRedundancy", &d.RequestedBackupStorageRedundancy) + delete(rawMsg, key) + case "requestedServiceObjectiveName": + err = unpopulate(val, "RequestedServiceObjectiveName", &d.RequestedServiceObjectiveName) + delete(rawMsg, key) + case "restorableDroppedDatabaseId": + err = unpopulate(val, "RestorableDroppedDatabaseID", &d.RestorableDroppedDatabaseID) + delete(rawMsg, key) + case "restorePointInTime": + err = unpopulateTimeRFC3339(val, "RestorePointInTime", &d.RestorePointInTime) + delete(rawMsg, key) + case "resumedDate": + err = unpopulateTimeRFC3339(val, "ResumedDate", &d.ResumedDate) + delete(rawMsg, key) + case "sampleName": + err = unpopulate(val, "SampleName", &d.SampleName) + delete(rawMsg, key) + case "secondaryType": + err = unpopulate(val, "SecondaryType", &d.SecondaryType) + delete(rawMsg, key) + case "sourceDatabaseDeletionDate": + err = unpopulateTimeRFC3339(val, "SourceDatabaseDeletionDate", &d.SourceDatabaseDeletionDate) + delete(rawMsg, key) + case "sourceDatabaseId": + err = unpopulate(val, "SourceDatabaseID", &d.SourceDatabaseID) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &d.ZoneRedundant) + 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 DatabaseSQLVulnerabilityAssessmentBaselineSet. +func (d DatabaseSQLVulnerabilityAssessmentBaselineSet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentBaselineSet. +func (d *DatabaseSQLVulnerabilityAssessmentBaselineSet) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentBaselineSetListResult. +func (d DatabaseSQLVulnerabilityAssessmentBaselineSetListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentBaselineSetListResult. +func (d *DatabaseSQLVulnerabilityAssessmentBaselineSetListResult) UnmarshalJSON(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 DatabaseSQLVulnerabilityAssessmentBaselineSetProperties. +func (d DatabaseSQLVulnerabilityAssessmentBaselineSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "results", d.Results) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentBaselineSetProperties. +func (d *DatabaseSQLVulnerabilityAssessmentBaselineSetProperties) UnmarshalJSON(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 "results": + err = unpopulate(val, "Results", &d.Results) + 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 DatabaseSQLVulnerabilityAssessmentRuleBaseline. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaseline. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineInput. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaselineInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineInput. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaselineInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "latestScan", d.LatestScan) + populate(objectMap, "results", d.Results) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaselineInputProperties) UnmarshalJSON(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 "latestScan": + err = unpopulate(val, "LatestScan", &d.LatestScan) + delete(rawMsg, key) + case "results": + err = unpopulate(val, "Results", &d.Results) + 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 DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "latestScan", d.LatestScan) + populate(objectMap, "results", d.Results) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaselineListInputProperties) UnmarshalJSON(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 "latestScan": + err = unpopulate(val, "LatestScan", &d.LatestScan) + delete(rawMsg, key) + case "results": + err = unpopulate(val, "Results", &d.Results) + 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 DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult) UnmarshalJSON(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 DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties. +func (d DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "results", d.Results) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties. +func (d *DatabaseSQLVulnerabilityAssessmentRuleBaselineProperties) UnmarshalJSON(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 "results": + err = unpopulate(val, "Results", &d.Results) + 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 DatabaseSchema. +func (d DatabaseSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSchema. +func (d *DatabaseSchema) UnmarshalJSON(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 "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 DatabaseSchemaListResult. +func (d DatabaseSchemaListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSchemaListResult. +func (d *DatabaseSchemaListResult) UnmarshalJSON(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 DatabaseSecurityAlertListResult. +func (d DatabaseSecurityAlertListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSecurityAlertListResult. +func (d *DatabaseSecurityAlertListResult) UnmarshalJSON(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 DatabaseSecurityAlertPolicy. +func (d DatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "systemData", d.SystemData) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseSecurityAlertPolicy. +func (d *DatabaseSecurityAlertPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &d.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseTable. +func (d DatabaseTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseTable. +func (d *DatabaseTable) UnmarshalJSON(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 DatabaseTableListResult. +func (d DatabaseTableListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseTableListResult. +func (d *DatabaseTableListResult) UnmarshalJSON(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 DatabaseTableProperties. +func (d DatabaseTableProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "memoryOptimized", d.MemoryOptimized) + populate(objectMap, "temporalType", d.TemporalType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseTableProperties. +func (d *DatabaseTableProperties) UnmarshalJSON(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 "memoryOptimized": + err = unpopulate(val, "MemoryOptimized", &d.MemoryOptimized) + delete(rawMsg, key) + case "temporalType": + err = unpopulate(val, "TemporalType", &d.TemporalType) + 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 DatabaseUpdate. +func (d DatabaseUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identity", d.Identity) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "sku", d.SKU) + populate(objectMap, "tags", d.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUpdate. +func (d *DatabaseUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "identity": + err = unpopulate(val, "Identity", &d.Identity) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &d.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &d.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DatabaseUpdateProperties. +func (d DatabaseUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoPauseDelay", d.AutoPauseDelay) + populate(objectMap, "catalogCollation", d.CatalogCollation) + populate(objectMap, "collation", d.Collation) + populate(objectMap, "createMode", d.CreateMode) + populateTimeRFC3339(objectMap, "creationDate", d.CreationDate) + populate(objectMap, "currentBackupStorageRedundancy", d.CurrentBackupStorageRedundancy) + populate(objectMap, "currentSku", d.CurrentSKU) + populate(objectMap, "currentServiceObjectiveName", d.CurrentServiceObjectiveName) + populate(objectMap, "databaseId", d.DatabaseID) + populate(objectMap, "defaultSecondaryLocation", d.DefaultSecondaryLocation) + populateTimeRFC3339(objectMap, "earliestRestoreDate", d.EarliestRestoreDate) + populate(objectMap, "elasticPoolId", d.ElasticPoolID) + populate(objectMap, "encryptionProtector", d.EncryptionProtector) + populate(objectMap, "failoverGroupId", d.FailoverGroupID) + populate(objectMap, "federatedClientId", d.FederatedClientID) + populate(objectMap, "highAvailabilityReplicaCount", d.HighAvailabilityReplicaCount) + populate(objectMap, "isInfraEncryptionEnabled", d.IsInfraEncryptionEnabled) + populate(objectMap, "isLedgerOn", d.IsLedgerOn) + populate(objectMap, "keys", d.Keys) + populate(objectMap, "licenseType", d.LicenseType) + populate(objectMap, "longTermRetentionBackupResourceId", d.LongTermRetentionBackupResourceID) + populate(objectMap, "maintenanceConfigurationId", d.MaintenanceConfigurationID) + populate(objectMap, "manualCutover", d.ManualCutover) + populate(objectMap, "maxLogSizeBytes", d.MaxLogSizeBytes) + populate(objectMap, "maxSizeBytes", d.MaxSizeBytes) + populate(objectMap, "minCapacity", d.MinCapacity) + populateTimeRFC3339(objectMap, "pausedDate", d.PausedDate) + populate(objectMap, "performCutover", d.PerformCutover) + populate(objectMap, "preferredEnclaveType", d.PreferredEnclaveType) + populate(objectMap, "readScale", d.ReadScale) + populate(objectMap, "recoverableDatabaseId", d.RecoverableDatabaseID) + populate(objectMap, "recoveryServicesRecoveryPointId", d.RecoveryServicesRecoveryPointID) + populate(objectMap, "requestedBackupStorageRedundancy", d.RequestedBackupStorageRedundancy) + populate(objectMap, "requestedServiceObjectiveName", d.RequestedServiceObjectiveName) + populate(objectMap, "restorableDroppedDatabaseId", d.RestorableDroppedDatabaseID) + populateTimeRFC3339(objectMap, "restorePointInTime", d.RestorePointInTime) + populateTimeRFC3339(objectMap, "resumedDate", d.ResumedDate) + populate(objectMap, "sampleName", d.SampleName) + populate(objectMap, "secondaryType", d.SecondaryType) + populateTimeRFC3339(objectMap, "sourceDatabaseDeletionDate", d.SourceDatabaseDeletionDate) + populate(objectMap, "sourceDatabaseId", d.SourceDatabaseID) + populate(objectMap, "status", d.Status) + populate(objectMap, "zoneRedundant", d.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUpdateProperties. +func (d *DatabaseUpdateProperties) UnmarshalJSON(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 "autoPauseDelay": + err = unpopulate(val, "AutoPauseDelay", &d.AutoPauseDelay) + delete(rawMsg, key) + case "catalogCollation": + err = unpopulate(val, "CatalogCollation", &d.CatalogCollation) + delete(rawMsg, key) + case "collation": + err = unpopulate(val, "Collation", &d.Collation) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &d.CreateMode) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &d.CreationDate) + delete(rawMsg, key) + case "currentBackupStorageRedundancy": + err = unpopulate(val, "CurrentBackupStorageRedundancy", &d.CurrentBackupStorageRedundancy) + delete(rawMsg, key) + case "currentSku": + err = unpopulate(val, "CurrentSKU", &d.CurrentSKU) + delete(rawMsg, key) + case "currentServiceObjectiveName": + err = unpopulate(val, "CurrentServiceObjectiveName", &d.CurrentServiceObjectiveName) + delete(rawMsg, key) + case "databaseId": + err = unpopulate(val, "DatabaseID", &d.DatabaseID) + delete(rawMsg, key) + case "defaultSecondaryLocation": + err = unpopulate(val, "DefaultSecondaryLocation", &d.DefaultSecondaryLocation) + delete(rawMsg, key) + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &d.EarliestRestoreDate) + delete(rawMsg, key) + case "elasticPoolId": + err = unpopulate(val, "ElasticPoolID", &d.ElasticPoolID) + delete(rawMsg, key) + case "encryptionProtector": + err = unpopulate(val, "EncryptionProtector", &d.EncryptionProtector) + delete(rawMsg, key) + case "failoverGroupId": + err = unpopulate(val, "FailoverGroupID", &d.FailoverGroupID) + delete(rawMsg, key) + case "federatedClientId": + err = unpopulate(val, "FederatedClientID", &d.FederatedClientID) + delete(rawMsg, key) + case "highAvailabilityReplicaCount": + err = unpopulate(val, "HighAvailabilityReplicaCount", &d.HighAvailabilityReplicaCount) + delete(rawMsg, key) + case "isInfraEncryptionEnabled": + err = unpopulate(val, "IsInfraEncryptionEnabled", &d.IsInfraEncryptionEnabled) + delete(rawMsg, key) + case "isLedgerOn": + err = unpopulate(val, "IsLedgerOn", &d.IsLedgerOn) + delete(rawMsg, key) + case "keys": + err = unpopulate(val, "Keys", &d.Keys) + delete(rawMsg, key) + case "licenseType": + err = unpopulate(val, "LicenseType", &d.LicenseType) + delete(rawMsg, key) + case "longTermRetentionBackupResourceId": + err = unpopulate(val, "LongTermRetentionBackupResourceID", &d.LongTermRetentionBackupResourceID) + delete(rawMsg, key) + case "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &d.MaintenanceConfigurationID) + delete(rawMsg, key) + case "manualCutover": + err = unpopulate(val, "ManualCutover", &d.ManualCutover) + delete(rawMsg, key) + case "maxLogSizeBytes": + err = unpopulate(val, "MaxLogSizeBytes", &d.MaxLogSizeBytes) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &d.MaxSizeBytes) + delete(rawMsg, key) + case "minCapacity": + err = unpopulate(val, "MinCapacity", &d.MinCapacity) + delete(rawMsg, key) + case "pausedDate": + err = unpopulateTimeRFC3339(val, "PausedDate", &d.PausedDate) + delete(rawMsg, key) + case "performCutover": + err = unpopulate(val, "PerformCutover", &d.PerformCutover) + delete(rawMsg, key) + case "preferredEnclaveType": + err = unpopulate(val, "PreferredEnclaveType", &d.PreferredEnclaveType) + delete(rawMsg, key) + case "readScale": + err = unpopulate(val, "ReadScale", &d.ReadScale) + delete(rawMsg, key) + case "recoverableDatabaseId": + err = unpopulate(val, "RecoverableDatabaseID", &d.RecoverableDatabaseID) + delete(rawMsg, key) + case "recoveryServicesRecoveryPointId": + err = unpopulate(val, "RecoveryServicesRecoveryPointID", &d.RecoveryServicesRecoveryPointID) + delete(rawMsg, key) + case "requestedBackupStorageRedundancy": + err = unpopulate(val, "RequestedBackupStorageRedundancy", &d.RequestedBackupStorageRedundancy) + delete(rawMsg, key) + case "requestedServiceObjectiveName": + err = unpopulate(val, "RequestedServiceObjectiveName", &d.RequestedServiceObjectiveName) + delete(rawMsg, key) + case "restorableDroppedDatabaseId": + err = unpopulate(val, "RestorableDroppedDatabaseID", &d.RestorableDroppedDatabaseID) + delete(rawMsg, key) + case "restorePointInTime": + err = unpopulateTimeRFC3339(val, "RestorePointInTime", &d.RestorePointInTime) + delete(rawMsg, key) + case "resumedDate": + err = unpopulateTimeRFC3339(val, "ResumedDate", &d.ResumedDate) + delete(rawMsg, key) + case "sampleName": + err = unpopulate(val, "SampleName", &d.SampleName) + delete(rawMsg, key) + case "secondaryType": + err = unpopulate(val, "SecondaryType", &d.SecondaryType) + delete(rawMsg, key) + case "sourceDatabaseDeletionDate": + err = unpopulateTimeRFC3339(val, "SourceDatabaseDeletionDate", &d.SourceDatabaseDeletionDate) + delete(rawMsg, key) + case "sourceDatabaseId": + err = unpopulate(val, "SourceDatabaseID", &d.SourceDatabaseID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &d.ZoneRedundant) + 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 DatabaseUsage. +func (d DatabaseUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUsage. +func (d *DatabaseUsage) UnmarshalJSON(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 DatabaseUsageListResult. +func (d DatabaseUsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUsageListResult. +func (d *DatabaseUsageListResult) UnmarshalJSON(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 DatabaseUsageProperties. +func (d DatabaseUsageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentValue", d.CurrentValue) + populate(objectMap, "displayName", d.DisplayName) + populate(objectMap, "limit", d.Limit) + populate(objectMap, "unit", d.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUsageProperties. +func (d *DatabaseUsageProperties) UnmarshalJSON(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 "currentValue": + err = unpopulate(val, "CurrentValue", &d.CurrentValue) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &d.DisplayName) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &d.Limit) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &d.Unit) + 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 DatabaseUserIdentity. +func (d DatabaseUserIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", d.ClientID) + populate(objectMap, "principalId", d.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUserIdentity. +func (d *DatabaseUserIdentity) UnmarshalJSON(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 "clientId": + err = unpopulate(val, "ClientID", &d.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &d.PrincipalID) + 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 DatabaseVulnerabilityAssessment. +func (d DatabaseVulnerabilityAssessment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessment. +func (d *DatabaseVulnerabilityAssessment) UnmarshalJSON(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 DatabaseVulnerabilityAssessmentListResult. +func (d DatabaseVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentListResult. +func (d *DatabaseVulnerabilityAssessmentListResult) UnmarshalJSON(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 DatabaseVulnerabilityAssessmentProperties. +func (d DatabaseVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "recurringScans", d.RecurringScans) + populate(objectMap, "storageAccountAccessKey", d.StorageAccountAccessKey) + populate(objectMap, "storageContainerPath", d.StorageContainerPath) + populate(objectMap, "storageContainerSasKey", d.StorageContainerSasKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentProperties. +func (d *DatabaseVulnerabilityAssessmentProperties) UnmarshalJSON(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 "recurringScans": + err = unpopulate(val, "RecurringScans", &d.RecurringScans) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &d.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageContainerPath": + err = unpopulate(val, "StorageContainerPath", &d.StorageContainerPath) + delete(rawMsg, key) + case "storageContainerSasKey": + err = unpopulate(val, "StorageContainerSasKey", &d.StorageContainerSasKey) + 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 DatabaseVulnerabilityAssessmentRuleBaseline. +func (d DatabaseVulnerabilityAssessmentRuleBaseline) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentRuleBaseline. +func (d *DatabaseVulnerabilityAssessmentRuleBaseline) UnmarshalJSON(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 DatabaseVulnerabilityAssessmentRuleBaselineItem. +func (d DatabaseVulnerabilityAssessmentRuleBaselineItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "result", d.Result) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineItem. +func (d *DatabaseVulnerabilityAssessmentRuleBaselineItem) UnmarshalJSON(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 "result": + err = unpopulate(val, "Result", &d.Result) + 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 DatabaseVulnerabilityAssessmentRuleBaselineProperties. +func (d DatabaseVulnerabilityAssessmentRuleBaselineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "baselineResults", d.BaselineResults) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineProperties. +func (d *DatabaseVulnerabilityAssessmentRuleBaselineProperties) UnmarshalJSON(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 "baselineResults": + err = unpopulate(val, "BaselineResults", &d.BaselineResults) + 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 DatabaseVulnerabilityAssessmentScanExportProperties. +func (d DatabaseVulnerabilityAssessmentScanExportProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "exportedReportLocation", d.ExportedReportLocation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentScanExportProperties. +func (d *DatabaseVulnerabilityAssessmentScanExportProperties) UnmarshalJSON(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 "exportedReportLocation": + err = unpopulate(val, "ExportedReportLocation", &d.ExportedReportLocation) + 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 DatabaseVulnerabilityAssessmentScansExport. +func (d DatabaseVulnerabilityAssessmentScansExport) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseVulnerabilityAssessmentScansExport. +func (d *DatabaseVulnerabilityAssessmentScansExport) UnmarshalJSON(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 DeletedServer. +func (d DeletedServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServer. +func (d *DeletedServer) UnmarshalJSON(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 DeletedServerListResult. +func (d DeletedServerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServerListResult. +func (d *DeletedServerListResult) UnmarshalJSON(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 DeletedServerProperties. +func (d DeletedServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "deletionTime", d.DeletionTime) + populate(objectMap, "fullyQualifiedDomainName", d.FullyQualifiedDomainName) + populate(objectMap, "originalId", d.OriginalID) + populate(objectMap, "version", d.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServerProperties. +func (d *DeletedServerProperties) UnmarshalJSON(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 "deletionTime": + err = unpopulateTimeRFC3339(val, "DeletionTime", &d.DeletionTime) + delete(rawMsg, key) + case "fullyQualifiedDomainName": + err = unpopulate(val, "FullyQualifiedDomainName", &d.FullyQualifiedDomainName) + delete(rawMsg, key) + case "originalId": + err = unpopulate(val, "OriginalID", &d.OriginalID) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &d.Version) + 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 DistributedAvailabilityGroup. +func (d DistributedAvailabilityGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroup. +func (d *DistributedAvailabilityGroup) UnmarshalJSON(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 DistributedAvailabilityGroupProperties. +func (d DistributedAvailabilityGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "distributedAvailabilityGroupId", d.DistributedAvailabilityGroupID) + populate(objectMap, "instanceRole", d.InstanceRole) + populate(objectMap, "lastHardenedLsn", d.LastHardenedLsn) + populate(objectMap, "linkState", d.LinkState) + populate(objectMap, "primaryAvailabilityGroupName", d.PrimaryAvailabilityGroupName) + populate(objectMap, "replicationMode", d.ReplicationMode) + populate(objectMap, "secondaryAvailabilityGroupName", d.SecondaryAvailabilityGroupName) + populate(objectMap, "sourceEndpoint", d.SourceEndpoint) + populate(objectMap, "sourceReplicaId", d.SourceReplicaID) + populate(objectMap, "targetDatabase", d.TargetDatabase) + populate(objectMap, "targetReplicaId", d.TargetReplicaID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroupProperties. +func (d *DistributedAvailabilityGroupProperties) UnmarshalJSON(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 "distributedAvailabilityGroupId": + err = unpopulate(val, "DistributedAvailabilityGroupID", &d.DistributedAvailabilityGroupID) + delete(rawMsg, key) + case "instanceRole": + err = unpopulate(val, "InstanceRole", &d.InstanceRole) + delete(rawMsg, key) + case "lastHardenedLsn": + err = unpopulate(val, "LastHardenedLsn", &d.LastHardenedLsn) + delete(rawMsg, key) + case "linkState": + err = unpopulate(val, "LinkState", &d.LinkState) + delete(rawMsg, key) + case "primaryAvailabilityGroupName": + err = unpopulate(val, "PrimaryAvailabilityGroupName", &d.PrimaryAvailabilityGroupName) + delete(rawMsg, key) + case "replicationMode": + err = unpopulate(val, "ReplicationMode", &d.ReplicationMode) + delete(rawMsg, key) + case "secondaryAvailabilityGroupName": + err = unpopulate(val, "SecondaryAvailabilityGroupName", &d.SecondaryAvailabilityGroupName) + delete(rawMsg, key) + case "sourceEndpoint": + err = unpopulate(val, "SourceEndpoint", &d.SourceEndpoint) + delete(rawMsg, key) + case "sourceReplicaId": + err = unpopulate(val, "SourceReplicaID", &d.SourceReplicaID) + delete(rawMsg, key) + case "targetDatabase": + err = unpopulate(val, "TargetDatabase", &d.TargetDatabase) + delete(rawMsg, key) + case "targetReplicaId": + err = unpopulate(val, "TargetReplicaID", &d.TargetReplicaID) + 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 DistributedAvailabilityGroupSetRole. +func (d DistributedAvailabilityGroupSetRole) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "instanceRole", d.InstanceRole) + populate(objectMap, "roleChangeType", d.RoleChangeType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroupSetRole. +func (d *DistributedAvailabilityGroupSetRole) UnmarshalJSON(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 "instanceRole": + err = unpopulate(val, "InstanceRole", &d.InstanceRole) + delete(rawMsg, key) + case "roleChangeType": + err = unpopulate(val, "RoleChangeType", &d.RoleChangeType) + 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 DistributedAvailabilityGroupsListResult. +func (d DistributedAvailabilityGroupsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedAvailabilityGroupsListResult. +func (d *DistributedAvailabilityGroupsListResult) UnmarshalJSON(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 EditionCapability. +func (e EditionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", e.Name) + populate(objectMap, "readScale", e.ReadScale) + populate(objectMap, "reason", e.Reason) + populate(objectMap, "status", e.Status) + populate(objectMap, "supportedServiceLevelObjectives", e.SupportedServiceLevelObjectives) + populate(objectMap, "supportedStorageCapabilities", e.SupportedStorageCapabilities) + populate(objectMap, "zonePinning", e.ZonePinning) + populate(objectMap, "zoneRedundant", e.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EditionCapability. +func (e *EditionCapability) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "readScale": + err = unpopulate(val, "ReadScale", &e.ReadScale) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "supportedServiceLevelObjectives": + err = unpopulate(val, "SupportedServiceLevelObjectives", &e.SupportedServiceLevelObjectives) + delete(rawMsg, key) + case "supportedStorageCapabilities": + err = unpopulate(val, "SupportedStorageCapabilities", &e.SupportedStorageCapabilities) + delete(rawMsg, key) + case "zonePinning": + err = unpopulate(val, "ZonePinning", &e.ZonePinning) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + 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 ElasticPool. +func (e ElasticPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "kind", e.Kind) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "sku", e.SKU) + populate(objectMap, "tags", e.Tags) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPool. +func (e *ElasticPool) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &e.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + 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 ElasticPoolEditionCapability. +func (e ElasticPoolEditionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", e.Name) + populate(objectMap, "reason", e.Reason) + populate(objectMap, "status", e.Status) + populate(objectMap, "supportedElasticPoolPerformanceLevels", e.SupportedElasticPoolPerformanceLevels) + populate(objectMap, "zonePinning", e.ZonePinning) + populate(objectMap, "zoneRedundant", e.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolEditionCapability. +func (e *ElasticPoolEditionCapability) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "supportedElasticPoolPerformanceLevels": + err = unpopulate(val, "SupportedElasticPoolPerformanceLevels", &e.SupportedElasticPoolPerformanceLevels) + delete(rawMsg, key) + case "zonePinning": + err = unpopulate(val, "ZonePinning", &e.ZonePinning) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + 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 ElasticPoolListResult. +func (e ElasticPoolListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolListResult. +func (e *ElasticPoolListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + 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 ElasticPoolOperation. +func (e ElasticPoolOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperation. +func (e *ElasticPoolOperation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 ElasticPoolOperationListResult. +func (e ElasticPoolOperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperationListResult. +func (e *ElasticPoolOperationListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + 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 ElasticPoolOperationProperties. +func (e ElasticPoolOperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", e.Description) + populate(objectMap, "elasticPoolName", e.ElasticPoolName) + populate(objectMap, "errorCode", e.ErrorCode) + populate(objectMap, "errorDescription", e.ErrorDescription) + populate(objectMap, "errorSeverity", e.ErrorSeverity) + populateTimeRFC3339(objectMap, "estimatedCompletionTime", e.EstimatedCompletionTime) + populate(objectMap, "isCancellable", e.IsCancellable) + populate(objectMap, "isUserError", e.IsUserError) + populate(objectMap, "operation", e.Operation) + populate(objectMap, "operationFriendlyName", e.OperationFriendlyName) + populate(objectMap, "percentComplete", e.PercentComplete) + populate(objectMap, "serverName", e.ServerName) + populateTimeRFC3339(objectMap, "startTime", e.StartTime) + populate(objectMap, "state", e.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperationProperties. +func (e *ElasticPoolOperationProperties) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &e.Description) + delete(rawMsg, key) + case "elasticPoolName": + err = unpopulate(val, "ElasticPoolName", &e.ElasticPoolName) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &e.ErrorCode) + delete(rawMsg, key) + case "errorDescription": + err = unpopulate(val, "ErrorDescription", &e.ErrorDescription) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) + delete(rawMsg, key) + case "estimatedCompletionTime": + err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &e.EstimatedCompletionTime) + delete(rawMsg, key) + case "isCancellable": + err = unpopulate(val, "IsCancellable", &e.IsCancellable) + delete(rawMsg, key) + case "isUserError": + err = unpopulate(val, "IsUserError", &e.IsUserError) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &e.Operation) + delete(rawMsg, key) + case "operationFriendlyName": + err = unpopulate(val, "OperationFriendlyName", &e.OperationFriendlyName) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &e.PercentComplete) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &e.ServerName) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + 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 ElasticPoolPerDatabaseMaxPerformanceLevelCapability. +func (e ElasticPoolPerDatabaseMaxPerformanceLevelCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limit", e.Limit) + populate(objectMap, "reason", e.Reason) + populate(objectMap, "status", e.Status) + populate(objectMap, "supportedPerDatabaseMinPerformanceLevels", e.SupportedPerDatabaseMinPerformanceLevels) + populate(objectMap, "unit", e.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolPerDatabaseMaxPerformanceLevelCapability. +func (e *ElasticPoolPerDatabaseMaxPerformanceLevelCapability) UnmarshalJSON(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 "limit": + err = unpopulate(val, "Limit", &e.Limit) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "supportedPerDatabaseMinPerformanceLevels": + err = unpopulate(val, "SupportedPerDatabaseMinPerformanceLevels", &e.SupportedPerDatabaseMinPerformanceLevels) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &e.Unit) + 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 ElasticPoolPerDatabaseMinPerformanceLevelCapability. +func (e ElasticPoolPerDatabaseMinPerformanceLevelCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limit", e.Limit) + populate(objectMap, "reason", e.Reason) + populate(objectMap, "status", e.Status) + populate(objectMap, "unit", e.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolPerDatabaseMinPerformanceLevelCapability. +func (e *ElasticPoolPerDatabaseMinPerformanceLevelCapability) UnmarshalJSON(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 "limit": + err = unpopulate(val, "Limit", &e.Limit) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &e.Unit) + 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 ElasticPoolPerDatabaseSettings. +func (e ElasticPoolPerDatabaseSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxCapacity", e.MaxCapacity) + populate(objectMap, "minCapacity", e.MinCapacity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolPerDatabaseSettings. +func (e *ElasticPoolPerDatabaseSettings) UnmarshalJSON(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 "maxCapacity": + err = unpopulate(val, "MaxCapacity", &e.MaxCapacity) + delete(rawMsg, key) + case "minCapacity": + err = unpopulate(val, "MinCapacity", &e.MinCapacity) + 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 ElasticPoolPerformanceLevelCapability. +func (e ElasticPoolPerformanceLevelCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "includedMaxSize", e.IncludedMaxSize) + populate(objectMap, "maxDatabaseCount", e.MaxDatabaseCount) + populate(objectMap, "performanceLevel", e.PerformanceLevel) + populate(objectMap, "reason", e.Reason) + populate(objectMap, "sku", e.SKU) + populate(objectMap, "status", e.Status) + populate(objectMap, "supportedLicenseTypes", e.SupportedLicenseTypes) + populate(objectMap, "supportedMaintenanceConfigurations", e.SupportedMaintenanceConfigurations) + populate(objectMap, "supportedMaxSizes", e.SupportedMaxSizes) + populate(objectMap, "supportedPerDatabaseMaxPerformanceLevels", e.SupportedPerDatabaseMaxPerformanceLevels) + populate(objectMap, "supportedPerDatabaseMaxSizes", e.SupportedPerDatabaseMaxSizes) + populate(objectMap, "zoneRedundant", e.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolPerformanceLevelCapability. +func (e *ElasticPoolPerformanceLevelCapability) UnmarshalJSON(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 "includedMaxSize": + err = unpopulate(val, "IncludedMaxSize", &e.IncludedMaxSize) + delete(rawMsg, key) + case "maxDatabaseCount": + err = unpopulate(val, "MaxDatabaseCount", &e.MaxDatabaseCount) + delete(rawMsg, key) + case "performanceLevel": + err = unpopulate(val, "PerformanceLevel", &e.PerformanceLevel) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &e.Reason) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &e.SKU) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &e.Status) + delete(rawMsg, key) + case "supportedLicenseTypes": + err = unpopulate(val, "SupportedLicenseTypes", &e.SupportedLicenseTypes) + delete(rawMsg, key) + case "supportedMaintenanceConfigurations": + err = unpopulate(val, "SupportedMaintenanceConfigurations", &e.SupportedMaintenanceConfigurations) + delete(rawMsg, key) + case "supportedMaxSizes": + err = unpopulate(val, "SupportedMaxSizes", &e.SupportedMaxSizes) + delete(rawMsg, key) + case "supportedPerDatabaseMaxPerformanceLevels": + err = unpopulate(val, "SupportedPerDatabaseMaxPerformanceLevels", &e.SupportedPerDatabaseMaxPerformanceLevels) + delete(rawMsg, key) + case "supportedPerDatabaseMaxSizes": + err = unpopulate(val, "SupportedPerDatabaseMaxSizes", &e.SupportedPerDatabaseMaxSizes) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + 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 ElasticPoolProperties. +func (e ElasticPoolProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availabilityZone", e.AvailabilityZone) + populateTimeRFC3339(objectMap, "creationDate", e.CreationDate) + populate(objectMap, "highAvailabilityReplicaCount", e.HighAvailabilityReplicaCount) + populate(objectMap, "licenseType", e.LicenseType) + populate(objectMap, "maintenanceConfigurationId", e.MaintenanceConfigurationID) + populate(objectMap, "maxSizeBytes", e.MaxSizeBytes) + populate(objectMap, "minCapacity", e.MinCapacity) + populate(objectMap, "perDatabaseSettings", e.PerDatabaseSettings) + populate(objectMap, "preferredEnclaveType", e.PreferredEnclaveType) + populate(objectMap, "state", e.State) + populate(objectMap, "zoneRedundant", e.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolProperties. +func (e *ElasticPoolProperties) UnmarshalJSON(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 "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &e.AvailabilityZone) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &e.CreationDate) + delete(rawMsg, key) + case "highAvailabilityReplicaCount": + err = unpopulate(val, "HighAvailabilityReplicaCount", &e.HighAvailabilityReplicaCount) + delete(rawMsg, key) + case "licenseType": + err = unpopulate(val, "LicenseType", &e.LicenseType) + delete(rawMsg, key) + case "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &e.MaintenanceConfigurationID) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &e.MaxSizeBytes) + delete(rawMsg, key) + case "minCapacity": + err = unpopulate(val, "MinCapacity", &e.MinCapacity) + delete(rawMsg, key) + case "perDatabaseSettings": + err = unpopulate(val, "PerDatabaseSettings", &e.PerDatabaseSettings) + delete(rawMsg, key) + case "preferredEnclaveType": + err = unpopulate(val, "PreferredEnclaveType", &e.PreferredEnclaveType) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + 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 ElasticPoolUpdate. +func (e ElasticPoolUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "sku", e.SKU) + populate(objectMap, "tags", e.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolUpdate. +func (e *ElasticPoolUpdate) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &e.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &e.Tags) + 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 ElasticPoolUpdateProperties. +func (e ElasticPoolUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availabilityZone", e.AvailabilityZone) + populate(objectMap, "highAvailabilityReplicaCount", e.HighAvailabilityReplicaCount) + populate(objectMap, "licenseType", e.LicenseType) + populate(objectMap, "maintenanceConfigurationId", e.MaintenanceConfigurationID) + populate(objectMap, "maxSizeBytes", e.MaxSizeBytes) + populate(objectMap, "minCapacity", e.MinCapacity) + populate(objectMap, "perDatabaseSettings", e.PerDatabaseSettings) + populate(objectMap, "preferredEnclaveType", e.PreferredEnclaveType) + populate(objectMap, "zoneRedundant", e.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolUpdateProperties. +func (e *ElasticPoolUpdateProperties) UnmarshalJSON(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 "availabilityZone": + err = unpopulate(val, "AvailabilityZone", &e.AvailabilityZone) + delete(rawMsg, key) + case "highAvailabilityReplicaCount": + err = unpopulate(val, "HighAvailabilityReplicaCount", &e.HighAvailabilityReplicaCount) + delete(rawMsg, key) + case "licenseType": + err = unpopulate(val, "LicenseType", &e.LicenseType) + delete(rawMsg, key) + case "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &e.MaintenanceConfigurationID) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &e.MaxSizeBytes) + delete(rawMsg, key) + case "minCapacity": + err = unpopulate(val, "MinCapacity", &e.MinCapacity) + delete(rawMsg, key) + case "perDatabaseSettings": + err = unpopulate(val, "PerDatabaseSettings", &e.PerDatabaseSettings) + delete(rawMsg, key) + case "preferredEnclaveType": + err = unpopulate(val, "PreferredEnclaveType", &e.PreferredEnclaveType) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) + 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 EncryptionProtector. +func (e EncryptionProtector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "kind", e.Kind) + populate(objectMap, "location", e.Location) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProtector. +func (e *EncryptionProtector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &e.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &e.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 EncryptionProtectorListResult. +func (e EncryptionProtectorListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProtectorListResult. +func (e *EncryptionProtectorListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + 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 EncryptionProtectorProperties. +func (e EncryptionProtectorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoRotationEnabled", e.AutoRotationEnabled) + populate(objectMap, "serverKeyName", e.ServerKeyName) + populate(objectMap, "serverKeyType", e.ServerKeyType) + populate(objectMap, "subregion", e.Subregion) + populate(objectMap, "thumbprint", e.Thumbprint) + populate(objectMap, "uri", e.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionProtectorProperties. +func (e *EncryptionProtectorProperties) UnmarshalJSON(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 "autoRotationEnabled": + err = unpopulate(val, "AutoRotationEnabled", &e.AutoRotationEnabled) + delete(rawMsg, key) + case "serverKeyName": + err = unpopulate(val, "ServerKeyName", &e.ServerKeyName) + delete(rawMsg, key) + case "serverKeyType": + err = unpopulate(val, "ServerKeyType", &e.ServerKeyType) + delete(rawMsg, key) + case "subregion": + err = unpopulate(val, "Subregion", &e.Subregion) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &e.Thumbprint) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &e.URI) + 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 EndpointCertificate. +func (e EndpointCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointCertificate. +func (e *EndpointCertificate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 EndpointCertificateListResult. +func (e EndpointCertificateListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointCertificateListResult. +func (e *EndpointCertificateListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + 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 EndpointCertificateProperties. +func (e EndpointCertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "publicBlob", e.PublicBlob) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointCertificateProperties. +func (e *EndpointCertificateProperties) UnmarshalJSON(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 "publicBlob": + err = unpopulate(val, "PublicBlob", &e.PublicBlob) + 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 EndpointDependency. +func (e EndpointDependency) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "domainName", e.DomainName) + populate(objectMap, "endpointDetails", e.EndpointDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDependency. +func (e *EndpointDependency) UnmarshalJSON(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 "domainName": + err = unpopulate(val, "DomainName", &e.DomainName) + delete(rawMsg, key) + case "endpointDetails": + err = unpopulate(val, "EndpointDetails", &e.EndpointDetails) + 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 EndpointDetail. +func (e EndpointDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", e.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDetail. +func (e *EndpointDetail) UnmarshalJSON(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 "port": + err = unpopulate(val, "Port", &e.Port) + 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 ExportDatabaseDefinition. +func (e ExportDatabaseDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorLogin", e.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", e.AdministratorLoginPassword) + populate(objectMap, "authenticationType", e.AuthenticationType) + populate(objectMap, "networkIsolation", e.NetworkIsolation) + populate(objectMap, "storageKey", e.StorageKey) + populate(objectMap, "storageKeyType", e.StorageKeyType) + populate(objectMap, "storageUri", e.StorageURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExportDatabaseDefinition. +func (e *ExportDatabaseDefinition) UnmarshalJSON(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 "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &e.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &e.AdministratorLoginPassword) + delete(rawMsg, key) + case "authenticationType": + err = unpopulate(val, "AuthenticationType", &e.AuthenticationType) + delete(rawMsg, key) + case "networkIsolation": + err = unpopulate(val, "NetworkIsolation", &e.NetworkIsolation) + delete(rawMsg, key) + case "storageKey": + err = unpopulate(val, "StorageKey", &e.StorageKey) + delete(rawMsg, key) + case "storageKeyType": + err = unpopulate(val, "StorageKeyType", &e.StorageKeyType) + delete(rawMsg, key) + case "storageUri": + err = unpopulate(val, "StorageURI", &e.StorageURI) + 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 ExtendedDatabaseBlobAuditingPolicy. +func (e ExtendedDatabaseBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedDatabaseBlobAuditingPolicy. +func (e *ExtendedDatabaseBlobAuditingPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 ExtendedDatabaseBlobAuditingPolicyListResult. +func (e ExtendedDatabaseBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedDatabaseBlobAuditingPolicyListResult. +func (e *ExtendedDatabaseBlobAuditingPolicyListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + 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 ExtendedDatabaseBlobAuditingPolicyProperties. +func (e ExtendedDatabaseBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "auditActionsAndGroups", e.AuditActionsAndGroups) + populate(objectMap, "isAzureMonitorTargetEnabled", e.IsAzureMonitorTargetEnabled) + populate(objectMap, "isManagedIdentityInUse", e.IsManagedIdentityInUse) + populate(objectMap, "isStorageSecondaryKeyInUse", e.IsStorageSecondaryKeyInUse) + populate(objectMap, "predicateExpression", e.PredicateExpression) + populate(objectMap, "queueDelayMs", e.QueueDelayMs) + populate(objectMap, "retentionDays", e.RetentionDays) + populate(objectMap, "state", e.State) + populate(objectMap, "storageAccountAccessKey", e.StorageAccountAccessKey) + populate(objectMap, "storageAccountSubscriptionId", e.StorageAccountSubscriptionID) + populate(objectMap, "storageEndpoint", e.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedDatabaseBlobAuditingPolicyProperties. +func (e *ExtendedDatabaseBlobAuditingPolicyProperties) UnmarshalJSON(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 "auditActionsAndGroups": + err = unpopulate(val, "AuditActionsAndGroups", &e.AuditActionsAndGroups) + delete(rawMsg, key) + case "isAzureMonitorTargetEnabled": + err = unpopulate(val, "IsAzureMonitorTargetEnabled", &e.IsAzureMonitorTargetEnabled) + delete(rawMsg, key) + case "isManagedIdentityInUse": + err = unpopulate(val, "IsManagedIdentityInUse", &e.IsManagedIdentityInUse) + delete(rawMsg, key) + case "isStorageSecondaryKeyInUse": + err = unpopulate(val, "IsStorageSecondaryKeyInUse", &e.IsStorageSecondaryKeyInUse) + delete(rawMsg, key) + case "predicateExpression": + err = unpopulate(val, "PredicateExpression", &e.PredicateExpression) + delete(rawMsg, key) + case "queueDelayMs": + err = unpopulate(val, "QueueDelayMs", &e.QueueDelayMs) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &e.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &e.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageAccountSubscriptionId": + err = unpopulate(val, "StorageAccountSubscriptionID", &e.StorageAccountSubscriptionID) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &e.StorageEndpoint) + 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 ExtendedServerBlobAuditingPolicy. +func (e ExtendedServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedServerBlobAuditingPolicy. +func (e *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + 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 ExtendedServerBlobAuditingPolicyListResult. +func (e ExtendedServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedServerBlobAuditingPolicyListResult. +func (e *ExtendedServerBlobAuditingPolicyListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + 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 ExtendedServerBlobAuditingPolicyProperties. +func (e ExtendedServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "auditActionsAndGroups", e.AuditActionsAndGroups) + populate(objectMap, "isAzureMonitorTargetEnabled", e.IsAzureMonitorTargetEnabled) + populate(objectMap, "isDevopsAuditEnabled", e.IsDevopsAuditEnabled) + populate(objectMap, "isManagedIdentityInUse", e.IsManagedIdentityInUse) + populate(objectMap, "isStorageSecondaryKeyInUse", e.IsStorageSecondaryKeyInUse) + populate(objectMap, "predicateExpression", e.PredicateExpression) + populate(objectMap, "queueDelayMs", e.QueueDelayMs) + populate(objectMap, "retentionDays", e.RetentionDays) + populate(objectMap, "state", e.State) + populate(objectMap, "storageAccountAccessKey", e.StorageAccountAccessKey) + populate(objectMap, "storageAccountSubscriptionId", e.StorageAccountSubscriptionID) + populate(objectMap, "storageEndpoint", e.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedServerBlobAuditingPolicyProperties. +func (e *ExtendedServerBlobAuditingPolicyProperties) UnmarshalJSON(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 "auditActionsAndGroups": + err = unpopulate(val, "AuditActionsAndGroups", &e.AuditActionsAndGroups) + delete(rawMsg, key) + case "isAzureMonitorTargetEnabled": + err = unpopulate(val, "IsAzureMonitorTargetEnabled", &e.IsAzureMonitorTargetEnabled) + delete(rawMsg, key) + case "isDevopsAuditEnabled": + err = unpopulate(val, "IsDevopsAuditEnabled", &e.IsDevopsAuditEnabled) + delete(rawMsg, key) + case "isManagedIdentityInUse": + err = unpopulate(val, "IsManagedIdentityInUse", &e.IsManagedIdentityInUse) + delete(rawMsg, key) + case "isStorageSecondaryKeyInUse": + err = unpopulate(val, "IsStorageSecondaryKeyInUse", &e.IsStorageSecondaryKeyInUse) + delete(rawMsg, key) + case "predicateExpression": + err = unpopulate(val, "PredicateExpression", &e.PredicateExpression) + delete(rawMsg, key) + case "queueDelayMs": + err = unpopulate(val, "QueueDelayMs", &e.QueueDelayMs) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &e.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &e.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &e.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageAccountSubscriptionId": + err = unpopulate(val, "StorageAccountSubscriptionID", &e.StorageAccountSubscriptionID) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &e.StorageEndpoint) + 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 FailoverGroup. +func (f FailoverGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "location", f.Location) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "tags", f.Tags) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroup. +func (f *FailoverGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &f.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupListResult. +func (f FailoverGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupListResult. +func (f *FailoverGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupProperties. +func (f FailoverGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databases", f.Databases) + populate(objectMap, "partnerServers", f.PartnerServers) + populate(objectMap, "readOnlyEndpoint", f.ReadOnlyEndpoint) + populate(objectMap, "readWriteEndpoint", f.ReadWriteEndpoint) + populate(objectMap, "replicationRole", f.ReplicationRole) + populate(objectMap, "replicationState", f.ReplicationState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupProperties. +func (f *FailoverGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databases": + err = unpopulate(val, "Databases", &f.Databases) + delete(rawMsg, key) + case "partnerServers": + err = unpopulate(val, "PartnerServers", &f.PartnerServers) + delete(rawMsg, key) + case "readOnlyEndpoint": + err = unpopulate(val, "ReadOnlyEndpoint", &f.ReadOnlyEndpoint) + delete(rawMsg, key) + case "readWriteEndpoint": + err = unpopulate(val, "ReadWriteEndpoint", &f.ReadWriteEndpoint) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &f.ReplicationRole) + delete(rawMsg, key) + case "replicationState": + err = unpopulate(val, "ReplicationState", &f.ReplicationState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupReadOnlyEndpoint. +func (f FailoverGroupReadOnlyEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failoverPolicy", f.FailoverPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupReadOnlyEndpoint. +func (f *FailoverGroupReadOnlyEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failoverPolicy": + err = unpopulate(val, "FailoverPolicy", &f.FailoverPolicy) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupReadWriteEndpoint. +func (f FailoverGroupReadWriteEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failoverPolicy", f.FailoverPolicy) + populate(objectMap, "failoverWithDataLossGracePeriodMinutes", f.FailoverWithDataLossGracePeriodMinutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupReadWriteEndpoint. +func (f *FailoverGroupReadWriteEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "failoverPolicy": + err = unpopulate(val, "FailoverPolicy", &f.FailoverPolicy) + delete(rawMsg, key) + case "failoverWithDataLossGracePeriodMinutes": + err = unpopulate(val, "FailoverWithDataLossGracePeriodMinutes", &f.FailoverWithDataLossGracePeriodMinutes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupTryPlannedBeforeForcedFailover. +func (f FailoverGroupTryPlannedBeforeForcedFailover) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", &f.Properties) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupTryPlannedBeforeForcedFailover. +func (f *FailoverGroupTryPlannedBeforeForcedFailover) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupUpdate. +func (f FailoverGroupUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "tags", f.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupUpdate. +func (f *FailoverGroupUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &f.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FailoverGroupUpdateProperties. +func (f FailoverGroupUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databases", f.Databases) + populate(objectMap, "readOnlyEndpoint", f.ReadOnlyEndpoint) + populate(objectMap, "readWriteEndpoint", f.ReadWriteEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FailoverGroupUpdateProperties. +func (f *FailoverGroupUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databases": + err = unpopulate(val, "Databases", &f.Databases) + delete(rawMsg, key) + case "readOnlyEndpoint": + err = unpopulate(val, "ReadOnlyEndpoint", &f.ReadOnlyEndpoint) + delete(rawMsg, key) + case "readWriteEndpoint": + err = unpopulate(val, "ReadWriteEndpoint", &f.ReadWriteEndpoint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FirewallRule. +func (f FirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", f.ID) + populate(objectMap, "name", f.Name) + populate(objectMap, "properties", f.Properties) + populate(objectMap, "type", f.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRule. +func (f *FirewallRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &f.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &f.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &f.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &f.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FirewallRuleList. +func (f FirewallRuleList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "values", f.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleList. +func (f *FirewallRuleList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "values": + err = unpopulate(val, "Values", &f.Values) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type FirewallRuleListResult. +func (f FirewallRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", f.NextLink) + populate(objectMap, "value", f.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FirewallRuleListResult. +func (f *FirewallRuleListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &f.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &f.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GeoBackupPolicy. +func (g GeoBackupPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", g.ID) + populate(objectMap, "kind", g.Kind) + populate(objectMap, "location", g.Location) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GeoBackupPolicy. +func (g *GeoBackupPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &g.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &g.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GeoBackupPolicyListResult. +func (g GeoBackupPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GeoBackupPolicyListResult. +func (g *GeoBackupPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GeoBackupPolicyProperties. +func (g GeoBackupPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "state", g.State) + populate(objectMap, "storageType", g.StorageType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GeoBackupPolicyProperties. +func (g *GeoBackupPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "state": + err = unpopulate(val, "State", &g.State) + delete(rawMsg, key) + case "storageType": + err = unpopulate(val, "StorageType", &g.StorageType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPv6FirewallRule. +func (i IPv6FirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6FirewallRule. +func (i *IPv6FirewallRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IPv6FirewallRuleListResult. +func (i IPv6FirewallRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6FirewallRuleListResult. +func (i *IPv6FirewallRuleListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 IPv6ServerFirewallRuleProperties. +func (i IPv6ServerFirewallRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endIPv6Address", i.EndIPv6Address) + populate(objectMap, "startIPv6Address", i.StartIPv6Address) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IPv6ServerFirewallRuleProperties. +func (i *IPv6ServerFirewallRuleProperties) UnmarshalJSON(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 "endIPv6Address": + err = unpopulate(val, "EndIPv6Address", &i.EndIPv6Address) + delete(rawMsg, key) + case "startIPv6Address": + err = unpopulate(val, "StartIPv6Address", &i.StartIPv6Address) + 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 ImportExistingDatabaseDefinition. +func (i ImportExistingDatabaseDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorLogin", i.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", i.AdministratorLoginPassword) + populate(objectMap, "authenticationType", i.AuthenticationType) + populate(objectMap, "networkIsolation", i.NetworkIsolation) + populate(objectMap, "storageKey", i.StorageKey) + populate(objectMap, "storageKeyType", i.StorageKeyType) + populate(objectMap, "storageUri", i.StorageURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExistingDatabaseDefinition. +func (i *ImportExistingDatabaseDefinition) UnmarshalJSON(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 "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &i.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &i.AdministratorLoginPassword) + delete(rawMsg, key) + case "authenticationType": + err = unpopulate(val, "AuthenticationType", &i.AuthenticationType) + delete(rawMsg, key) + case "networkIsolation": + err = unpopulate(val, "NetworkIsolation", &i.NetworkIsolation) + delete(rawMsg, key) + case "storageKey": + err = unpopulate(val, "StorageKey", &i.StorageKey) + delete(rawMsg, key) + case "storageKeyType": + err = unpopulate(val, "StorageKeyType", &i.StorageKeyType) + delete(rawMsg, key) + case "storageUri": + err = unpopulate(val, "StorageURI", &i.StorageURI) + 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 ImportExportExtensionsOperationListResult. +func (i ImportExportExtensionsOperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExportExtensionsOperationListResult. +func (i *ImportExportExtensionsOperationListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 ImportExportExtensionsOperationResult. +func (i ImportExportExtensionsOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExportExtensionsOperationResult. +func (i *ImportExportExtensionsOperationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImportExportExtensionsOperationResultProperties. +func (i ImportExportExtensionsOperationResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobUri", i.BlobURI) + populate(objectMap, "databaseName", i.DatabaseName) + populate(objectMap, "errorMessage", i.ErrorMessage) + populate(objectMap, "lastModifiedTime", i.LastModifiedTime) + populate(objectMap, "privateEndpointConnections", i.PrivateEndpointConnections) + populate(objectMap, "queuedTime", i.QueuedTime) + populate(objectMap, "requestId", i.RequestID) + populate(objectMap, "requestType", i.RequestType) + populate(objectMap, "serverName", i.ServerName) + populate(objectMap, "status", i.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExportExtensionsOperationResultProperties. +func (i *ImportExportExtensionsOperationResultProperties) UnmarshalJSON(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 "blobUri": + err = unpopulate(val, "BlobURI", &i.BlobURI) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &i.DatabaseName) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &i.ErrorMessage) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulate(val, "LastModifiedTime", &i.LastModifiedTime) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &i.PrivateEndpointConnections) + delete(rawMsg, key) + case "queuedTime": + err = unpopulate(val, "QueuedTime", &i.QueuedTime) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "RequestID", &i.RequestID) + delete(rawMsg, key) + case "requestType": + err = unpopulate(val, "RequestType", &i.RequestType) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &i.ServerName) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + 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 ImportExportOperationResult. +func (i ImportExportOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExportOperationResult. +func (i *ImportExportOperationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ImportExportOperationResultProperties. +func (i ImportExportOperationResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobUri", i.BlobURI) + populate(objectMap, "databaseName", i.DatabaseName) + populate(objectMap, "errorMessage", i.ErrorMessage) + populate(objectMap, "lastModifiedTime", i.LastModifiedTime) + populate(objectMap, "privateEndpointConnections", i.PrivateEndpointConnections) + populate(objectMap, "queuedTime", i.QueuedTime) + populate(objectMap, "requestId", i.RequestID) + populate(objectMap, "requestType", i.RequestType) + populate(objectMap, "serverName", i.ServerName) + populate(objectMap, "status", i.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportExportOperationResultProperties. +func (i *ImportExportOperationResultProperties) UnmarshalJSON(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 "blobUri": + err = unpopulate(val, "BlobURI", &i.BlobURI) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &i.DatabaseName) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &i.ErrorMessage) + delete(rawMsg, key) + case "lastModifiedTime": + err = unpopulate(val, "LastModifiedTime", &i.LastModifiedTime) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &i.PrivateEndpointConnections) + delete(rawMsg, key) + case "queuedTime": + err = unpopulate(val, "QueuedTime", &i.QueuedTime) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "RequestID", &i.RequestID) + delete(rawMsg, key) + case "requestType": + err = unpopulate(val, "RequestType", &i.RequestType) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &i.ServerName) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + 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 ImportNewDatabaseDefinition. +func (i ImportNewDatabaseDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorLogin", i.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", i.AdministratorLoginPassword) + populate(objectMap, "authenticationType", i.AuthenticationType) + populate(objectMap, "databaseName", i.DatabaseName) + populate(objectMap, "edition", i.Edition) + populate(objectMap, "maxSizeBytes", i.MaxSizeBytes) + populate(objectMap, "networkIsolation", i.NetworkIsolation) + populate(objectMap, "serviceObjectiveName", i.ServiceObjectiveName) + populate(objectMap, "storageKey", i.StorageKey) + populate(objectMap, "storageKeyType", i.StorageKeyType) + populate(objectMap, "storageUri", i.StorageURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ImportNewDatabaseDefinition. +func (i *ImportNewDatabaseDefinition) UnmarshalJSON(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 "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &i.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &i.AdministratorLoginPassword) + delete(rawMsg, key) + case "authenticationType": + err = unpopulate(val, "AuthenticationType", &i.AuthenticationType) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &i.DatabaseName) + delete(rawMsg, key) + case "edition": + err = unpopulate(val, "Edition", &i.Edition) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &i.MaxSizeBytes) + delete(rawMsg, key) + case "networkIsolation": + err = unpopulate(val, "NetworkIsolation", &i.NetworkIsolation) + delete(rawMsg, key) + case "serviceObjectiveName": + err = unpopulate(val, "ServiceObjectiveName", &i.ServiceObjectiveName) + delete(rawMsg, key) + case "storageKey": + err = unpopulate(val, "StorageKey", &i.StorageKey) + delete(rawMsg, key) + case "storageKeyType": + err = unpopulate(val, "StorageKeyType", &i.StorageKeyType) + delete(rawMsg, key) + case "storageUri": + err = unpopulate(val, "StorageURI", &i.StorageURI) + 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 InstanceFailoverGroup. +func (i InstanceFailoverGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroup. +func (i *InstanceFailoverGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupListResult. +func (i InstanceFailoverGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroupListResult. +func (i *InstanceFailoverGroupListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 InstanceFailoverGroupProperties. +func (i InstanceFailoverGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "managedInstancePairs", i.ManagedInstancePairs) + populate(objectMap, "partnerRegions", i.PartnerRegions) + populate(objectMap, "readOnlyEndpoint", i.ReadOnlyEndpoint) + populate(objectMap, "readWriteEndpoint", i.ReadWriteEndpoint) + populate(objectMap, "replicationRole", i.ReplicationRole) + populate(objectMap, "replicationState", i.ReplicationState) + populate(objectMap, "secondaryType", i.SecondaryType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroupProperties. +func (i *InstanceFailoverGroupProperties) UnmarshalJSON(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 "managedInstancePairs": + err = unpopulate(val, "ManagedInstancePairs", &i.ManagedInstancePairs) + delete(rawMsg, key) + case "partnerRegions": + err = unpopulate(val, "PartnerRegions", &i.PartnerRegions) + delete(rawMsg, key) + case "readOnlyEndpoint": + err = unpopulate(val, "ReadOnlyEndpoint", &i.ReadOnlyEndpoint) + delete(rawMsg, key) + case "readWriteEndpoint": + err = unpopulate(val, "ReadWriteEndpoint", &i.ReadWriteEndpoint) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &i.ReplicationRole) + delete(rawMsg, key) + case "replicationState": + err = unpopulate(val, "ReplicationState", &i.ReplicationState) + delete(rawMsg, key) + case "secondaryType": + err = unpopulate(val, "SecondaryType", &i.SecondaryType) + 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 InstanceFailoverGroupReadOnlyEndpoint. +func (i InstanceFailoverGroupReadOnlyEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failoverPolicy", i.FailoverPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroupReadOnlyEndpoint. +func (i *InstanceFailoverGroupReadOnlyEndpoint) UnmarshalJSON(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 "failoverPolicy": + err = unpopulate(val, "FailoverPolicy", &i.FailoverPolicy) + 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 InstanceFailoverGroupReadWriteEndpoint. +func (i InstanceFailoverGroupReadWriteEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failoverPolicy", i.FailoverPolicy) + populate(objectMap, "failoverWithDataLossGracePeriodMinutes", i.FailoverWithDataLossGracePeriodMinutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstanceFailoverGroupReadWriteEndpoint. +func (i *InstanceFailoverGroupReadWriteEndpoint) UnmarshalJSON(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 "failoverPolicy": + err = unpopulate(val, "FailoverPolicy", &i.FailoverPolicy) + delete(rawMsg, key) + case "failoverWithDataLossGracePeriodMinutes": + err = unpopulate(val, "FailoverWithDataLossGracePeriodMinutes", &i.FailoverWithDataLossGracePeriodMinutes) + 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 InstancePool. +func (i InstancePool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "sku", i.SKU) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePool. +func (i *InstancePool) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &i.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &i.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &i.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type InstancePoolEditionCapability. +func (i InstancePoolEditionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", i.Name) + populate(objectMap, "reason", i.Reason) + populate(objectMap, "status", i.Status) + populate(objectMap, "supportedFamilies", i.SupportedFamilies) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolEditionCapability. +func (i *InstancePoolEditionCapability) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &i.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + delete(rawMsg, key) + case "supportedFamilies": + err = unpopulate(val, "SupportedFamilies", &i.SupportedFamilies) + 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 InstancePoolFamilyCapability. +func (i InstancePoolFamilyCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", i.Name) + populate(objectMap, "reason", i.Reason) + populate(objectMap, "status", i.Status) + populate(objectMap, "supportedLicenseTypes", i.SupportedLicenseTypes) + populate(objectMap, "supportedVcoresValues", i.SupportedVcoresValues) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolFamilyCapability. +func (i *InstancePoolFamilyCapability) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &i.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + delete(rawMsg, key) + case "supportedLicenseTypes": + err = unpopulate(val, "SupportedLicenseTypes", &i.SupportedLicenseTypes) + delete(rawMsg, key) + case "supportedVcoresValues": + err = unpopulate(val, "SupportedVcoresValues", &i.SupportedVcoresValues) + 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 InstancePoolListResult. +func (i InstancePoolListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolListResult. +func (i *InstancePoolListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + 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 InstancePoolProperties. +func (i InstancePoolProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "licenseType", i.LicenseType) + populate(objectMap, "subnetId", i.SubnetID) + populate(objectMap, "vCores", i.VCores) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolProperties. +func (i *InstancePoolProperties) UnmarshalJSON(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 "licenseType": + err = unpopulate(val, "LicenseType", &i.LicenseType) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &i.SubnetID) + delete(rawMsg, key) + case "vCores": + err = unpopulate(val, "VCores", &i.VCores) + 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 InstancePoolUpdate. +func (i InstancePoolUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", i.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolUpdate. +func (i *InstancePoolUpdate) UnmarshalJSON(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 "tags": + err = unpopulate(val, "Tags", &i.Tags) + 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 InstancePoolVcoresCapability. +func (i InstancePoolVcoresCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", i.Name) + populate(objectMap, "reason", i.Reason) + populate(objectMap, "status", i.Status) + populate(objectMap, "storageLimit", i.StorageLimit) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstancePoolVcoresCapability. +func (i *InstancePoolVcoresCapability) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &i.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &i.Status) + delete(rawMsg, key) + case "storageLimit": + err = unpopulate(val, "StorageLimit", &i.StorageLimit) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Job. +func (j *Job) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobAgent. +func (j JobAgent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", j.ID) + populate(objectMap, "location", j.Location) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "sku", j.SKU) + populate(objectMap, "tags", j.Tags) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobAgent. +func (j *JobAgent) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &j.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &j.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &j.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobAgentListResult. +func (j JobAgentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobAgentListResult. +func (j *JobAgentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobAgentProperties. +func (j JobAgentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseId", j.DatabaseID) + populate(objectMap, "state", j.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobAgentProperties. +func (j *JobAgentProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseId": + err = unpopulate(val, "DatabaseID", &j.DatabaseID) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &j.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobAgentUpdate. +func (j JobAgentUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "tags", j.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobAgentUpdate. +func (j *JobAgentUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "tags": + err = unpopulate(val, "Tags", &j.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobCredential. +func (j JobCredential) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobCredential. +func (j *JobCredential) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobCredentialListResult. +func (j JobCredentialListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobCredentialListResult. +func (j *JobCredentialListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobCredentialProperties. +func (j JobCredentialProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "password", j.Password) + populate(objectMap, "username", j.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobCredentialProperties. +func (j *JobCredentialProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "password": + err = unpopulate(val, "Password", &j.Password) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &j.Username) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobExecution. +func (j JobExecution) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecution. +func (j *JobExecution) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobExecutionListResult. +func (j JobExecutionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionListResult. +func (j *JobExecutionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobExecutionProperties. +func (j JobExecutionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createTime", j.CreateTime) + populateTimeRFC3339(objectMap, "currentAttemptStartTime", j.CurrentAttemptStartTime) + populate(objectMap, "currentAttempts", j.CurrentAttempts) + populateTimeRFC3339(objectMap, "endTime", j.EndTime) + populate(objectMap, "jobExecutionId", j.JobExecutionID) + populate(objectMap, "jobVersion", j.JobVersion) + populate(objectMap, "lastMessage", j.LastMessage) + populate(objectMap, "lifecycle", j.Lifecycle) + populate(objectMap, "provisioningState", j.ProvisioningState) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "stepId", j.StepID) + populate(objectMap, "stepName", j.StepName) + populate(objectMap, "target", j.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionProperties. +func (j *JobExecutionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createTime": + err = unpopulateTimeRFC3339(val, "CreateTime", &j.CreateTime) + delete(rawMsg, key) + case "currentAttemptStartTime": + err = unpopulateTimeRFC3339(val, "CurrentAttemptStartTime", &j.CurrentAttemptStartTime) + delete(rawMsg, key) + case "currentAttempts": + err = unpopulate(val, "CurrentAttempts", &j.CurrentAttempts) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) + delete(rawMsg, key) + case "jobExecutionId": + err = unpopulate(val, "JobExecutionID", &j.JobExecutionID) + delete(rawMsg, key) + case "jobVersion": + err = unpopulate(val, "JobVersion", &j.JobVersion) + delete(rawMsg, key) + case "lastMessage": + err = unpopulate(val, "LastMessage", &j.LastMessage) + delete(rawMsg, key) + case "lifecycle": + err = unpopulate(val, "Lifecycle", &j.Lifecycle) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &j.ProvisioningState) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "stepId": + err = unpopulate(val, "StepID", &j.StepID) + delete(rawMsg, key) + case "stepName": + err = unpopulate(val, "StepName", &j.StepName) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &j.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobExecutionTarget. +func (j JobExecutionTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", j.DatabaseName) + populate(objectMap, "serverName", j.ServerName) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionTarget. +func (j *JobExecutionTarget) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &j.DatabaseName) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &j.ServerName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobListResult. +func (j JobListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobListResult. +func (j *JobListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobProperties. +func (j JobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", j.Description) + populate(objectMap, "schedule", j.Schedule) + populate(objectMap, "version", j.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobProperties. +func (j *JobProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &j.Description) + delete(rawMsg, key) + case "schedule": + err = unpopulate(val, "Schedule", &j.Schedule) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &j.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobSchedule. +func (j JobSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", j.Enabled) + populateTimeRFC3339(objectMap, "endTime", j.EndTime) + populate(objectMap, "interval", j.Interval) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobSchedule. +func (j *JobSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &j.Enabled) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) + delete(rawMsg, key) + case "interval": + err = unpopulate(val, "Interval", &j.Interval) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStep. +func (j JobStep) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStep. +func (j *JobStep) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStepAction. +func (j JobStepAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "source", j.Source) + populate(objectMap, "type", j.Type) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStepAction. +func (j *JobStepAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "source": + err = unpopulate(val, "Source", &j.Source) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStepExecutionOptions. +func (j JobStepExecutionOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "initialRetryIntervalSeconds", j.InitialRetryIntervalSeconds) + populate(objectMap, "maximumRetryIntervalSeconds", j.MaximumRetryIntervalSeconds) + populate(objectMap, "retryAttempts", j.RetryAttempts) + populate(objectMap, "retryIntervalBackoffMultiplier", j.RetryIntervalBackoffMultiplier) + populate(objectMap, "timeoutSeconds", j.TimeoutSeconds) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStepExecutionOptions. +func (j *JobStepExecutionOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "initialRetryIntervalSeconds": + err = unpopulate(val, "InitialRetryIntervalSeconds", &j.InitialRetryIntervalSeconds) + delete(rawMsg, key) + case "maximumRetryIntervalSeconds": + err = unpopulate(val, "MaximumRetryIntervalSeconds", &j.MaximumRetryIntervalSeconds) + delete(rawMsg, key) + case "retryAttempts": + err = unpopulate(val, "RetryAttempts", &j.RetryAttempts) + delete(rawMsg, key) + case "retryIntervalBackoffMultiplier": + err = unpopulate(val, "RetryIntervalBackoffMultiplier", &j.RetryIntervalBackoffMultiplier) + delete(rawMsg, key) + case "timeoutSeconds": + err = unpopulate(val, "TimeoutSeconds", &j.TimeoutSeconds) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStepListResult. +func (j JobStepListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStepListResult. +func (j *JobStepListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStepOutput. +func (j JobStepOutput) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "credential", j.Credential) + populate(objectMap, "databaseName", j.DatabaseName) + populate(objectMap, "resourceGroupName", j.ResourceGroupName) + populate(objectMap, "schemaName", j.SchemaName) + populate(objectMap, "serverName", j.ServerName) + populate(objectMap, "subscriptionId", j.SubscriptionID) + populate(objectMap, "tableName", j.TableName) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStepOutput. +func (j *JobStepOutput) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "credential": + err = unpopulate(val, "Credential", &j.Credential) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &j.DatabaseName) + delete(rawMsg, key) + case "resourceGroupName": + err = unpopulate(val, "ResourceGroupName", &j.ResourceGroupName) + delete(rawMsg, key) + case "schemaName": + err = unpopulate(val, "SchemaName", &j.SchemaName) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &j.ServerName) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &j.SubscriptionID) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &j.TableName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobStepProperties. +func (j JobStepProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", j.Action) + populate(objectMap, "credential", j.Credential) + populate(objectMap, "executionOptions", j.ExecutionOptions) + populate(objectMap, "output", j.Output) + populate(objectMap, "stepId", j.StepID) + populate(objectMap, "targetGroup", j.TargetGroup) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobStepProperties. +func (j *JobStepProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "action": + err = unpopulate(val, "Action", &j.Action) + delete(rawMsg, key) + case "credential": + err = unpopulate(val, "Credential", &j.Credential) + delete(rawMsg, key) + case "executionOptions": + err = unpopulate(val, "ExecutionOptions", &j.ExecutionOptions) + delete(rawMsg, key) + case "output": + err = unpopulate(val, "Output", &j.Output) + delete(rawMsg, key) + case "stepId": + err = unpopulate(val, "StepID", &j.StepID) + delete(rawMsg, key) + case "targetGroup": + err = unpopulate(val, "TargetGroup", &j.TargetGroup) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobTarget. +func (j JobTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", j.DatabaseName) + populate(objectMap, "elasticPoolName", j.ElasticPoolName) + populate(objectMap, "membershipType", j.MembershipType) + populate(objectMap, "refreshCredential", j.RefreshCredential) + populate(objectMap, "serverName", j.ServerName) + populate(objectMap, "shardMapName", j.ShardMapName) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobTarget. +func (j *JobTarget) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "databaseName": + err = unpopulate(val, "DatabaseName", &j.DatabaseName) + delete(rawMsg, key) + case "elasticPoolName": + err = unpopulate(val, "ElasticPoolName", &j.ElasticPoolName) + delete(rawMsg, key) + case "membershipType": + err = unpopulate(val, "MembershipType", &j.MembershipType) + delete(rawMsg, key) + case "refreshCredential": + err = unpopulate(val, "RefreshCredential", &j.RefreshCredential) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &j.ServerName) + delete(rawMsg, key) + case "shardMapName": + err = unpopulate(val, "ShardMapName", &j.ShardMapName) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobTargetGroup. +func (j JobTargetGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobTargetGroup. +func (j *JobTargetGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &j.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobTargetGroupListResult. +func (j JobTargetGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobTargetGroupListResult. +func (j *JobTargetGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobTargetGroupProperties. +func (j JobTargetGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "members", j.Members) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobTargetGroupProperties. +func (j *JobTargetGroupProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "members": + err = unpopulate(val, "Members", &j.Members) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobVersion. +func (j JobVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", j.ID) + populate(objectMap, "name", j.Name) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobVersion. +func (j *JobVersion) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &j.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &j.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &j.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobVersionListResult. +func (j JobVersionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", j.NextLink) + populate(objectMap, "value", j.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobVersionListResult. +func (j *JobVersionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &j.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &j.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LedgerDigestUploads. +func (l LedgerDigestUploads) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 LedgerDigestUploads. +func (l *LedgerDigestUploads) UnmarshalJSON(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 LedgerDigestUploadsListResult. +func (l LedgerDigestUploadsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LedgerDigestUploadsListResult. +func (l *LedgerDigestUploadsListResult) UnmarshalJSON(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 LedgerDigestUploadsProperties. +func (l LedgerDigestUploadsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "digestStorageEndpoint", l.DigestStorageEndpoint) + populate(objectMap, "state", l.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LedgerDigestUploadsProperties. +func (l *LedgerDigestUploadsProperties) UnmarshalJSON(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 "digestStorageEndpoint": + err = unpopulate(val, "DigestStorageEndpoint", &l.DigestStorageEndpoint) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &l.State) + 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 LicenseTypeCapability. +func (l LicenseTypeCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", l.Name) + populate(objectMap, "reason", l.Reason) + populate(objectMap, "status", l.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LicenseTypeCapability. +func (l *LicenseTypeCapability) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &l.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &l.Status) + 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 LocationCapabilities. +func (l LocationCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", l.Name) + populate(objectMap, "reason", l.Reason) + populate(objectMap, "status", l.Status) + populate(objectMap, "supportedManagedInstanceVersions", l.SupportedManagedInstanceVersions) + populate(objectMap, "supportedServerVersions", l.SupportedServerVersions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LocationCapabilities. +func (l *LocationCapabilities) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &l.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &l.Status) + delete(rawMsg, key) + case "supportedManagedInstanceVersions": + err = unpopulate(val, "SupportedManagedInstanceVersions", &l.SupportedManagedInstanceVersions) + delete(rawMsg, key) + case "supportedServerVersions": + err = unpopulate(val, "SupportedServerVersions", &l.SupportedServerVersions) + 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 LogSizeCapability. +func (l LogSizeCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limit", l.Limit) + populate(objectMap, "unit", l.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogSizeCapability. +func (l *LogSizeCapability) UnmarshalJSON(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 "limit": + err = unpopulate(val, "Limit", &l.Limit) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &l.Unit) + 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 LogicalDatabaseTransparentDataEncryption. +func (l LogicalDatabaseTransparentDataEncryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 LogicalDatabaseTransparentDataEncryption. +func (l *LogicalDatabaseTransparentDataEncryption) UnmarshalJSON(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 LogicalDatabaseTransparentDataEncryptionListResult. +func (l LogicalDatabaseTransparentDataEncryptionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogicalDatabaseTransparentDataEncryptionListResult. +func (l *LogicalDatabaseTransparentDataEncryptionListResult) UnmarshalJSON(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 LogicalServerAdvancedThreatProtectionListResult. +func (l LogicalServerAdvancedThreatProtectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogicalServerAdvancedThreatProtectionListResult. +func (l *LogicalServerAdvancedThreatProtectionListResult) UnmarshalJSON(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 LogicalServerSecurityAlertPolicyListResult. +func (l LogicalServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogicalServerSecurityAlertPolicyListResult. +func (l *LogicalServerSecurityAlertPolicyListResult) UnmarshalJSON(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 LongTermRetentionBackup. +func (l LongTermRetentionBackup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 LongTermRetentionBackup. +func (l *LongTermRetentionBackup) UnmarshalJSON(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 LongTermRetentionBackupListResult. +func (l LongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionBackupListResult. +func (l *LongTermRetentionBackupListResult) UnmarshalJSON(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 LongTermRetentionBackupOperationResult. +func (l LongTermRetentionBackupOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 LongTermRetentionBackupOperationResult. +func (l *LongTermRetentionBackupOperationResult) UnmarshalJSON(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 LongTermRetentionBackupProperties. +func (l LongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "backupExpirationTime", l.BackupExpirationTime) + populate(objectMap, "backupStorageRedundancy", l.BackupStorageRedundancy) + populateTimeRFC3339(objectMap, "backupTime", l.BackupTime) + populateTimeRFC3339(objectMap, "databaseDeletionTime", l.DatabaseDeletionTime) + populate(objectMap, "databaseName", l.DatabaseName) + populate(objectMap, "requestedBackupStorageRedundancy", l.RequestedBackupStorageRedundancy) + populateTimeRFC3339(objectMap, "serverCreateTime", l.ServerCreateTime) + populate(objectMap, "serverName", l.ServerName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionBackupProperties. +func (l *LongTermRetentionBackupProperties) UnmarshalJSON(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 "backupExpirationTime": + err = unpopulateTimeRFC3339(val, "BackupExpirationTime", &l.BackupExpirationTime) + delete(rawMsg, key) + case "backupStorageRedundancy": + err = unpopulate(val, "BackupStorageRedundancy", &l.BackupStorageRedundancy) + delete(rawMsg, key) + case "backupTime": + err = unpopulateTimeRFC3339(val, "BackupTime", &l.BackupTime) + delete(rawMsg, key) + case "databaseDeletionTime": + err = unpopulateTimeRFC3339(val, "DatabaseDeletionTime", &l.DatabaseDeletionTime) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &l.DatabaseName) + delete(rawMsg, key) + case "requestedBackupStorageRedundancy": + err = unpopulate(val, "RequestedBackupStorageRedundancy", &l.RequestedBackupStorageRedundancy) + delete(rawMsg, key) + case "serverCreateTime": + err = unpopulateTimeRFC3339(val, "ServerCreateTime", &l.ServerCreateTime) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &l.ServerName) + 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 LongTermRetentionOperationResultProperties. +func (l LongTermRetentionOperationResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fromBackupResourceId", l.FromBackupResourceID) + populate(objectMap, "message", l.Message) + populate(objectMap, "operationType", l.OperationType) + populate(objectMap, "requestId", l.RequestID) + populate(objectMap, "status", l.Status) + populate(objectMap, "targetBackupStorageRedundancy", l.TargetBackupStorageRedundancy) + populate(objectMap, "toBackupResourceId", l.ToBackupResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionOperationResultProperties. +func (l *LongTermRetentionOperationResultProperties) UnmarshalJSON(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 "fromBackupResourceId": + err = unpopulate(val, "FromBackupResourceID", &l.FromBackupResourceID) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &l.Message) + delete(rawMsg, key) + case "operationType": + err = unpopulate(val, "OperationType", &l.OperationType) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "RequestID", &l.RequestID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &l.Status) + delete(rawMsg, key) + case "targetBackupStorageRedundancy": + err = unpopulate(val, "TargetBackupStorageRedundancy", &l.TargetBackupStorageRedundancy) + delete(rawMsg, key) + case "toBackupResourceId": + err = unpopulate(val, "ToBackupResourceID", &l.ToBackupResourceID) + 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 LongTermRetentionPolicy. +func (l LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 LongTermRetentionPolicy. +func (l *LongTermRetentionPolicy) UnmarshalJSON(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 LongTermRetentionPolicyListResult. +func (l LongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionPolicyListResult. +func (l *LongTermRetentionPolicyListResult) UnmarshalJSON(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 MaintenanceConfigurationCapability. +func (m MaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", m.Name) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "status", m.Status) + populate(objectMap, "zoneRedundant", m.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceConfigurationCapability. +func (m *MaintenanceConfigurationCapability) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) + 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 MaintenanceWindowOptions. +func (m MaintenanceWindowOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowOptions. +func (m *MaintenanceWindowOptions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowOptionsProperties. +func (m MaintenanceWindowOptionsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowMultipleMaintenanceWindowsPerCycle", m.AllowMultipleMaintenanceWindowsPerCycle) + populate(objectMap, "defaultDurationInMinutes", m.DefaultDurationInMinutes) + populate(objectMap, "isEnabled", m.IsEnabled) + populate(objectMap, "maintenanceWindowCycles", m.MaintenanceWindowCycles) + populate(objectMap, "minCycles", m.MinCycles) + populate(objectMap, "minDurationInMinutes", m.MinDurationInMinutes) + populate(objectMap, "timeGranularityInMinutes", m.TimeGranularityInMinutes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowOptionsProperties. +func (m *MaintenanceWindowOptionsProperties) UnmarshalJSON(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 "allowMultipleMaintenanceWindowsPerCycle": + err = unpopulate(val, "AllowMultipleMaintenanceWindowsPerCycle", &m.AllowMultipleMaintenanceWindowsPerCycle) + delete(rawMsg, key) + case "defaultDurationInMinutes": + err = unpopulate(val, "DefaultDurationInMinutes", &m.DefaultDurationInMinutes) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &m.IsEnabled) + delete(rawMsg, key) + case "maintenanceWindowCycles": + err = unpopulate(val, "MaintenanceWindowCycles", &m.MaintenanceWindowCycles) + delete(rawMsg, key) + case "minCycles": + err = unpopulate(val, "MinCycles", &m.MinCycles) + delete(rawMsg, key) + case "minDurationInMinutes": + err = unpopulate(val, "MinDurationInMinutes", &m.MinDurationInMinutes) + delete(rawMsg, key) + case "timeGranularityInMinutes": + err = unpopulate(val, "TimeGranularityInMinutes", &m.TimeGranularityInMinutes) + 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 MaintenanceWindowTimeRange. +func (m MaintenanceWindowTimeRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dayOfWeek", m.DayOfWeek) + populate(objectMap, "duration", m.Duration) + populate(objectMap, "startTime", m.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowTimeRange. +func (m *MaintenanceWindowTimeRange) UnmarshalJSON(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 "dayOfWeek": + err = unpopulate(val, "DayOfWeek", &m.DayOfWeek) + delete(rawMsg, key) + case "duration": + err = unpopulate(val, "Duration", &m.Duration) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &m.StartTime) + 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 MaintenanceWindows. +func (m MaintenanceWindows) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindows. +func (m *MaintenanceWindows) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowsProperties. +func (m MaintenanceWindowsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "timeRanges", m.TimeRanges) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaintenanceWindowsProperties. +func (m *MaintenanceWindowsProperties) UnmarshalJSON(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 "timeRanges": + err = unpopulate(val, "TimeRanges", &m.TimeRanges) + 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 ManagedBackupShortTermRetentionPolicy. +func (m ManagedBackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedBackupShortTermRetentionPolicy. +func (m *ManagedBackupShortTermRetentionPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicyListResult. +func (m ManagedBackupShortTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedBackupShortTermRetentionPolicyListResult. +func (m *ManagedBackupShortTermRetentionPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicyProperties. +func (m ManagedBackupShortTermRetentionPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "retentionDays", m.RetentionDays) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedBackupShortTermRetentionPolicyProperties. +func (m *ManagedBackupShortTermRetentionPolicyProperties) UnmarshalJSON(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 "retentionDays": + err = unpopulate(val, "RetentionDays", &m.RetentionDays) + 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 ManagedDatabase. +func (m ManagedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabase. +func (m *ManagedDatabase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseAdvancedThreatProtection. +func (m ManagedDatabaseAdvancedThreatProtection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseAdvancedThreatProtection. +func (m *ManagedDatabaseAdvancedThreatProtection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseAdvancedThreatProtectionListResult. +func (m ManagedDatabaseAdvancedThreatProtectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseAdvancedThreatProtectionListResult. +func (m *ManagedDatabaseAdvancedThreatProtectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseListResult. +func (m ManagedDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseListResult. +func (m *ManagedDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseMoveDefinition. +func (m ManagedDatabaseMoveDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationManagedDatabaseId", m.DestinationManagedDatabaseID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseMoveDefinition. +func (m *ManagedDatabaseMoveDefinition) UnmarshalJSON(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 "destinationManagedDatabaseId": + err = unpopulate(val, "DestinationManagedDatabaseID", &m.DestinationManagedDatabaseID) + 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 ManagedDatabaseMoveOperationListResult. +func (m ManagedDatabaseMoveOperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseMoveOperationListResult. +func (m *ManagedDatabaseMoveOperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseMoveOperationResult. +func (m ManagedDatabaseMoveOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseMoveOperationResult. +func (m *ManagedDatabaseMoveOperationResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseMoveOperationResultProperties. +func (m ManagedDatabaseMoveOperationResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorCode", m.ErrorCode) + populate(objectMap, "errorDescription", m.ErrorDescription) + populate(objectMap, "errorSeverity", m.ErrorSeverity) + populate(objectMap, "isCancellable", m.IsCancellable) + populate(objectMap, "isUserError", m.IsUserError) + populate(objectMap, "operation", m.Operation) + populate(objectMap, "operationFriendlyName", m.OperationFriendlyName) + populate(objectMap, "operationMode", m.OperationMode) + populate(objectMap, "sourceDatabaseName", m.SourceDatabaseName) + populate(objectMap, "sourceManagedInstanceId", m.SourceManagedInstanceID) + populate(objectMap, "sourceManagedInstanceName", m.SourceManagedInstanceName) + populateTimeRFC3339(objectMap, "startTime", m.StartTime) + populate(objectMap, "state", m.State) + populate(objectMap, "targetDatabaseName", m.TargetDatabaseName) + populate(objectMap, "targetManagedInstanceId", m.TargetManagedInstanceID) + populate(objectMap, "targetManagedInstanceName", m.TargetManagedInstanceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseMoveOperationResultProperties. +func (m *ManagedDatabaseMoveOperationResultProperties) UnmarshalJSON(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 "errorCode": + err = unpopulate(val, "ErrorCode", &m.ErrorCode) + delete(rawMsg, key) + case "errorDescription": + err = unpopulate(val, "ErrorDescription", &m.ErrorDescription) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &m.ErrorSeverity) + delete(rawMsg, key) + case "isCancellable": + err = unpopulate(val, "IsCancellable", &m.IsCancellable) + delete(rawMsg, key) + case "isUserError": + err = unpopulate(val, "IsUserError", &m.IsUserError) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &m.Operation) + delete(rawMsg, key) + case "operationFriendlyName": + err = unpopulate(val, "OperationFriendlyName", &m.OperationFriendlyName) + delete(rawMsg, key) + case "operationMode": + err = unpopulate(val, "OperationMode", &m.OperationMode) + delete(rawMsg, key) + case "sourceDatabaseName": + err = unpopulate(val, "SourceDatabaseName", &m.SourceDatabaseName) + delete(rawMsg, key) + case "sourceManagedInstanceId": + err = unpopulate(val, "SourceManagedInstanceID", &m.SourceManagedInstanceID) + delete(rawMsg, key) + case "sourceManagedInstanceName": + err = unpopulate(val, "SourceManagedInstanceName", &m.SourceManagedInstanceName) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "targetDatabaseName": + err = unpopulate(val, "TargetDatabaseName", &m.TargetDatabaseName) + delete(rawMsg, key) + case "targetManagedInstanceId": + err = unpopulate(val, "TargetManagedInstanceID", &m.TargetManagedInstanceID) + delete(rawMsg, key) + case "targetManagedInstanceName": + err = unpopulate(val, "TargetManagedInstanceName", &m.TargetManagedInstanceName) + 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 ManagedDatabaseProperties. +func (m ManagedDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoCompleteRestore", m.AutoCompleteRestore) + populate(objectMap, "catalogCollation", m.CatalogCollation) + populate(objectMap, "collation", m.Collation) + populate(objectMap, "createMode", m.CreateMode) + populateTimeRFC3339(objectMap, "creationDate", m.CreationDate) + populate(objectMap, "crossSubscriptionRestorableDroppedDatabaseId", m.CrossSubscriptionRestorableDroppedDatabaseID) + populate(objectMap, "crossSubscriptionSourceDatabaseId", m.CrossSubscriptionSourceDatabaseID) + populate(objectMap, "crossSubscriptionTargetManagedInstanceId", m.CrossSubscriptionTargetManagedInstanceID) + populate(objectMap, "defaultSecondaryLocation", m.DefaultSecondaryLocation) + populateTimeRFC3339(objectMap, "earliestRestorePoint", m.EarliestRestorePoint) + populate(objectMap, "failoverGroupId", m.FailoverGroupID) + populate(objectMap, "isLedgerOn", m.IsLedgerOn) + populate(objectMap, "lastBackupName", m.LastBackupName) + populate(objectMap, "longTermRetentionBackupResourceId", m.LongTermRetentionBackupResourceID) + populate(objectMap, "recoverableDatabaseId", m.RecoverableDatabaseID) + populate(objectMap, "restorableDroppedDatabaseId", m.RestorableDroppedDatabaseID) + populateTimeRFC3339(objectMap, "restorePointInTime", m.RestorePointInTime) + populate(objectMap, "sourceDatabaseId", m.SourceDatabaseID) + populate(objectMap, "status", m.Status) + populate(objectMap, "storageContainerIdentity", m.StorageContainerIdentity) + populate(objectMap, "storageContainerSasToken", m.StorageContainerSasToken) + populate(objectMap, "storageContainerUri", m.StorageContainerURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseProperties. +func (m *ManagedDatabaseProperties) UnmarshalJSON(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 "autoCompleteRestore": + err = unpopulate(val, "AutoCompleteRestore", &m.AutoCompleteRestore) + delete(rawMsg, key) + case "catalogCollation": + err = unpopulate(val, "CatalogCollation", &m.CatalogCollation) + delete(rawMsg, key) + case "collation": + err = unpopulate(val, "Collation", &m.Collation) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &m.CreateMode) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &m.CreationDate) + delete(rawMsg, key) + case "crossSubscriptionRestorableDroppedDatabaseId": + err = unpopulate(val, "CrossSubscriptionRestorableDroppedDatabaseID", &m.CrossSubscriptionRestorableDroppedDatabaseID) + delete(rawMsg, key) + case "crossSubscriptionSourceDatabaseId": + err = unpopulate(val, "CrossSubscriptionSourceDatabaseID", &m.CrossSubscriptionSourceDatabaseID) + delete(rawMsg, key) + case "crossSubscriptionTargetManagedInstanceId": + err = unpopulate(val, "CrossSubscriptionTargetManagedInstanceID", &m.CrossSubscriptionTargetManagedInstanceID) + delete(rawMsg, key) + case "defaultSecondaryLocation": + err = unpopulate(val, "DefaultSecondaryLocation", &m.DefaultSecondaryLocation) + delete(rawMsg, key) + case "earliestRestorePoint": + err = unpopulateTimeRFC3339(val, "EarliestRestorePoint", &m.EarliestRestorePoint) + delete(rawMsg, key) + case "failoverGroupId": + err = unpopulate(val, "FailoverGroupID", &m.FailoverGroupID) + delete(rawMsg, key) + case "isLedgerOn": + err = unpopulate(val, "IsLedgerOn", &m.IsLedgerOn) + delete(rawMsg, key) + case "lastBackupName": + err = unpopulate(val, "LastBackupName", &m.LastBackupName) + delete(rawMsg, key) + case "longTermRetentionBackupResourceId": + err = unpopulate(val, "LongTermRetentionBackupResourceID", &m.LongTermRetentionBackupResourceID) + delete(rawMsg, key) + case "recoverableDatabaseId": + err = unpopulate(val, "RecoverableDatabaseID", &m.RecoverableDatabaseID) + delete(rawMsg, key) + case "restorableDroppedDatabaseId": + err = unpopulate(val, "RestorableDroppedDatabaseID", &m.RestorableDroppedDatabaseID) + delete(rawMsg, key) + case "restorePointInTime": + err = unpopulateTimeRFC3339(val, "RestorePointInTime", &m.RestorePointInTime) + delete(rawMsg, key) + case "sourceDatabaseId": + err = unpopulate(val, "SourceDatabaseID", &m.SourceDatabaseID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "storageContainerIdentity": + err = unpopulate(val, "StorageContainerIdentity", &m.StorageContainerIdentity) + delete(rawMsg, key) + case "storageContainerSasToken": + err = unpopulate(val, "StorageContainerSasToken", &m.StorageContainerSasToken) + delete(rawMsg, key) + case "storageContainerUri": + err = unpopulate(val, "StorageContainerURI", &m.StorageContainerURI) + 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 ManagedDatabaseRestoreDetailsBackupSetProperties. +func (m ManagedDatabaseRestoreDetailsBackupSetProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupSizeMB", m.BackupSizeMB) + populate(objectMap, "firstStripeName", m.FirstStripeName) + populate(objectMap, "numberOfStripes", m.NumberOfStripes) + populateTimeRFC3339(objectMap, "restoreFinishedTimestampUtc", m.RestoreFinishedTimestampUTC) + populateTimeRFC3339(objectMap, "restoreStartedTimestampUtc", m.RestoreStartedTimestampUTC) + populate(objectMap, "status", m.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseRestoreDetailsBackupSetProperties. +func (m *ManagedDatabaseRestoreDetailsBackupSetProperties) UnmarshalJSON(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 "backupSizeMB": + err = unpopulate(val, "BackupSizeMB", &m.BackupSizeMB) + delete(rawMsg, key) + case "firstStripeName": + err = unpopulate(val, "FirstStripeName", &m.FirstStripeName) + delete(rawMsg, key) + case "numberOfStripes": + err = unpopulate(val, "NumberOfStripes", &m.NumberOfStripes) + delete(rawMsg, key) + case "restoreFinishedTimestampUtc": + err = unpopulateTimeRFC3339(val, "RestoreFinishedTimestampUTC", &m.RestoreFinishedTimestampUTC) + delete(rawMsg, key) + case "restoreStartedTimestampUtc": + err = unpopulateTimeRFC3339(val, "RestoreStartedTimestampUTC", &m.RestoreStartedTimestampUTC) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + 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 ManagedDatabaseRestoreDetailsProperties. +func (m ManagedDatabaseRestoreDetailsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blockReason", m.BlockReason) + populate(objectMap, "currentBackupType", m.CurrentBackupType) + populate(objectMap, "currentRestorePlanSizeMB", m.CurrentRestorePlanSizeMB) + populate(objectMap, "currentRestoredSizeMB", m.CurrentRestoredSizeMB) + populate(objectMap, "currentRestoringFileName", m.CurrentRestoringFileName) + populate(objectMap, "diffBackupSets", m.DiffBackupSets) + populate(objectMap, "fullBackupSets", m.FullBackupSets) + populate(objectMap, "lastRestoredFileName", m.LastRestoredFileName) + populateTimeRFC3339(objectMap, "lastRestoredFileTime", m.LastRestoredFileTime) + populate(objectMap, "lastUploadedFileName", m.LastUploadedFileName) + populateTimeRFC3339(objectMap, "lastUploadedFileTime", m.LastUploadedFileTime) + populate(objectMap, "logBackupSets", m.LogBackupSets) + populate(objectMap, "numberOfFilesDetected", m.NumberOfFilesDetected) + populate(objectMap, "numberOfFilesQueued", m.NumberOfFilesQueued) + populate(objectMap, "numberOfFilesRestored", m.NumberOfFilesRestored) + populate(objectMap, "numberOfFilesRestoring", m.NumberOfFilesRestoring) + populate(objectMap, "numberOfFilesSkipped", m.NumberOfFilesSkipped) + populate(objectMap, "numberOfFilesUnrestorable", m.NumberOfFilesUnrestorable) + populate(objectMap, "percentCompleted", m.PercentCompleted) + populate(objectMap, "status", m.Status) + populate(objectMap, "type", m.Type) + populate(objectMap, "unrestorableFiles", m.UnrestorableFiles) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseRestoreDetailsProperties. +func (m *ManagedDatabaseRestoreDetailsProperties) UnmarshalJSON(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 "blockReason": + err = unpopulate(val, "BlockReason", &m.BlockReason) + delete(rawMsg, key) + case "currentBackupType": + err = unpopulate(val, "CurrentBackupType", &m.CurrentBackupType) + delete(rawMsg, key) + case "currentRestorePlanSizeMB": + err = unpopulate(val, "CurrentRestorePlanSizeMB", &m.CurrentRestorePlanSizeMB) + delete(rawMsg, key) + case "currentRestoredSizeMB": + err = unpopulate(val, "CurrentRestoredSizeMB", &m.CurrentRestoredSizeMB) + delete(rawMsg, key) + case "currentRestoringFileName": + err = unpopulate(val, "CurrentRestoringFileName", &m.CurrentRestoringFileName) + delete(rawMsg, key) + case "diffBackupSets": + err = unpopulate(val, "DiffBackupSets", &m.DiffBackupSets) + delete(rawMsg, key) + case "fullBackupSets": + err = unpopulate(val, "FullBackupSets", &m.FullBackupSets) + delete(rawMsg, key) + case "lastRestoredFileName": + err = unpopulate(val, "LastRestoredFileName", &m.LastRestoredFileName) + delete(rawMsg, key) + case "lastRestoredFileTime": + err = unpopulateTimeRFC3339(val, "LastRestoredFileTime", &m.LastRestoredFileTime) + delete(rawMsg, key) + case "lastUploadedFileName": + err = unpopulate(val, "LastUploadedFileName", &m.LastUploadedFileName) + delete(rawMsg, key) + case "lastUploadedFileTime": + err = unpopulateTimeRFC3339(val, "LastUploadedFileTime", &m.LastUploadedFileTime) + delete(rawMsg, key) + case "logBackupSets": + err = unpopulate(val, "LogBackupSets", &m.LogBackupSets) + delete(rawMsg, key) + case "numberOfFilesDetected": + err = unpopulate(val, "NumberOfFilesDetected", &m.NumberOfFilesDetected) + delete(rawMsg, key) + case "numberOfFilesQueued": + err = unpopulate(val, "NumberOfFilesQueued", &m.NumberOfFilesQueued) + delete(rawMsg, key) + case "numberOfFilesRestored": + err = unpopulate(val, "NumberOfFilesRestored", &m.NumberOfFilesRestored) + delete(rawMsg, key) + case "numberOfFilesRestoring": + err = unpopulate(val, "NumberOfFilesRestoring", &m.NumberOfFilesRestoring) + delete(rawMsg, key) + case "numberOfFilesSkipped": + err = unpopulate(val, "NumberOfFilesSkipped", &m.NumberOfFilesSkipped) + delete(rawMsg, key) + case "numberOfFilesUnrestorable": + err = unpopulate(val, "NumberOfFilesUnrestorable", &m.NumberOfFilesUnrestorable) + delete(rawMsg, key) + case "percentCompleted": + err = unpopulate(val, "PercentCompleted", &m.PercentCompleted) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + case "unrestorableFiles": + err = unpopulate(val, "UnrestorableFiles", &m.UnrestorableFiles) + 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 ManagedDatabaseRestoreDetailsResult. +func (m ManagedDatabaseRestoreDetailsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseRestoreDetailsResult. +func (m *ManagedDatabaseRestoreDetailsResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseRestoreDetailsUnrestorableFileProperties. +func (m ManagedDatabaseRestoreDetailsUnrestorableFileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", m.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseRestoreDetailsUnrestorableFileProperties. +func (m *ManagedDatabaseRestoreDetailsUnrestorableFileProperties) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseSecurityAlertPolicy. +func (m ManagedDatabaseSecurityAlertPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseSecurityAlertPolicy. +func (m *ManagedDatabaseSecurityAlertPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseSecurityAlertPolicyListResult. +func (m ManagedDatabaseSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseSecurityAlertPolicyListResult. +func (m *ManagedDatabaseSecurityAlertPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseStartMoveDefinition. +func (m ManagedDatabaseStartMoveDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destinationManagedDatabaseId", m.DestinationManagedDatabaseID) + populate(objectMap, "operationMode", m.OperationMode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseStartMoveDefinition. +func (m *ManagedDatabaseStartMoveDefinition) UnmarshalJSON(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 "destinationManagedDatabaseId": + err = unpopulate(val, "DestinationManagedDatabaseID", &m.DestinationManagedDatabaseID) + delete(rawMsg, key) + case "operationMode": + err = unpopulate(val, "OperationMode", &m.OperationMode) + 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 ManagedDatabaseUpdate. +func (m ManagedDatabaseUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseUpdate. +func (m *ManagedDatabaseUpdate) UnmarshalJSON(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) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + 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 ManagedInstance. +func (m ManagedInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "identity", m.Identity) + populate(objectMap, "location", m.Location) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "sku", m.SKU) + populate(objectMap, "tags", m.Tags) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstance. +func (m *ManagedInstance) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &m.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &m.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministrator. +func (m ManagedInstanceAdministrator) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAdministrator. +func (m *ManagedInstanceAdministrator) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministratorListResult. +func (m ManagedInstanceAdministratorListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAdministratorListResult. +func (m *ManagedInstanceAdministratorListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdministratorProperties. +func (m ManagedInstanceAdministratorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorType", m.AdministratorType) + populate(objectMap, "login", m.Login) + populate(objectMap, "sid", m.Sid) + populate(objectMap, "tenantId", m.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAdministratorProperties. +func (m *ManagedInstanceAdministratorProperties) UnmarshalJSON(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 "administratorType": + err = unpopulate(val, "AdministratorType", &m.AdministratorType) + delete(rawMsg, key) + case "login": + err = unpopulate(val, "Login", &m.Login) + delete(rawMsg, key) + case "sid": + err = unpopulate(val, "Sid", &m.Sid) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + 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 ManagedInstanceAdvancedThreatProtection. +func (m ManagedInstanceAdvancedThreatProtection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAdvancedThreatProtection. +func (m *ManagedInstanceAdvancedThreatProtection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAdvancedThreatProtectionListResult. +func (m ManagedInstanceAdvancedThreatProtectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAdvancedThreatProtectionListResult. +func (m *ManagedInstanceAdvancedThreatProtectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAzureADOnlyAuthListResult. +func (m ManagedInstanceAzureADOnlyAuthListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAzureADOnlyAuthListResult. +func (m *ManagedInstanceAzureADOnlyAuthListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceAzureADOnlyAuthProperties. +func (m ManagedInstanceAzureADOnlyAuthProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureADOnlyAuthentication", m.AzureADOnlyAuthentication) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAzureADOnlyAuthProperties. +func (m *ManagedInstanceAzureADOnlyAuthProperties) UnmarshalJSON(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 "azureADOnlyAuthentication": + err = unpopulate(val, "AzureADOnlyAuthentication", &m.AzureADOnlyAuthentication) + 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 ManagedInstanceAzureADOnlyAuthentication. +func (m ManagedInstanceAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceAzureADOnlyAuthentication. +func (m *ManagedInstanceAzureADOnlyAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtc. +func (m ManagedInstanceDtc) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceDtc. +func (m *ManagedInstanceDtc) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtcListResult. +func (m ManagedInstanceDtcListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceDtcListResult. +func (m *ManagedInstanceDtcListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceDtcProperties. +func (m ManagedInstanceDtcProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dtcEnabled", m.DtcEnabled) + populate(objectMap, "dtcHostNameDnsSuffix", m.DtcHostNameDNSSuffix) + populate(objectMap, "externalDnsSuffixSearchList", m.ExternalDNSSuffixSearchList) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "securitySettings", m.SecuritySettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceDtcProperties. +func (m *ManagedInstanceDtcProperties) UnmarshalJSON(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 "dtcEnabled": + err = unpopulate(val, "DtcEnabled", &m.DtcEnabled) + delete(rawMsg, key) + case "dtcHostNameDnsSuffix": + err = unpopulate(val, "DtcHostNameDNSSuffix", &m.DtcHostNameDNSSuffix) + delete(rawMsg, key) + case "externalDnsSuffixSearchList": + err = unpopulate(val, "ExternalDNSSuffixSearchList", &m.ExternalDNSSuffixSearchList) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "securitySettings": + err = unpopulate(val, "SecuritySettings", &m.SecuritySettings) + 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 ManagedInstanceDtcSecuritySettings. +func (m ManagedInstanceDtcSecuritySettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "snaLu6point2TransactionsEnabled", m.SnaLu6Point2TransactionsEnabled) + populate(objectMap, "transactionManagerCommunicationSettings", m.TransactionManagerCommunicationSettings) + populate(objectMap, "xaTransactionsDefaultTimeout", m.XaTransactionsDefaultTimeout) + populate(objectMap, "xaTransactionsEnabled", m.XaTransactionsEnabled) + populate(objectMap, "xaTransactionsMaximumTimeout", m.XaTransactionsMaximumTimeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceDtcSecuritySettings. +func (m *ManagedInstanceDtcSecuritySettings) UnmarshalJSON(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 "snaLu6point2TransactionsEnabled": + err = unpopulate(val, "SnaLu6Point2TransactionsEnabled", &m.SnaLu6Point2TransactionsEnabled) + delete(rawMsg, key) + case "transactionManagerCommunicationSettings": + err = unpopulate(val, "TransactionManagerCommunicationSettings", &m.TransactionManagerCommunicationSettings) + delete(rawMsg, key) + case "xaTransactionsDefaultTimeout": + err = unpopulate(val, "XaTransactionsDefaultTimeout", &m.XaTransactionsDefaultTimeout) + delete(rawMsg, key) + case "xaTransactionsEnabled": + err = unpopulate(val, "XaTransactionsEnabled", &m.XaTransactionsEnabled) + delete(rawMsg, key) + case "xaTransactionsMaximumTimeout": + err = unpopulate(val, "XaTransactionsMaximumTimeout", &m.XaTransactionsMaximumTimeout) + 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 ManagedInstanceDtcTransactionManagerCommunicationSettings. +func (m ManagedInstanceDtcTransactionManagerCommunicationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowInboundEnabled", m.AllowInboundEnabled) + populate(objectMap, "allowOutboundEnabled", m.AllowOutboundEnabled) + populate(objectMap, "authentication", m.Authentication) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceDtcTransactionManagerCommunicationSettings. +func (m *ManagedInstanceDtcTransactionManagerCommunicationSettings) UnmarshalJSON(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 "allowInboundEnabled": + err = unpopulate(val, "AllowInboundEnabled", &m.AllowInboundEnabled) + delete(rawMsg, key) + case "allowOutboundEnabled": + err = unpopulate(val, "AllowOutboundEnabled", &m.AllowOutboundEnabled) + delete(rawMsg, key) + case "authentication": + err = unpopulate(val, "Authentication", &m.Authentication) + 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 ManagedInstanceEditionCapability. +func (m ManagedInstanceEditionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", m.Name) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "status", m.Status) + populate(objectMap, "supportedFamilies", m.SupportedFamilies) + populate(objectMap, "supportedStorageCapabilities", m.SupportedStorageCapabilities) + populate(objectMap, "zoneRedundant", m.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceEditionCapability. +func (m *ManagedInstanceEditionCapability) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "supportedFamilies": + err = unpopulate(val, "SupportedFamilies", &m.SupportedFamilies) + delete(rawMsg, key) + case "supportedStorageCapabilities": + err = unpopulate(val, "SupportedStorageCapabilities", &m.SupportedStorageCapabilities) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) + 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 ManagedInstanceEncryptionProtector. +func (m ManagedInstanceEncryptionProtector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "kind", m.Kind) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceEncryptionProtector. +func (m *ManagedInstanceEncryptionProtector) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEncryptionProtectorListResult. +func (m ManagedInstanceEncryptionProtectorListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceEncryptionProtectorListResult. +func (m *ManagedInstanceEncryptionProtectorListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceEncryptionProtectorProperties. +func (m ManagedInstanceEncryptionProtectorProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoRotationEnabled", m.AutoRotationEnabled) + populate(objectMap, "serverKeyName", m.ServerKeyName) + populate(objectMap, "serverKeyType", m.ServerKeyType) + populate(objectMap, "thumbprint", m.Thumbprint) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceEncryptionProtectorProperties. +func (m *ManagedInstanceEncryptionProtectorProperties) UnmarshalJSON(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 "autoRotationEnabled": + err = unpopulate(val, "AutoRotationEnabled", &m.AutoRotationEnabled) + delete(rawMsg, key) + case "serverKeyName": + err = unpopulate(val, "ServerKeyName", &m.ServerKeyName) + delete(rawMsg, key) + case "serverKeyType": + err = unpopulate(val, "ServerKeyType", &m.ServerKeyType) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &m.Thumbprint) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + 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 ManagedInstanceExternalAdministrator. +func (m ManagedInstanceExternalAdministrator) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorType", m.AdministratorType) + populate(objectMap, "azureADOnlyAuthentication", m.AzureADOnlyAuthentication) + populate(objectMap, "login", m.Login) + populate(objectMap, "principalType", m.PrincipalType) + populate(objectMap, "sid", m.Sid) + populate(objectMap, "tenantId", m.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceExternalAdministrator. +func (m *ManagedInstanceExternalAdministrator) UnmarshalJSON(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 "administratorType": + err = unpopulate(val, "AdministratorType", &m.AdministratorType) + delete(rawMsg, key) + case "azureADOnlyAuthentication": + err = unpopulate(val, "AzureADOnlyAuthentication", &m.AzureADOnlyAuthentication) + delete(rawMsg, key) + case "login": + err = unpopulate(val, "Login", &m.Login) + delete(rawMsg, key) + case "principalType": + err = unpopulate(val, "PrincipalType", &m.PrincipalType) + delete(rawMsg, key) + case "sid": + err = unpopulate(val, "Sid", &m.Sid) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &m.TenantID) + 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 ManagedInstanceFamilyCapability. +func (m ManagedInstanceFamilyCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", m.Name) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "sku", m.SKU) + populate(objectMap, "status", m.Status) + populate(objectMap, "supportedLicenseTypes", m.SupportedLicenseTypes) + populate(objectMap, "supportedVcoresValues", m.SupportedVcoresValues) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceFamilyCapability. +func (m *ManagedInstanceFamilyCapability) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "supportedLicenseTypes": + err = unpopulate(val, "SupportedLicenseTypes", &m.SupportedLicenseTypes) + delete(rawMsg, key) + case "supportedVcoresValues": + err = unpopulate(val, "SupportedVcoresValues", &m.SupportedVcoresValues) + 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 ManagedInstanceKey. +func (m ManagedInstanceKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "kind", m.Kind) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceKey. +func (m *ManagedInstanceKey) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &m.Kind) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKeyListResult. +func (m ManagedInstanceKeyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceKeyListResult. +func (m *ManagedInstanceKeyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKeyProperties. +func (m ManagedInstanceKeyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoRotationEnabled", m.AutoRotationEnabled) + populateTimeRFC3339(objectMap, "creationDate", m.CreationDate) + populate(objectMap, "serverKeyType", m.ServerKeyType) + populate(objectMap, "thumbprint", m.Thumbprint) + populate(objectMap, "uri", m.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceKeyProperties. +func (m *ManagedInstanceKeyProperties) UnmarshalJSON(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 "autoRotationEnabled": + err = unpopulate(val, "AutoRotationEnabled", &m.AutoRotationEnabled) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &m.CreationDate) + delete(rawMsg, key) + case "serverKeyType": + err = unpopulate(val, "ServerKeyType", &m.ServerKeyType) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &m.Thumbprint) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &m.URI) + 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 ManagedInstanceListResult. +func (m ManagedInstanceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceListResult. +func (m *ManagedInstanceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackup. +func (m ManagedInstanceLongTermRetentionBackup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionBackup. +func (m *ManagedInstanceLongTermRetentionBackup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackupListResult. +func (m ManagedInstanceLongTermRetentionBackupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionBackupListResult. +func (m *ManagedInstanceLongTermRetentionBackupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionBackupProperties. +func (m ManagedInstanceLongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "backupExpirationTime", m.BackupExpirationTime) + populate(objectMap, "backupStorageRedundancy", m.BackupStorageRedundancy) + populateTimeRFC3339(objectMap, "backupTime", m.BackupTime) + populateTimeRFC3339(objectMap, "databaseDeletionTime", m.DatabaseDeletionTime) + populate(objectMap, "databaseName", m.DatabaseName) + populateTimeRFC3339(objectMap, "managedInstanceCreateTime", m.ManagedInstanceCreateTime) + populate(objectMap, "managedInstanceName", m.ManagedInstanceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionBackupProperties. +func (m *ManagedInstanceLongTermRetentionBackupProperties) UnmarshalJSON(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 "backupExpirationTime": + err = unpopulateTimeRFC3339(val, "BackupExpirationTime", &m.BackupExpirationTime) + delete(rawMsg, key) + case "backupStorageRedundancy": + err = unpopulate(val, "BackupStorageRedundancy", &m.BackupStorageRedundancy) + delete(rawMsg, key) + case "backupTime": + err = unpopulateTimeRFC3339(val, "BackupTime", &m.BackupTime) + delete(rawMsg, key) + case "databaseDeletionTime": + err = unpopulateTimeRFC3339(val, "DatabaseDeletionTime", &m.DatabaseDeletionTime) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &m.DatabaseName) + delete(rawMsg, key) + case "managedInstanceCreateTime": + err = unpopulateTimeRFC3339(val, "ManagedInstanceCreateTime", &m.ManagedInstanceCreateTime) + delete(rawMsg, key) + case "managedInstanceName": + err = unpopulate(val, "ManagedInstanceName", &m.ManagedInstanceName) + 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 ManagedInstanceLongTermRetentionPolicy. +func (m ManagedInstanceLongTermRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionPolicy. +func (m *ManagedInstanceLongTermRetentionPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceLongTermRetentionPolicyListResult. +func (m ManagedInstanceLongTermRetentionPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionPolicyListResult. +func (m *ManagedInstanceLongTermRetentionPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceMaintenanceConfigurationCapability. +func (m ManagedInstanceMaintenanceConfigurationCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", m.Name) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "status", m.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceMaintenanceConfigurationCapability. +func (m *ManagedInstanceMaintenanceConfigurationCapability) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + 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 ManagedInstanceOperation. +func (m ManagedInstanceOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperation. +func (m *ManagedInstanceOperation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationListResult. +func (m ManagedInstanceOperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationListResult. +func (m *ManagedInstanceOperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceOperationParametersPair. +func (m ManagedInstanceOperationParametersPair) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentParameters", m.CurrentParameters) + populate(objectMap, "requestedParameters", m.RequestedParameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationParametersPair. +func (m *ManagedInstanceOperationParametersPair) UnmarshalJSON(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 "currentParameters": + err = unpopulate(val, "CurrentParameters", &m.CurrentParameters) + delete(rawMsg, key) + case "requestedParameters": + err = unpopulate(val, "RequestedParameters", &m.RequestedParameters) + 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 ManagedInstanceOperationProperties. +func (m ManagedInstanceOperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", m.Description) + populate(objectMap, "errorCode", m.ErrorCode) + populate(objectMap, "errorDescription", m.ErrorDescription) + populate(objectMap, "errorSeverity", m.ErrorSeverity) + populateTimeRFC3339(objectMap, "estimatedCompletionTime", m.EstimatedCompletionTime) + populate(objectMap, "isCancellable", m.IsCancellable) + populate(objectMap, "isUserError", m.IsUserError) + populate(objectMap, "managedInstanceName", m.ManagedInstanceName) + populate(objectMap, "operation", m.Operation) + populate(objectMap, "operationFriendlyName", m.OperationFriendlyName) + populate(objectMap, "operationParameters", m.OperationParameters) + populate(objectMap, "operationSteps", m.OperationSteps) + populate(objectMap, "percentComplete", m.PercentComplete) + populateTimeRFC3339(objectMap, "startTime", m.StartTime) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationProperties. +func (m *ManagedInstanceOperationProperties) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &m.ErrorCode) + delete(rawMsg, key) + case "errorDescription": + err = unpopulate(val, "ErrorDescription", &m.ErrorDescription) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &m.ErrorSeverity) + delete(rawMsg, key) + case "estimatedCompletionTime": + err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &m.EstimatedCompletionTime) + delete(rawMsg, key) + case "isCancellable": + err = unpopulate(val, "IsCancellable", &m.IsCancellable) + delete(rawMsg, key) + case "isUserError": + err = unpopulate(val, "IsUserError", &m.IsUserError) + delete(rawMsg, key) + case "managedInstanceName": + err = unpopulate(val, "ManagedInstanceName", &m.ManagedInstanceName) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &m.Operation) + delete(rawMsg, key) + case "operationFriendlyName": + err = unpopulate(val, "OperationFriendlyName", &m.OperationFriendlyName) + delete(rawMsg, key) + case "operationParameters": + err = unpopulate(val, "OperationParameters", &m.OperationParameters) + delete(rawMsg, key) + case "operationSteps": + err = unpopulate(val, "OperationSteps", &m.OperationSteps) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &m.PercentComplete) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + 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 ManagedInstanceOperationSteps. +func (m ManagedInstanceOperationSteps) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentStep", m.CurrentStep) + populate(objectMap, "stepsList", m.StepsList) + populate(objectMap, "totalSteps", m.TotalSteps) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationSteps. +func (m *ManagedInstanceOperationSteps) UnmarshalJSON(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 "currentStep": + err = unpopulate(val, "CurrentStep", &m.CurrentStep) + delete(rawMsg, key) + case "stepsList": + err = unpopulate(val, "StepsList", &m.StepsList) + delete(rawMsg, key) + case "totalSteps": + err = unpopulate(val, "TotalSteps", &m.TotalSteps) + 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 ManagedInstancePairInfo. +func (m ManagedInstancePairInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "partnerManagedInstanceId", m.PartnerManagedInstanceID) + populate(objectMap, "primaryManagedInstanceId", m.PrimaryManagedInstanceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePairInfo. +func (m *ManagedInstancePairInfo) UnmarshalJSON(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 "partnerManagedInstanceId": + err = unpopulate(val, "PartnerManagedInstanceID", &m.PartnerManagedInstanceID) + delete(rawMsg, key) + case "primaryManagedInstanceId": + err = unpopulate(val, "PrimaryManagedInstanceID", &m.PrimaryManagedInstanceID) + 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 ManagedInstancePecProperty. +func (m ManagedInstancePecProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "properties", m.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePecProperty. +func (m *ManagedInstancePecProperty) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "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 ManagedInstancePrivateEndpointConnection. +func (m ManagedInstancePrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateEndpointConnection. +func (m *ManagedInstancePrivateEndpointConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointConnectionListResult. +func (m ManagedInstancePrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateEndpointConnectionListResult. +func (m *ManagedInstancePrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateEndpointConnectionProperties. +func (m ManagedInstancePrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateEndpoint", m.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", m.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", m.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateEndpointConnectionProperties. +func (m *ManagedInstancePrivateEndpointConnectionProperties) UnmarshalJSON(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 "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &m.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &m.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + 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 ManagedInstancePrivateEndpointProperty. +func (m ManagedInstancePrivateEndpointProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateEndpointProperty. +func (m *ManagedInstancePrivateEndpointProperty) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLink. +func (m ManagedInstancePrivateLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateLink. +func (m *ManagedInstancePrivateLink) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkListResult. +func (m ManagedInstancePrivateLinkListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateLinkListResult. +func (m *ManagedInstancePrivateLinkListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkProperties. +func (m ManagedInstancePrivateLinkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupId", m.GroupID) + populate(objectMap, "requiredMembers", m.RequiredMembers) + populate(objectMap, "requiredZoneNames", m.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateLinkProperties. +func (m *ManagedInstancePrivateLinkProperties) UnmarshalJSON(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 "groupId": + err = unpopulate(val, "GroupID", &m.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &m.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &m.RequiredZoneNames) + 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 ManagedInstancePrivateLinkServiceConnectionStateProperty. +func (m ManagedInstancePrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionsRequired", m.ActionsRequired) + populate(objectMap, "description", m.Description) + populate(objectMap, "status", m.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstancePrivateLinkServiceConnectionStateProperty. +func (m *ManagedInstancePrivateLinkServiceConnectionStateProperty) UnmarshalJSON(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 "actionsRequired": + err = unpopulate(val, "ActionsRequired", &m.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &m.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + 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 ManagedInstanceProperties. +func (m ManagedInstanceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorLogin", m.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", m.AdministratorLoginPassword) + populate(objectMap, "administrators", m.Administrators) + populate(objectMap, "collation", m.Collation) + populate(objectMap, "currentBackupStorageRedundancy", m.CurrentBackupStorageRedundancy) + populate(objectMap, "dnsZone", m.DNSZone) + populate(objectMap, "dnsZonePartner", m.DNSZonePartner) + populate(objectMap, "fullyQualifiedDomainName", m.FullyQualifiedDomainName) + populate(objectMap, "instancePoolId", m.InstancePoolID) + populate(objectMap, "keyId", m.KeyID) + populate(objectMap, "licenseType", m.LicenseType) + populate(objectMap, "maintenanceConfigurationId", m.MaintenanceConfigurationID) + populate(objectMap, "managedInstanceCreateMode", m.ManagedInstanceCreateMode) + populate(objectMap, "minimalTlsVersion", m.MinimalTLSVersion) + populate(objectMap, "primaryUserAssignedIdentityId", m.PrimaryUserAssignedIdentityID) + populate(objectMap, "privateEndpointConnections", m.PrivateEndpointConnections) + populate(objectMap, "provisioningState", m.ProvisioningState) + populate(objectMap, "proxyOverride", m.ProxyOverride) + populate(objectMap, "publicDataEndpointEnabled", m.PublicDataEndpointEnabled) + populate(objectMap, "requestedBackupStorageRedundancy", m.RequestedBackupStorageRedundancy) + populateTimeRFC3339(objectMap, "restorePointInTime", m.RestorePointInTime) + populate(objectMap, "servicePrincipal", m.ServicePrincipal) + populate(objectMap, "sourceManagedInstanceId", m.SourceManagedInstanceID) + populate(objectMap, "state", m.State) + populate(objectMap, "storageSizeInGB", m.StorageSizeInGB) + populate(objectMap, "subnetId", m.SubnetID) + populate(objectMap, "timezoneId", m.TimezoneID) + populate(objectMap, "vCores", m.VCores) + populate(objectMap, "zoneRedundant", m.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceProperties. +func (m *ManagedInstanceProperties) UnmarshalJSON(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 "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &m.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &m.AdministratorLoginPassword) + delete(rawMsg, key) + case "administrators": + err = unpopulate(val, "Administrators", &m.Administrators) + delete(rawMsg, key) + case "collation": + err = unpopulate(val, "Collation", &m.Collation) + delete(rawMsg, key) + case "currentBackupStorageRedundancy": + err = unpopulate(val, "CurrentBackupStorageRedundancy", &m.CurrentBackupStorageRedundancy) + delete(rawMsg, key) + case "dnsZone": + err = unpopulate(val, "DNSZone", &m.DNSZone) + delete(rawMsg, key) + case "dnsZonePartner": + err = unpopulate(val, "DNSZonePartner", &m.DNSZonePartner) + delete(rawMsg, key) + case "fullyQualifiedDomainName": + err = unpopulate(val, "FullyQualifiedDomainName", &m.FullyQualifiedDomainName) + delete(rawMsg, key) + case "instancePoolId": + err = unpopulate(val, "InstancePoolID", &m.InstancePoolID) + delete(rawMsg, key) + case "keyId": + err = unpopulate(val, "KeyID", &m.KeyID) + delete(rawMsg, key) + case "licenseType": + err = unpopulate(val, "LicenseType", &m.LicenseType) + delete(rawMsg, key) + case "maintenanceConfigurationId": + err = unpopulate(val, "MaintenanceConfigurationID", &m.MaintenanceConfigurationID) + delete(rawMsg, key) + case "managedInstanceCreateMode": + err = unpopulate(val, "ManagedInstanceCreateMode", &m.ManagedInstanceCreateMode) + delete(rawMsg, key) + case "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &m.MinimalTLSVersion) + delete(rawMsg, key) + case "primaryUserAssignedIdentityId": + err = unpopulate(val, "PrimaryUserAssignedIdentityID", &m.PrimaryUserAssignedIdentityID) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &m.PrivateEndpointConnections) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) + delete(rawMsg, key) + case "proxyOverride": + err = unpopulate(val, "ProxyOverride", &m.ProxyOverride) + delete(rawMsg, key) + case "publicDataEndpointEnabled": + err = unpopulate(val, "PublicDataEndpointEnabled", &m.PublicDataEndpointEnabled) + delete(rawMsg, key) + case "requestedBackupStorageRedundancy": + err = unpopulate(val, "RequestedBackupStorageRedundancy", &m.RequestedBackupStorageRedundancy) + delete(rawMsg, key) + case "restorePointInTime": + err = unpopulateTimeRFC3339(val, "RestorePointInTime", &m.RestorePointInTime) + delete(rawMsg, key) + case "servicePrincipal": + err = unpopulate(val, "ServicePrincipal", &m.ServicePrincipal) + delete(rawMsg, key) + case "sourceManagedInstanceId": + err = unpopulate(val, "SourceManagedInstanceID", &m.SourceManagedInstanceID) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + delete(rawMsg, key) + case "storageSizeInGB": + err = unpopulate(val, "StorageSizeInGB", &m.StorageSizeInGB) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &m.SubnetID) + delete(rawMsg, key) + case "timezoneId": + err = unpopulate(val, "TimezoneID", &m.TimezoneID) + delete(rawMsg, key) + case "vCores": + err = unpopulate(val, "VCores", &m.VCores) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) + 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 ManagedInstanceQuery. +func (m ManagedInstanceQuery) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceQuery. +func (m *ManagedInstanceQuery) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceQueryStatistics. +func (m ManagedInstanceQueryStatistics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceQueryStatistics. +func (m *ManagedInstanceQueryStatistics) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceUpdate. +func (m ManagedInstanceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identity", m.Identity) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "sku", m.SKU) + populate(objectMap, "tags", m.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceUpdate. +func (m *ManagedInstanceUpdate) UnmarshalJSON(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 "identity": + err = unpopulate(val, "Identity", &m.Identity) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &m.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &m.Tags) + 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 ManagedInstanceVcoresCapability. +func (m ManagedInstanceVcoresCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "includedMaxSize", m.IncludedMaxSize) + populate(objectMap, "instancePoolSupported", m.InstancePoolSupported) + populate(objectMap, "name", m.Name) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "standaloneSupported", m.StandaloneSupported) + populate(objectMap, "status", m.Status) + populate(objectMap, "supportedMaintenanceConfigurations", m.SupportedMaintenanceConfigurations) + populate(objectMap, "supportedStorageSizes", m.SupportedStorageSizes) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVcoresCapability. +func (m *ManagedInstanceVcoresCapability) UnmarshalJSON(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 "includedMaxSize": + err = unpopulate(val, "IncludedMaxSize", &m.IncludedMaxSize) + delete(rawMsg, key) + case "instancePoolSupported": + err = unpopulate(val, "InstancePoolSupported", &m.InstancePoolSupported) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "standaloneSupported": + err = unpopulate(val, "StandaloneSupported", &m.StandaloneSupported) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "supportedMaintenanceConfigurations": + err = unpopulate(val, "SupportedMaintenanceConfigurations", &m.SupportedMaintenanceConfigurations) + delete(rawMsg, key) + case "supportedStorageSizes": + err = unpopulate(val, "SupportedStorageSizes", &m.SupportedStorageSizes) + 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 ManagedInstanceVersionCapability. +func (m ManagedInstanceVersionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", m.Name) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "status", m.Status) + populate(objectMap, "supportedEditions", m.SupportedEditions) + populate(objectMap, "supportedInstancePoolEditions", m.SupportedInstancePoolEditions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVersionCapability. +func (m *ManagedInstanceVersionCapability) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "supportedEditions": + err = unpopulate(val, "SupportedEditions", &m.SupportedEditions) + delete(rawMsg, key) + case "supportedInstancePoolEditions": + err = unpopulate(val, "SupportedInstancePoolEditions", &m.SupportedInstancePoolEditions) + 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 ManagedInstanceVulnerabilityAssessment. +func (m ManagedInstanceVulnerabilityAssessment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVulnerabilityAssessment. +func (m *ManagedInstanceVulnerabilityAssessment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVulnerabilityAssessmentListResult. +func (m ManagedInstanceVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVulnerabilityAssessmentListResult. +func (m *ManagedInstanceVulnerabilityAssessmentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceVulnerabilityAssessmentProperties. +func (m ManagedInstanceVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "recurringScans", m.RecurringScans) + populate(objectMap, "storageAccountAccessKey", m.StorageAccountAccessKey) + populate(objectMap, "storageContainerPath", m.StorageContainerPath) + populate(objectMap, "storageContainerSasKey", m.StorageContainerSasKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceVulnerabilityAssessmentProperties. +func (m *ManagedInstanceVulnerabilityAssessmentProperties) UnmarshalJSON(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 "recurringScans": + err = unpopulate(val, "RecurringScans", &m.RecurringScans) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &m.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageContainerPath": + err = unpopulate(val, "StorageContainerPath", &m.StorageContainerPath) + delete(rawMsg, key) + case "storageContainerSasKey": + err = unpopulate(val, "StorageContainerSasKey", &m.StorageContainerSasKey) + 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 ManagedLedgerDigestUploads. +func (m ManagedLedgerDigestUploads) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedLedgerDigestUploads. +func (m *ManagedLedgerDigestUploads) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedLedgerDigestUploadsListResult. +func (m ManagedLedgerDigestUploadsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedLedgerDigestUploadsListResult. +func (m *ManagedLedgerDigestUploadsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedLedgerDigestUploadsProperties. +func (m ManagedLedgerDigestUploadsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "digestStorageEndpoint", m.DigestStorageEndpoint) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedLedgerDigestUploadsProperties. +func (m *ManagedLedgerDigestUploadsProperties) UnmarshalJSON(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 "digestStorageEndpoint": + err = unpopulate(val, "DigestStorageEndpoint", &m.DigestStorageEndpoint) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &m.State) + 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 ManagedServerDNSAlias. +func (m ManagedServerDNSAlias) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerDNSAlias. +func (m *ManagedServerDNSAlias) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServerDNSAliasAcquisition. +func (m ManagedServerDNSAliasAcquisition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "oldManagedServerDnsAliasResourceId", m.OldManagedServerDNSAliasResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerDNSAliasAcquisition. +func (m *ManagedServerDNSAliasAcquisition) UnmarshalJSON(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 "oldManagedServerDnsAliasResourceId": + err = unpopulate(val, "OldManagedServerDNSAliasResourceID", &m.OldManagedServerDNSAliasResourceID) + 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 ManagedServerDNSAliasCreation. +func (m ManagedServerDNSAliasCreation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "createDnsRecord", m.CreateDNSRecord) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerDNSAliasCreation. +func (m *ManagedServerDNSAliasCreation) UnmarshalJSON(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 "createDnsRecord": + err = unpopulate(val, "CreateDNSRecord", &m.CreateDNSRecord) + 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 ManagedServerDNSAliasListResult. +func (m ManagedServerDNSAliasListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerDNSAliasListResult. +func (m *ManagedServerDNSAliasListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServerDNSAliasProperties. +func (m ManagedServerDNSAliasProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureDnsRecord", m.AzureDNSRecord) + populate(objectMap, "publicAzureDnsRecord", m.PublicAzureDNSRecord) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerDNSAliasProperties. +func (m *ManagedServerDNSAliasProperties) UnmarshalJSON(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 "azureDnsRecord": + err = unpopulate(val, "AzureDNSRecord", &m.AzureDNSRecord) + delete(rawMsg, key) + case "publicAzureDnsRecord": + err = unpopulate(val, "PublicAzureDNSRecord", &m.PublicAzureDNSRecord) + 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 ManagedServerSecurityAlertPolicy. +func (m ManagedServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "systemData", m.SystemData) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerSecurityAlertPolicy. +func (m *ManagedServerSecurityAlertPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &m.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedServerSecurityAlertPolicyListResult. +func (m ManagedServerSecurityAlertPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedServerSecurityAlertPolicyListResult. +func (m *ManagedServerSecurityAlertPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryption. +func (m ManagedTransparentDataEncryption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedTransparentDataEncryption. +func (m *ManagedTransparentDataEncryption) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &m.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &m.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &m.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &m.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryptionListResult. +func (m ManagedTransparentDataEncryptionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedTransparentDataEncryptionListResult. +func (m *ManagedTransparentDataEncryptionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &m.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &m.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ManagedTransparentDataEncryptionProperties. +func (m ManagedTransparentDataEncryptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "state", m.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedTransparentDataEncryptionProperties. +func (m *ManagedTransparentDataEncryptionProperties) UnmarshalJSON(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 "state": + err = unpopulate(val, "State", &m.State) + 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 MaxSizeCapability. +func (m MaxSizeCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "limit", m.Limit) + populate(objectMap, "unit", m.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaxSizeCapability. +func (m *MaxSizeCapability) UnmarshalJSON(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 "limit": + err = unpopulate(val, "Limit", &m.Limit) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &m.Unit) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", m, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MaxSizeRangeCapability. +func (m MaxSizeRangeCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "logSize", m.LogSize) + populate(objectMap, "maxValue", m.MaxValue) + populate(objectMap, "minValue", m.MinValue) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "scaleSize", m.ScaleSize) + populate(objectMap, "status", m.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MaxSizeRangeCapability. +func (m *MaxSizeRangeCapability) UnmarshalJSON(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 "logSize": + err = unpopulate(val, "LogSize", &m.LogSize) + delete(rawMsg, key) + case "maxValue": + err = unpopulate(val, "MaxValue", &m.MaxValue) + delete(rawMsg, key) + case "minValue": + err = unpopulate(val, "MinValue", &m.MinValue) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "scaleSize": + err = unpopulate(val, "ScaleSize", &m.ScaleSize) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + 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 MinCapacityCapability. +func (m MinCapacityCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "reason", m.Reason) + populate(objectMap, "status", m.Status) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MinCapacityCapability. +func (m *MinCapacityCapability) UnmarshalJSON(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 "reason": + err = unpopulate(val, "Reason", &m.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + 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 Name. +func (n Name) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "localizedValue", n.LocalizedValue) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Name. +func (n *Name) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "localizedValue": + err = unpopulate(val, "LocalizedValue", &n.LocalizedValue) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NetworkIsolationSettings. +func (n NetworkIsolationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sqlServerResourceId", n.SQLServerResourceID) + populate(objectMap, "storageAccountResourceId", n.StorageAccountResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkIsolationSettings. +func (n *NetworkIsolationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sqlServerResourceId": + err = unpopulate(val, "SQLServerResourceID", &n.SQLServerResourceID) + delete(rawMsg, key) + case "storageAccountResourceId": + err = unpopulate(val, "StorageAccountResourceID", &n.StorageAccountResourceID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type 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 OutboundEnvironmentEndpoint. +func (o OutboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "category", o.Category) + populate(objectMap, "endpoints", o.Endpoints) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpoint. +func (o *OutboundEnvironmentEndpoint) UnmarshalJSON(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 "category": + err = unpopulate(val, "Category", &o.Category) + delete(rawMsg, key) + case "endpoints": + err = unpopulate(val, "Endpoints", &o.Endpoints) + 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 OutboundEnvironmentEndpointCollection. +func (o OutboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpointCollection. +func (o *OutboundEnvironmentEndpointCollection) UnmarshalJSON(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 OutboundFirewallRule. +func (o OutboundFirewallRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundFirewallRule. +func (o *OutboundFirewallRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundFirewallRuleListResult. +func (o OutboundFirewallRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundFirewallRuleListResult. +func (o *OutboundFirewallRuleListResult) UnmarshalJSON(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 OutboundFirewallRuleProperties. +func (o OutboundFirewallRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", o.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundFirewallRuleProperties. +func (o *OutboundFirewallRuleProperties) UnmarshalJSON(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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &o.ProvisioningState) + 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 PartnerInfo. +func (p PartnerInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "replicationRole", p.ReplicationRole) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerInfo. +func (p *PartnerInfo) UnmarshalJSON(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 "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &p.ReplicationRole) + 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 PartnerRegionInfo. +func (p PartnerRegionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", p.Location) + populate(objectMap, "replicationRole", p.ReplicationRole) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PartnerRegionInfo. +func (p *PartnerRegionInfo) UnmarshalJSON(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 "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "replicationRole": + err = unpopulate(val, "ReplicationRole", &p.ReplicationRole) + 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 PerformanceLevelCapability. +func (p PerformanceLevelCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "unit", p.Unit) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PerformanceLevelCapability. +func (p *PerformanceLevelCapability) UnmarshalJSON(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 "unit": + err = unpopulate(val, "Unit", &p.Unit) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + 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 PhaseDetails. +func (p PhaseDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "phase", p.Phase) + populate(objectMap, "phaseInformation", p.PhaseInformation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PhaseDetails. +func (p *PhaseDetails) UnmarshalJSON(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 "phase": + err = unpopulate(val, "Phase", &p.Phase) + delete(rawMsg, key) + case "phaseInformation": + err = unpopulate(val, "PhaseInformation", &p.PhaseInformation) + 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 PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &p.Properties) + 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 PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + 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 PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(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 "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + 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 PrivateEndpointConnectionRequestStatus. +func (p PrivateEndpointConnectionRequestStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateEndpointConnectionName", p.PrivateEndpointConnectionName) + populate(objectMap, "privateLinkServiceId", p.PrivateLinkServiceID) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionRequestStatus. +func (p *PrivateEndpointConnectionRequestStatus) UnmarshalJSON(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 "privateEndpointConnectionName": + err = unpopulate(val, "PrivateEndpointConnectionName", &p.PrivateEndpointConnectionName) + delete(rawMsg, key) + case "privateLinkServiceId": + err = unpopulate(val, "PrivateLinkServiceID", &p.PrivateLinkServiceID) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + 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 PrivateEndpointProperty. +func (p PrivateEndpointProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointProperty. +func (p *PrivateEndpointProperty) UnmarshalJSON(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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &p.Properties) + 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 PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &p.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &p.Value) + 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 PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) UnmarshalJSON(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 "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + 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 PrivateLinkServiceConnectionStateProperty. +func (p PrivateLinkServiceConnectionStateProperty) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionStateProperty. +func (p *PrivateLinkServiceConnectionStateProperty) UnmarshalJSON(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 "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + 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]any) + 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 ProxyResourceWithWritableName. +func (p ProxyResourceWithWritableName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 ProxyResourceWithWritableName. +func (p *ProxyResourceWithWritableName) UnmarshalJSON(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 QueryCheck. +func (q QueryCheck) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "columnNames", q.ColumnNames) + populate(objectMap, "expectedResult", q.ExpectedResult) + populate(objectMap, "query", q.Query) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryCheck. +func (q *QueryCheck) UnmarshalJSON(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 "columnNames": + err = unpopulate(val, "ColumnNames", &q.ColumnNames) + delete(rawMsg, key) + case "expectedResult": + err = unpopulate(val, "ExpectedResult", &q.ExpectedResult) + delete(rawMsg, key) + case "query": + err = unpopulate(val, "Query", &q.Query) + 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 QueryMetricInterval. +func (q QueryMetricInterval) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "executionCount", q.ExecutionCount) + populate(objectMap, "intervalStartTime", q.IntervalStartTime) + populate(objectMap, "intervalType", q.IntervalType) + populate(objectMap, "metrics", q.Metrics) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryMetricInterval. +func (q *QueryMetricInterval) UnmarshalJSON(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 "executionCount": + err = unpopulate(val, "ExecutionCount", &q.ExecutionCount) + delete(rawMsg, key) + case "intervalStartTime": + err = unpopulate(val, "IntervalStartTime", &q.IntervalStartTime) + delete(rawMsg, key) + case "intervalType": + err = unpopulate(val, "IntervalType", &q.IntervalType) + delete(rawMsg, key) + case "metrics": + err = unpopulate(val, "Metrics", &q.Metrics) + 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 QueryMetricProperties. +func (q QueryMetricProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "avg", q.Avg) + populate(objectMap, "displayName", q.DisplayName) + populate(objectMap, "max", q.Max) + populate(objectMap, "min", q.Min) + populate(objectMap, "name", q.Name) + populate(objectMap, "stdev", q.Stdev) + populate(objectMap, "sum", q.Sum) + populate(objectMap, "unit", q.Unit) + populate(objectMap, "value", q.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryMetricProperties. +func (q *QueryMetricProperties) UnmarshalJSON(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 "avg": + err = unpopulate(val, "Avg", &q.Avg) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &q.DisplayName) + delete(rawMsg, key) + case "max": + err = unpopulate(val, "Max", &q.Max) + delete(rawMsg, key) + case "min": + err = unpopulate(val, "Min", &q.Min) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &q.Name) + delete(rawMsg, key) + case "stdev": + err = unpopulate(val, "Stdev", &q.Stdev) + delete(rawMsg, key) + case "sum": + err = unpopulate(val, "Sum", &q.Sum) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &q.Unit) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &q.Value) + 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 QueryProperties. +func (q QueryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "queryText", q.QueryText) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryProperties. +func (q *QueryProperties) UnmarshalJSON(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 "queryText": + err = unpopulate(val, "QueryText", &q.QueryText) + 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 QueryStatistics. +func (q QueryStatistics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", q.ID) + populate(objectMap, "name", q.Name) + populate(objectMap, "properties", q.Properties) + populate(objectMap, "type", q.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryStatistics. +func (q *QueryStatistics) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &q.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &q.Properties) + 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 QueryStatisticsProperties. +func (q QueryStatisticsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", q.DatabaseName) + populate(objectMap, "endTime", q.EndTime) + populate(objectMap, "intervals", q.Intervals) + populate(objectMap, "queryId", q.QueryID) + populate(objectMap, "startTime", q.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QueryStatisticsProperties. +func (q *QueryStatisticsProperties) UnmarshalJSON(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 "databaseName": + err = unpopulate(val, "DatabaseName", &q.DatabaseName) + delete(rawMsg, key) + case "endTime": + err = unpopulate(val, "EndTime", &q.EndTime) + delete(rawMsg, key) + case "intervals": + err = unpopulate(val, "Intervals", &q.Intervals) + delete(rawMsg, key) + case "queryId": + err = unpopulate(val, "QueryID", &q.QueryID) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &q.StartTime) + 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 ReadScaleCapability. +func (r ReadScaleCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "maxNumberOfReplicas", r.MaxNumberOfReplicas) + populate(objectMap, "reason", r.Reason) + populate(objectMap, "status", r.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReadScaleCapability. +func (r *ReadScaleCapability) UnmarshalJSON(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 "maxNumberOfReplicas": + err = unpopulate(val, "MaxNumberOfReplicas", &r.MaxNumberOfReplicas) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &r.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) + 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 RecommendedAction. +func (r RecommendedAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedAction. +func (r *RecommendedAction) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &r.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 RecommendedActionErrorInfo. +func (r RecommendedActionErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorCode", r.ErrorCode) + populate(objectMap, "isRetryable", r.IsRetryable) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionErrorInfo. +func (r *RecommendedActionErrorInfo) UnmarshalJSON(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 "errorCode": + err = unpopulate(val, "ErrorCode", &r.ErrorCode) + delete(rawMsg, key) + case "isRetryable": + err = unpopulate(val, "IsRetryable", &r.IsRetryable) + 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 RecommendedActionImpactRecord. +func (r RecommendedActionImpactRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "absoluteValue", r.AbsoluteValue) + populate(objectMap, "changeValueAbsolute", r.ChangeValueAbsolute) + populate(objectMap, "changeValueRelative", r.ChangeValueRelative) + populate(objectMap, "dimensionName", r.DimensionName) + populate(objectMap, "unit", r.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionImpactRecord. +func (r *RecommendedActionImpactRecord) UnmarshalJSON(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 "absoluteValue": + err = unpopulate(val, "AbsoluteValue", &r.AbsoluteValue) + delete(rawMsg, key) + case "changeValueAbsolute": + err = unpopulate(val, "ChangeValueAbsolute", &r.ChangeValueAbsolute) + delete(rawMsg, key) + case "changeValueRelative": + err = unpopulate(val, "ChangeValueRelative", &r.ChangeValueRelative) + delete(rawMsg, key) + case "dimensionName": + err = unpopulate(val, "DimensionName", &r.DimensionName) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &r.Unit) + 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 RecommendedActionImplementationInfo. +func (r RecommendedActionImplementationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "method", r.Method) + populate(objectMap, "script", r.Script) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionImplementationInfo. +func (r *RecommendedActionImplementationInfo) UnmarshalJSON(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 "method": + err = unpopulate(val, "Method", &r.Method) + delete(rawMsg, key) + case "script": + err = unpopulate(val, "Script", &r.Script) + 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 RecommendedActionMetricInfo. +func (r RecommendedActionMetricInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "metricName", r.MetricName) + populateTimeRFC3339(objectMap, "startTime", r.StartTime) + populate(objectMap, "timeGrain", r.TimeGrain) + populate(objectMap, "unit", r.Unit) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionMetricInfo. +func (r *RecommendedActionMetricInfo) UnmarshalJSON(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 "metricName": + err = unpopulate(val, "MetricName", &r.MetricName) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &r.StartTime) + delete(rawMsg, key) + case "timeGrain": + err = unpopulate(val, "TimeGrain", &r.TimeGrain) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &r.Unit) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 RecommendedActionProperties. +func (r RecommendedActionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "details", r.Details) + populate(objectMap, "errorDetails", r.ErrorDetails) + populate(objectMap, "estimatedImpact", r.EstimatedImpact) + populate(objectMap, "executeActionDuration", r.ExecuteActionDuration) + populate(objectMap, "executeActionInitiatedBy", r.ExecuteActionInitiatedBy) + populateTimeRFC3339(objectMap, "executeActionInitiatedTime", r.ExecuteActionInitiatedTime) + populateTimeRFC3339(objectMap, "executeActionStartTime", r.ExecuteActionStartTime) + populate(objectMap, "implementationDetails", r.ImplementationDetails) + populate(objectMap, "isArchivedAction", r.IsArchivedAction) + populate(objectMap, "isExecutableAction", r.IsExecutableAction) + populate(objectMap, "isRevertableAction", r.IsRevertableAction) + populateTimeRFC3339(objectMap, "lastRefresh", r.LastRefresh) + populate(objectMap, "linkedObjects", r.LinkedObjects) + populate(objectMap, "observedImpact", r.ObservedImpact) + populate(objectMap, "recommendationReason", r.RecommendationReason) + populate(objectMap, "revertActionDuration", r.RevertActionDuration) + populate(objectMap, "revertActionInitiatedBy", r.RevertActionInitiatedBy) + populateTimeRFC3339(objectMap, "revertActionInitiatedTime", r.RevertActionInitiatedTime) + populateTimeRFC3339(objectMap, "revertActionStartTime", r.RevertActionStartTime) + populate(objectMap, "score", r.Score) + populate(objectMap, "state", r.State) + populate(objectMap, "timeSeries", r.TimeSeries) + populateTimeRFC3339(objectMap, "validSince", r.ValidSince) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionProperties. +func (r *RecommendedActionProperties) UnmarshalJSON(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 "details": + err = unpopulate(val, "Details", &r.Details) + delete(rawMsg, key) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &r.ErrorDetails) + delete(rawMsg, key) + case "estimatedImpact": + err = unpopulate(val, "EstimatedImpact", &r.EstimatedImpact) + delete(rawMsg, key) + case "executeActionDuration": + err = unpopulate(val, "ExecuteActionDuration", &r.ExecuteActionDuration) + delete(rawMsg, key) + case "executeActionInitiatedBy": + err = unpopulate(val, "ExecuteActionInitiatedBy", &r.ExecuteActionInitiatedBy) + delete(rawMsg, key) + case "executeActionInitiatedTime": + err = unpopulateTimeRFC3339(val, "ExecuteActionInitiatedTime", &r.ExecuteActionInitiatedTime) + delete(rawMsg, key) + case "executeActionStartTime": + err = unpopulateTimeRFC3339(val, "ExecuteActionStartTime", &r.ExecuteActionStartTime) + delete(rawMsg, key) + case "implementationDetails": + err = unpopulate(val, "ImplementationDetails", &r.ImplementationDetails) + delete(rawMsg, key) + case "isArchivedAction": + err = unpopulate(val, "IsArchivedAction", &r.IsArchivedAction) + delete(rawMsg, key) + case "isExecutableAction": + err = unpopulate(val, "IsExecutableAction", &r.IsExecutableAction) + delete(rawMsg, key) + case "isRevertableAction": + err = unpopulate(val, "IsRevertableAction", &r.IsRevertableAction) + delete(rawMsg, key) + case "lastRefresh": + err = unpopulateTimeRFC3339(val, "LastRefresh", &r.LastRefresh) + delete(rawMsg, key) + case "linkedObjects": + err = unpopulate(val, "LinkedObjects", &r.LinkedObjects) + delete(rawMsg, key) + case "observedImpact": + err = unpopulate(val, "ObservedImpact", &r.ObservedImpact) + delete(rawMsg, key) + case "recommendationReason": + err = unpopulate(val, "RecommendationReason", &r.RecommendationReason) + delete(rawMsg, key) + case "revertActionDuration": + err = unpopulate(val, "RevertActionDuration", &r.RevertActionDuration) + delete(rawMsg, key) + case "revertActionInitiatedBy": + err = unpopulate(val, "RevertActionInitiatedBy", &r.RevertActionInitiatedBy) + delete(rawMsg, key) + case "revertActionInitiatedTime": + err = unpopulateTimeRFC3339(val, "RevertActionInitiatedTime", &r.RevertActionInitiatedTime) + delete(rawMsg, key) + case "revertActionStartTime": + err = unpopulateTimeRFC3339(val, "RevertActionStartTime", &r.RevertActionStartTime) + delete(rawMsg, key) + case "score": + err = unpopulate(val, "Score", &r.Score) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &r.State) + delete(rawMsg, key) + case "timeSeries": + err = unpopulate(val, "TimeSeries", &r.TimeSeries) + delete(rawMsg, key) + case "validSince": + err = unpopulateTimeRFC3339(val, "ValidSince", &r.ValidSince) + 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 RecommendedActionStateInfo. +func (r RecommendedActionStateInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionInitiatedBy", r.ActionInitiatedBy) + populate(objectMap, "currentValue", r.CurrentValue) + populateTimeRFC3339(objectMap, "lastModified", r.LastModified) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionStateInfo. +func (r *RecommendedActionStateInfo) UnmarshalJSON(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 "actionInitiatedBy": + err = unpopulate(val, "ActionInitiatedBy", &r.ActionInitiatedBy) + delete(rawMsg, key) + case "currentValue": + err = unpopulate(val, "CurrentValue", &r.CurrentValue) + delete(rawMsg, key) + case "lastModified": + err = unpopulateTimeRFC3339(val, "LastModified", &r.LastModified) + 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 RecommendedSensitivityLabelUpdate. +func (r RecommendedSensitivityLabelUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedSensitivityLabelUpdate. +func (r *RecommendedSensitivityLabelUpdate) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 RecommendedSensitivityLabelUpdateList. +func (r RecommendedSensitivityLabelUpdateList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "operations", r.Operations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedSensitivityLabelUpdateList. +func (r *RecommendedSensitivityLabelUpdateList) UnmarshalJSON(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 "operations": + err = unpopulate(val, "Operations", &r.Operations) + 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 RecommendedSensitivityLabelUpdateProperties. +func (r RecommendedSensitivityLabelUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "column", r.Column) + populate(objectMap, "op", r.Op) + populate(objectMap, "schema", r.Schema) + populate(objectMap, "table", r.Table) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedSensitivityLabelUpdateProperties. +func (r *RecommendedSensitivityLabelUpdateProperties) UnmarshalJSON(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 "column": + err = unpopulate(val, "Column", &r.Column) + delete(rawMsg, key) + case "op": + err = unpopulate(val, "Op", &r.Op) + delete(rawMsg, key) + case "schema": + err = unpopulate(val, "Schema", &r.Schema) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &r.Table) + 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 RecoverableDatabase. +func (r RecoverableDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableDatabase. +func (r *RecoverableDatabase) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 RecoverableDatabaseListResult. +func (r RecoverableDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableDatabaseListResult. +func (r *RecoverableDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 RecoverableDatabaseProperties. +func (r RecoverableDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "edition", r.Edition) + populate(objectMap, "elasticPoolName", r.ElasticPoolName) + populate(objectMap, "keys", r.Keys) + populateTimeRFC3339(objectMap, "lastAvailableBackupDate", r.LastAvailableBackupDate) + populate(objectMap, "serviceLevelObjective", r.ServiceLevelObjective) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableDatabaseProperties. +func (r *RecoverableDatabaseProperties) UnmarshalJSON(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 "edition": + err = unpopulate(val, "Edition", &r.Edition) + delete(rawMsg, key) + case "elasticPoolName": + err = unpopulate(val, "ElasticPoolName", &r.ElasticPoolName) + delete(rawMsg, key) + case "keys": + err = unpopulate(val, "Keys", &r.Keys) + delete(rawMsg, key) + case "lastAvailableBackupDate": + err = unpopulateTimeRFC3339(val, "LastAvailableBackupDate", &r.LastAvailableBackupDate) + delete(rawMsg, key) + case "serviceLevelObjective": + err = unpopulate(val, "ServiceLevelObjective", &r.ServiceLevelObjective) + 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 RecoverableManagedDatabase. +func (r RecoverableManagedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableManagedDatabase. +func (r *RecoverableManagedDatabase) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 RecoverableManagedDatabaseListResult. +func (r RecoverableManagedDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableManagedDatabaseListResult. +func (r *RecoverableManagedDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 RecoverableManagedDatabaseProperties. +func (r RecoverableManagedDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "lastAvailableBackupDate", r.LastAvailableBackupDate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableManagedDatabaseProperties. +func (r *RecoverableManagedDatabaseProperties) UnmarshalJSON(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 "lastAvailableBackupDate": + err = unpopulate(val, "LastAvailableBackupDate", &r.LastAvailableBackupDate) + 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 RefreshExternalGovernanceStatusOperationResult. +func (r RefreshExternalGovernanceStatusOperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RefreshExternalGovernanceStatusOperationResult. +func (r *RefreshExternalGovernanceStatusOperationResult) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 RefreshExternalGovernanceStatusOperationResultProperties. +func (r RefreshExternalGovernanceStatusOperationResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorMessage", r.ErrorMessage) + populate(objectMap, "queuedTime", r.QueuedTime) + populate(objectMap, "requestId", r.RequestID) + populate(objectMap, "requestType", r.RequestType) + populate(objectMap, "serverName", r.ServerName) + populate(objectMap, "status", r.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RefreshExternalGovernanceStatusOperationResultProperties. +func (r *RefreshExternalGovernanceStatusOperationResultProperties) UnmarshalJSON(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 "errorMessage": + err = unpopulate(val, "ErrorMessage", &r.ErrorMessage) + delete(rawMsg, key) + case "queuedTime": + err = unpopulate(val, "QueuedTime", &r.QueuedTime) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "RequestID", &r.RequestID) + delete(rawMsg, key) + case "requestType": + err = unpopulate(val, "RequestType", &r.RequestType) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &r.ServerName) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) + 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 Remediation. +func (r Remediation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "automated", r.Automated) + populate(objectMap, "description", r.Description) + populate(objectMap, "portalLink", r.PortalLink) + populate(objectMap, "scripts", r.Scripts) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Remediation. +func (r *Remediation) UnmarshalJSON(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 "automated": + err = unpopulate(val, "Automated", &r.Automated) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + case "portalLink": + err = unpopulate(val, "PortalLink", &r.PortalLink) + delete(rawMsg, key) + case "scripts": + err = unpopulate(val, "Scripts", &r.Scripts) + 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 ReplicationLink. +func (r ReplicationLink) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationLink. +func (r *ReplicationLink) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 ReplicationLinkListResult. +func (r ReplicationLinkListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationLinkListResult. +func (r *ReplicationLinkListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 ReplicationLinkProperties. +func (r ReplicationLinkProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isTerminationAllowed", r.IsTerminationAllowed) + populate(objectMap, "linkType", r.LinkType) + populate(objectMap, "partnerDatabase", r.PartnerDatabase) + populate(objectMap, "partnerDatabaseId", r.PartnerDatabaseID) + populate(objectMap, "partnerLocation", r.PartnerLocation) + populate(objectMap, "partnerRole", r.PartnerRole) + populate(objectMap, "partnerServer", r.PartnerServer) + populate(objectMap, "percentComplete", r.PercentComplete) + populate(objectMap, "replicationMode", r.ReplicationMode) + populate(objectMap, "replicationState", r.ReplicationState) + populate(objectMap, "role", r.Role) + populateTimeRFC3339(objectMap, "startTime", r.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationLinkProperties. +func (r *ReplicationLinkProperties) UnmarshalJSON(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 "isTerminationAllowed": + err = unpopulate(val, "IsTerminationAllowed", &r.IsTerminationAllowed) + delete(rawMsg, key) + case "linkType": + err = unpopulate(val, "LinkType", &r.LinkType) + delete(rawMsg, key) + case "partnerDatabase": + err = unpopulate(val, "PartnerDatabase", &r.PartnerDatabase) + delete(rawMsg, key) + case "partnerDatabaseId": + err = unpopulate(val, "PartnerDatabaseID", &r.PartnerDatabaseID) + delete(rawMsg, key) + case "partnerLocation": + err = unpopulate(val, "PartnerLocation", &r.PartnerLocation) + delete(rawMsg, key) + case "partnerRole": + err = unpopulate(val, "PartnerRole", &r.PartnerRole) + delete(rawMsg, key) + case "partnerServer": + err = unpopulate(val, "PartnerServer", &r.PartnerServer) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &r.PercentComplete) + delete(rawMsg, key) + case "replicationMode": + err = unpopulate(val, "ReplicationMode", &r.ReplicationMode) + delete(rawMsg, key) + case "replicationState": + err = unpopulate(val, "ReplicationState", &r.ReplicationState) + delete(rawMsg, key) + case "role": + err = unpopulate(val, "Role", &r.Role) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &r.StartTime) + 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 Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 ResourceIdentity. +func (r ResourceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", r.PrincipalID) + populate(objectMap, "tenantId", r.TenantID) + populate(objectMap, "type", r.Type) + populate(objectMap, "userAssignedIdentities", r.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceIdentity. +func (r *ResourceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &r.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &r.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &r.UserAssignedIdentities) + 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 ResourceMoveDefinition. +func (r ResourceMoveDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceMoveDefinition. +func (r *ResourceMoveDefinition) UnmarshalJSON(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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceWithWritableName. +func (r ResourceWithWritableName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 ResourceWithWritableName. +func (r *ResourceWithWritableName) UnmarshalJSON(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 RestorableDroppedDatabase. +func (r RestorableDroppedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "sku", r.SKU) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedDatabase. +func (r *RestorableDroppedDatabase) UnmarshalJSON(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 "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &r.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + 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 RestorableDroppedDatabaseListResult. +func (r RestorableDroppedDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedDatabaseListResult. +func (r *RestorableDroppedDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 RestorableDroppedDatabaseProperties. +func (r RestorableDroppedDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupStorageRedundancy", r.BackupStorageRedundancy) + populateTimeRFC3339(objectMap, "creationDate", r.CreationDate) + populate(objectMap, "databaseName", r.DatabaseName) + populateTimeRFC3339(objectMap, "deletionDate", r.DeletionDate) + populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) + populate(objectMap, "keys", r.Keys) + populate(objectMap, "maxSizeBytes", r.MaxSizeBytes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedDatabaseProperties. +func (r *RestorableDroppedDatabaseProperties) UnmarshalJSON(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 "backupStorageRedundancy": + err = unpopulate(val, "BackupStorageRedundancy", &r.BackupStorageRedundancy) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &r.CreationDate) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &r.DatabaseName) + delete(rawMsg, key) + case "deletionDate": + err = unpopulateTimeRFC3339(val, "DeletionDate", &r.DeletionDate) + delete(rawMsg, key) + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) + delete(rawMsg, key) + case "keys": + err = unpopulate(val, "Keys", &r.Keys) + delete(rawMsg, key) + case "maxSizeBytes": + err = unpopulate(val, "MaxSizeBytes", &r.MaxSizeBytes) + 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 RestorableDroppedManagedDatabase. +func (r RestorableDroppedManagedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedManagedDatabase. +func (r *RestorableDroppedManagedDatabase) UnmarshalJSON(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 "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) + 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 RestorableDroppedManagedDatabaseListResult. +func (r RestorableDroppedManagedDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedManagedDatabaseListResult. +func (r *RestorableDroppedManagedDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 RestorableDroppedManagedDatabaseProperties. +func (r RestorableDroppedManagedDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "creationDate", r.CreationDate) + populate(objectMap, "databaseName", r.DatabaseName) + populateTimeRFC3339(objectMap, "deletionDate", r.DeletionDate) + populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedManagedDatabaseProperties. +func (r *RestorableDroppedManagedDatabaseProperties) UnmarshalJSON(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 "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &r.CreationDate) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &r.DatabaseName) + delete(rawMsg, key) + case "deletionDate": + err = unpopulateTimeRFC3339(val, "DeletionDate", &r.DeletionDate) + delete(rawMsg, key) + case "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) + 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 RestorePoint. +func (r RestorePoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePoint. +func (r *RestorePoint) UnmarshalJSON(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 "location": + err = unpopulate(val, "Location", &r.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 RestorePointListResult. +func (r RestorePointListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointListResult. +func (r *RestorePointListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &r.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &r.Value) + 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 RestorePointProperties. +func (r RestorePointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) + populateTimeRFC3339(objectMap, "restorePointCreationDate", r.RestorePointCreationDate) + populate(objectMap, "restorePointLabel", r.RestorePointLabel) + populate(objectMap, "restorePointType", r.RestorePointType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointProperties. +func (r *RestorePointProperties) UnmarshalJSON(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 "earliestRestoreDate": + err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) + delete(rawMsg, key) + case "restorePointCreationDate": + err = unpopulateTimeRFC3339(val, "RestorePointCreationDate", &r.RestorePointCreationDate) + delete(rawMsg, key) + case "restorePointLabel": + err = unpopulate(val, "RestorePointLabel", &r.RestorePointLabel) + delete(rawMsg, key) + case "restorePointType": + err = unpopulate(val, "RestorePointType", &r.RestorePointType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "family", s.Family) + populate(objectMap, "name", s.Name) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &s.Family) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ScheduleItem. +func (s ScheduleItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "startDay", s.StartDay) + populate(objectMap, "startTime", s.StartTime) + populate(objectMap, "stopDay", s.StopDay) + populate(objectMap, "stopTime", s.StopTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ScheduleItem. +func (s *ScheduleItem) UnmarshalJSON(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 "startDay": + err = unpopulate(val, "StartDay", &s.StartDay) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &s.StartTime) + delete(rawMsg, key) + case "stopDay": + err = unpopulate(val, "StopDay", &s.StopDay) + delete(rawMsg, key) + case "stopTime": + err = unpopulate(val, "StopTime", &s.StopTime) + 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 SecurityAlertPolicyProperties. +func (s SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "creationTime", s.CreationTime) + populate(objectMap, "disabledAlerts", s.DisabledAlerts) + populate(objectMap, "emailAccountAdmins", s.EmailAccountAdmins) + populate(objectMap, "emailAddresses", s.EmailAddresses) + populate(objectMap, "retentionDays", s.RetentionDays) + populate(objectMap, "state", s.State) + populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) + populate(objectMap, "storageEndpoint", s.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertPolicyProperties. +func (s *SecurityAlertPolicyProperties) UnmarshalJSON(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 "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) + delete(rawMsg, key) + case "disabledAlerts": + err = unpopulate(val, "DisabledAlerts", &s.DisabledAlerts) + delete(rawMsg, key) + case "emailAccountAdmins": + err = unpopulate(val, "EmailAccountAdmins", &s.EmailAccountAdmins) + delete(rawMsg, key) + case "emailAddresses": + err = unpopulate(val, "EmailAddresses", &s.EmailAddresses) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &s.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + 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 SecurityAlertsPolicyProperties. +func (s SecurityAlertsPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "creationTime", s.CreationTime) + populate(objectMap, "disabledAlerts", s.DisabledAlerts) + populate(objectMap, "emailAccountAdmins", s.EmailAccountAdmins) + populate(objectMap, "emailAddresses", s.EmailAddresses) + populate(objectMap, "retentionDays", s.RetentionDays) + populate(objectMap, "state", s.State) + populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) + populate(objectMap, "storageEndpoint", s.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertsPolicyProperties. +func (s *SecurityAlertsPolicyProperties) UnmarshalJSON(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 "creationTime": + err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) + delete(rawMsg, key) + case "disabledAlerts": + err = unpopulate(val, "DisabledAlerts", &s.DisabledAlerts) + delete(rawMsg, key) + case "emailAccountAdmins": + err = unpopulate(val, "EmailAccountAdmins", &s.EmailAccountAdmins) + delete(rawMsg, key) + case "emailAddresses": + err = unpopulate(val, "EmailAddresses", &s.EmailAddresses) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &s.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + 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 SecurityEvent. +func (s SecurityEvent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEvent. +func (s *SecurityEvent) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityEventCollection. +func (s SecurityEventCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventCollection. +func (s *SecurityEventCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SecurityEventProperties. +func (s SecurityEventProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "applicationName", s.ApplicationName) + populate(objectMap, "clientIp", s.ClientIP) + populate(objectMap, "database", s.Database) + populateTimeRFC3339(objectMap, "eventTime", s.EventTime) + populate(objectMap, "principalName", s.PrincipalName) + populate(objectMap, "securityEventSqlInjectionAdditionalProperties", s.SecurityEventSQLInjectionAdditionalProperties) + populate(objectMap, "securityEventType", s.SecurityEventType) + populate(objectMap, "server", s.Server) + populate(objectMap, "subscription", s.Subscription) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventProperties. +func (s *SecurityEventProperties) UnmarshalJSON(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 "applicationName": + err = unpopulate(val, "ApplicationName", &s.ApplicationName) + delete(rawMsg, key) + case "clientIp": + err = unpopulate(val, "ClientIP", &s.ClientIP) + delete(rawMsg, key) + case "database": + err = unpopulate(val, "Database", &s.Database) + delete(rawMsg, key) + case "eventTime": + err = unpopulateTimeRFC3339(val, "EventTime", &s.EventTime) + delete(rawMsg, key) + case "principalName": + err = unpopulate(val, "PrincipalName", &s.PrincipalName) + delete(rawMsg, key) + case "securityEventSqlInjectionAdditionalProperties": + err = unpopulate(val, "SecurityEventSQLInjectionAdditionalProperties", &s.SecurityEventSQLInjectionAdditionalProperties) + delete(rawMsg, key) + case "securityEventType": + err = unpopulate(val, "SecurityEventType", &s.SecurityEventType) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &s.Server) + delete(rawMsg, key) + case "subscription": + err = unpopulate(val, "Subscription", &s.Subscription) + 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 SecurityEventSQLInjectionAdditionalProperties. +func (s SecurityEventSQLInjectionAdditionalProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorCode", s.ErrorCode) + populate(objectMap, "errorMessage", s.ErrorMessage) + populate(objectMap, "errorSeverity", s.ErrorSeverity) + populate(objectMap, "statement", s.Statement) + populate(objectMap, "statementHighlightLength", s.StatementHighlightLength) + populate(objectMap, "statementHighlightOffset", s.StatementHighlightOffset) + populate(objectMap, "threatId", s.ThreatID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventSQLInjectionAdditionalProperties. +func (s *SecurityEventSQLInjectionAdditionalProperties) UnmarshalJSON(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 "errorCode": + err = unpopulate(val, "ErrorCode", &s.ErrorCode) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &s.ErrorMessage) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &s.ErrorSeverity) + delete(rawMsg, key) + case "statement": + err = unpopulate(val, "Statement", &s.Statement) + delete(rawMsg, key) + case "statementHighlightLength": + err = unpopulate(val, "StatementHighlightLength", &s.StatementHighlightLength) + delete(rawMsg, key) + case "statementHighlightOffset": + err = unpopulate(val, "StatementHighlightOffset", &s.StatementHighlightOffset) + delete(rawMsg, key) + case "threatId": + err = unpopulate(val, "ThreatID", &s.ThreatID) + 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 SecurityEventsFilterParameters. +func (s SecurityEventsFilterParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "eventTime", s.EventTime) + populate(objectMap, "showServerRecords", s.ShowServerRecords) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventsFilterParameters. +func (s *SecurityEventsFilterParameters) UnmarshalJSON(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 "eventTime": + err = unpopulateTimeRFC3339(val, "EventTime", &s.EventTime) + delete(rawMsg, key) + case "showServerRecords": + err = unpopulate(val, "ShowServerRecords", &s.ShowServerRecords) + 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 SensitivityLabel. +func (s SensitivityLabel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "managedBy", s.ManagedBy) + 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 SensitivityLabel. +func (s *SensitivityLabel) UnmarshalJSON(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 "managedBy": + err = unpopulate(val, "ManagedBy", &s.ManagedBy) + 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 SensitivityLabelListResult. +func (s SensitivityLabelListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelListResult. +func (s *SensitivityLabelListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelProperties. +func (s SensitivityLabelProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "columnName", s.ColumnName) + populate(objectMap, "informationType", s.InformationType) + populate(objectMap, "informationTypeId", s.InformationTypeID) + populate(objectMap, "isDisabled", s.IsDisabled) + populate(objectMap, "labelId", s.LabelID) + populate(objectMap, "labelName", s.LabelName) + populate(objectMap, "rank", s.Rank) + populate(objectMap, "schemaName", s.SchemaName) + populate(objectMap, "tableName", s.TableName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelProperties. +func (s *SensitivityLabelProperties) UnmarshalJSON(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 "columnName": + err = unpopulate(val, "ColumnName", &s.ColumnName) + delete(rawMsg, key) + case "informationType": + err = unpopulate(val, "InformationType", &s.InformationType) + delete(rawMsg, key) + case "informationTypeId": + err = unpopulate(val, "InformationTypeID", &s.InformationTypeID) + delete(rawMsg, key) + case "isDisabled": + err = unpopulate(val, "IsDisabled", &s.IsDisabled) + delete(rawMsg, key) + case "labelId": + err = unpopulate(val, "LabelID", &s.LabelID) + delete(rawMsg, key) + case "labelName": + err = unpopulate(val, "LabelName", &s.LabelName) + delete(rawMsg, key) + case "rank": + err = unpopulate(val, "Rank", &s.Rank) + delete(rawMsg, key) + case "schemaName": + err = unpopulate(val, "SchemaName", &s.SchemaName) + delete(rawMsg, key) + case "tableName": + err = unpopulate(val, "TableName", &s.TableName) + 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 SensitivityLabelUpdate. +func (s SensitivityLabelUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelUpdate. +func (s *SensitivityLabelUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SensitivityLabelUpdateList. +func (s SensitivityLabelUpdateList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "operations", s.Operations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelUpdateList. +func (s *SensitivityLabelUpdateList) UnmarshalJSON(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 "operations": + err = unpopulate(val, "Operations", &s.Operations) + 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 SensitivityLabelUpdateProperties. +func (s SensitivityLabelUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "column", s.Column) + populate(objectMap, "op", s.Op) + populate(objectMap, "schema", s.Schema) + populate(objectMap, "sensitivityLabel", s.SensitivityLabel) + populate(objectMap, "table", s.Table) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SensitivityLabelUpdateProperties. +func (s *SensitivityLabelUpdateProperties) UnmarshalJSON(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 "column": + err = unpopulate(val, "Column", &s.Column) + delete(rawMsg, key) + case "op": + err = unpopulate(val, "Op", &s.Op) + delete(rawMsg, key) + case "schema": + err = unpopulate(val, "Schema", &s.Schema) + delete(rawMsg, key) + case "sensitivityLabel": + err = unpopulate(val, "SensitivityLabel", &s.SensitivityLabel) + delete(rawMsg, key) + case "table": + err = unpopulate(val, "Table", &s.Table) + 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 Server. +func (s Server) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "location", s.Location) + 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 Server. +func (s *Server) UnmarshalJSON(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 "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + 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 ServerAdvancedThreatProtection. +func (s ServerAdvancedThreatProtection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAdvancedThreatProtection. +func (s *ServerAdvancedThreatProtection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerAutomaticTuning. +func (s ServerAutomaticTuning) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAutomaticTuning. +func (s *ServerAutomaticTuning) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerAzureADAdministrator. +func (s ServerAzureADAdministrator) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAzureADAdministrator. +func (s *ServerAzureADAdministrator) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerAzureADOnlyAuthentication. +func (s ServerAzureADOnlyAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerAzureADOnlyAuthentication. +func (s *ServerAzureADOnlyAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicy. +func (s ServerBlobAuditingPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicy. +func (s *ServerBlobAuditingPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyListResult. +func (s ServerBlobAuditingPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicyListResult. +func (s *ServerBlobAuditingPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyProperties. +func (s ServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "auditActionsAndGroups", s.AuditActionsAndGroups) + populate(objectMap, "isAzureMonitorTargetEnabled", s.IsAzureMonitorTargetEnabled) + populate(objectMap, "isDevopsAuditEnabled", s.IsDevopsAuditEnabled) + populate(objectMap, "isManagedIdentityInUse", s.IsManagedIdentityInUse) + populate(objectMap, "isStorageSecondaryKeyInUse", s.IsStorageSecondaryKeyInUse) + populate(objectMap, "queueDelayMs", s.QueueDelayMs) + populate(objectMap, "retentionDays", s.RetentionDays) + populate(objectMap, "state", s.State) + populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) + populate(objectMap, "storageAccountSubscriptionId", s.StorageAccountSubscriptionID) + populate(objectMap, "storageEndpoint", s.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerBlobAuditingPolicyProperties. +func (s *ServerBlobAuditingPolicyProperties) UnmarshalJSON(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 "auditActionsAndGroups": + err = unpopulate(val, "AuditActionsAndGroups", &s.AuditActionsAndGroups) + delete(rawMsg, key) + case "isAzureMonitorTargetEnabled": + err = unpopulate(val, "IsAzureMonitorTargetEnabled", &s.IsAzureMonitorTargetEnabled) + delete(rawMsg, key) + case "isDevopsAuditEnabled": + err = unpopulate(val, "IsDevopsAuditEnabled", &s.IsDevopsAuditEnabled) + delete(rawMsg, key) + case "isManagedIdentityInUse": + err = unpopulate(val, "IsManagedIdentityInUse", &s.IsManagedIdentityInUse) + delete(rawMsg, key) + case "isStorageSecondaryKeyInUse": + err = unpopulate(val, "IsStorageSecondaryKeyInUse", &s.IsStorageSecondaryKeyInUse) + delete(rawMsg, key) + case "queueDelayMs": + err = unpopulate(val, "QueueDelayMs", &s.QueueDelayMs) + delete(rawMsg, key) + case "retentionDays": + err = unpopulate(val, "RetentionDays", &s.RetentionDays) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageAccountSubscriptionId": + err = unpopulate(val, "StorageAccountSubscriptionID", &s.StorageAccountSubscriptionID) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + 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 ServerConfigurationOption. +func (s ServerConfigurationOption) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConfigurationOption. +func (s *ServerConfigurationOption) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerConfigurationOptionListResult. +func (s ServerConfigurationOptionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConfigurationOptionListResult. +func (s *ServerConfigurationOptionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerConfigurationOptionProperties. +func (s ServerConfigurationOptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "serverConfigurationOptionValue", s.ServerConfigurationOptionValue) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConfigurationOptionProperties. +func (s *ServerConfigurationOptionProperties) UnmarshalJSON(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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "serverConfigurationOptionValue": + err = unpopulate(val, "ServerConfigurationOptionValue", &s.ServerConfigurationOptionValue) + 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 ServerConnectionPolicy. +func (s ServerConnectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "location", s.Location) + 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 ServerConnectionPolicy. +func (s *ServerConnectionPolicy) UnmarshalJSON(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 "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + 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 ServerConnectionPolicyListResult. +func (s ServerConnectionPolicyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConnectionPolicyListResult. +func (s *ServerConnectionPolicyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerConnectionPolicyProperties. +func (s ServerConnectionPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionType", s.ConnectionType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerConnectionPolicyProperties. +func (s *ServerConnectionPolicyProperties) UnmarshalJSON(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 "connectionType": + err = unpopulate(val, "ConnectionType", &s.ConnectionType) + 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 ServerDNSAlias. +func (s ServerDNSAlias) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDNSAlias. +func (s *ServerDNSAlias) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerDNSAliasAcquisition. +func (s ServerDNSAliasAcquisition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "oldServerDnsAliasId", s.OldServerDNSAliasID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDNSAliasAcquisition. +func (s *ServerDNSAliasAcquisition) UnmarshalJSON(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 "oldServerDnsAliasId": + err = unpopulate(val, "OldServerDNSAliasID", &s.OldServerDNSAliasID) + 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 ServerDNSAliasListResult. +func (s ServerDNSAliasListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDNSAliasListResult. +func (s *ServerDNSAliasListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerDNSAliasProperties. +func (s ServerDNSAliasProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureDnsRecord", s.AzureDNSRecord) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDNSAliasProperties. +func (s *ServerDNSAliasProperties) UnmarshalJSON(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 "azureDnsRecord": + err = unpopulate(val, "AzureDNSRecord", &s.AzureDNSRecord) + 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 ServerDevOpsAuditSettingsListResult. +func (s ServerDevOpsAuditSettingsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDevOpsAuditSettingsListResult. +func (s *ServerDevOpsAuditSettingsListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerDevOpsAuditSettingsProperties. +func (s ServerDevOpsAuditSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isAzureMonitorTargetEnabled", s.IsAzureMonitorTargetEnabled) + populate(objectMap, "isManagedIdentityInUse", s.IsManagedIdentityInUse) + populate(objectMap, "state", s.State) + populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) + populate(objectMap, "storageAccountSubscriptionId", s.StorageAccountSubscriptionID) + populate(objectMap, "storageEndpoint", s.StorageEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDevOpsAuditSettingsProperties. +func (s *ServerDevOpsAuditSettingsProperties) UnmarshalJSON(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 "isAzureMonitorTargetEnabled": + err = unpopulate(val, "IsAzureMonitorTargetEnabled", &s.IsAzureMonitorTargetEnabled) + delete(rawMsg, key) + case "isManagedIdentityInUse": + err = unpopulate(val, "IsManagedIdentityInUse", &s.IsManagedIdentityInUse) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageAccountSubscriptionId": + err = unpopulate(val, "StorageAccountSubscriptionID", &s.StorageAccountSubscriptionID) + delete(rawMsg, key) + case "storageEndpoint": + err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) + 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 ServerDevOpsAuditingSettings. +func (s ServerDevOpsAuditingSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerDevOpsAuditingSettings. +func (s *ServerDevOpsAuditingSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerExternalAdministrator. +func (s ServerExternalAdministrator) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorType", s.AdministratorType) + populate(objectMap, "azureADOnlyAuthentication", s.AzureADOnlyAuthentication) + populate(objectMap, "login", s.Login) + populate(objectMap, "principalType", s.PrincipalType) + populate(objectMap, "sid", s.Sid) + populate(objectMap, "tenantId", s.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerExternalAdministrator. +func (s *ServerExternalAdministrator) UnmarshalJSON(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 "administratorType": + err = unpopulate(val, "AdministratorType", &s.AdministratorType) + delete(rawMsg, key) + case "azureADOnlyAuthentication": + err = unpopulate(val, "AzureADOnlyAuthentication", &s.AzureADOnlyAuthentication) + delete(rawMsg, key) + case "login": + err = unpopulate(val, "Login", &s.Login) + delete(rawMsg, key) + case "principalType": + err = unpopulate(val, "PrincipalType", &s.PrincipalType) + delete(rawMsg, key) + case "sid": + err = unpopulate(val, "Sid", &s.Sid) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerFirewallRuleProperties. +func (s ServerFirewallRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "endIpAddress", s.EndIPAddress) + populate(objectMap, "startIpAddress", s.StartIPAddress) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerFirewallRuleProperties. +func (s *ServerFirewallRuleProperties) UnmarshalJSON(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 "endIpAddress": + err = unpopulate(val, "EndIPAddress", &s.EndIPAddress) + delete(rawMsg, key) + case "startIpAddress": + err = unpopulate(val, "StartIPAddress", &s.StartIPAddress) + 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 ServerInfo. +func (s ServerInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serverId", s.ServerID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerInfo. +func (s *ServerInfo) UnmarshalJSON(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 "serverId": + err = unpopulate(val, "ServerID", &s.ServerID) + 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 ServerKey. +func (s ServerKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "location", s.Location) + 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 ServerKey. +func (s *ServerKey) UnmarshalJSON(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 "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + 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 ServerKeyListResult. +func (s ServerKeyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyListResult. +func (s *ServerKeyListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerKeyProperties. +func (s ServerKeyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "autoRotationEnabled", s.AutoRotationEnabled) + populateTimeRFC3339(objectMap, "creationDate", s.CreationDate) + populate(objectMap, "serverKeyType", s.ServerKeyType) + populate(objectMap, "subregion", s.Subregion) + populate(objectMap, "thumbprint", s.Thumbprint) + populate(objectMap, "uri", s.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyProperties. +func (s *ServerKeyProperties) UnmarshalJSON(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 "autoRotationEnabled": + err = unpopulate(val, "AutoRotationEnabled", &s.AutoRotationEnabled) + delete(rawMsg, key) + case "creationDate": + err = unpopulateTimeRFC3339(val, "CreationDate", &s.CreationDate) + delete(rawMsg, key) + case "serverKeyType": + err = unpopulate(val, "ServerKeyType", &s.ServerKeyType) + delete(rawMsg, key) + case "subregion": + err = unpopulate(val, "Subregion", &s.Subregion) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &s.Thumbprint) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, "URI", &s.URI) + 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 ServerListResult. +func (s ServerListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerListResult. +func (s *ServerListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerOperation. +func (s ServerOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerOperation. +func (s *ServerOperation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerOperationListResult. +func (s ServerOperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerOperationListResult. +func (s *ServerOperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerOperationProperties. +func (s ServerOperationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", s.Description) + populate(objectMap, "errorCode", s.ErrorCode) + populate(objectMap, "errorDescription", s.ErrorDescription) + populate(objectMap, "errorSeverity", s.ErrorSeverity) + populateTimeRFC3339(objectMap, "estimatedCompletionTime", s.EstimatedCompletionTime) + populate(objectMap, "isCancellable", s.IsCancellable) + populate(objectMap, "isUserError", s.IsUserError) + populate(objectMap, "operation", s.Operation) + populate(objectMap, "operationFriendlyName", s.OperationFriendlyName) + populate(objectMap, "percentComplete", s.PercentComplete) + populate(objectMap, "serverName", s.ServerName) + populateTimeRFC3339(objectMap, "startTime", s.StartTime) + populate(objectMap, "state", s.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerOperationProperties. +func (s *ServerOperationProperties) UnmarshalJSON(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 "errorCode": + err = unpopulate(val, "ErrorCode", &s.ErrorCode) + delete(rawMsg, key) + case "errorDescription": + err = unpopulate(val, "ErrorDescription", &s.ErrorDescription) + delete(rawMsg, key) + case "errorSeverity": + err = unpopulate(val, "ErrorSeverity", &s.ErrorSeverity) + delete(rawMsg, key) + case "estimatedCompletionTime": + err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &s.EstimatedCompletionTime) + delete(rawMsg, key) + case "isCancellable": + err = unpopulate(val, "IsCancellable", &s.IsCancellable) + delete(rawMsg, key) + case "isUserError": + err = unpopulate(val, "IsUserError", &s.IsUserError) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &s.Operation) + delete(rawMsg, key) + case "operationFriendlyName": + err = unpopulate(val, "OperationFriendlyName", &s.OperationFriendlyName) + delete(rawMsg, key) + case "percentComplete": + err = unpopulate(val, "PercentComplete", &s.PercentComplete) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &s.ServerName) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &s.StartTime) + 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 ServerPrivateEndpointConnection. +func (s ServerPrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerPrivateEndpointConnection. +func (s *ServerPrivateEndpointConnection) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &s.Properties) + 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 ServerProperties. +func (s ServerProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "administratorLogin", s.AdministratorLogin) + populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) + populate(objectMap, "administrators", s.Administrators) + populate(objectMap, "externalGovernanceStatus", s.ExternalGovernanceStatus) + populate(objectMap, "federatedClientId", s.FederatedClientID) + populate(objectMap, "fullyQualifiedDomainName", s.FullyQualifiedDomainName) + populate(objectMap, "keyId", s.KeyID) + populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) + populate(objectMap, "primaryUserAssignedIdentityId", s.PrimaryUserAssignedIdentityID) + populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "restrictOutboundNetworkAccess", s.RestrictOutboundNetworkAccess) + populate(objectMap, "state", s.State) + populate(objectMap, "version", s.Version) + populate(objectMap, "workspaceFeature", s.WorkspaceFeature) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerProperties. +func (s *ServerProperties) UnmarshalJSON(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 "administratorLogin": + err = unpopulate(val, "AdministratorLogin", &s.AdministratorLogin) + delete(rawMsg, key) + case "administratorLoginPassword": + err = unpopulate(val, "AdministratorLoginPassword", &s.AdministratorLoginPassword) + delete(rawMsg, key) + case "administrators": + err = unpopulate(val, "Administrators", &s.Administrators) + delete(rawMsg, key) + case "externalGovernanceStatus": + err = unpopulate(val, "ExternalGovernanceStatus", &s.ExternalGovernanceStatus) + delete(rawMsg, key) + case "federatedClientId": + err = unpopulate(val, "FederatedClientID", &s.FederatedClientID) + delete(rawMsg, key) + case "fullyQualifiedDomainName": + err = unpopulate(val, "FullyQualifiedDomainName", &s.FullyQualifiedDomainName) + delete(rawMsg, key) + case "keyId": + err = unpopulate(val, "KeyID", &s.KeyID) + delete(rawMsg, key) + case "minimalTlsVersion": + err = unpopulate(val, "MinimalTLSVersion", &s.MinimalTLSVersion) + delete(rawMsg, key) + case "primaryUserAssignedIdentityId": + err = unpopulate(val, "PrimaryUserAssignedIdentityID", &s.PrimaryUserAssignedIdentityID) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "restrictOutboundNetworkAccess": + err = unpopulate(val, "RestrictOutboundNetworkAccess", &s.RestrictOutboundNetworkAccess) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &s.Version) + delete(rawMsg, key) + case "workspaceFeature": + err = unpopulate(val, "WorkspaceFeature", &s.WorkspaceFeature) + 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 ServerSecurityAlertPolicy. +func (s ServerSecurityAlertPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerSecurityAlertPolicy. +func (s *ServerSecurityAlertPolicy) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerTrustCertificate. +func (s ServerTrustCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerTrustCertificate. +func (s *ServerTrustCertificate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerTrustCertificateProperties. +func (s ServerTrustCertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificateName", s.CertificateName) + populate(objectMap, "publicBlob", s.PublicBlob) + populate(objectMap, "thumbprint", s.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerTrustCertificateProperties. +func (s *ServerTrustCertificateProperties) UnmarshalJSON(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 "certificateName": + err = unpopulate(val, "CertificateName", &s.CertificateName) + delete(rawMsg, key) + case "publicBlob": + err = unpopulate(val, "PublicBlob", &s.PublicBlob) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &s.Thumbprint) + 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 ServerTrustCertificatesListResult. +func (s ServerTrustCertificatesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerTrustCertificatesListResult. +func (s *ServerTrustCertificatesListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroup. +func (s ServerTrustGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerTrustGroup. +func (s *ServerTrustGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroupListResult. +func (s ServerTrustGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerTrustGroupListResult. +func (s *ServerTrustGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroupProperties. +func (s ServerTrustGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupMembers", s.GroupMembers) + populate(objectMap, "trustScopes", s.TrustScopes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerTrustGroupProperties. +func (s *ServerTrustGroupProperties) UnmarshalJSON(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 "groupMembers": + err = unpopulate(val, "GroupMembers", &s.GroupMembers) + delete(rawMsg, key) + case "trustScopes": + err = unpopulate(val, "TrustScopes", &s.TrustScopes) + 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 ServerUpdate. +func (s ServerUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "tags", s.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUpdate. +func (s *ServerUpdate) UnmarshalJSON(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 "identity": + err = unpopulate(val, "Identity", &s.Identity) + 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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerUsage. +func (s ServerUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUsage. +func (s *ServerUsage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerUsageListResult. +func (s ServerUsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUsageListResult. +func (s *ServerUsageListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerUsageProperties. +func (s ServerUsageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentValue", s.CurrentValue) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "limit", s.Limit) + populate(objectMap, "unit", s.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUsageProperties. +func (s *ServerUsageProperties) UnmarshalJSON(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 "currentValue": + err = unpopulate(val, "CurrentValue", &s.CurrentValue) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &s.Limit) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &s.Unit) + 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 ServerVersionCapability. +func (s ServerVersionCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "status", s.Status) + populate(objectMap, "supportedEditions", s.SupportedEditions) + populate(objectMap, "supportedElasticPoolEditions", s.SupportedElasticPoolEditions) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVersionCapability. +func (s *ServerVersionCapability) UnmarshalJSON(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 "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "supportedEditions": + err = unpopulate(val, "SupportedEditions", &s.SupportedEditions) + delete(rawMsg, key) + case "supportedElasticPoolEditions": + err = unpopulate(val, "SupportedElasticPoolEditions", &s.SupportedElasticPoolEditions) + 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 ServerVulnerabilityAssessment. +func (s ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessment. +func (s *ServerVulnerabilityAssessment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentListResult. +func (s ServerVulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessmentListResult. +func (s *ServerVulnerabilityAssessmentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServerVulnerabilityAssessmentProperties. +func (s ServerVulnerabilityAssessmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "recurringScans", s.RecurringScans) + populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) + populate(objectMap, "storageContainerPath", s.StorageContainerPath) + populate(objectMap, "storageContainerSasKey", s.StorageContainerSasKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServerVulnerabilityAssessmentProperties. +func (s *ServerVulnerabilityAssessmentProperties) UnmarshalJSON(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 "recurringScans": + err = unpopulate(val, "RecurringScans", &s.RecurringScans) + delete(rawMsg, key) + case "storageAccountAccessKey": + err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) + delete(rawMsg, key) + case "storageContainerPath": + err = unpopulate(val, "StorageContainerPath", &s.StorageContainerPath) + delete(rawMsg, key) + case "storageContainerSasKey": + err = unpopulate(val, "StorageContainerSasKey", &s.StorageContainerSasKey) + 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 ServiceObjectiveCapability. +func (s ServiceObjectiveCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "computeModel", s.ComputeModel) + populate(objectMap, "id", s.ID) + populate(objectMap, "includedMaxSize", s.IncludedMaxSize) + populate(objectMap, "name", s.Name) + populate(objectMap, "performanceLevel", s.PerformanceLevel) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "status", s.Status) + populate(objectMap, "supportedAutoPauseDelay", s.SupportedAutoPauseDelay) + populate(objectMap, "supportedLicenseTypes", s.SupportedLicenseTypes) + populate(objectMap, "supportedMaintenanceConfigurations", s.SupportedMaintenanceConfigurations) + populate(objectMap, "supportedMaxSizes", s.SupportedMaxSizes) + populate(objectMap, "supportedMinCapacities", s.SupportedMinCapacities) + populate(objectMap, "zonePinning", s.ZonePinning) + populate(objectMap, "zoneRedundant", s.ZoneRedundant) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceObjectiveCapability. +func (s *ServiceObjectiveCapability) UnmarshalJSON(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 "computeModel": + err = unpopulate(val, "ComputeModel", &s.ComputeModel) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "includedMaxSize": + err = unpopulate(val, "IncludedMaxSize", &s.IncludedMaxSize) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "performanceLevel": + err = unpopulate(val, "PerformanceLevel", &s.PerformanceLevel) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "supportedAutoPauseDelay": + err = unpopulate(val, "SupportedAutoPauseDelay", &s.SupportedAutoPauseDelay) + delete(rawMsg, key) + case "supportedLicenseTypes": + err = unpopulate(val, "SupportedLicenseTypes", &s.SupportedLicenseTypes) + delete(rawMsg, key) + case "supportedMaintenanceConfigurations": + err = unpopulate(val, "SupportedMaintenanceConfigurations", &s.SupportedMaintenanceConfigurations) + delete(rawMsg, key) + case "supportedMaxSizes": + err = unpopulate(val, "SupportedMaxSizes", &s.SupportedMaxSizes) + delete(rawMsg, key) + case "supportedMinCapacities": + err = unpopulate(val, "SupportedMinCapacities", &s.SupportedMinCapacities) + delete(rawMsg, key) + case "zonePinning": + err = unpopulate(val, "ZonePinning", &s.ZonePinning) + delete(rawMsg, key) + case "zoneRedundant": + err = unpopulate(val, "ZoneRedundant", &s.ZoneRedundant) + 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 ServicePrincipal. +func (s ServicePrincipal) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", s.ClientID) + populate(objectMap, "principalId", s.PrincipalID) + populate(objectMap, "tenantId", s.TenantID) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServicePrincipal. +func (s *ServicePrincipal) UnmarshalJSON(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 "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &s.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) + 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 StartStopManagedInstanceSchedule. +func (s StartStopManagedInstanceSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StartStopManagedInstanceSchedule. +func (s *StartStopManagedInstanceSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StartStopManagedInstanceScheduleListResult. +func (s StartStopManagedInstanceScheduleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StartStopManagedInstanceScheduleListResult. +func (s *StartStopManagedInstanceScheduleListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StartStopManagedInstanceScheduleProperties. +func (s StartStopManagedInstanceScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", s.Description) + populate(objectMap, "nextExecutionTime", s.NextExecutionTime) + populate(objectMap, "nextRunAction", s.NextRunAction) + populate(objectMap, "scheduleList", s.ScheduleList) + populate(objectMap, "timeZoneId", s.TimeZoneID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StartStopManagedInstanceScheduleProperties. +func (s *StartStopManagedInstanceScheduleProperties) UnmarshalJSON(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 "nextExecutionTime": + err = unpopulate(val, "NextExecutionTime", &s.NextExecutionTime) + delete(rawMsg, key) + case "nextRunAction": + err = unpopulate(val, "NextRunAction", &s.NextRunAction) + delete(rawMsg, key) + case "scheduleList": + err = unpopulate(val, "ScheduleList", &s.ScheduleList) + delete(rawMsg, key) + case "timeZoneId": + err = unpopulate(val, "TimeZoneID", &s.TimeZoneID) + 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 StorageCapability. +func (s StorageCapability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "reason", s.Reason) + populate(objectMap, "status", s.Status) + populate(objectMap, "storageAccountType", s.StorageAccountType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StorageCapability. +func (s *StorageCapability) UnmarshalJSON(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 "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &s.Status) + delete(rawMsg, key) + case "storageAccountType": + err = unpopulate(val, "StorageAccountType", &s.StorageAccountType) + 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 SubscriptionUsage. +func (s SubscriptionUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUsage. +func (s *SubscriptionUsage) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionUsageListResult. +func (s SubscriptionUsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUsageListResult. +func (s *SubscriptionUsageListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionUsageProperties. +func (s SubscriptionUsageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentValue", s.CurrentValue) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "limit", s.Limit) + populate(objectMap, "unit", s.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUsageProperties. +func (s *SubscriptionUsageProperties) UnmarshalJSON(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 "currentValue": + err = unpopulate(val, "CurrentValue", &s.CurrentValue) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "limit": + err = unpopulate(val, "Limit", &s.Limit) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &s.Unit) + 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 SynapseLinkWorkspace. +func (s SynapseLinkWorkspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseLinkWorkspace. +func (s *SynapseLinkWorkspace) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SynapseLinkWorkspaceInfoProperties. +func (s SynapseLinkWorkspaceInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "linkConnectionName", s.LinkConnectionName) + populate(objectMap, "workspaceId", s.WorkspaceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseLinkWorkspaceInfoProperties. +func (s *SynapseLinkWorkspaceInfoProperties) UnmarshalJSON(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 "linkConnectionName": + err = unpopulate(val, "LinkConnectionName", &s.LinkConnectionName) + delete(rawMsg, key) + case "workspaceId": + err = unpopulate(val, "WorkspaceID", &s.WorkspaceID) + 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 SynapseLinkWorkspaceListResult. +func (s SynapseLinkWorkspaceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseLinkWorkspaceListResult. +func (s *SynapseLinkWorkspaceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SynapseLinkWorkspaceProperties. +func (s SynapseLinkWorkspaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "workspaces", s.Workspaces) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SynapseLinkWorkspaceProperties. +func (s *SynapseLinkWorkspaceProperties) UnmarshalJSON(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 "workspaces": + err = unpopulate(val, "Workspaces", &s.Workspaces) + 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 SyncAgent. +func (s SyncAgent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgent. +func (s *SyncAgent) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncAgentKeyProperties. +func (s SyncAgentKeyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "syncAgentKey", s.SyncAgentKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentKeyProperties. +func (s *SyncAgentKeyProperties) UnmarshalJSON(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 "syncAgentKey": + err = unpopulate(val, "SyncAgentKey", &s.SyncAgentKey) + 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 SyncAgentLinkedDatabase. +func (s SyncAgentLinkedDatabase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentLinkedDatabase. +func (s *SyncAgentLinkedDatabase) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncAgentLinkedDatabaseListResult. +func (s SyncAgentLinkedDatabaseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentLinkedDatabaseListResult. +func (s *SyncAgentLinkedDatabaseListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncAgentLinkedDatabaseProperties. +func (s SyncAgentLinkedDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseId", s.DatabaseID) + populate(objectMap, "databaseName", s.DatabaseName) + populate(objectMap, "databaseType", s.DatabaseType) + populate(objectMap, "description", s.Description) + populate(objectMap, "serverName", s.ServerName) + populate(objectMap, "userName", s.UserName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentLinkedDatabaseProperties. +func (s *SyncAgentLinkedDatabaseProperties) UnmarshalJSON(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 "databaseId": + err = unpopulate(val, "DatabaseID", &s.DatabaseID) + delete(rawMsg, key) + case "databaseName": + err = unpopulate(val, "DatabaseName", &s.DatabaseName) + delete(rawMsg, key) + case "databaseType": + err = unpopulate(val, "DatabaseType", &s.DatabaseType) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &s.Description) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &s.ServerName) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &s.UserName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncAgentListResult. +func (s SyncAgentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentListResult. +func (s *SyncAgentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncAgentProperties. +func (s SyncAgentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "expiryTime", s.ExpiryTime) + populate(objectMap, "isUpToDate", s.IsUpToDate) + populateTimeRFC3339(objectMap, "lastAliveTime", s.LastAliveTime) + populate(objectMap, "name", s.Name) + populate(objectMap, "state", s.State) + populate(objectMap, "syncDatabaseId", s.SyncDatabaseID) + populate(objectMap, "version", s.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentProperties. +func (s *SyncAgentProperties) UnmarshalJSON(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 "expiryTime": + err = unpopulateTimeRFC3339(val, "ExpiryTime", &s.ExpiryTime) + delete(rawMsg, key) + case "isUpToDate": + err = unpopulate(val, "IsUpToDate", &s.IsUpToDate) + delete(rawMsg, key) + case "lastAliveTime": + err = unpopulateTimeRFC3339(val, "LastAliveTime", &s.LastAliveTime) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "syncDatabaseId": + err = unpopulate(val, "SyncDatabaseID", &s.SyncDatabaseID) + 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 SyncDatabaseIDListResult. +func (s SyncDatabaseIDListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncDatabaseIDListResult. +func (s *SyncDatabaseIDListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncDatabaseIDProperties. +func (s SyncDatabaseIDProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncDatabaseIDProperties. +func (s *SyncDatabaseIDProperties) UnmarshalJSON(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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaProperties. +func (s SyncFullSchemaProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "lastUpdateTime", s.LastUpdateTime) + populate(objectMap, "tables", s.Tables) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncFullSchemaProperties. +func (s *SyncFullSchemaProperties) UnmarshalJSON(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 "lastUpdateTime": + err = unpopulateTimeRFC3339(val, "LastUpdateTime", &s.LastUpdateTime) + 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 SyncFullSchemaPropertiesListResult. +func (s SyncFullSchemaPropertiesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncFullSchemaPropertiesListResult. +func (s *SyncFullSchemaPropertiesListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncFullSchemaTable. +func (s SyncFullSchemaTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "columns", s.Columns) + populate(objectMap, "errorId", s.ErrorID) + populate(objectMap, "hasError", s.HasError) + populate(objectMap, "name", s.Name) + populate(objectMap, "quotedName", s.QuotedName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncFullSchemaTable. +func (s *SyncFullSchemaTable) UnmarshalJSON(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 "columns": + err = unpopulate(val, "Columns", &s.Columns) + delete(rawMsg, key) + case "errorId": + err = unpopulate(val, "ErrorID", &s.ErrorID) + delete(rawMsg, key) + case "hasError": + err = unpopulate(val, "HasError", &s.HasError) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "quotedName": + err = unpopulate(val, "QuotedName", &s.QuotedName) + 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 SyncFullSchemaTableColumn. +func (s SyncFullSchemaTableColumn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataSize", s.DataSize) + populate(objectMap, "dataType", s.DataType) + populate(objectMap, "errorId", s.ErrorID) + populate(objectMap, "hasError", s.HasError) + populate(objectMap, "isPrimaryKey", s.IsPrimaryKey) + populate(objectMap, "name", s.Name) + populate(objectMap, "quotedName", s.QuotedName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncFullSchemaTableColumn. +func (s *SyncFullSchemaTableColumn) UnmarshalJSON(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 "dataSize": + err = unpopulate(val, "DataSize", &s.DataSize) + delete(rawMsg, key) + case "dataType": + err = unpopulate(val, "DataType", &s.DataType) + delete(rawMsg, key) + case "errorId": + err = unpopulate(val, "ErrorID", &s.ErrorID) + delete(rawMsg, key) + case "hasError": + err = unpopulate(val, "HasError", &s.HasError) + delete(rawMsg, key) + case "isPrimaryKey": + err = unpopulate(val, "IsPrimaryKey", &s.IsPrimaryKey) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "quotedName": + err = unpopulate(val, "QuotedName", &s.QuotedName) + 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 SyncGroup. +func (s SyncGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroup. +func (s *SyncGroup) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + 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 SyncGroupListResult. +func (s SyncGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupListResult. +func (s *SyncGroupListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncGroupLogListResult. +func (s SyncGroupLogListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupLogListResult. +func (s *SyncGroupLogListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncGroupLogProperties. +func (s SyncGroupLogProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "details", s.Details) + populate(objectMap, "operationStatus", s.OperationStatus) + populate(objectMap, "source", s.Source) + populateTimeRFC3339(objectMap, "timestamp", s.Timestamp) + populate(objectMap, "tracingId", s.TracingID) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupLogProperties. +func (s *SyncGroupLogProperties) UnmarshalJSON(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 "details": + err = unpopulate(val, "Details", &s.Details) + delete(rawMsg, key) + case "operationStatus": + err = unpopulate(val, "OperationStatus", &s.OperationStatus) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &s.Source) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &s.Timestamp) + delete(rawMsg, key) + case "tracingId": + err = unpopulate(val, "TracingID", &s.TracingID) + 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 SyncGroupProperties. +func (s SyncGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "conflictLoggingRetentionInDays", s.ConflictLoggingRetentionInDays) + populate(objectMap, "conflictResolutionPolicy", s.ConflictResolutionPolicy) + populate(objectMap, "enableConflictLogging", s.EnableConflictLogging) + populate(objectMap, "hubDatabasePassword", s.HubDatabasePassword) + populate(objectMap, "hubDatabaseUserName", s.HubDatabaseUserName) + populate(objectMap, "interval", s.Interval) + populateTimeRFC3339(objectMap, "lastSyncTime", s.LastSyncTime) + populate(objectMap, "privateEndpointName", s.PrivateEndpointName) + populate(objectMap, "schema", s.Schema) + populate(objectMap, "syncDatabaseId", s.SyncDatabaseID) + populate(objectMap, "syncState", s.SyncState) + populate(objectMap, "usePrivateLinkConnection", s.UsePrivateLinkConnection) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupProperties. +func (s *SyncGroupProperties) UnmarshalJSON(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 "conflictLoggingRetentionInDays": + err = unpopulate(val, "ConflictLoggingRetentionInDays", &s.ConflictLoggingRetentionInDays) + delete(rawMsg, key) + case "conflictResolutionPolicy": + err = unpopulate(val, "ConflictResolutionPolicy", &s.ConflictResolutionPolicy) + delete(rawMsg, key) + case "enableConflictLogging": + err = unpopulate(val, "EnableConflictLogging", &s.EnableConflictLogging) + delete(rawMsg, key) + case "hubDatabasePassword": + err = unpopulate(val, "HubDatabasePassword", &s.HubDatabasePassword) + delete(rawMsg, key) + case "hubDatabaseUserName": + err = unpopulate(val, "HubDatabaseUserName", &s.HubDatabaseUserName) + delete(rawMsg, key) + case "interval": + err = unpopulate(val, "Interval", &s.Interval) + delete(rawMsg, key) + case "lastSyncTime": + err = unpopulateTimeRFC3339(val, "LastSyncTime", &s.LastSyncTime) + delete(rawMsg, key) + case "privateEndpointName": + err = unpopulate(val, "PrivateEndpointName", &s.PrivateEndpointName) + delete(rawMsg, key) + case "schema": + err = unpopulate(val, "Schema", &s.Schema) + delete(rawMsg, key) + case "syncDatabaseId": + err = unpopulate(val, "SyncDatabaseID", &s.SyncDatabaseID) + delete(rawMsg, key) + case "syncState": + err = unpopulate(val, "SyncState", &s.SyncState) + delete(rawMsg, key) + case "usePrivateLinkConnection": + err = unpopulate(val, "UsePrivateLinkConnection", &s.UsePrivateLinkConnection) + 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 SyncGroupSchema. +func (s SyncGroupSchema) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "masterSyncMemberName", s.MasterSyncMemberName) + populate(objectMap, "tables", s.Tables) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupSchema. +func (s *SyncGroupSchema) UnmarshalJSON(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 "masterSyncMemberName": + err = unpopulate(val, "MasterSyncMemberName", &s.MasterSyncMemberName) + 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 SyncGroupSchemaTable. +func (s SyncGroupSchemaTable) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "columns", s.Columns) + populate(objectMap, "quotedName", s.QuotedName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupSchemaTable. +func (s *SyncGroupSchemaTable) UnmarshalJSON(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 "columns": + err = unpopulate(val, "Columns", &s.Columns) + delete(rawMsg, key) + case "quotedName": + err = unpopulate(val, "QuotedName", &s.QuotedName) + 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 SyncGroupSchemaTableColumn. +func (s SyncGroupSchemaTableColumn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataSize", s.DataSize) + populate(objectMap, "dataType", s.DataType) + populate(objectMap, "quotedName", s.QuotedName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupSchemaTableColumn. +func (s *SyncGroupSchemaTableColumn) UnmarshalJSON(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 "dataSize": + err = unpopulate(val, "DataSize", &s.DataSize) + delete(rawMsg, key) + case "dataType": + err = unpopulate(val, "DataType", &s.DataType) + delete(rawMsg, key) + case "quotedName": + err = unpopulate(val, "QuotedName", &s.QuotedName) + 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 SyncMember. +func (s SyncMember) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncMember. +func (s *SyncMember) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncMemberListResult. +func (s SyncMemberListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncMemberListResult. +func (s *SyncMemberListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SyncMemberProperties. +func (s SyncMemberProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "databaseName", s.DatabaseName) + populate(objectMap, "databaseType", s.DatabaseType) + populate(objectMap, "password", s.Password) + populate(objectMap, "privateEndpointName", s.PrivateEndpointName) + populate(objectMap, "sqlServerDatabaseId", s.SQLServerDatabaseID) + populate(objectMap, "serverName", s.ServerName) + populate(objectMap, "syncAgentId", s.SyncAgentID) + populate(objectMap, "syncDirection", s.SyncDirection) + populate(objectMap, "syncMemberAzureDatabaseResourceId", s.SyncMemberAzureDatabaseResourceID) + populate(objectMap, "syncState", s.SyncState) + populate(objectMap, "usePrivateLinkConnection", s.UsePrivateLinkConnection) + populate(objectMap, "userName", s.UserName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SyncMemberProperties. +func (s *SyncMemberProperties) UnmarshalJSON(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 "databaseName": + err = unpopulate(val, "DatabaseName", &s.DatabaseName) + delete(rawMsg, key) + case "databaseType": + err = unpopulate(val, "DatabaseType", &s.DatabaseType) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &s.Password) + delete(rawMsg, key) + case "privateEndpointName": + err = unpopulate(val, "PrivateEndpointName", &s.PrivateEndpointName) + delete(rawMsg, key) + case "sqlServerDatabaseId": + err = unpopulate(val, "SQLServerDatabaseID", &s.SQLServerDatabaseID) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &s.ServerName) + delete(rawMsg, key) + case "syncAgentId": + err = unpopulate(val, "SyncAgentID", &s.SyncAgentID) + delete(rawMsg, key) + case "syncDirection": + err = unpopulate(val, "SyncDirection", &s.SyncDirection) + delete(rawMsg, key) + case "syncMemberAzureDatabaseResourceId": + err = unpopulate(val, "SyncMemberAzureDatabaseResourceID", &s.SyncMemberAzureDatabaseResourceID) + delete(rawMsg, key) + case "syncState": + err = unpopulate(val, "SyncState", &s.SyncState) + delete(rawMsg, key) + case "usePrivateLinkConnection": + err = unpopulate(val, "UsePrivateLinkConnection", &s.UsePrivateLinkConnection) + delete(rawMsg, key) + case "userName": + err = unpopulate(val, "UserName", &s.UserName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TdeCertificate. +func (t TdeCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TdeCertificate. +func (t *TdeCertificate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TdeCertificateProperties. +func (t TdeCertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certPassword", t.CertPassword) + populate(objectMap, "privateBlob", t.PrivateBlob) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TdeCertificateProperties. +func (t *TdeCertificateProperties) UnmarshalJSON(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 "certPassword": + err = unpopulate(val, "CertPassword", &t.CertPassword) + delete(rawMsg, key) + case "privateBlob": + err = unpopulate(val, "PrivateBlob", &t.PrivateBlob) + 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 TimeZone. +func (t TimeZone) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TimeZone. +func (t *TimeZone) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TimeZoneListResult. +func (t TimeZoneListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TimeZoneListResult. +func (t *TimeZoneListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + 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 TimeZoneProperties. +func (t TimeZoneProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", t.DisplayName) + populate(objectMap, "timeZoneId", t.TimeZoneID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TimeZoneProperties. +func (t *TimeZoneProperties) UnmarshalJSON(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 "displayName": + err = unpopulate(val, "DisplayName", &t.DisplayName) + delete(rawMsg, key) + case "timeZoneId": + err = unpopulate(val, "TimeZoneID", &t.TimeZoneID) + 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 TopQueries. +func (t TopQueries) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aggregationFunction", t.AggregationFunction) + populate(objectMap, "endTime", t.EndTime) + populate(objectMap, "intervalType", t.IntervalType) + populate(objectMap, "numberOfQueries", t.NumberOfQueries) + populate(objectMap, "observationMetric", t.ObservationMetric) + populate(objectMap, "queries", t.Queries) + populate(objectMap, "startTime", t.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopQueries. +func (t *TopQueries) UnmarshalJSON(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 "aggregationFunction": + err = unpopulate(val, "AggregationFunction", &t.AggregationFunction) + delete(rawMsg, key) + case "endTime": + err = unpopulate(val, "EndTime", &t.EndTime) + delete(rawMsg, key) + case "intervalType": + err = unpopulate(val, "IntervalType", &t.IntervalType) + delete(rawMsg, key) + case "numberOfQueries": + err = unpopulate(val, "NumberOfQueries", &t.NumberOfQueries) + delete(rawMsg, key) + case "observationMetric": + err = unpopulate(val, "ObservationMetric", &t.ObservationMetric) + delete(rawMsg, key) + case "queries": + err = unpopulate(val, "Queries", &t.Queries) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &t.StartTime) + 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 TopQueriesListResult. +func (t TopQueriesListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TopQueriesListResult. +func (t *TopQueriesListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + 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 TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 TransparentDataEncryptionProperties. +func (t TransparentDataEncryptionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "state", t.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TransparentDataEncryptionProperties. +func (t *TransparentDataEncryptionProperties) UnmarshalJSON(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 "state": + err = unpopulate(val, "State", &t.State) + 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 UpdateLongTermRetentionBackupParameters. +func (u UpdateLongTermRetentionBackupParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", u.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateLongTermRetentionBackupParameters. +func (u *UpdateLongTermRetentionBackupParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpdateLongTermRetentionBackupParametersProperties. +func (u UpdateLongTermRetentionBackupParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requestedBackupStorageRedundancy", u.RequestedBackupStorageRedundancy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateLongTermRetentionBackupParametersProperties. +func (u *UpdateLongTermRetentionBackupParametersProperties) UnmarshalJSON(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 "requestedBackupStorageRedundancy": + err = unpopulate(val, "RequestedBackupStorageRedundancy", &u.RequestedBackupStorageRedundancy) + 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 UpdateVirtualClusterDNSServersOperation. +func (u UpdateVirtualClusterDNSServersOperation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", u.ID) + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "type", u.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpdateVirtualClusterDNSServersOperation. +func (u *UpdateVirtualClusterDNSServersOperation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UpsertManagedServerOperationParameters. +func (u UpsertManagedServerOperationParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "family", u.Family) + populate(objectMap, "storageSizeInGB", u.StorageSizeInGB) + populate(objectMap, "tier", u.Tier) + populate(objectMap, "vCores", u.VCores) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpsertManagedServerOperationParameters. +func (u *UpsertManagedServerOperationParameters) UnmarshalJSON(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 "family": + err = unpopulate(val, "Family", &u.Family) + delete(rawMsg, key) + case "storageSizeInGB": + err = unpopulate(val, "StorageSizeInGB", &u.StorageSizeInGB) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &u.Tier) + delete(rawMsg, key) + case "vCores": + err = unpopulate(val, "VCores", &u.VCores) + 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 UpsertManagedServerOperationStepWithEstimatesAndDuration. +func (u UpsertManagedServerOperationStepWithEstimatesAndDuration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", u.Name) + populate(objectMap, "order", u.Order) + populate(objectMap, "status", u.Status) + populateTimeRFC3339(objectMap, "stepEndTime", u.StepEndTime) + populateTimeRFC3339(objectMap, "stepStartTime", u.StepStartTime) + populate(objectMap, "timeElapsed", u.TimeElapsed) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UpsertManagedServerOperationStepWithEstimatesAndDuration. +func (u *UpsertManagedServerOperationStepWithEstimatesAndDuration) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "order": + err = unpopulate(val, "Order", &u.Order) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &u.Status) + delete(rawMsg, key) + case "stepEndTime": + err = unpopulateTimeRFC3339(val, "StepEndTime", &u.StepEndTime) + delete(rawMsg, key) + case "stepStartTime": + err = unpopulateTimeRFC3339(val, "StepStartTime", &u.StepStartTime) + delete(rawMsg, key) + case "timeElapsed": + err = unpopulate(val, "TimeElapsed", &u.TimeElapsed) + 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 Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentValue", u.CurrentValue) + populate(objectMap, "id", u.ID) + populate(objectMap, "limit", u.Limit) + populate(objectMap, "name", u.Name) + populate(objectMap, "requestedLimit", u.RequestedLimit) + populate(objectMap, "type", u.Type) + populate(objectMap, "unit", u.Unit) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Usage. +func (u *Usage) UnmarshalJSON(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 "id": + err = unpopulate(val, "ID", &u.ID) + 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 "requestedLimit": + err = unpopulate(val, "RequestedLimit", &u.RequestedLimit) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + 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 UsageListResult. +func (u UsageListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UsageListResult. +func (u *UsageListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserIdentity. +func (u UserIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentity. +func (u *UserIdentity) UnmarshalJSON(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 VaRule. +func (v VaRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "benchmarkReferences", v.BenchmarkReferences) + populate(objectMap, "category", v.Category) + populate(objectMap, "description", v.Description) + populate(objectMap, "queryCheck", v.QueryCheck) + populate(objectMap, "rationale", v.Rationale) + populate(objectMap, "ruleId", v.RuleID) + populate(objectMap, "ruleType", v.RuleType) + populate(objectMap, "severity", v.Severity) + populate(objectMap, "title", v.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VaRule. +func (v *VaRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "benchmarkReferences": + err = unpopulate(val, "BenchmarkReferences", &v.BenchmarkReferences) + delete(rawMsg, key) + case "category": + err = unpopulate(val, "Category", &v.Category) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &v.Description) + delete(rawMsg, key) + case "queryCheck": + err = unpopulate(val, "QueryCheck", &v.QueryCheck) + delete(rawMsg, key) + case "rationale": + err = unpopulate(val, "Rationale", &v.Rationale) + delete(rawMsg, key) + case "ruleId": + err = unpopulate(val, "RuleID", &v.RuleID) + delete(rawMsg, key) + case "ruleType": + err = unpopulate(val, "RuleType", &v.RuleType) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &v.Severity) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &v.Title) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualCluster. +func (v VirtualCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "location", v.Location) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualCluster. +func (v *VirtualCluster) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &v.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualClusterDNSServersProperties. +func (v VirtualClusterDNSServersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "status", v.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualClusterDNSServersProperties. +func (v *VirtualClusterDNSServersProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "status": + err = unpopulate(val, "Status", &v.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualClusterListResult. +func (v VirtualClusterListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualClusterListResult. +func (v *VirtualClusterListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualClusterProperties. +func (v VirtualClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "childResources", v.ChildResources) + populate(objectMap, "subnetId", v.SubnetID) + populate(objectMap, "version", v.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualClusterProperties. +func (v *VirtualClusterProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "childResources": + err = unpopulate(val, "ChildResources", &v.ChildResources) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &v.SubnetID) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &v.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualClusterUpdate. +func (v VirtualClusterUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "tags", v.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualClusterUpdate. +func (v *VirtualClusterUpdate) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &v.Tags) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRule. +func (v VirtualNetworkRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRule. +func (v *VirtualNetworkRule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleListResult. +func (v VirtualNetworkRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRuleListResult. +func (v *VirtualNetworkRuleListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkRuleProperties. +func (v VirtualNetworkRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "ignoreMissingVnetServiceEndpoint", v.IgnoreMissingVnetServiceEndpoint) + populate(objectMap, "state", v.State) + populate(objectMap, "virtualNetworkSubnetId", v.VirtualNetworkSubnetID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkRuleProperties. +func (v *VirtualNetworkRuleProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "ignoreMissingVnetServiceEndpoint": + err = unpopulate(val, "IgnoreMissingVnetServiceEndpoint", &v.IgnoreMissingVnetServiceEndpoint) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "virtualNetworkSubnetId": + err = unpopulate(val, "VirtualNetworkSubnetID", &v.VirtualNetworkSubnetID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessment. +func (v VulnerabilityAssessment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "systemData", v.SystemData) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessment. +func (v *VulnerabilityAssessment) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &v.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentListResult. +func (v VulnerabilityAssessmentListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentListResult. +func (v *VulnerabilityAssessmentListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentPolicyProperties. +func (v VulnerabilityAssessmentPolicyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "state", v.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentPolicyProperties. +func (v *VulnerabilityAssessmentPolicyProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentRecurringScansProperties. +func (v VulnerabilityAssessmentRecurringScansProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "emailSubscriptionAdmins", v.EmailSubscriptionAdmins) + populate(objectMap, "emails", v.Emails) + populate(objectMap, "isEnabled", v.IsEnabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentRecurringScansProperties. +func (v *VulnerabilityAssessmentRecurringScansProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "emailSubscriptionAdmins": + err = unpopulate(val, "EmailSubscriptionAdmins", &v.EmailSubscriptionAdmins) + delete(rawMsg, key) + case "emails": + err = unpopulate(val, "Emails", &v.Emails) + delete(rawMsg, key) + case "isEnabled": + err = unpopulate(val, "IsEnabled", &v.IsEnabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanError. +func (v VulnerabilityAssessmentScanError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", v.Code) + populate(objectMap, "message", v.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanError. +func (v *VulnerabilityAssessmentScanError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &v.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &v.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanForSQLError. +func (v VulnerabilityAssessmentScanForSQLError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", v.Code) + populate(objectMap, "message", v.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanForSQLError. +func (v *VulnerabilityAssessmentScanForSQLError) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &v.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &v.Message) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanListResult. +func (v VulnerabilityAssessmentScanListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanListResult. +func (v *VulnerabilityAssessmentScanListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecord. +func (v VulnerabilityAssessmentScanRecord) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecord. +func (v *VulnerabilityAssessmentScanRecord) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordForSQL. +func (v VulnerabilityAssessmentScanRecordForSQL) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "systemData", v.SystemData) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordForSQL. +func (v *VulnerabilityAssessmentScanRecordForSQL) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &v.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordForSQLListResult. +func (v VulnerabilityAssessmentScanRecordForSQLListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordForSQLListResult. +func (v *VulnerabilityAssessmentScanRecordForSQLListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordForSQLProperties. +func (v VulnerabilityAssessmentScanRecordForSQLProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "database", v.Database) + populateTimeRFC3339(objectMap, "endTime", v.EndTime) + populate(objectMap, "errors", v.Errors) + populate(objectMap, "highSeverityFailedRulesCount", v.HighSeverityFailedRulesCount) + populate(objectMap, "isBaselineApplied", v.IsBaselineApplied) + populateTimeRFC3339(objectMap, "lastScanTime", v.LastScanTime) + populate(objectMap, "lowSeverityFailedRulesCount", v.LowSeverityFailedRulesCount) + populate(objectMap, "mediumSeverityFailedRulesCount", v.MediumSeverityFailedRulesCount) + populate(objectMap, "sqlVersion", v.SQLVersion) + populate(objectMap, "scanId", v.ScanID) + populate(objectMap, "server", v.Server) + populateTimeRFC3339(objectMap, "startTime", v.StartTime) + populate(objectMap, "state", v.State) + populate(objectMap, "totalFailedRulesCount", v.TotalFailedRulesCount) + populate(objectMap, "totalPassedRulesCount", v.TotalPassedRulesCount) + populate(objectMap, "totalRulesCount", v.TotalRulesCount) + populate(objectMap, "triggerType", v.TriggerType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordForSQLProperties. +func (v *VulnerabilityAssessmentScanRecordForSQLProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "database": + err = unpopulate(val, "Database", &v.Database) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &v.EndTime) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &v.Errors) + delete(rawMsg, key) + case "highSeverityFailedRulesCount": + err = unpopulate(val, "HighSeverityFailedRulesCount", &v.HighSeverityFailedRulesCount) + delete(rawMsg, key) + case "isBaselineApplied": + err = unpopulate(val, "IsBaselineApplied", &v.IsBaselineApplied) + delete(rawMsg, key) + case "lastScanTime": + err = unpopulateTimeRFC3339(val, "LastScanTime", &v.LastScanTime) + delete(rawMsg, key) + case "lowSeverityFailedRulesCount": + err = unpopulate(val, "LowSeverityFailedRulesCount", &v.LowSeverityFailedRulesCount) + delete(rawMsg, key) + case "mediumSeverityFailedRulesCount": + err = unpopulate(val, "MediumSeverityFailedRulesCount", &v.MediumSeverityFailedRulesCount) + delete(rawMsg, key) + case "sqlVersion": + err = unpopulate(val, "SQLVersion", &v.SQLVersion) + delete(rawMsg, key) + case "scanId": + err = unpopulate(val, "ScanID", &v.ScanID) + delete(rawMsg, key) + case "server": + err = unpopulate(val, "Server", &v.Server) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &v.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "totalFailedRulesCount": + err = unpopulate(val, "TotalFailedRulesCount", &v.TotalFailedRulesCount) + delete(rawMsg, key) + case "totalPassedRulesCount": + err = unpopulate(val, "TotalPassedRulesCount", &v.TotalPassedRulesCount) + delete(rawMsg, key) + case "totalRulesCount": + err = unpopulate(val, "TotalRulesCount", &v.TotalRulesCount) + delete(rawMsg, key) + case "triggerType": + err = unpopulate(val, "TriggerType", &v.TriggerType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordListResult. +func (v VulnerabilityAssessmentScanRecordListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", v.NextLink) + populate(objectMap, "value", v.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordListResult. +func (v *VulnerabilityAssessmentScanRecordListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &v.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &v.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordProperties. +func (v VulnerabilityAssessmentScanRecordProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "endTime", v.EndTime) + populate(objectMap, "errors", v.Errors) + populate(objectMap, "numberOfFailedSecurityChecks", v.NumberOfFailedSecurityChecks) + populate(objectMap, "scanId", v.ScanID) + populateTimeRFC3339(objectMap, "startTime", v.StartTime) + populate(objectMap, "state", v.State) + populate(objectMap, "storageContainerPath", v.StorageContainerPath) + populate(objectMap, "triggerType", v.TriggerType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordProperties. +func (v *VulnerabilityAssessmentScanRecordProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &v.EndTime) + delete(rawMsg, key) + case "errors": + err = unpopulate(val, "Errors", &v.Errors) + delete(rawMsg, key) + case "numberOfFailedSecurityChecks": + err = unpopulate(val, "NumberOfFailedSecurityChecks", &v.NumberOfFailedSecurityChecks) + delete(rawMsg, key) + case "scanId": + err = unpopulate(val, "ScanID", &v.ScanID) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &v.StartTime) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &v.State) + delete(rawMsg, key) + case "storageContainerPath": + err = unpopulate(val, "StorageContainerPath", &v.StorageContainerPath) + delete(rawMsg, key) + case "triggerType": + err = unpopulate(val, "TriggerType", &v.TriggerType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanResultProperties. +func (v VulnerabilityAssessmentScanResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "baselineAdjustedResult", v.BaselineAdjustedResult) + populate(objectMap, "errorMessage", v.ErrorMessage) + populate(objectMap, "isTrimmed", v.IsTrimmed) + populate(objectMap, "queryResults", v.QueryResults) + populate(objectMap, "remediation", v.Remediation) + populate(objectMap, "ruleId", v.RuleID) + populate(objectMap, "ruleMetadata", v.RuleMetadata) + populate(objectMap, "status", v.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanResultProperties. +func (v *VulnerabilityAssessmentScanResultProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "baselineAdjustedResult": + err = unpopulate(val, "BaselineAdjustedResult", &v.BaselineAdjustedResult) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &v.ErrorMessage) + delete(rawMsg, key) + case "isTrimmed": + err = unpopulate(val, "IsTrimmed", &v.IsTrimmed) + delete(rawMsg, key) + case "queryResults": + err = unpopulate(val, "QueryResults", &v.QueryResults) + delete(rawMsg, key) + case "remediation": + err = unpopulate(val, "Remediation", &v.Remediation) + delete(rawMsg, key) + case "ruleId": + err = unpopulate(val, "RuleID", &v.RuleID) + delete(rawMsg, key) + case "ruleMetadata": + err = unpopulate(val, "RuleMetadata", &v.RuleMetadata) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &v.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanResults. +func (v VulnerabilityAssessmentScanResults) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", v.ID) + populate(objectMap, "name", v.Name) + populate(objectMap, "properties", v.Properties) + populate(objectMap, "systemData", v.SystemData) + populate(objectMap, "type", v.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanResults. +func (v *VulnerabilityAssessmentScanResults) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &v.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &v.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &v.Properties) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &v.SystemData) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &v.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WorkloadClassifier. +func (w WorkloadClassifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", w.ID) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadClassifier. +func (w *WorkloadClassifier) UnmarshalJSON(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 "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 "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 WorkloadClassifierListResult. +func (w WorkloadClassifierListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadClassifierListResult. +func (w *WorkloadClassifierListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + 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 WorkloadClassifierProperties. +func (w WorkloadClassifierProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "context", w.Context) + populate(objectMap, "endTime", w.EndTime) + populate(objectMap, "importance", w.Importance) + populate(objectMap, "label", w.Label) + populate(objectMap, "memberName", w.MemberName) + populate(objectMap, "startTime", w.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadClassifierProperties. +func (w *WorkloadClassifierProperties) UnmarshalJSON(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 "context": + err = unpopulate(val, "Context", &w.Context) + delete(rawMsg, key) + case "endTime": + err = unpopulate(val, "EndTime", &w.EndTime) + delete(rawMsg, key) + case "importance": + err = unpopulate(val, "Importance", &w.Importance) + delete(rawMsg, key) + case "label": + err = unpopulate(val, "Label", &w.Label) + delete(rawMsg, key) + case "memberName": + err = unpopulate(val, "MemberName", &w.MemberName) + delete(rawMsg, key) + case "startTime": + err = unpopulate(val, "StartTime", &w.StartTime) + 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 WorkloadGroup. +func (w WorkloadGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", w.ID) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadGroup. +func (w *WorkloadGroup) UnmarshalJSON(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 "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 "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 WorkloadGroupListResult. +func (w WorkloadGroupListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadGroupListResult. +func (w *WorkloadGroupListResult) UnmarshalJSON(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 "nextLink": + err = unpopulate(val, "NextLink", &w.NextLink) + 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 WorkloadGroupProperties. +func (w WorkloadGroupProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "importance", w.Importance) + populate(objectMap, "maxResourcePercent", w.MaxResourcePercent) + populate(objectMap, "maxResourcePercentPerRequest", w.MaxResourcePercentPerRequest) + populate(objectMap, "minResourcePercent", w.MinResourcePercent) + populate(objectMap, "minResourcePercentPerRequest", w.MinResourcePercentPerRequest) + populate(objectMap, "queryExecutionTimeout", w.QueryExecutionTimeout) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadGroupProperties. +func (w *WorkloadGroupProperties) UnmarshalJSON(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 "importance": + err = unpopulate(val, "Importance", &w.Importance) + delete(rawMsg, key) + case "maxResourcePercent": + err = unpopulate(val, "MaxResourcePercent", &w.MaxResourcePercent) + delete(rawMsg, key) + case "maxResourcePercentPerRequest": + err = unpopulate(val, "MaxResourcePercentPerRequest", &w.MaxResourcePercentPerRequest) + delete(rawMsg, key) + case "minResourcePercent": + err = unpopulate(val, "MinResourcePercent", &w.MinResourcePercent) + delete(rawMsg, key) + case "minResourcePercentPerRequest": + err = unpopulate(val, "MinResourcePercentPerRequest", &w.MinResourcePercentPerRequest) + delete(rawMsg, key) + case "queryExecutionTimeout": + err = unpopulate(val, "QueryExecutionTimeout", &w.QueryExecutionTimeout) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v any) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_operations_client.go b/sdk/resourcemanager/sql/armsql/operations_client.go similarity index 89% rename from sdk/resourcemanager/sql/armsql/zz_generated_operations_client.go rename to sdk/resourcemanager/sql/armsql/operations_client.go index e76ce32f519b..32c92ac1050b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_operations_client.go +++ b/sdk/resourcemanager/sql/armsql/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 armsql @@ -27,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -49,9 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available SQL Rest API operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2022-11-01-preview +// - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ More: func(page OperationsClientListResponse) bool { @@ -88,7 +89,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_outboundfirewallrules_client.go b/sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go similarity index 82% rename from sdk/resourcemanager/sql/armsql/zz_generated_outboundfirewallrules_client.go rename to sdk/resourcemanager/sql/armsql/outboundfirewallrules_client.go index 403d7696478c..831314def0f1 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_outboundfirewallrules_client.go +++ b/sdk/resourcemanager/sql/armsql/outboundfirewallrules_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 armsql @@ -31,9 +32,9 @@ type OutboundFirewallRulesClient struct { } // NewOutboundFirewallRulesClient creates a new instance of OutboundFirewallRulesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOutboundFirewallRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OutboundFirewallRulesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewOutboundFirewallRulesClient(subscriptionID string, credential azcore.Tok // BeginCreateOrUpdate - Create a outbound firewall rule with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - OutboundFirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginCreateOrUpdate -// method. -func (client *OutboundFirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, parameters OutboundFirewallRule, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[OutboundFirewallRulesClientCreateOrUpdateResponse], error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - OutboundFirewallRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginCreateOrUpdate +// method. +func (client *OutboundFirewallRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[OutboundFirewallRulesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, outboundRuleFqdn, parameters, options) + resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, outboundRuleFqdn, options) if err != nil { return nil, err } @@ -76,9 +78,10 @@ func (client *OutboundFirewallRulesClient) BeginCreateOrUpdate(ctx context.Conte // CreateOrUpdate - Create a outbound firewall rule with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -func (client *OutboundFirewallRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, parameters OutboundFirewallRule, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, outboundRuleFqdn, parameters, options) +// +// Generated from API version 2022-11-01-preview +func (client *OutboundFirewallRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, outboundRuleFqdn, options) if err != nil { return nil, err } @@ -93,7 +96,7 @@ func (client *OutboundFirewallRulesClient) createOrUpdate(ctx context.Context, r } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *OutboundFirewallRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, parameters OutboundFirewallRule, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *OutboundFirewallRulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/outboundFirewallRules/{outboundRuleFqdn}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -116,20 +119,21 @@ func (client *OutboundFirewallRulesClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + return req, nil } // BeginDelete - Deletes a outbound firewall rule with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - OutboundFirewallRulesClientBeginDeleteOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - OutboundFirewallRulesClientBeginDeleteOptions contains the optional parameters for the OutboundFirewallRulesClient.BeginDelete +// method. func (client *OutboundFirewallRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientBeginDeleteOptions) (*runtime.Poller[OutboundFirewallRulesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, outboundRuleFqdn, options) @@ -144,7 +148,8 @@ func (client *OutboundFirewallRulesClient) BeginDelete(ctx context.Context, reso // Delete - Deletes a outbound firewall rule with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview +// +// Generated from API version 2022-11-01-preview func (client *OutboundFirewallRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, outboundRuleFqdn, options) if err != nil { @@ -184,19 +189,20 @@ func (client *OutboundFirewallRulesClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets an outbound firewall rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - OutboundFirewallRulesClientGetOptions contains the optional parameters for the OutboundFirewallRulesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - OutboundFirewallRulesClientGetOptions contains the optional parameters for the OutboundFirewallRulesClient.Get +// method. func (client *OutboundFirewallRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, outboundRuleFqdn string, options *OutboundFirewallRulesClientGetOptions) (OutboundFirewallRulesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, outboundRuleFqdn, options) if err != nil { @@ -236,7 +242,7 @@ func (client *OutboundFirewallRulesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -252,13 +258,13 @@ func (client *OutboundFirewallRulesClient) getHandleResponse(resp *http.Response } // NewListByServerPager - Gets all outbound firewall rules on a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - OutboundFirewallRulesClientListByServerOptions contains the optional parameters for the OutboundFirewallRulesClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - OutboundFirewallRulesClientListByServerOptions contains the optional parameters for the OutboundFirewallRulesClient.NewListByServerPager +// method. func (client *OutboundFirewallRulesClient) NewListByServerPager(resourceGroupName string, serverName string, options *OutboundFirewallRulesClientListByServerOptions) *runtime.Pager[OutboundFirewallRulesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[OutboundFirewallRulesClientListByServerResponse]{ More: func(page OutboundFirewallRulesClientListByServerResponse) bool { @@ -307,7 +313,7 @@ func (client *OutboundFirewallRulesClient) listByServerCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_privateendpointconnections_client.go rename to sdk/resourcemanager/sql/armsql/privateendpointconnections_client.go index 8debc8fe6f8e..b73de37cf1fe 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/sql/armsql/privateendpointconnections_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 armsql @@ -31,9 +32,9 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates a new instance of PrivateEndpointConnectionsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate +// method. func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) @@ -76,7 +78,8 @@ func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Approve or reject a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *PrivateEndpointConnectionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, parameters PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, parameters, options) if err != nil { @@ -116,7 +119,7 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -124,12 +127,13 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete +// method. func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, privateEndpointConnectionName, options) @@ -144,7 +148,8 @@ func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, // Delete - Deletes a private endpoint connection with a given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *PrivateEndpointConnectionsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, options) if err != nil { @@ -184,20 +189,21 @@ func (client *PrivateEndpointConnectionsClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// privateEndpointConnectionName - The name of the private endpoint connection. -// options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - privateEndpointConnectionName - The name of the private endpoint connection. +// - options - PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get +// method. func (client *PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientGetOptions) (PrivateEndpointConnectionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, privateEndpointConnectionName, options) if err != nil { @@ -237,7 +243,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,13 +259,13 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res } // NewListByServerPager - Gets all private endpoint connections on a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - PrivateEndpointConnectionsClientListByServerOptions contains the optional parameters for the PrivateEndpointConnectionsClient.NewListByServerPager +// method. func (client *PrivateEndpointConnectionsClient) NewListByServerPager(resourceGroupName string, serverName string, options *PrivateEndpointConnectionsClientListByServerOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionsClientListByServerResponse]{ More: func(page PrivateEndpointConnectionsClientListByServerResponse) bool { @@ -308,7 +314,7 @@ func (client *PrivateEndpointConnectionsClient) listByServerCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/sql/armsql/privatelinkresources_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_privatelinkresources_client.go rename to sdk/resourcemanager/sql/armsql/privatelinkresources_client.go index 4603c3d235b6..9e3e0cac36f3 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/sql/armsql/privatelinkresources_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 armsql @@ -31,9 +32,9 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates a new instance of PrivateLinkResourcesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // Get - Gets a private link resource for SQL server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// groupName - The name of the private link resource. -// options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - groupName - The name of the private link resource. +// - options - PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get +// method. func (client *PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, serverName string, groupName string, options *PrivateLinkResourcesClientGetOptions) (PrivateLinkResourcesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, groupName, options) if err != nil { @@ -102,7 +104,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,13 +120,13 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) } // NewListByServerPager - Gets the private link resources for SQL server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - PrivateLinkResourcesClientListByServerOptions contains the optional parameters for the PrivateLinkResourcesClient.NewListByServerPager +// method. func (client *PrivateLinkResourcesClient) NewListByServerPager(resourceGroupName string, serverName string, options *PrivateLinkResourcesClientListByServerOptions) *runtime.Pager[PrivateLinkResourcesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[PrivateLinkResourcesClientListByServerResponse]{ More: func(page PrivateLinkResourcesClientListByServerResponse) bool { @@ -173,7 +175,7 @@ func (client *PrivateLinkResourcesClient) listByServerCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_recommendedsensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_recommendedsensitivitylabels_client.go rename to sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_client.go index 81aa6ba05018..82ea741b75b5 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_recommendedsensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/recommendedsensitivitylabels_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 armsql @@ -31,9 +32,9 @@ type RecommendedSensitivityLabelsClient struct { } // NewRecommendedSensitivityLabelsClient creates a new instance of RecommendedSensitivityLabelsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRecommendedSensitivityLabelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RecommendedSensitivityLabelsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewRecommendedSensitivityLabelsClient(subscriptionID string, credential azc // Update - Update recommended sensitivity labels states of a given database using an operations batch. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - RecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the RecommendedSensitivityLabelsClient.Update -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - RecommendedSensitivityLabelsClientUpdateOptions contains the optional parameters for the RecommendedSensitivityLabelsClient.Update +// method. func (client *RecommendedSensitivityLabelsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters RecommendedSensitivityLabelUpdateList, options *RecommendedSensitivityLabelsClientUpdateOptions) (RecommendedSensitivityLabelsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -102,7 +104,7 @@ func (client *RecommendedSensitivityLabelsClient) updateCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, parameters) } diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_recoverabledatabases_client.go b/sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go similarity index 80% rename from sdk/resourcemanager/sql/armsql/zz_generated_recoverabledatabases_client.go rename to sdk/resourcemanager/sql/armsql/recoverabledatabases_client.go index 1449ba022497..ed95aae85389 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_recoverabledatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/recoverabledatabases_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 armsql @@ -31,9 +32,9 @@ type RecoverableDatabasesClient struct { } // NewRecoverableDatabasesClient creates a new instance of RecoverableDatabasesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRecoverableDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RecoverableDatabasesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,15 +55,16 @@ func NewRecoverableDatabasesClient(subscriptionID string, credential azcore.Toke return client, nil } -// Get - Gets a recoverable database, which is a resource representing a database's geo backup +// Get - Gets a recoverable database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database -// options - RecoverableDatabasesClientGetOptions contains the optional parameters for the RecoverableDatabasesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - RecoverableDatabasesClientGetOptions contains the optional parameters for the RecoverableDatabasesClient.Get +// method. func (client *RecoverableDatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *RecoverableDatabasesClientGetOptions) (RecoverableDatabasesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) if err != nil { @@ -81,10 +83,6 @@ func (client *RecoverableDatabasesClient) Get(ctx context.Context, resourceGroup // getCreateRequest creates the Get request. func (client *RecoverableDatabasesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *RecoverableDatabasesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases/{databaseName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -97,12 +95,22 @@ func (client *RecoverableDatabasesClient) getCreateRequest(ctx context.Context, return nil, errors.New("parameter databaseName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,21 +125,27 @@ func (client *RecoverableDatabasesClient) getHandleResponse(resp *http.Response) return result, nil } -// NewListByServerPager - Gets a list of recoverable databases -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - RecoverableDatabasesClientListByServerOptions contains the optional parameters for the RecoverableDatabasesClient.ListByServer -// method. +// NewListByServerPager - Gets a list of recoverable databases. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - RecoverableDatabasesClientListByServerOptions contains the optional parameters for the RecoverableDatabasesClient.NewListByServerPager +// method. func (client *RecoverableDatabasesClient) NewListByServerPager(resourceGroupName string, serverName string, options *RecoverableDatabasesClientListByServerOptions) *runtime.Pager[RecoverableDatabasesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[RecoverableDatabasesClientListByServerResponse]{ More: func(page RecoverableDatabasesClientListByServerResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *RecoverableDatabasesClientListByServerResponse) (RecoverableDatabasesClientListByServerResponse, error) { - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + var req *policy.Request + var err error + if page == nil { + req, err = client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { return RecoverableDatabasesClientListByServerResponse{}, err } @@ -150,10 +164,6 @@ func (client *RecoverableDatabasesClient) NewListByServerPager(resourceGroupName // listByServerCreateRequest creates the ListByServer request. func (client *RecoverableDatabasesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *RecoverableDatabasesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/recoverableDatabases" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -162,12 +172,16 @@ func (client *RecoverableDatabasesClient) listByServerCreateRequest(ctx context. return nil, errors.New("parameter serverName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_recoverablemanageddatabases_client.go b/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_recoverablemanageddatabases_client.go rename to sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_client.go index 3d1469611e88..dcec228083d8 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_recoverablemanageddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/recoverablemanageddatabases_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 armsql @@ -31,9 +32,9 @@ type RecoverableManagedDatabasesClient struct { } // NewRecoverableManagedDatabasesClient creates a new instance of RecoverableManagedDatabasesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRecoverableManagedDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RecoverableManagedDatabasesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewRecoverableManagedDatabasesClient(subscriptionID string, credential azco // Get - Gets a recoverable managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - RecoverableManagedDatabasesClientGetOptions contains the optional parameters for the RecoverableManagedDatabasesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - RecoverableManagedDatabasesClientGetOptions contains the optional parameters for the RecoverableManagedDatabasesClient.Get +// method. func (client *RecoverableManagedDatabasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, recoverableDatabaseName string, options *RecoverableManagedDatabasesClientGetOptions) (RecoverableManagedDatabasesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, recoverableDatabaseName, options) if err != nil { @@ -101,7 +103,7 @@ func (client *RecoverableManagedDatabasesClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,13 +119,13 @@ func (client *RecoverableManagedDatabasesClient) getHandleResponse(resp *http.Re } // NewListByInstancePager - Gets a list of recoverable managed databases. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - RecoverableManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RecoverableManagedDatabasesClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - RecoverableManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RecoverableManagedDatabasesClient.NewListByInstancePager +// method. func (client *RecoverableManagedDatabasesClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *RecoverableManagedDatabasesClientListByInstanceOptions) *runtime.Pager[RecoverableManagedDatabasesClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[RecoverableManagedDatabasesClientListByInstanceResponse]{ More: func(page RecoverableManagedDatabasesClientListByInstanceResponse) bool { @@ -172,7 +174,7 @@ func (client *RecoverableManagedDatabasesClient) listByInstanceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_replicationlinks_client.go b/sdk/resourcemanager/sql/armsql/replicationlinks_client.go similarity index 80% rename from sdk/resourcemanager/sql/armsql/zz_generated_replicationlinks_client.go rename to sdk/resourcemanager/sql/armsql/replicationlinks_client.go index 3640d9ea280e..c76b5864d5a2 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_replicationlinks_client.go +++ b/sdk/resourcemanager/sql/armsql/replicationlinks_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 armsql @@ -31,9 +32,9 @@ type ReplicationLinksClient struct { } // NewReplicationLinksClient creates a new instance of ReplicationLinksClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewReplicationLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReplicationLinksClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,31 +55,49 @@ func NewReplicationLinksClient(subscriptionID string, credential azcore.TokenCre return client, nil } +// BeginDelete - Deletes the replication link. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - ReplicationLinksClientBeginDeleteOptions contains the optional parameters for the ReplicationLinksClient.BeginDelete +// method. +func (client *ReplicationLinksClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginDeleteOptions) (*runtime.Poller[ReplicationLinksClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, databaseName, linkID, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ReplicationLinksClientDeleteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ReplicationLinksClientDeleteResponse](options.ResumeToken, client.pl, nil) + } +} + // Delete - Deletes the replication link. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - ReplicationLinksClientDeleteOptions contains the optional parameters for the ReplicationLinksClient.Delete method. -func (client *ReplicationLinksClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientDeleteOptions) (ReplicationLinksClientDeleteResponse, error) { +// +// Generated from API version 2022-11-01-preview +func (client *ReplicationLinksClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) if err != nil { - return ReplicationLinksClientDeleteResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return ReplicationLinksClientDeleteResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ReplicationLinksClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) } - return ReplicationLinksClientDeleteResponse{}, nil + return resp, nil } // deleteCreateRequest creates the Delete request. -func (client *ReplicationLinksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientDeleteOptions) (*policy.Request, error) { +func (client *ReplicationLinksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginDeleteOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/replicationLinks/{linkId}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -105,21 +124,22 @@ func (client *ReplicationLinksClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginFailover - Fails over from the current primary server to this server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// linkID - The name of the replication link. -// options - ReplicationLinksClientBeginFailoverOptions contains the optional parameters for the ReplicationLinksClient.BeginFailover -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - linkID - The name of the replication link. +// - options - ReplicationLinksClientBeginFailoverOptions contains the optional parameters for the ReplicationLinksClient.BeginFailover +// method. func (client *ReplicationLinksClient) BeginFailover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginFailoverOptions) (*runtime.Poller[ReplicationLinksClientFailoverResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.failover(ctx, resourceGroupName, serverName, databaseName, linkID, options) @@ -134,7 +154,8 @@ func (client *ReplicationLinksClient) BeginFailover(ctx context.Context, resourc // Failover - Fails over from the current primary server to this server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ReplicationLinksClient) failover(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginFailoverOptions) (*http.Response, error) { req, err := client.failoverCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) if err != nil { @@ -178,7 +199,7 @@ func (client *ReplicationLinksClient) failoverCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,14 +207,15 @@ func (client *ReplicationLinksClient) failoverCreateRequest(ctx context.Context, // BeginFailoverAllowDataLoss - Fails over from the current primary server to this server allowing data loss. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// linkID - The name of the replication link. -// options - ReplicationLinksClientBeginFailoverAllowDataLossOptions contains the optional parameters for the ReplicationLinksClient.BeginFailoverAllowDataLoss -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - linkID - The name of the replication link. +// - options - ReplicationLinksClientBeginFailoverAllowDataLossOptions contains the optional parameters for the ReplicationLinksClient.BeginFailoverAllowDataLoss +// method. func (client *ReplicationLinksClient) BeginFailoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginFailoverAllowDataLossOptions) (*runtime.Poller[ReplicationLinksClientFailoverAllowDataLossResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.failoverAllowDataLoss(ctx, resourceGroupName, serverName, databaseName, linkID, options) @@ -208,7 +230,8 @@ func (client *ReplicationLinksClient) BeginFailoverAllowDataLoss(ctx context.Con // FailoverAllowDataLoss - Fails over from the current primary server to this server allowing data loss. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ReplicationLinksClient) failoverAllowDataLoss(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientBeginFailoverAllowDataLossOptions) (*http.Response, error) { req, err := client.failoverAllowDataLossCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) if err != nil { @@ -252,7 +275,7 @@ func (client *ReplicationLinksClient) failoverAllowDataLossCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,13 +283,14 @@ func (client *ReplicationLinksClient) failoverAllowDataLossCreateRequest(ctx con // Get - Gets a replication link. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// linkID - The name of the replication link. -// options - ReplicationLinksClientGetOptions contains the optional parameters for the ReplicationLinksClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - linkID - The name of the replication link. +// - options - ReplicationLinksClientGetOptions contains the optional parameters for the ReplicationLinksClient.Get method. func (client *ReplicationLinksClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, linkID string, options *ReplicationLinksClientGetOptions) (ReplicationLinksClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, linkID, options) if err != nil { @@ -310,7 +334,7 @@ func (client *ReplicationLinksClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,14 +350,14 @@ func (client *ReplicationLinksClient) getHandleResponse(resp *http.Response) (Re } // NewListByDatabasePager - Gets a list of replication links on database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - ReplicationLinksClientListByDatabaseOptions contains the optional parameters for the ReplicationLinksClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - ReplicationLinksClientListByDatabaseOptions contains the optional parameters for the ReplicationLinksClient.NewListByDatabasePager +// method. func (client *ReplicationLinksClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *ReplicationLinksClientListByDatabaseOptions) *runtime.Pager[ReplicationLinksClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationLinksClientListByDatabaseResponse]{ More: func(page ReplicationLinksClientListByDatabaseResponse) bool { @@ -386,7 +410,7 @@ func (client *ReplicationLinksClient) listByDatabaseCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,13 +426,13 @@ func (client *ReplicationLinksClient) listByDatabaseHandleResponse(resp *http.Re } // NewListByServerPager - Gets a list of replication links. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ReplicationLinksClientListByServerOptions contains the optional parameters for the ReplicationLinksClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ReplicationLinksClientListByServerOptions contains the optional parameters for the ReplicationLinksClient.NewListByServerPager +// method. func (client *ReplicationLinksClient) NewListByServerPager(resourceGroupName string, serverName string, options *ReplicationLinksClientListByServerOptions) *runtime.Pager[ReplicationLinksClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ReplicationLinksClientListByServerResponse]{ More: func(page ReplicationLinksClientListByServerResponse) bool { @@ -457,7 +481,7 @@ func (client *ReplicationLinksClient) listByServerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_response_types.go b/sdk/resourcemanager/sql/armsql/response_types.go similarity index 71% rename from sdk/resourcemanager/sql/armsql/zz_generated_response_types.go rename to sdk/resourcemanager/sql/armsql/response_types.go index 6883c0aec70e..5aecc3c64477 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_response_types.go +++ b/sdk/resourcemanager/sql/armsql/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 armsql @@ -18,7 +19,7 @@ type AgentClientGetResponse struct { AgentConfiguration } -// BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method BackupShortTermRetentionPoliciesClient.CreateOrUpdate. +// BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method BackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate. type BackupShortTermRetentionPoliciesClientCreateOrUpdateResponse struct { BackupShortTermRetentionPolicy } @@ -28,12 +29,12 @@ type BackupShortTermRetentionPoliciesClientGetResponse struct { BackupShortTermRetentionPolicy } -// BackupShortTermRetentionPoliciesClientListByDatabaseResponse contains the response from method BackupShortTermRetentionPoliciesClient.ListByDatabase. +// BackupShortTermRetentionPoliciesClientListByDatabaseResponse contains the response from method BackupShortTermRetentionPoliciesClient.NewListByDatabasePager. type BackupShortTermRetentionPoliciesClientListByDatabaseResponse struct { BackupShortTermRetentionPolicyListResult } -// BackupShortTermRetentionPoliciesClientUpdateResponse contains the response from method BackupShortTermRetentionPoliciesClient.Update. +// BackupShortTermRetentionPoliciesClientUpdateResponse contains the response from method BackupShortTermRetentionPoliciesClient.BeginUpdate. type BackupShortTermRetentionPoliciesClientUpdateResponse struct { BackupShortTermRetentionPolicy } @@ -58,7 +59,7 @@ type DataMaskingRulesClientCreateOrUpdateResponse struct { DataMaskingRule } -// DataMaskingRulesClientListByDatabaseResponse contains the response from method DataMaskingRulesClient.ListByDatabase. +// DataMaskingRulesClientListByDatabaseResponse contains the response from method DataMaskingRulesClient.NewListByDatabasePager. type DataMaskingRulesClientListByDatabaseResponse struct { DataMaskingRuleListResult } @@ -68,7 +69,7 @@ type DataWarehouseUserActivitiesClientGetResponse struct { DataWarehouseUserActivities } -// DataWarehouseUserActivitiesClientListByDatabaseResponse contains the response from method DataWarehouseUserActivitiesClient.ListByDatabase. +// DataWarehouseUserActivitiesClientListByDatabaseResponse contains the response from method DataWarehouseUserActivitiesClient.NewListByDatabasePager. type DataWarehouseUserActivitiesClientListByDatabaseResponse struct { DataWarehouseUserActivitiesListResult } @@ -83,7 +84,7 @@ type DatabaseAdvancedThreatProtectionSettingsClientGetResponse struct { DatabaseAdvancedThreatProtection } -// DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse contains the response from method DatabaseAdvancedThreatProtectionSettingsClient.ListByDatabase. +// DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse contains the response from method DatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager. type DatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse struct { DatabaseAdvancedThreatProtectionListResult } @@ -124,7 +125,7 @@ type DatabaseBlobAuditingPoliciesClientGetResponse struct { DatabaseBlobAuditingPolicy } -// DatabaseBlobAuditingPoliciesClientListByDatabaseResponse contains the response from method DatabaseBlobAuditingPoliciesClient.ListByDatabase. +// DatabaseBlobAuditingPoliciesClientListByDatabaseResponse contains the response from method DatabaseBlobAuditingPoliciesClient.NewListByDatabasePager. type DatabaseBlobAuditingPoliciesClientListByDatabaseResponse struct { DatabaseBlobAuditingPolicyListResult } @@ -134,17 +135,27 @@ type DatabaseColumnsClientGetResponse struct { DatabaseColumn } -// DatabaseColumnsClientListByDatabaseResponse contains the response from method DatabaseColumnsClient.ListByDatabase. +// DatabaseColumnsClientListByDatabaseResponse contains the response from method DatabaseColumnsClient.NewListByDatabasePager. type DatabaseColumnsClientListByDatabaseResponse struct { DatabaseColumnListResult } -// DatabaseColumnsClientListByTableResponse contains the response from method DatabaseColumnsClient.ListByTable. +// DatabaseColumnsClientListByTableResponse contains the response from method DatabaseColumnsClient.NewListByTablePager. type DatabaseColumnsClientListByTableResponse struct { DatabaseColumnListResult } -// DatabaseExtensionsClientCreateOrUpdateResponse contains the response from method DatabaseExtensionsClient.CreateOrUpdate. +// DatabaseEncryptionProtectorsClientRevalidateResponse contains the response from method DatabaseEncryptionProtectorsClient.BeginRevalidate. +type DatabaseEncryptionProtectorsClientRevalidateResponse struct { + // placeholder for future response values +} + +// DatabaseEncryptionProtectorsClientRevertResponse contains the response from method DatabaseEncryptionProtectorsClient.BeginRevert. +type DatabaseEncryptionProtectorsClientRevertResponse struct { + // placeholder for future response values +} + +// DatabaseExtensionsClientCreateOrUpdateResponse contains the response from method DatabaseExtensionsClient.BeginCreateOrUpdate. type DatabaseExtensionsClientCreateOrUpdateResponse struct { ImportExportExtensionsOperationResult } @@ -154,7 +165,7 @@ type DatabaseExtensionsClientGetResponse struct { // placeholder for future response values } -// DatabaseExtensionsClientListByDatabaseResponse contains the response from method DatabaseExtensionsClient.ListByDatabase. +// DatabaseExtensionsClientListByDatabaseResponse contains the response from method DatabaseExtensionsClient.NewListByDatabasePager. type DatabaseExtensionsClientListByDatabaseResponse struct { ImportExportExtensionsOperationListResult } @@ -164,7 +175,7 @@ type DatabaseOperationsClientCancelResponse struct { // placeholder for future response values } -// DatabaseOperationsClientListByDatabaseResponse contains the response from method DatabaseOperationsClient.ListByDatabase. +// DatabaseOperationsClientListByDatabaseResponse contains the response from method DatabaseOperationsClient.NewListByDatabasePager. type DatabaseOperationsClientListByDatabaseResponse struct { DatabaseOperationListResult } @@ -185,12 +196,84 @@ type DatabaseRecommendedActionsClientUpdateResponse struct { RecommendedAction } +// DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse contains the response from method DatabaseSQLVulnerabilityAssessmentBaselinesClient.CreateOrUpdate. +type DatabaseSQLVulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse struct { + DatabaseSQLVulnerabilityAssessmentBaselineSet +} + +// DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse contains the response from method DatabaseSQLVulnerabilityAssessmentBaselinesClient.Get. +type DatabaseSQLVulnerabilityAssessmentBaselinesClientGetResponse struct { + DatabaseSQLVulnerabilityAssessmentBaselineSet +} + +// DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse contains the response from method +// DatabaseSQLVulnerabilityAssessmentBaselinesClient.NewListBySQLVulnerabilityAssessmentPager. +type DatabaseSQLVulnerabilityAssessmentBaselinesClientListBySQLVulnerabilityAssessmentResponse struct { + DatabaseSQLVulnerabilityAssessmentBaselineSetListResult +} + +// DatabaseSQLVulnerabilityAssessmentExecuteScanClientExecuteResponse contains the response from method DatabaseSQLVulnerabilityAssessmentExecuteScanClient.BeginExecute. +type DatabaseSQLVulnerabilityAssessmentExecuteScanClientExecuteResponse struct { + // placeholder for future response values +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse contains the response from method DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.CreateOrUpdate. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientCreateOrUpdateResponse struct { + DatabaseSQLVulnerabilityAssessmentRuleBaseline +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse contains the response from method DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Delete. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientDeleteResponse struct { + // placeholder for future response values +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse contains the response from method DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.Get. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientGetResponse struct { + DatabaseSQLVulnerabilityAssessmentRuleBaseline +} + +// DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse contains the response from method DatabaseSQLVulnerabilityAssessmentRuleBaselinesClient.NewListByBaselinePager. +type DatabaseSQLVulnerabilityAssessmentRuleBaselinesClientListByBaselineResponse struct { + DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult +} + +// DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse contains the response from method DatabaseSQLVulnerabilityAssessmentScanResultClient.Get. +type DatabaseSQLVulnerabilityAssessmentScanResultClientGetResponse struct { + VulnerabilityAssessmentScanResults +} + +// DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse contains the response from method DatabaseSQLVulnerabilityAssessmentScanResultClient.NewListByScanPager. +type DatabaseSQLVulnerabilityAssessmentScanResultClientListByScanResponse struct { + VulnerabilityAssessmentScanListResult +} + +// DatabaseSQLVulnerabilityAssessmentScansClientGetResponse contains the response from method DatabaseSQLVulnerabilityAssessmentScansClient.Get. +type DatabaseSQLVulnerabilityAssessmentScansClientGetResponse struct { + VulnerabilityAssessmentScanRecordForSQL +} + +// DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse contains the response from method +// DatabaseSQLVulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager. +type DatabaseSQLVulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse struct { + VulnerabilityAssessmentScanRecordForSQLListResult +} + +// DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse contains the response from method DatabaseSQLVulnerabilityAssessmentsSettingsClient.Get. +type DatabaseSQLVulnerabilityAssessmentsSettingsClientGetResponse struct { + VulnerabilityAssessment +} + +// DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse contains the response from method DatabaseSQLVulnerabilityAssessmentsSettingsClient.NewListByDatabasePager. +type DatabaseSQLVulnerabilityAssessmentsSettingsClientListByDatabaseResponse struct { + VulnerabilityAssessmentListResult +} + // DatabaseSchemasClientGetResponse contains the response from method DatabaseSchemasClient.Get. type DatabaseSchemasClientGetResponse struct { DatabaseSchema } -// DatabaseSchemasClientListByDatabaseResponse contains the response from method DatabaseSchemasClient.ListByDatabase. +// DatabaseSchemasClientListByDatabaseResponse contains the response from method DatabaseSchemasClient.NewListByDatabasePager. type DatabaseSchemasClientListByDatabaseResponse struct { DatabaseSchemaListResult } @@ -205,7 +288,7 @@ type DatabaseSecurityAlertPoliciesClientGetResponse struct { DatabaseSecurityAlertPolicy } -// DatabaseSecurityAlertPoliciesClientListByDatabaseResponse contains the response from method DatabaseSecurityAlertPoliciesClient.ListByDatabase. +// DatabaseSecurityAlertPoliciesClientListByDatabaseResponse contains the response from method DatabaseSecurityAlertPoliciesClient.NewListByDatabasePager. type DatabaseSecurityAlertPoliciesClientListByDatabaseResponse struct { DatabaseSecurityAlertListResult } @@ -215,12 +298,12 @@ type DatabaseTablesClientGetResponse struct { DatabaseTable } -// DatabaseTablesClientListBySchemaResponse contains the response from method DatabaseTablesClient.ListBySchema. +// DatabaseTablesClientListBySchemaResponse contains the response from method DatabaseTablesClient.NewListBySchemaPager. type DatabaseTablesClientListBySchemaResponse struct { DatabaseTableListResult } -// DatabaseUsagesClientListByDatabaseResponse contains the response from method DatabaseUsagesClient.ListByDatabase. +// DatabaseUsagesClientListByDatabaseResponse contains the response from method DatabaseUsagesClient.NewListByDatabasePager. type DatabaseUsagesClientListByDatabaseResponse struct { DatabaseUsageListResult } @@ -250,12 +333,12 @@ type DatabaseVulnerabilityAssessmentScansClientGetResponse struct { VulnerabilityAssessmentScanRecord } -// DatabaseVulnerabilityAssessmentScansClientInitiateScanResponse contains the response from method DatabaseVulnerabilityAssessmentScansClient.InitiateScan. +// DatabaseVulnerabilityAssessmentScansClientInitiateScanResponse contains the response from method DatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan. type DatabaseVulnerabilityAssessmentScansClientInitiateScanResponse struct { // placeholder for future response values } -// DatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse contains the response from method DatabaseVulnerabilityAssessmentScansClient.ListByDatabase. +// DatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse contains the response from method DatabaseVulnerabilityAssessmentScansClient.NewListByDatabasePager. type DatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse struct { VulnerabilityAssessmentScanRecordListResult } @@ -275,27 +358,27 @@ type DatabaseVulnerabilityAssessmentsClientGetResponse struct { DatabaseVulnerabilityAssessment } -// DatabaseVulnerabilityAssessmentsClientListByDatabaseResponse contains the response from method DatabaseVulnerabilityAssessmentsClient.ListByDatabase. +// DatabaseVulnerabilityAssessmentsClientListByDatabaseResponse contains the response from method DatabaseVulnerabilityAssessmentsClient.NewListByDatabasePager. type DatabaseVulnerabilityAssessmentsClientListByDatabaseResponse struct { DatabaseVulnerabilityAssessmentListResult } -// DatabasesClientCreateOrUpdateResponse contains the response from method DatabasesClient.CreateOrUpdate. +// DatabasesClientCreateOrUpdateResponse contains the response from method DatabasesClient.BeginCreateOrUpdate. type DatabasesClientCreateOrUpdateResponse struct { Database } -// DatabasesClientDeleteResponse contains the response from method DatabasesClient.Delete. +// DatabasesClientDeleteResponse contains the response from method DatabasesClient.BeginDelete. type DatabasesClientDeleteResponse struct { // placeholder for future response values } -// DatabasesClientExportResponse contains the response from method DatabasesClient.Export. +// DatabasesClientExportResponse contains the response from method DatabasesClient.BeginExport. type DatabasesClientExportResponse struct { ImportExportOperationResult } -// DatabasesClientFailoverResponse contains the response from method DatabasesClient.Failover. +// DatabasesClientFailoverResponse contains the response from method DatabasesClient.BeginFailover. type DatabasesClientFailoverResponse struct { // placeholder for future response values } @@ -305,37 +388,27 @@ type DatabasesClientGetResponse struct { Database } -// DatabasesClientImportResponse contains the response from method DatabasesClient.Import. +// DatabasesClientImportResponse contains the response from method DatabasesClient.BeginImport. type DatabasesClientImportResponse struct { ImportExportOperationResult } -// DatabasesClientListByElasticPoolResponse contains the response from method DatabasesClient.ListByElasticPool. +// DatabasesClientListByElasticPoolResponse contains the response from method DatabasesClient.NewListByElasticPoolPager. type DatabasesClientListByElasticPoolResponse struct { DatabaseListResult } -// DatabasesClientListByServerResponse contains the response from method DatabasesClient.ListByServer. +// DatabasesClientListByServerResponse contains the response from method DatabasesClient.NewListByServerPager. type DatabasesClientListByServerResponse struct { DatabaseListResult } -// DatabasesClientListInaccessibleByServerResponse contains the response from method DatabasesClient.ListInaccessibleByServer. +// DatabasesClientListInaccessibleByServerResponse contains the response from method DatabasesClient.NewListInaccessibleByServerPager. type DatabasesClientListInaccessibleByServerResponse struct { DatabaseListResult } -// DatabasesClientListMetricDefinitionsResponse contains the response from method DatabasesClient.ListMetricDefinitions. -type DatabasesClientListMetricDefinitionsResponse struct { - MetricDefinitionListResult -} - -// DatabasesClientListMetricsResponse contains the response from method DatabasesClient.ListMetrics. -type DatabasesClientListMetricsResponse struct { - MetricListResult -} - -// DatabasesClientPauseResponse contains the response from method DatabasesClient.Pause. +// DatabasesClientPauseResponse contains the response from method DatabasesClient.BeginPause. type DatabasesClientPauseResponse struct { Database } @@ -345,17 +418,17 @@ type DatabasesClientRenameResponse struct { // placeholder for future response values } -// DatabasesClientResumeResponse contains the response from method DatabasesClient.Resume. +// DatabasesClientResumeResponse contains the response from method DatabasesClient.BeginResume. type DatabasesClientResumeResponse struct { Database } -// DatabasesClientUpdateResponse contains the response from method DatabasesClient.Update. +// DatabasesClientUpdateResponse contains the response from method DatabasesClient.BeginUpdate. type DatabasesClientUpdateResponse struct { Database } -// DatabasesClientUpgradeDataWarehouseResponse contains the response from method DatabasesClient.UpgradeDataWarehouse. +// DatabasesClientUpgradeDataWarehouseResponse contains the response from method DatabasesClient.BeginUpgradeDataWarehouse. type DatabasesClientUpgradeDataWarehouseResponse struct { // placeholder for future response values } @@ -365,27 +438,27 @@ type DeletedServersClientGetResponse struct { DeletedServer } -// DeletedServersClientListByLocationResponse contains the response from method DeletedServersClient.ListByLocation. +// DeletedServersClientListByLocationResponse contains the response from method DeletedServersClient.NewListByLocationPager. type DeletedServersClientListByLocationResponse struct { DeletedServerListResult } -// DeletedServersClientListResponse contains the response from method DeletedServersClient.List. +// DeletedServersClientListResponse contains the response from method DeletedServersClient.NewListPager. type DeletedServersClientListResponse struct { DeletedServerListResult } -// DeletedServersClientRecoverResponse contains the response from method DeletedServersClient.Recover. +// DeletedServersClientRecoverResponse contains the response from method DeletedServersClient.BeginRecover. type DeletedServersClientRecoverResponse struct { DeletedServer } -// DistributedAvailabilityGroupsClientCreateOrUpdateResponse contains the response from method DistributedAvailabilityGroupsClient.CreateOrUpdate. +// DistributedAvailabilityGroupsClientCreateOrUpdateResponse contains the response from method DistributedAvailabilityGroupsClient.BeginCreateOrUpdate. type DistributedAvailabilityGroupsClientCreateOrUpdateResponse struct { DistributedAvailabilityGroup } -// DistributedAvailabilityGroupsClientDeleteResponse contains the response from method DistributedAvailabilityGroupsClient.Delete. +// DistributedAvailabilityGroupsClientDeleteResponse contains the response from method DistributedAvailabilityGroupsClient.BeginDelete. type DistributedAvailabilityGroupsClientDeleteResponse struct { // placeholder for future response values } @@ -395,24 +468,19 @@ type DistributedAvailabilityGroupsClientGetResponse struct { DistributedAvailabilityGroup } -// DistributedAvailabilityGroupsClientListByInstanceResponse contains the response from method DistributedAvailabilityGroupsClient.ListByInstance. +// DistributedAvailabilityGroupsClientListByInstanceResponse contains the response from method DistributedAvailabilityGroupsClient.NewListByInstancePager. type DistributedAvailabilityGroupsClientListByInstanceResponse struct { DistributedAvailabilityGroupsListResult } -// DistributedAvailabilityGroupsClientUpdateResponse contains the response from method DistributedAvailabilityGroupsClient.Update. -type DistributedAvailabilityGroupsClientUpdateResponse struct { +// DistributedAvailabilityGroupsClientSetRoleResponse contains the response from method DistributedAvailabilityGroupsClient.BeginSetRole. +type DistributedAvailabilityGroupsClientSetRoleResponse struct { DistributedAvailabilityGroup } -// ElasticPoolActivitiesClientListByElasticPoolResponse contains the response from method ElasticPoolActivitiesClient.ListByElasticPool. -type ElasticPoolActivitiesClientListByElasticPoolResponse struct { - ElasticPoolActivityListResult -} - -// ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse contains the response from method ElasticPoolDatabaseActivitiesClient.ListByElasticPool. -type ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse struct { - ElasticPoolDatabaseActivityListResult +// DistributedAvailabilityGroupsClientUpdateResponse contains the response from method DistributedAvailabilityGroupsClient.BeginUpdate. +type DistributedAvailabilityGroupsClientUpdateResponse struct { + DistributedAvailabilityGroup } // ElasticPoolOperationsClientCancelResponse contains the response from method ElasticPoolOperationsClient.Cancel. @@ -420,22 +488,22 @@ type ElasticPoolOperationsClientCancelResponse struct { // placeholder for future response values } -// ElasticPoolOperationsClientListByElasticPoolResponse contains the response from method ElasticPoolOperationsClient.ListByElasticPool. +// ElasticPoolOperationsClientListByElasticPoolResponse contains the response from method ElasticPoolOperationsClient.NewListByElasticPoolPager. type ElasticPoolOperationsClientListByElasticPoolResponse struct { ElasticPoolOperationListResult } -// ElasticPoolsClientCreateOrUpdateResponse contains the response from method ElasticPoolsClient.CreateOrUpdate. +// ElasticPoolsClientCreateOrUpdateResponse contains the response from method ElasticPoolsClient.BeginCreateOrUpdate. type ElasticPoolsClientCreateOrUpdateResponse struct { ElasticPool } -// ElasticPoolsClientDeleteResponse contains the response from method ElasticPoolsClient.Delete. +// ElasticPoolsClientDeleteResponse contains the response from method ElasticPoolsClient.BeginDelete. type ElasticPoolsClientDeleteResponse struct { // placeholder for future response values } -// ElasticPoolsClientFailoverResponse contains the response from method ElasticPoolsClient.Failover. +// ElasticPoolsClientFailoverResponse contains the response from method ElasticPoolsClient.BeginFailover. type ElasticPoolsClientFailoverResponse struct { // placeholder for future response values } @@ -445,27 +513,17 @@ type ElasticPoolsClientGetResponse struct { ElasticPool } -// ElasticPoolsClientListByServerResponse contains the response from method ElasticPoolsClient.ListByServer. +// ElasticPoolsClientListByServerResponse contains the response from method ElasticPoolsClient.NewListByServerPager. type ElasticPoolsClientListByServerResponse struct { ElasticPoolListResult } -// ElasticPoolsClientListMetricDefinitionsResponse contains the response from method ElasticPoolsClient.ListMetricDefinitions. -type ElasticPoolsClientListMetricDefinitionsResponse struct { - MetricDefinitionListResult -} - -// ElasticPoolsClientListMetricsResponse contains the response from method ElasticPoolsClient.ListMetrics. -type ElasticPoolsClientListMetricsResponse struct { - MetricListResult -} - -// ElasticPoolsClientUpdateResponse contains the response from method ElasticPoolsClient.Update. +// ElasticPoolsClientUpdateResponse contains the response from method ElasticPoolsClient.BeginUpdate. type ElasticPoolsClientUpdateResponse struct { ElasticPool } -// EncryptionProtectorsClientCreateOrUpdateResponse contains the response from method EncryptionProtectorsClient.CreateOrUpdate. +// EncryptionProtectorsClientCreateOrUpdateResponse contains the response from method EncryptionProtectorsClient.BeginCreateOrUpdate. type EncryptionProtectorsClientCreateOrUpdateResponse struct { EncryptionProtector } @@ -475,12 +533,12 @@ type EncryptionProtectorsClientGetResponse struct { EncryptionProtector } -// EncryptionProtectorsClientListByServerResponse contains the response from method EncryptionProtectorsClient.ListByServer. +// EncryptionProtectorsClientListByServerResponse contains the response from method EncryptionProtectorsClient.NewListByServerPager. type EncryptionProtectorsClientListByServerResponse struct { EncryptionProtectorListResult } -// EncryptionProtectorsClientRevalidateResponse contains the response from method EncryptionProtectorsClient.Revalidate. +// EncryptionProtectorsClientRevalidateResponse contains the response from method EncryptionProtectorsClient.BeginRevalidate. type EncryptionProtectorsClientRevalidateResponse struct { // placeholder for future response values } @@ -490,7 +548,7 @@ type EndpointCertificatesClientGetResponse struct { EndpointCertificate } -// EndpointCertificatesClientListByInstanceResponse contains the response from method EndpointCertificatesClient.ListByInstance. +// EndpointCertificatesClientListByInstanceResponse contains the response from method EndpointCertificatesClient.NewListByInstancePager. type EndpointCertificatesClientListByInstanceResponse struct { EndpointCertificateListResult } @@ -505,12 +563,12 @@ type ExtendedDatabaseBlobAuditingPoliciesClientGetResponse struct { ExtendedDatabaseBlobAuditingPolicy } -// ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResponse contains the response from method ExtendedDatabaseBlobAuditingPoliciesClient.ListByDatabase. +// ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResponse contains the response from method ExtendedDatabaseBlobAuditingPoliciesClient.NewListByDatabasePager. type ExtendedDatabaseBlobAuditingPoliciesClientListByDatabaseResponse struct { ExtendedDatabaseBlobAuditingPolicyListResult } -// ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse contains the response from method ExtendedServerBlobAuditingPoliciesClient.CreateOrUpdate. +// ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse contains the response from method ExtendedServerBlobAuditingPoliciesClient.BeginCreateOrUpdate. type ExtendedServerBlobAuditingPoliciesClientCreateOrUpdateResponse struct { ExtendedServerBlobAuditingPolicy } @@ -520,27 +578,27 @@ type ExtendedServerBlobAuditingPoliciesClientGetResponse struct { ExtendedServerBlobAuditingPolicy } -// ExtendedServerBlobAuditingPoliciesClientListByServerResponse contains the response from method ExtendedServerBlobAuditingPoliciesClient.ListByServer. +// ExtendedServerBlobAuditingPoliciesClientListByServerResponse contains the response from method ExtendedServerBlobAuditingPoliciesClient.NewListByServerPager. type ExtendedServerBlobAuditingPoliciesClientListByServerResponse struct { ExtendedServerBlobAuditingPolicyListResult } -// FailoverGroupsClientCreateOrUpdateResponse contains the response from method FailoverGroupsClient.CreateOrUpdate. +// FailoverGroupsClientCreateOrUpdateResponse contains the response from method FailoverGroupsClient.BeginCreateOrUpdate. type FailoverGroupsClientCreateOrUpdateResponse struct { FailoverGroup } -// FailoverGroupsClientDeleteResponse contains the response from method FailoverGroupsClient.Delete. +// FailoverGroupsClientDeleteResponse contains the response from method FailoverGroupsClient.BeginDelete. type FailoverGroupsClientDeleteResponse struct { // placeholder for future response values } -// FailoverGroupsClientFailoverResponse contains the response from method FailoverGroupsClient.Failover. +// FailoverGroupsClientFailoverResponse contains the response from method FailoverGroupsClient.BeginFailover. type FailoverGroupsClientFailoverResponse struct { FailoverGroup } -// FailoverGroupsClientForceFailoverAllowDataLossResponse contains the response from method FailoverGroupsClient.ForceFailoverAllowDataLoss. +// FailoverGroupsClientForceFailoverAllowDataLossResponse contains the response from method FailoverGroupsClient.BeginForceFailoverAllowDataLoss. type FailoverGroupsClientForceFailoverAllowDataLossResponse struct { FailoverGroup } @@ -550,12 +608,17 @@ type FailoverGroupsClientGetResponse struct { FailoverGroup } -// FailoverGroupsClientListByServerResponse contains the response from method FailoverGroupsClient.ListByServer. +// FailoverGroupsClientListByServerResponse contains the response from method FailoverGroupsClient.NewListByServerPager. type FailoverGroupsClientListByServerResponse struct { FailoverGroupListResult } -// FailoverGroupsClientUpdateResponse contains the response from method FailoverGroupsClient.Update. +// FailoverGroupsClientTryPlannedBeforeForcedFailoverResponse contains the response from method FailoverGroupsClient.BeginTryPlannedBeforeForcedFailover. +type FailoverGroupsClientTryPlannedBeforeForcedFailoverResponse struct { + FailoverGroup +} + +// FailoverGroupsClientUpdateResponse contains the response from method FailoverGroupsClient.BeginUpdate. type FailoverGroupsClientUpdateResponse struct { FailoverGroup } @@ -575,7 +638,7 @@ type FirewallRulesClientGetResponse struct { FirewallRule } -// FirewallRulesClientListByServerResponse contains the response from method FirewallRulesClient.ListByServer. +// FirewallRulesClientListByServerResponse contains the response from method FirewallRulesClient.NewListByServerPager. type FirewallRulesClientListByServerResponse struct { FirewallRuleListResult } @@ -595,8 +658,8 @@ type GeoBackupPoliciesClientGetResponse struct { GeoBackupPolicy } -// GeoBackupPoliciesClientListByDatabaseResponse contains the response from method GeoBackupPoliciesClient.ListByDatabase. -type GeoBackupPoliciesClientListByDatabaseResponse struct { +// GeoBackupPoliciesClientListResponse contains the response from method GeoBackupPoliciesClient.NewListPager. +type GeoBackupPoliciesClientListResponse struct { GeoBackupPolicyListResult } @@ -615,27 +678,27 @@ type IPv6FirewallRulesClientGetResponse struct { IPv6FirewallRule } -// IPv6FirewallRulesClientListByServerResponse contains the response from method IPv6FirewallRulesClient.ListByServer. +// IPv6FirewallRulesClientListByServerResponse contains the response from method IPv6FirewallRulesClient.NewListByServerPager. type IPv6FirewallRulesClientListByServerResponse struct { IPv6FirewallRuleListResult } -// InstanceFailoverGroupsClientCreateOrUpdateResponse contains the response from method InstanceFailoverGroupsClient.CreateOrUpdate. +// InstanceFailoverGroupsClientCreateOrUpdateResponse contains the response from method InstanceFailoverGroupsClient.BeginCreateOrUpdate. type InstanceFailoverGroupsClientCreateOrUpdateResponse struct { InstanceFailoverGroup } -// InstanceFailoverGroupsClientDeleteResponse contains the response from method InstanceFailoverGroupsClient.Delete. +// InstanceFailoverGroupsClientDeleteResponse contains the response from method InstanceFailoverGroupsClient.BeginDelete. type InstanceFailoverGroupsClientDeleteResponse struct { // placeholder for future response values } -// InstanceFailoverGroupsClientFailoverResponse contains the response from method InstanceFailoverGroupsClient.Failover. +// InstanceFailoverGroupsClientFailoverResponse contains the response from method InstanceFailoverGroupsClient.BeginFailover. type InstanceFailoverGroupsClientFailoverResponse struct { InstanceFailoverGroup } -// InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse contains the response from method InstanceFailoverGroupsClient.ForceFailoverAllowDataLoss. +// InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse contains the response from method InstanceFailoverGroupsClient.BeginForceFailoverAllowDataLoss. type InstanceFailoverGroupsClientForceFailoverAllowDataLossResponse struct { InstanceFailoverGroup } @@ -645,17 +708,17 @@ type InstanceFailoverGroupsClientGetResponse struct { InstanceFailoverGroup } -// InstanceFailoverGroupsClientListByLocationResponse contains the response from method InstanceFailoverGroupsClient.ListByLocation. +// InstanceFailoverGroupsClientListByLocationResponse contains the response from method InstanceFailoverGroupsClient.NewListByLocationPager. type InstanceFailoverGroupsClientListByLocationResponse struct { InstanceFailoverGroupListResult } -// InstancePoolsClientCreateOrUpdateResponse contains the response from method InstancePoolsClient.CreateOrUpdate. +// InstancePoolsClientCreateOrUpdateResponse contains the response from method InstancePoolsClient.BeginCreateOrUpdate. type InstancePoolsClientCreateOrUpdateResponse struct { InstancePool } -// InstancePoolsClientDeleteResponse contains the response from method InstancePoolsClient.Delete. +// InstancePoolsClientDeleteResponse contains the response from method InstancePoolsClient.BeginDelete. type InstancePoolsClientDeleteResponse struct { // placeholder for future response values } @@ -665,27 +728,27 @@ type InstancePoolsClientGetResponse struct { InstancePool } -// InstancePoolsClientListByResourceGroupResponse contains the response from method InstancePoolsClient.ListByResourceGroup. +// InstancePoolsClientListByResourceGroupResponse contains the response from method InstancePoolsClient.NewListByResourceGroupPager. type InstancePoolsClientListByResourceGroupResponse struct { InstancePoolListResult } -// InstancePoolsClientListResponse contains the response from method InstancePoolsClient.List. +// InstancePoolsClientListResponse contains the response from method InstancePoolsClient.NewListPager. type InstancePoolsClientListResponse struct { InstancePoolListResult } -// InstancePoolsClientUpdateResponse contains the response from method InstancePoolsClient.Update. +// InstancePoolsClientUpdateResponse contains the response from method InstancePoolsClient.BeginUpdate. type InstancePoolsClientUpdateResponse struct { InstancePool } -// JobAgentsClientCreateOrUpdateResponse contains the response from method JobAgentsClient.CreateOrUpdate. +// JobAgentsClientCreateOrUpdateResponse contains the response from method JobAgentsClient.BeginCreateOrUpdate. type JobAgentsClientCreateOrUpdateResponse struct { JobAgent } -// JobAgentsClientDeleteResponse contains the response from method JobAgentsClient.Delete. +// JobAgentsClientDeleteResponse contains the response from method JobAgentsClient.BeginDelete. type JobAgentsClientDeleteResponse struct { // placeholder for future response values } @@ -695,12 +758,12 @@ type JobAgentsClientGetResponse struct { JobAgent } -// JobAgentsClientListByServerResponse contains the response from method JobAgentsClient.ListByServer. +// JobAgentsClientListByServerResponse contains the response from method JobAgentsClient.NewListByServerPager. type JobAgentsClientListByServerResponse struct { JobAgentListResult } -// JobAgentsClientUpdateResponse contains the response from method JobAgentsClient.Update. +// JobAgentsClientUpdateResponse contains the response from method JobAgentsClient.BeginUpdate. type JobAgentsClientUpdateResponse struct { JobAgent } @@ -720,7 +783,7 @@ type JobCredentialsClientGetResponse struct { JobCredential } -// JobCredentialsClientListByAgentResponse contains the response from method JobCredentialsClient.ListByAgent. +// JobCredentialsClientListByAgentResponse contains the response from method JobCredentialsClient.NewListByAgentPager. type JobCredentialsClientListByAgentResponse struct { JobCredentialListResult } @@ -730,12 +793,12 @@ type JobExecutionsClientCancelResponse struct { // placeholder for future response values } -// JobExecutionsClientCreateOrUpdateResponse contains the response from method JobExecutionsClient.CreateOrUpdate. +// JobExecutionsClientCreateOrUpdateResponse contains the response from method JobExecutionsClient.BeginCreateOrUpdate. type JobExecutionsClientCreateOrUpdateResponse struct { JobExecution } -// JobExecutionsClientCreateResponse contains the response from method JobExecutionsClient.Create. +// JobExecutionsClientCreateResponse contains the response from method JobExecutionsClient.BeginCreate. type JobExecutionsClientCreateResponse struct { JobExecution } @@ -745,12 +808,12 @@ type JobExecutionsClientGetResponse struct { JobExecution } -// JobExecutionsClientListByAgentResponse contains the response from method JobExecutionsClient.ListByAgent. +// JobExecutionsClientListByAgentResponse contains the response from method JobExecutionsClient.NewListByAgentPager. type JobExecutionsClientListByAgentResponse struct { JobExecutionListResult } -// JobExecutionsClientListByJobResponse contains the response from method JobExecutionsClient.ListByJob. +// JobExecutionsClientListByJobResponse contains the response from method JobExecutionsClient.NewListByJobPager. type JobExecutionsClientListByJobResponse struct { JobExecutionListResult } @@ -760,7 +823,7 @@ type JobStepExecutionsClientGetResponse struct { JobExecution } -// JobStepExecutionsClientListByJobExecutionResponse contains the response from method JobStepExecutionsClient.ListByJobExecution. +// JobStepExecutionsClientListByJobExecutionResponse contains the response from method JobStepExecutionsClient.NewListByJobExecutionPager. type JobStepExecutionsClientListByJobExecutionResponse struct { JobExecutionListResult } @@ -785,12 +848,12 @@ type JobStepsClientGetResponse struct { JobStep } -// JobStepsClientListByJobResponse contains the response from method JobStepsClient.ListByJob. +// JobStepsClientListByJobResponse contains the response from method JobStepsClient.NewListByJobPager. type JobStepsClientListByJobResponse struct { JobStepListResult } -// JobStepsClientListByVersionResponse contains the response from method JobStepsClient.ListByVersion. +// JobStepsClientListByVersionResponse contains the response from method JobStepsClient.NewListByVersionPager. type JobStepsClientListByVersionResponse struct { JobStepListResult } @@ -800,12 +863,12 @@ type JobTargetExecutionsClientGetResponse struct { JobExecution } -// JobTargetExecutionsClientListByJobExecutionResponse contains the response from method JobTargetExecutionsClient.ListByJobExecution. +// JobTargetExecutionsClientListByJobExecutionResponse contains the response from method JobTargetExecutionsClient.NewListByJobExecutionPager. type JobTargetExecutionsClientListByJobExecutionResponse struct { JobExecutionListResult } -// JobTargetExecutionsClientListByStepResponse contains the response from method JobTargetExecutionsClient.ListByStep. +// JobTargetExecutionsClientListByStepResponse contains the response from method JobTargetExecutionsClient.NewListByStepPager. type JobTargetExecutionsClientListByStepResponse struct { JobExecutionListResult } @@ -825,7 +888,7 @@ type JobTargetGroupsClientGetResponse struct { JobTargetGroup } -// JobTargetGroupsClientListByAgentResponse contains the response from method JobTargetGroupsClient.ListByAgent. +// JobTargetGroupsClientListByAgentResponse contains the response from method JobTargetGroupsClient.NewListByAgentPager. type JobTargetGroupsClientListByAgentResponse struct { JobTargetGroupListResult } @@ -835,7 +898,7 @@ type JobVersionsClientGetResponse struct { JobVersion } -// JobVersionsClientListByJobResponse contains the response from method JobVersionsClient.ListByJob. +// JobVersionsClientListByJobResponse contains the response from method JobVersionsClient.NewListByJobPager. type JobVersionsClientListByJobResponse struct { JobVersionListResult } @@ -855,17 +918,17 @@ type JobsClientGetResponse struct { Job } -// JobsClientListByAgentResponse contains the response from method JobsClient.ListByAgent. +// JobsClientListByAgentResponse contains the response from method JobsClient.NewListByAgentPager. type JobsClientListByAgentResponse struct { JobListResult } -// LedgerDigestUploadsClientCreateOrUpdateResponse contains the response from method LedgerDigestUploadsClient.CreateOrUpdate. +// LedgerDigestUploadsClientCreateOrUpdateResponse contains the response from method LedgerDigestUploadsClient.BeginCreateOrUpdate. type LedgerDigestUploadsClientCreateOrUpdateResponse struct { LedgerDigestUploads } -// LedgerDigestUploadsClientDisableResponse contains the response from method LedgerDigestUploadsClient.Disable. +// LedgerDigestUploadsClientDisableResponse contains the response from method LedgerDigestUploadsClient.BeginDisable. type LedgerDigestUploadsClientDisableResponse struct { LedgerDigestUploads } @@ -875,27 +938,27 @@ type LedgerDigestUploadsClientGetResponse struct { LedgerDigestUploads } -// LedgerDigestUploadsClientListByDatabaseResponse contains the response from method LedgerDigestUploadsClient.ListByDatabase. +// LedgerDigestUploadsClientListByDatabaseResponse contains the response from method LedgerDigestUploadsClient.NewListByDatabasePager. type LedgerDigestUploadsClientListByDatabaseResponse struct { LedgerDigestUploadsListResult } -// LongTermRetentionBackupsClientCopyByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.CopyByResourceGroup. +// LongTermRetentionBackupsClientCopyByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.BeginCopyByResourceGroup. type LongTermRetentionBackupsClientCopyByResourceGroupResponse struct { LongTermRetentionBackupOperationResult } -// LongTermRetentionBackupsClientCopyResponse contains the response from method LongTermRetentionBackupsClient.Copy. +// LongTermRetentionBackupsClientCopyResponse contains the response from method LongTermRetentionBackupsClient.BeginCopy. type LongTermRetentionBackupsClientCopyResponse struct { LongTermRetentionBackupOperationResult } -// LongTermRetentionBackupsClientDeleteByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.DeleteByResourceGroup. +// LongTermRetentionBackupsClientDeleteByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.BeginDeleteByResourceGroup. type LongTermRetentionBackupsClientDeleteByResourceGroupResponse struct { // placeholder for future response values } -// LongTermRetentionBackupsClientDeleteResponse contains the response from method LongTermRetentionBackupsClient.Delete. +// LongTermRetentionBackupsClientDeleteResponse contains the response from method LongTermRetentionBackupsClient.BeginDelete. type LongTermRetentionBackupsClientDeleteResponse struct { // placeholder for future response values } @@ -910,52 +973,52 @@ type LongTermRetentionBackupsClientGetResponse struct { LongTermRetentionBackup } -// LongTermRetentionBackupsClientListByDatabaseResponse contains the response from method LongTermRetentionBackupsClient.ListByDatabase. +// LongTermRetentionBackupsClientListByDatabaseResponse contains the response from method LongTermRetentionBackupsClient.NewListByDatabasePager. type LongTermRetentionBackupsClientListByDatabaseResponse struct { LongTermRetentionBackupListResult } -// LongTermRetentionBackupsClientListByLocationResponse contains the response from method LongTermRetentionBackupsClient.ListByLocation. +// LongTermRetentionBackupsClientListByLocationResponse contains the response from method LongTermRetentionBackupsClient.NewListByLocationPager. type LongTermRetentionBackupsClientListByLocationResponse struct { LongTermRetentionBackupListResult } -// LongTermRetentionBackupsClientListByResourceGroupDatabaseResponse contains the response from method LongTermRetentionBackupsClient.ListByResourceGroupDatabase. +// LongTermRetentionBackupsClientListByResourceGroupDatabaseResponse contains the response from method LongTermRetentionBackupsClient.NewListByResourceGroupDatabasePager. type LongTermRetentionBackupsClientListByResourceGroupDatabaseResponse struct { LongTermRetentionBackupListResult } -// LongTermRetentionBackupsClientListByResourceGroupLocationResponse contains the response from method LongTermRetentionBackupsClient.ListByResourceGroupLocation. +// LongTermRetentionBackupsClientListByResourceGroupLocationResponse contains the response from method LongTermRetentionBackupsClient.NewListByResourceGroupLocationPager. type LongTermRetentionBackupsClientListByResourceGroupLocationResponse struct { LongTermRetentionBackupListResult } -// LongTermRetentionBackupsClientListByResourceGroupServerResponse contains the response from method LongTermRetentionBackupsClient.ListByResourceGroupServer. +// LongTermRetentionBackupsClientListByResourceGroupServerResponse contains the response from method LongTermRetentionBackupsClient.NewListByResourceGroupServerPager. type LongTermRetentionBackupsClientListByResourceGroupServerResponse struct { LongTermRetentionBackupListResult } -// LongTermRetentionBackupsClientListByServerResponse contains the response from method LongTermRetentionBackupsClient.ListByServer. +// LongTermRetentionBackupsClientListByServerResponse contains the response from method LongTermRetentionBackupsClient.NewListByServerPager. type LongTermRetentionBackupsClientListByServerResponse struct { LongTermRetentionBackupListResult } -// LongTermRetentionBackupsClientUpdateByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.UpdateByResourceGroup. +// LongTermRetentionBackupsClientUpdateByResourceGroupResponse contains the response from method LongTermRetentionBackupsClient.BeginUpdateByResourceGroup. type LongTermRetentionBackupsClientUpdateByResourceGroupResponse struct { LongTermRetentionBackupOperationResult } -// LongTermRetentionBackupsClientUpdateResponse contains the response from method LongTermRetentionBackupsClient.Update. +// LongTermRetentionBackupsClientUpdateResponse contains the response from method LongTermRetentionBackupsClient.BeginUpdate. type LongTermRetentionBackupsClientUpdateResponse struct { LongTermRetentionBackupOperationResult } -// LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.DeleteByResourceGroup. +// LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.BeginDeleteByResourceGroup. type LongTermRetentionManagedInstanceBackupsClientDeleteByResourceGroupResponse struct { // placeholder for future response values } -// LongTermRetentionManagedInstanceBackupsClientDeleteResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.Delete. +// LongTermRetentionManagedInstanceBackupsClientDeleteResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.BeginDelete. type LongTermRetentionManagedInstanceBackupsClientDeleteResponse struct { // placeholder for future response values } @@ -970,37 +1033,37 @@ type LongTermRetentionManagedInstanceBackupsClientGetResponse struct { ManagedInstanceLongTermRetentionBackup } -// LongTermRetentionManagedInstanceBackupsClientListByDatabaseResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.ListByDatabase. +// LongTermRetentionManagedInstanceBackupsClientListByDatabaseResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.NewListByDatabasePager. type LongTermRetentionManagedInstanceBackupsClientListByDatabaseResponse struct { ManagedInstanceLongTermRetentionBackupListResult } -// LongTermRetentionManagedInstanceBackupsClientListByInstanceResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.ListByInstance. +// LongTermRetentionManagedInstanceBackupsClientListByInstanceResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.NewListByInstancePager. type LongTermRetentionManagedInstanceBackupsClientListByInstanceResponse struct { ManagedInstanceLongTermRetentionBackupListResult } -// LongTermRetentionManagedInstanceBackupsClientListByLocationResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.ListByLocation. +// LongTermRetentionManagedInstanceBackupsClientListByLocationResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.NewListByLocationPager. type LongTermRetentionManagedInstanceBackupsClientListByLocationResponse struct { ManagedInstanceLongTermRetentionBackupListResult } -// LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupDatabase. +// LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupDatabasePager. type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseResponse struct { ManagedInstanceLongTermRetentionBackupListResult } -// LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupInstance. +// LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupInstancePager. type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceResponse struct { ManagedInstanceLongTermRetentionBackupListResult } -// LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.ListByResourceGroupLocation. +// LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResponse contains the response from method LongTermRetentionManagedInstanceBackupsClient.NewListByResourceGroupLocationPager. type LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationResponse struct { ManagedInstanceLongTermRetentionBackupListResult } -// LongTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method LongTermRetentionPoliciesClient.CreateOrUpdate. +// LongTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method LongTermRetentionPoliciesClient.BeginCreateOrUpdate. type LongTermRetentionPoliciesClientCreateOrUpdateResponse struct { LongTermRetentionPolicy } @@ -1010,7 +1073,7 @@ type LongTermRetentionPoliciesClientGetResponse struct { LongTermRetentionPolicy } -// LongTermRetentionPoliciesClientListByDatabaseResponse contains the response from method LongTermRetentionPoliciesClient.ListByDatabase. +// LongTermRetentionPoliciesClientListByDatabaseResponse contains the response from method LongTermRetentionPoliciesClient.NewListByDatabasePager. type LongTermRetentionPoliciesClientListByDatabaseResponse struct { LongTermRetentionPolicyListResult } @@ -1030,7 +1093,7 @@ type MaintenanceWindowsClientGetResponse struct { MaintenanceWindows } -// ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.CreateOrUpdate. +// ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate. type ManagedBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse struct { ManagedBackupShortTermRetentionPolicy } @@ -1040,37 +1103,62 @@ type ManagedBackupShortTermRetentionPoliciesClientGetResponse struct { ManagedBackupShortTermRetentionPolicy } -// ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.ListByDatabase. +// ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.NewListByDatabasePager. type ManagedBackupShortTermRetentionPoliciesClientListByDatabaseResponse struct { ManagedBackupShortTermRetentionPolicyListResult } -// ManagedBackupShortTermRetentionPoliciesClientUpdateResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.Update. +// ManagedBackupShortTermRetentionPoliciesClientUpdateResponse contains the response from method ManagedBackupShortTermRetentionPoliciesClient.BeginUpdate. type ManagedBackupShortTermRetentionPoliciesClientUpdateResponse struct { ManagedBackupShortTermRetentionPolicy } +// ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method ManagedDatabaseAdvancedThreatProtectionSettingsClient.CreateOrUpdate. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse struct { + ManagedDatabaseAdvancedThreatProtection +} + +// ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse contains the response from method ManagedDatabaseAdvancedThreatProtectionSettingsClient.Get. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientGetResponse struct { + ManagedDatabaseAdvancedThreatProtection +} + +// ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse contains the response from method ManagedDatabaseAdvancedThreatProtectionSettingsClient.NewListByDatabasePager. +type ManagedDatabaseAdvancedThreatProtectionSettingsClientListByDatabaseResponse struct { + ManagedDatabaseAdvancedThreatProtectionListResult +} + // ManagedDatabaseColumnsClientGetResponse contains the response from method ManagedDatabaseColumnsClient.Get. type ManagedDatabaseColumnsClientGetResponse struct { DatabaseColumn } -// ManagedDatabaseColumnsClientListByDatabaseResponse contains the response from method ManagedDatabaseColumnsClient.ListByDatabase. +// ManagedDatabaseColumnsClientListByDatabaseResponse contains the response from method ManagedDatabaseColumnsClient.NewListByDatabasePager. type ManagedDatabaseColumnsClientListByDatabaseResponse struct { DatabaseColumnListResult } -// ManagedDatabaseColumnsClientListByTableResponse contains the response from method ManagedDatabaseColumnsClient.ListByTable. +// ManagedDatabaseColumnsClientListByTableResponse contains the response from method ManagedDatabaseColumnsClient.NewListByTablePager. type ManagedDatabaseColumnsClientListByTableResponse struct { DatabaseColumnListResult } +// ManagedDatabaseMoveOperationsClientGetResponse contains the response from method ManagedDatabaseMoveOperationsClient.Get. +type ManagedDatabaseMoveOperationsClientGetResponse struct { + ManagedDatabaseMoveOperationResult +} + +// ManagedDatabaseMoveOperationsClientListByLocationResponse contains the response from method ManagedDatabaseMoveOperationsClient.NewListByLocationPager. +type ManagedDatabaseMoveOperationsClientListByLocationResponse struct { + ManagedDatabaseMoveOperationListResult +} + // ManagedDatabaseQueriesClientGetResponse contains the response from method ManagedDatabaseQueriesClient.Get. type ManagedDatabaseQueriesClientGetResponse struct { ManagedInstanceQuery } -// ManagedDatabaseQueriesClientListByQueryResponse contains the response from method ManagedDatabaseQueriesClient.ListByQuery. +// ManagedDatabaseQueriesClientListByQueryResponse contains the response from method ManagedDatabaseQueriesClient.NewListByQueryPager. type ManagedDatabaseQueriesClientListByQueryResponse struct { ManagedInstanceQueryStatistics } @@ -1090,7 +1178,7 @@ type ManagedDatabaseSchemasClientGetResponse struct { DatabaseSchema } -// ManagedDatabaseSchemasClientListByDatabaseResponse contains the response from method ManagedDatabaseSchemasClient.ListByDatabase. +// ManagedDatabaseSchemasClientListByDatabaseResponse contains the response from method ManagedDatabaseSchemasClient.NewListByDatabasePager. type ManagedDatabaseSchemasClientListByDatabaseResponse struct { DatabaseSchemaListResult } @@ -1105,12 +1193,12 @@ type ManagedDatabaseSecurityAlertPoliciesClientGetResponse struct { ManagedDatabaseSecurityAlertPolicy } -// ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResponse contains the response from method ManagedDatabaseSecurityAlertPoliciesClient.ListByDatabase. +// ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResponse contains the response from method ManagedDatabaseSecurityAlertPoliciesClient.NewListByDatabasePager. type ManagedDatabaseSecurityAlertPoliciesClientListByDatabaseResponse struct { ManagedDatabaseSecurityAlertPolicyListResult } -// ManagedDatabaseSecurityEventsClientListByDatabaseResponse contains the response from method ManagedDatabaseSecurityEventsClient.ListByDatabase. +// ManagedDatabaseSecurityEventsClientListByDatabaseResponse contains the response from method ManagedDatabaseSecurityEventsClient.NewListByDatabasePager. type ManagedDatabaseSecurityEventsClientListByDatabaseResponse struct { SecurityEventCollection } @@ -1140,12 +1228,17 @@ type ManagedDatabaseSensitivityLabelsClientGetResponse struct { SensitivityLabel } -// ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.ListCurrentByDatabase. +// ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.NewListByDatabasePager. +type ManagedDatabaseSensitivityLabelsClientListByDatabaseResponse struct { + SensitivityLabelListResult +} + +// ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.NewListCurrentByDatabasePager. type ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseResponse struct { SensitivityLabelListResult } -// ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.ListRecommendedByDatabase. +// ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResponse contains the response from method ManagedDatabaseSensitivityLabelsClient.NewListRecommendedByDatabasePager. type ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseResponse struct { SensitivityLabelListResult } @@ -1160,7 +1253,7 @@ type ManagedDatabaseTablesClientGetResponse struct { DatabaseTable } -// ManagedDatabaseTablesClientListBySchemaResponse contains the response from method ManagedDatabaseTablesClient.ListBySchema. +// ManagedDatabaseTablesClientListBySchemaResponse contains the response from method ManagedDatabaseTablesClient.NewListBySchemaPager. type ManagedDatabaseTablesClientListBySchemaResponse struct { DatabaseTableListResult } @@ -1175,7 +1268,7 @@ type ManagedDatabaseTransparentDataEncryptionClientGetResponse struct { ManagedTransparentDataEncryption } -// ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResponse contains the response from method ManagedDatabaseTransparentDataEncryptionClient.ListByDatabase. +// ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResponse contains the response from method ManagedDatabaseTransparentDataEncryptionClient.NewListByDatabasePager. type ManagedDatabaseTransparentDataEncryptionClientListByDatabaseResponse struct { ManagedTransparentDataEncryptionListResult } @@ -1205,12 +1298,12 @@ type ManagedDatabaseVulnerabilityAssessmentScansClientGetResponse struct { VulnerabilityAssessmentScanRecord } -// ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentScansClient.InitiateScan. +// ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentScansClient.BeginInitiateScan. type ManagedDatabaseVulnerabilityAssessmentScansClientInitiateScanResponse struct { // placeholder for future response values } -// ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentScansClient.ListByDatabase. +// ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentScansClient.NewListByDatabasePager. type ManagedDatabaseVulnerabilityAssessmentScansClientListByDatabaseResponse struct { VulnerabilityAssessmentScanRecordListResult } @@ -1230,22 +1323,32 @@ type ManagedDatabaseVulnerabilityAssessmentsClientGetResponse struct { DatabaseVulnerabilityAssessment } -// ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentsClient.ListByDatabase. +// ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse contains the response from method ManagedDatabaseVulnerabilityAssessmentsClient.NewListByDatabasePager. type ManagedDatabaseVulnerabilityAssessmentsClientListByDatabaseResponse struct { DatabaseVulnerabilityAssessmentListResult } -// ManagedDatabasesClientCompleteRestoreResponse contains the response from method ManagedDatabasesClient.CompleteRestore. +// ManagedDatabasesClientCancelMoveResponse contains the response from method ManagedDatabasesClient.BeginCancelMove. +type ManagedDatabasesClientCancelMoveResponse struct { + // placeholder for future response values +} + +// ManagedDatabasesClientCompleteMoveResponse contains the response from method ManagedDatabasesClient.BeginCompleteMove. +type ManagedDatabasesClientCompleteMoveResponse struct { + // placeholder for future response values +} + +// ManagedDatabasesClientCompleteRestoreResponse contains the response from method ManagedDatabasesClient.BeginCompleteRestore. type ManagedDatabasesClientCompleteRestoreResponse struct { // placeholder for future response values } -// ManagedDatabasesClientCreateOrUpdateResponse contains the response from method ManagedDatabasesClient.CreateOrUpdate. +// ManagedDatabasesClientCreateOrUpdateResponse contains the response from method ManagedDatabasesClient.BeginCreateOrUpdate. type ManagedDatabasesClientCreateOrUpdateResponse struct { ManagedDatabase } -// ManagedDatabasesClientDeleteResponse contains the response from method ManagedDatabasesClient.Delete. +// ManagedDatabasesClientDeleteResponse contains the response from method ManagedDatabasesClient.BeginDelete. type ManagedDatabasesClientDeleteResponse struct { // placeholder for future response values } @@ -1255,27 +1358,32 @@ type ManagedDatabasesClientGetResponse struct { ManagedDatabase } -// ManagedDatabasesClientListByInstanceResponse contains the response from method ManagedDatabasesClient.ListByInstance. +// ManagedDatabasesClientListByInstanceResponse contains the response from method ManagedDatabasesClient.NewListByInstancePager. type ManagedDatabasesClientListByInstanceResponse struct { ManagedDatabaseListResult } -// ManagedDatabasesClientListInaccessibleByInstanceResponse contains the response from method ManagedDatabasesClient.ListInaccessibleByInstance. +// ManagedDatabasesClientListInaccessibleByInstanceResponse contains the response from method ManagedDatabasesClient.NewListInaccessibleByInstancePager. type ManagedDatabasesClientListInaccessibleByInstanceResponse struct { ManagedDatabaseListResult } -// ManagedDatabasesClientUpdateResponse contains the response from method ManagedDatabasesClient.Update. +// ManagedDatabasesClientStartMoveResponse contains the response from method ManagedDatabasesClient.BeginStartMove. +type ManagedDatabasesClientStartMoveResponse struct { + // placeholder for future response values +} + +// ManagedDatabasesClientUpdateResponse contains the response from method ManagedDatabasesClient.BeginUpdate. type ManagedDatabasesClientUpdateResponse struct { ManagedDatabase } -// ManagedInstanceAdministratorsClientCreateOrUpdateResponse contains the response from method ManagedInstanceAdministratorsClient.CreateOrUpdate. +// ManagedInstanceAdministratorsClientCreateOrUpdateResponse contains the response from method ManagedInstanceAdministratorsClient.BeginCreateOrUpdate. type ManagedInstanceAdministratorsClientCreateOrUpdateResponse struct { ManagedInstanceAdministrator } -// ManagedInstanceAdministratorsClientDeleteResponse contains the response from method ManagedInstanceAdministratorsClient.Delete. +// ManagedInstanceAdministratorsClientDeleteResponse contains the response from method ManagedInstanceAdministratorsClient.BeginDelete. type ManagedInstanceAdministratorsClientDeleteResponse struct { // placeholder for future response values } @@ -1285,17 +1393,32 @@ type ManagedInstanceAdministratorsClientGetResponse struct { ManagedInstanceAdministrator } -// ManagedInstanceAdministratorsClientListByInstanceResponse contains the response from method ManagedInstanceAdministratorsClient.ListByInstance. +// ManagedInstanceAdministratorsClientListByInstanceResponse contains the response from method ManagedInstanceAdministratorsClient.NewListByInstancePager. type ManagedInstanceAdministratorsClientListByInstanceResponse struct { ManagedInstanceAdministratorListResult } -// ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.CreateOrUpdate. +// ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method ManagedInstanceAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate. +type ManagedInstanceAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse struct { + ManagedInstanceAdvancedThreatProtection +} + +// ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse contains the response from method ManagedInstanceAdvancedThreatProtectionSettingsClient.Get. +type ManagedInstanceAdvancedThreatProtectionSettingsClientGetResponse struct { + ManagedInstanceAdvancedThreatProtection +} + +// ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse contains the response from method ManagedInstanceAdvancedThreatProtectionSettingsClient.NewListByInstancePager. +type ManagedInstanceAdvancedThreatProtectionSettingsClientListByInstanceResponse struct { + ManagedInstanceAdvancedThreatProtectionListResult +} + +// ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate. type ManagedInstanceAzureADOnlyAuthenticationsClientCreateOrUpdateResponse struct { ManagedInstanceAzureADOnlyAuthentication } -// ManagedInstanceAzureADOnlyAuthenticationsClientDeleteResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.Delete. +// ManagedInstanceAzureADOnlyAuthenticationsClientDeleteResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.BeginDelete. type ManagedInstanceAzureADOnlyAuthenticationsClientDeleteResponse struct { // placeholder for future response values } @@ -1305,12 +1428,27 @@ type ManagedInstanceAzureADOnlyAuthenticationsClientGetResponse struct { ManagedInstanceAzureADOnlyAuthentication } -// ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.ListByInstance. +// ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse contains the response from method ManagedInstanceAzureADOnlyAuthenticationsClient.NewListByInstancePager. type ManagedInstanceAzureADOnlyAuthenticationsClientListByInstanceResponse struct { ManagedInstanceAzureADOnlyAuthListResult } -// ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.CreateOrUpdate. +// ManagedInstanceDtcsClientCreateOrUpdateResponse contains the response from method ManagedInstanceDtcsClient.BeginCreateOrUpdate. +type ManagedInstanceDtcsClientCreateOrUpdateResponse struct { + ManagedInstanceDtc +} + +// ManagedInstanceDtcsClientGetResponse contains the response from method ManagedInstanceDtcsClient.Get. +type ManagedInstanceDtcsClientGetResponse struct { + ManagedInstanceDtc +} + +// ManagedInstanceDtcsClientListByManagedInstanceResponse contains the response from method ManagedInstanceDtcsClient.NewListByManagedInstancePager. +type ManagedInstanceDtcsClientListByManagedInstanceResponse struct { + ManagedInstanceDtcListResult +} + +// ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.BeginCreateOrUpdate. type ManagedInstanceEncryptionProtectorsClientCreateOrUpdateResponse struct { ManagedInstanceEncryptionProtector } @@ -1320,22 +1458,22 @@ type ManagedInstanceEncryptionProtectorsClientGetResponse struct { ManagedInstanceEncryptionProtector } -// ManagedInstanceEncryptionProtectorsClientListByInstanceResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.ListByInstance. +// ManagedInstanceEncryptionProtectorsClientListByInstanceResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.NewListByInstancePager. type ManagedInstanceEncryptionProtectorsClientListByInstanceResponse struct { ManagedInstanceEncryptionProtectorListResult } -// ManagedInstanceEncryptionProtectorsClientRevalidateResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.Revalidate. +// ManagedInstanceEncryptionProtectorsClientRevalidateResponse contains the response from method ManagedInstanceEncryptionProtectorsClient.BeginRevalidate. type ManagedInstanceEncryptionProtectorsClientRevalidateResponse struct { // placeholder for future response values } -// ManagedInstanceKeysClientCreateOrUpdateResponse contains the response from method ManagedInstanceKeysClient.CreateOrUpdate. +// ManagedInstanceKeysClientCreateOrUpdateResponse contains the response from method ManagedInstanceKeysClient.BeginCreateOrUpdate. type ManagedInstanceKeysClientCreateOrUpdateResponse struct { ManagedInstanceKey } -// ManagedInstanceKeysClientDeleteResponse contains the response from method ManagedInstanceKeysClient.Delete. +// ManagedInstanceKeysClientDeleteResponse contains the response from method ManagedInstanceKeysClient.BeginDelete. type ManagedInstanceKeysClientDeleteResponse struct { // placeholder for future response values } @@ -1345,22 +1483,27 @@ type ManagedInstanceKeysClientGetResponse struct { ManagedInstanceKey } -// ManagedInstanceKeysClientListByInstanceResponse contains the response from method ManagedInstanceKeysClient.ListByInstance. +// ManagedInstanceKeysClientListByInstanceResponse contains the response from method ManagedInstanceKeysClient.NewListByInstancePager. type ManagedInstanceKeysClientListByInstanceResponse struct { ManagedInstanceKeyListResult } -// ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.CreateOrUpdate. +// ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.BeginCreateOrUpdate. type ManagedInstanceLongTermRetentionPoliciesClientCreateOrUpdateResponse struct { ManagedInstanceLongTermRetentionPolicy } +// ManagedInstanceLongTermRetentionPoliciesClientDeleteResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.BeginDelete. +type ManagedInstanceLongTermRetentionPoliciesClientDeleteResponse struct { + ManagedInstanceLongTermRetentionPolicy +} + // ManagedInstanceLongTermRetentionPoliciesClientGetResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.Get. type ManagedInstanceLongTermRetentionPoliciesClientGetResponse struct { ManagedInstanceLongTermRetentionPolicy } -// ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.ListByDatabase. +// ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResponse contains the response from method ManagedInstanceLongTermRetentionPoliciesClient.NewListByDatabasePager. type ManagedInstanceLongTermRetentionPoliciesClientListByDatabaseResponse struct { ManagedInstanceLongTermRetentionPolicyListResult } @@ -1375,17 +1518,17 @@ type ManagedInstanceOperationsClientGetResponse struct { ManagedInstanceOperation } -// ManagedInstanceOperationsClientListByManagedInstanceResponse contains the response from method ManagedInstanceOperationsClient.ListByManagedInstance. +// ManagedInstanceOperationsClientListByManagedInstanceResponse contains the response from method ManagedInstanceOperationsClient.NewListByManagedInstancePager. type ManagedInstanceOperationsClientListByManagedInstanceResponse struct { ManagedInstanceOperationListResult } -// ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.CreateOrUpdate. +// ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.BeginCreateOrUpdate. type ManagedInstancePrivateEndpointConnectionsClientCreateOrUpdateResponse struct { ManagedInstancePrivateEndpointConnection } -// ManagedInstancePrivateEndpointConnectionsClientDeleteResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.Delete. +// ManagedInstancePrivateEndpointConnectionsClientDeleteResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.BeginDelete. type ManagedInstancePrivateEndpointConnectionsClientDeleteResponse struct { // placeholder for future response values } @@ -1395,7 +1538,7 @@ type ManagedInstancePrivateEndpointConnectionsClientGetResponse struct { ManagedInstancePrivateEndpointConnection } -// ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.ListByManagedInstance. +// ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResponse contains the response from method ManagedInstancePrivateEndpointConnectionsClient.NewListByManagedInstancePager. type ManagedInstancePrivateEndpointConnectionsClientListByManagedInstanceResponse struct { ManagedInstancePrivateEndpointConnectionListResult } @@ -1405,12 +1548,12 @@ type ManagedInstancePrivateLinkResourcesClientGetResponse struct { ManagedInstancePrivateLink } -// ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResponse contains the response from method ManagedInstancePrivateLinkResourcesClient.ListByManagedInstance. +// ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResponse contains the response from method ManagedInstancePrivateLinkResourcesClient.NewListByManagedInstancePager. type ManagedInstancePrivateLinkResourcesClientListByManagedInstanceResponse struct { ManagedInstancePrivateLinkListResult } -// ManagedInstanceTdeCertificatesClientCreateResponse contains the response from method ManagedInstanceTdeCertificatesClient.Create. +// ManagedInstanceTdeCertificatesClientCreateResponse contains the response from method ManagedInstanceTdeCertificatesClient.BeginCreate. type ManagedInstanceTdeCertificatesClientCreateResponse struct { // placeholder for future response values } @@ -1430,22 +1573,22 @@ type ManagedInstanceVulnerabilityAssessmentsClientGetResponse struct { ManagedInstanceVulnerabilityAssessment } -// ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResponse contains the response from method ManagedInstanceVulnerabilityAssessmentsClient.ListByInstance. +// ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResponse contains the response from method ManagedInstanceVulnerabilityAssessmentsClient.NewListByInstancePager. type ManagedInstanceVulnerabilityAssessmentsClientListByInstanceResponse struct { ManagedInstanceVulnerabilityAssessmentListResult } -// ManagedInstancesClientCreateOrUpdateResponse contains the response from method ManagedInstancesClient.CreateOrUpdate. +// ManagedInstancesClientCreateOrUpdateResponse contains the response from method ManagedInstancesClient.BeginCreateOrUpdate. type ManagedInstancesClientCreateOrUpdateResponse struct { ManagedInstance } -// ManagedInstancesClientDeleteResponse contains the response from method ManagedInstancesClient.Delete. +// ManagedInstancesClientDeleteResponse contains the response from method ManagedInstancesClient.BeginDelete. type ManagedInstancesClientDeleteResponse struct { // placeholder for future response values } -// ManagedInstancesClientFailoverResponse contains the response from method ManagedInstancesClient.Failover. +// ManagedInstancesClientFailoverResponse contains the response from method ManagedInstancesClient.BeginFailover. type ManagedInstancesClientFailoverResponse struct { // placeholder for future response values } @@ -1455,33 +1598,68 @@ type ManagedInstancesClientGetResponse struct { ManagedInstance } -// ManagedInstancesClientListByInstancePoolResponse contains the response from method ManagedInstancesClient.ListByInstancePool. +// ManagedInstancesClientListByInstancePoolResponse contains the response from method ManagedInstancesClient.NewListByInstancePoolPager. type ManagedInstancesClientListByInstancePoolResponse struct { ManagedInstanceListResult } -// ManagedInstancesClientListByManagedInstanceResponse contains the response from method ManagedInstancesClient.ListByManagedInstance. +// ManagedInstancesClientListByManagedInstanceResponse contains the response from method ManagedInstancesClient.NewListByManagedInstancePager. type ManagedInstancesClientListByManagedInstanceResponse struct { TopQueriesListResult } -// ManagedInstancesClientListByResourceGroupResponse contains the response from method ManagedInstancesClient.ListByResourceGroup. +// ManagedInstancesClientListByResourceGroupResponse contains the response from method ManagedInstancesClient.NewListByResourceGroupPager. type ManagedInstancesClientListByResourceGroupResponse struct { ManagedInstanceListResult } -// ManagedInstancesClientListResponse contains the response from method ManagedInstancesClient.List. +// ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse contains the response from method ManagedInstancesClient.NewListOutboundNetworkDependenciesByManagedInstancePager. +type ManagedInstancesClientListOutboundNetworkDependenciesByManagedInstanceResponse struct { + OutboundEnvironmentEndpointCollection +} + +// ManagedInstancesClientListResponse contains the response from method ManagedInstancesClient.NewListPager. type ManagedInstancesClientListResponse struct { ManagedInstanceListResult } -// ManagedInstancesClientUpdateResponse contains the response from method ManagedInstancesClient.Update. +// ManagedInstancesClientStartResponse contains the response from method ManagedInstancesClient.BeginStart. +type ManagedInstancesClientStartResponse struct { + // placeholder for future response values +} + +// ManagedInstancesClientStopResponse contains the response from method ManagedInstancesClient.BeginStop. +type ManagedInstancesClientStopResponse struct { + // placeholder for future response values +} + +// ManagedInstancesClientUpdateResponse contains the response from method ManagedInstancesClient.BeginUpdate. type ManagedInstancesClientUpdateResponse struct { ManagedInstance } +// ManagedLedgerDigestUploadsClientCreateOrUpdateResponse contains the response from method ManagedLedgerDigestUploadsClient.BeginCreateOrUpdate. +type ManagedLedgerDigestUploadsClientCreateOrUpdateResponse struct { + ManagedLedgerDigestUploads +} + +// ManagedLedgerDigestUploadsClientDisableResponse contains the response from method ManagedLedgerDigestUploadsClient.BeginDisable. +type ManagedLedgerDigestUploadsClientDisableResponse struct { + ManagedLedgerDigestUploads +} + +// ManagedLedgerDigestUploadsClientGetResponse contains the response from method ManagedLedgerDigestUploadsClient.Get. +type ManagedLedgerDigestUploadsClientGetResponse struct { + ManagedLedgerDigestUploads +} + +// ManagedLedgerDigestUploadsClientListByDatabaseResponse contains the response from method ManagedLedgerDigestUploadsClient.NewListByDatabasePager. +type ManagedLedgerDigestUploadsClientListByDatabaseResponse struct { + ManagedLedgerDigestUploadsListResult +} + // ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse contains the response from -// method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.CreateOrUpdate. +// method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginCreateOrUpdate. type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientCreateOrUpdateResponse struct { ManagedBackupShortTermRetentionPolicy } @@ -1492,18 +1670,43 @@ type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientGetRe } // ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResponse contains -// the response from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.ListByRestorableDroppedDatabase. +// the response from method ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.NewListByRestorableDroppedDatabasePager. type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientListByRestorableDroppedDatabaseResponse struct { ManagedBackupShortTermRetentionPolicyListResult } // ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResponse contains the response from method -// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.Update. +// ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient.BeginUpdate. type ManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClientUpdateResponse struct { ManagedBackupShortTermRetentionPolicy } -// ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ManagedServerSecurityAlertPoliciesClient.CreateOrUpdate. +// ManagedServerDNSAliasesClientAcquireResponse contains the response from method ManagedServerDNSAliasesClient.BeginAcquire. +type ManagedServerDNSAliasesClientAcquireResponse struct { + ManagedServerDNSAlias +} + +// ManagedServerDNSAliasesClientCreateOrUpdateResponse contains the response from method ManagedServerDNSAliasesClient.BeginCreateOrUpdate. +type ManagedServerDNSAliasesClientCreateOrUpdateResponse struct { + ManagedServerDNSAlias +} + +// ManagedServerDNSAliasesClientDeleteResponse contains the response from method ManagedServerDNSAliasesClient.BeginDelete. +type ManagedServerDNSAliasesClientDeleteResponse struct { + // placeholder for future response values +} + +// ManagedServerDNSAliasesClientGetResponse contains the response from method ManagedServerDNSAliasesClient.Get. +type ManagedServerDNSAliasesClientGetResponse struct { + ManagedServerDNSAlias +} + +// ManagedServerDNSAliasesClientListByManagedInstanceResponse contains the response from method ManagedServerDNSAliasesClient.NewListByManagedInstancePager. +type ManagedServerDNSAliasesClientListByManagedInstanceResponse struct { + ManagedServerDNSAliasListResult +} + +// ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ManagedServerSecurityAlertPoliciesClient.BeginCreateOrUpdate. type ManagedServerSecurityAlertPoliciesClientCreateOrUpdateResponse struct { ManagedServerSecurityAlertPolicy } @@ -1513,22 +1716,22 @@ type ManagedServerSecurityAlertPoliciesClientGetResponse struct { ManagedServerSecurityAlertPolicy } -// ManagedServerSecurityAlertPoliciesClientListByInstanceResponse contains the response from method ManagedServerSecurityAlertPoliciesClient.ListByInstance. +// ManagedServerSecurityAlertPoliciesClientListByInstanceResponse contains the response from method ManagedServerSecurityAlertPoliciesClient.NewListByInstancePager. type ManagedServerSecurityAlertPoliciesClientListByInstanceResponse struct { ManagedServerSecurityAlertPolicyListResult } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } -// OutboundFirewallRulesClientCreateOrUpdateResponse contains the response from method OutboundFirewallRulesClient.CreateOrUpdate. +// OutboundFirewallRulesClientCreateOrUpdateResponse contains the response from method OutboundFirewallRulesClient.BeginCreateOrUpdate. type OutboundFirewallRulesClientCreateOrUpdateResponse struct { OutboundFirewallRule } -// OutboundFirewallRulesClientDeleteResponse contains the response from method OutboundFirewallRulesClient.Delete. +// OutboundFirewallRulesClientDeleteResponse contains the response from method OutboundFirewallRulesClient.BeginDelete. type OutboundFirewallRulesClientDeleteResponse struct { // placeholder for future response values } @@ -1538,17 +1741,17 @@ type OutboundFirewallRulesClientGetResponse struct { OutboundFirewallRule } -// OutboundFirewallRulesClientListByServerResponse contains the response from method OutboundFirewallRulesClient.ListByServer. +// OutboundFirewallRulesClientListByServerResponse contains the response from method OutboundFirewallRulesClient.NewListByServerPager. type OutboundFirewallRulesClientListByServerResponse struct { OutboundFirewallRuleListResult } -// PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.CreateOrUpdate. +// PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.BeginCreateOrUpdate. type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { PrivateEndpointConnection } -// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete. +// PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.BeginDelete. type PrivateEndpointConnectionsClientDeleteResponse struct { // placeholder for future response values } @@ -1558,7 +1761,7 @@ type PrivateEndpointConnectionsClientGetResponse struct { PrivateEndpointConnection } -// PrivateEndpointConnectionsClientListByServerResponse contains the response from method PrivateEndpointConnectionsClient.ListByServer. +// PrivateEndpointConnectionsClientListByServerResponse contains the response from method PrivateEndpointConnectionsClient.NewListByServerPager. type PrivateEndpointConnectionsClientListByServerResponse struct { PrivateEndpointConnectionListResult } @@ -1568,7 +1771,7 @@ type PrivateLinkResourcesClientGetResponse struct { PrivateLinkResource } -// PrivateLinkResourcesClientListByServerResponse contains the response from method PrivateLinkResourcesClient.ListByServer. +// PrivateLinkResourcesClientListByServerResponse contains the response from method PrivateLinkResourcesClient.NewListByServerPager. type PrivateLinkResourcesClientListByServerResponse struct { PrivateLinkResourceListResult } @@ -1583,7 +1786,7 @@ type RecoverableDatabasesClientGetResponse struct { RecoverableDatabase } -// RecoverableDatabasesClientListByServerResponse contains the response from method RecoverableDatabasesClient.ListByServer. +// RecoverableDatabasesClientListByServerResponse contains the response from method RecoverableDatabasesClient.NewListByServerPager. type RecoverableDatabasesClientListByServerResponse struct { RecoverableDatabaseListResult } @@ -1593,22 +1796,22 @@ type RecoverableManagedDatabasesClientGetResponse struct { RecoverableManagedDatabase } -// RecoverableManagedDatabasesClientListByInstanceResponse contains the response from method RecoverableManagedDatabasesClient.ListByInstance. +// RecoverableManagedDatabasesClientListByInstanceResponse contains the response from method RecoverableManagedDatabasesClient.NewListByInstancePager. type RecoverableManagedDatabasesClientListByInstanceResponse struct { RecoverableManagedDatabaseListResult } -// ReplicationLinksClientDeleteResponse contains the response from method ReplicationLinksClient.Delete. +// ReplicationLinksClientDeleteResponse contains the response from method ReplicationLinksClient.BeginDelete. type ReplicationLinksClientDeleteResponse struct { // placeholder for future response values } -// ReplicationLinksClientFailoverAllowDataLossResponse contains the response from method ReplicationLinksClient.FailoverAllowDataLoss. +// ReplicationLinksClientFailoverAllowDataLossResponse contains the response from method ReplicationLinksClient.BeginFailoverAllowDataLoss. type ReplicationLinksClientFailoverAllowDataLossResponse struct { ReplicationLink } -// ReplicationLinksClientFailoverResponse contains the response from method ReplicationLinksClient.Failover. +// ReplicationLinksClientFailoverResponse contains the response from method ReplicationLinksClient.BeginFailover. type ReplicationLinksClientFailoverResponse struct { ReplicationLink } @@ -1618,12 +1821,12 @@ type ReplicationLinksClientGetResponse struct { ReplicationLink } -// ReplicationLinksClientListByDatabaseResponse contains the response from method ReplicationLinksClient.ListByDatabase. +// ReplicationLinksClientListByDatabaseResponse contains the response from method ReplicationLinksClient.NewListByDatabasePager. type ReplicationLinksClientListByDatabaseResponse struct { ReplicationLinkListResult } -// ReplicationLinksClientListByServerResponse contains the response from method ReplicationLinksClient.ListByServer. +// ReplicationLinksClientListByServerResponse contains the response from method ReplicationLinksClient.NewListByServerPager. type ReplicationLinksClientListByServerResponse struct { ReplicationLinkListResult } @@ -1633,7 +1836,7 @@ type RestorableDroppedDatabasesClientGetResponse struct { RestorableDroppedDatabase } -// RestorableDroppedDatabasesClientListByServerResponse contains the response from method RestorableDroppedDatabasesClient.ListByServer. +// RestorableDroppedDatabasesClientListByServerResponse contains the response from method RestorableDroppedDatabasesClient.NewListByServerPager. type RestorableDroppedDatabasesClientListByServerResponse struct { RestorableDroppedDatabaseListResult } @@ -1643,12 +1846,12 @@ type RestorableDroppedManagedDatabasesClientGetResponse struct { RestorableDroppedManagedDatabase } -// RestorableDroppedManagedDatabasesClientListByInstanceResponse contains the response from method RestorableDroppedManagedDatabasesClient.ListByInstance. +// RestorableDroppedManagedDatabasesClientListByInstanceResponse contains the response from method RestorableDroppedManagedDatabasesClient.NewListByInstancePager. type RestorableDroppedManagedDatabasesClientListByInstanceResponse struct { RestorableDroppedManagedDatabaseListResult } -// RestorePointsClientCreateResponse contains the response from method RestorePointsClient.Create. +// RestorePointsClientCreateResponse contains the response from method RestorePointsClient.BeginCreate. type RestorePointsClientCreateResponse struct { RestorePoint } @@ -1663,7 +1866,7 @@ type RestorePointsClientGetResponse struct { RestorePoint } -// RestorePointsClientListByDatabaseResponse contains the response from method RestorePointsClient.ListByDatabase. +// RestorePointsClientListByDatabaseResponse contains the response from method RestorePointsClient.NewListByDatabasePager. type RestorePointsClientListByDatabaseResponse struct { RestorePointListResult } @@ -1693,12 +1896,17 @@ type SensitivityLabelsClientGetResponse struct { SensitivityLabel } -// SensitivityLabelsClientListCurrentByDatabaseResponse contains the response from method SensitivityLabelsClient.ListCurrentByDatabase. +// SensitivityLabelsClientListByDatabaseResponse contains the response from method SensitivityLabelsClient.NewListByDatabasePager. +type SensitivityLabelsClientListByDatabaseResponse struct { + SensitivityLabelListResult +} + +// SensitivityLabelsClientListCurrentByDatabaseResponse contains the response from method SensitivityLabelsClient.NewListCurrentByDatabasePager. type SensitivityLabelsClientListCurrentByDatabaseResponse struct { SensitivityLabelListResult } -// SensitivityLabelsClientListRecommendedByDatabaseResponse contains the response from method SensitivityLabelsClient.ListRecommendedByDatabase. +// SensitivityLabelsClientListRecommendedByDatabaseResponse contains the response from method SensitivityLabelsClient.NewListRecommendedByDatabasePager. type SensitivityLabelsClientListRecommendedByDatabaseResponse struct { SensitivityLabelListResult } @@ -1708,7 +1916,7 @@ type SensitivityLabelsClientUpdateResponse struct { // placeholder for future response values } -// ServerAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method ServerAdvancedThreatProtectionSettingsClient.CreateOrUpdate. +// ServerAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse contains the response from method ServerAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate. type ServerAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse struct { ServerAdvancedThreatProtection } @@ -1718,7 +1926,7 @@ type ServerAdvancedThreatProtectionSettingsClientGetResponse struct { ServerAdvancedThreatProtection } -// ServerAdvancedThreatProtectionSettingsClientListByServerResponse contains the response from method ServerAdvancedThreatProtectionSettingsClient.ListByServer. +// ServerAdvancedThreatProtectionSettingsClientListByServerResponse contains the response from method ServerAdvancedThreatProtectionSettingsClient.NewListByServerPager. type ServerAdvancedThreatProtectionSettingsClientListByServerResponse struct { LogicalServerAdvancedThreatProtectionListResult } @@ -1749,12 +1957,12 @@ type ServerAutomaticTuningClientUpdateResponse struct { ServerAutomaticTuning } -// ServerAzureADAdministratorsClientCreateOrUpdateResponse contains the response from method ServerAzureADAdministratorsClient.CreateOrUpdate. +// ServerAzureADAdministratorsClientCreateOrUpdateResponse contains the response from method ServerAzureADAdministratorsClient.BeginCreateOrUpdate. type ServerAzureADAdministratorsClientCreateOrUpdateResponse struct { ServerAzureADAdministrator } -// ServerAzureADAdministratorsClientDeleteResponse contains the response from method ServerAzureADAdministratorsClient.Delete. +// ServerAzureADAdministratorsClientDeleteResponse contains the response from method ServerAzureADAdministratorsClient.BeginDelete. type ServerAzureADAdministratorsClientDeleteResponse struct { // placeholder for future response values } @@ -1764,17 +1972,17 @@ type ServerAzureADAdministratorsClientGetResponse struct { ServerAzureADAdministrator } -// ServerAzureADAdministratorsClientListByServerResponse contains the response from method ServerAzureADAdministratorsClient.ListByServer. +// ServerAzureADAdministratorsClientListByServerResponse contains the response from method ServerAzureADAdministratorsClient.NewListByServerPager. type ServerAzureADAdministratorsClientListByServerResponse struct { AdministratorListResult } -// ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.CreateOrUpdate. +// ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate. type ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse struct { ServerAzureADOnlyAuthentication } -// ServerAzureADOnlyAuthenticationsClientDeleteResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.Delete. +// ServerAzureADOnlyAuthenticationsClientDeleteResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.BeginDelete. type ServerAzureADOnlyAuthenticationsClientDeleteResponse struct { // placeholder for future response values } @@ -1784,12 +1992,12 @@ type ServerAzureADOnlyAuthenticationsClientGetResponse struct { ServerAzureADOnlyAuthentication } -// ServerAzureADOnlyAuthenticationsClientListByServerResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.ListByServer. +// ServerAzureADOnlyAuthenticationsClientListByServerResponse contains the response from method ServerAzureADOnlyAuthenticationsClient.NewListByServerPager. type ServerAzureADOnlyAuthenticationsClientListByServerResponse struct { AzureADOnlyAuthListResult } -// ServerBlobAuditingPoliciesClientCreateOrUpdateResponse contains the response from method ServerBlobAuditingPoliciesClient.CreateOrUpdate. +// ServerBlobAuditingPoliciesClientCreateOrUpdateResponse contains the response from method ServerBlobAuditingPoliciesClient.BeginCreateOrUpdate. type ServerBlobAuditingPoliciesClientCreateOrUpdateResponse struct { ServerBlobAuditingPolicy } @@ -1799,32 +2007,27 @@ type ServerBlobAuditingPoliciesClientGetResponse struct { ServerBlobAuditingPolicy } -// ServerBlobAuditingPoliciesClientListByServerResponse contains the response from method ServerBlobAuditingPoliciesClient.ListByServer. +// ServerBlobAuditingPoliciesClientListByServerResponse contains the response from method ServerBlobAuditingPoliciesClient.NewListByServerPager. type ServerBlobAuditingPoliciesClientListByServerResponse struct { ServerBlobAuditingPolicyListResult } -// ServerCommunicationLinksClientCreateOrUpdateResponse contains the response from method ServerCommunicationLinksClient.CreateOrUpdate. -type ServerCommunicationLinksClientCreateOrUpdateResponse struct { - ServerCommunicationLink -} - -// ServerCommunicationLinksClientDeleteResponse contains the response from method ServerCommunicationLinksClient.Delete. -type ServerCommunicationLinksClientDeleteResponse struct { - // placeholder for future response values +// ServerConfigurationOptionsClientCreateOrUpdateResponse contains the response from method ServerConfigurationOptionsClient.BeginCreateOrUpdate. +type ServerConfigurationOptionsClientCreateOrUpdateResponse struct { + ServerConfigurationOption } -// ServerCommunicationLinksClientGetResponse contains the response from method ServerCommunicationLinksClient.Get. -type ServerCommunicationLinksClientGetResponse struct { - ServerCommunicationLink +// ServerConfigurationOptionsClientGetResponse contains the response from method ServerConfigurationOptionsClient.Get. +type ServerConfigurationOptionsClientGetResponse struct { + ServerConfigurationOption } -// ServerCommunicationLinksClientListByServerResponse contains the response from method ServerCommunicationLinksClient.ListByServer. -type ServerCommunicationLinksClientListByServerResponse struct { - ServerCommunicationLinkListResult +// ServerConfigurationOptionsClientListByManagedInstanceResponse contains the response from method ServerConfigurationOptionsClient.NewListByManagedInstancePager. +type ServerConfigurationOptionsClientListByManagedInstanceResponse struct { + ServerConfigurationOptionListResult } -// ServerConnectionPoliciesClientCreateOrUpdateResponse contains the response from method ServerConnectionPoliciesClient.CreateOrUpdate. +// ServerConnectionPoliciesClientCreateOrUpdateResponse contains the response from method ServerConnectionPoliciesClient.BeginCreateOrUpdate. type ServerConnectionPoliciesClientCreateOrUpdateResponse struct { ServerConnectionPolicy } @@ -1834,22 +2037,22 @@ type ServerConnectionPoliciesClientGetResponse struct { ServerConnectionPolicy } -// ServerConnectionPoliciesClientListByServerResponse contains the response from method ServerConnectionPoliciesClient.ListByServer. +// ServerConnectionPoliciesClientListByServerResponse contains the response from method ServerConnectionPoliciesClient.NewListByServerPager. type ServerConnectionPoliciesClientListByServerResponse struct { ServerConnectionPolicyListResult } -// ServerDNSAliasesClientAcquireResponse contains the response from method ServerDNSAliasesClient.Acquire. +// ServerDNSAliasesClientAcquireResponse contains the response from method ServerDNSAliasesClient.BeginAcquire. type ServerDNSAliasesClientAcquireResponse struct { ServerDNSAlias } -// ServerDNSAliasesClientCreateOrUpdateResponse contains the response from method ServerDNSAliasesClient.CreateOrUpdate. +// ServerDNSAliasesClientCreateOrUpdateResponse contains the response from method ServerDNSAliasesClient.BeginCreateOrUpdate. type ServerDNSAliasesClientCreateOrUpdateResponse struct { ServerDNSAlias } -// ServerDNSAliasesClientDeleteResponse contains the response from method ServerDNSAliasesClient.Delete. +// ServerDNSAliasesClientDeleteResponse contains the response from method ServerDNSAliasesClient.BeginDelete. type ServerDNSAliasesClientDeleteResponse struct { // placeholder for future response values } @@ -1859,12 +2062,12 @@ type ServerDNSAliasesClientGetResponse struct { ServerDNSAlias } -// ServerDNSAliasesClientListByServerResponse contains the response from method ServerDNSAliasesClient.ListByServer. +// ServerDNSAliasesClientListByServerResponse contains the response from method ServerDNSAliasesClient.NewListByServerPager. type ServerDNSAliasesClientListByServerResponse struct { ServerDNSAliasListResult } -// ServerDevOpsAuditSettingsClientCreateOrUpdateResponse contains the response from method ServerDevOpsAuditSettingsClient.CreateOrUpdate. +// ServerDevOpsAuditSettingsClientCreateOrUpdateResponse contains the response from method ServerDevOpsAuditSettingsClient.BeginCreateOrUpdate. type ServerDevOpsAuditSettingsClientCreateOrUpdateResponse struct { ServerDevOpsAuditingSettings } @@ -1874,17 +2077,17 @@ type ServerDevOpsAuditSettingsClientGetResponse struct { ServerDevOpsAuditingSettings } -// ServerDevOpsAuditSettingsClientListByServerResponse contains the response from method ServerDevOpsAuditSettingsClient.ListByServer. +// ServerDevOpsAuditSettingsClientListByServerResponse contains the response from method ServerDevOpsAuditSettingsClient.NewListByServerPager. type ServerDevOpsAuditSettingsClientListByServerResponse struct { ServerDevOpsAuditSettingsListResult } -// ServerKeysClientCreateOrUpdateResponse contains the response from method ServerKeysClient.CreateOrUpdate. +// ServerKeysClientCreateOrUpdateResponse contains the response from method ServerKeysClient.BeginCreateOrUpdate. type ServerKeysClientCreateOrUpdateResponse struct { ServerKey } -// ServerKeysClientDeleteResponse contains the response from method ServerKeysClient.Delete. +// ServerKeysClientDeleteResponse contains the response from method ServerKeysClient.BeginDelete. type ServerKeysClientDeleteResponse struct { // placeholder for future response values } @@ -1894,17 +2097,17 @@ type ServerKeysClientGetResponse struct { ServerKey } -// ServerKeysClientListByServerResponse contains the response from method ServerKeysClient.ListByServer. +// ServerKeysClientListByServerResponse contains the response from method ServerKeysClient.NewListByServerPager. type ServerKeysClientListByServerResponse struct { ServerKeyListResult } -// ServerOperationsClientListByServerResponse contains the response from method ServerOperationsClient.ListByServer. +// ServerOperationsClientListByServerResponse contains the response from method ServerOperationsClient.NewListByServerPager. type ServerOperationsClientListByServerResponse struct { ServerOperationListResult } -// ServerSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ServerSecurityAlertPoliciesClient.CreateOrUpdate. +// ServerSecurityAlertPoliciesClientCreateOrUpdateResponse contains the response from method ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate. type ServerSecurityAlertPoliciesClientCreateOrUpdateResponse struct { ServerSecurityAlertPolicy } @@ -1914,17 +2117,17 @@ type ServerSecurityAlertPoliciesClientGetResponse struct { ServerSecurityAlertPolicy } -// ServerSecurityAlertPoliciesClientListByServerResponse contains the response from method ServerSecurityAlertPoliciesClient.ListByServer. +// ServerSecurityAlertPoliciesClientListByServerResponse contains the response from method ServerSecurityAlertPoliciesClient.NewListByServerPager. type ServerSecurityAlertPoliciesClientListByServerResponse struct { LogicalServerSecurityAlertPolicyListResult } -// ServerTrustCertificatesClientCreateOrUpdateResponse contains the response from method ServerTrustCertificatesClient.CreateOrUpdate. +// ServerTrustCertificatesClientCreateOrUpdateResponse contains the response from method ServerTrustCertificatesClient.BeginCreateOrUpdate. type ServerTrustCertificatesClientCreateOrUpdateResponse struct { ServerTrustCertificate } -// ServerTrustCertificatesClientDeleteResponse contains the response from method ServerTrustCertificatesClient.Delete. +// ServerTrustCertificatesClientDeleteResponse contains the response from method ServerTrustCertificatesClient.BeginDelete. type ServerTrustCertificatesClientDeleteResponse struct { // placeholder for future response values } @@ -1934,17 +2137,17 @@ type ServerTrustCertificatesClientGetResponse struct { ServerTrustCertificate } -// ServerTrustCertificatesClientListByInstanceResponse contains the response from method ServerTrustCertificatesClient.ListByInstance. +// ServerTrustCertificatesClientListByInstanceResponse contains the response from method ServerTrustCertificatesClient.NewListByInstancePager. type ServerTrustCertificatesClientListByInstanceResponse struct { ServerTrustCertificatesListResult } -// ServerTrustGroupsClientCreateOrUpdateResponse contains the response from method ServerTrustGroupsClient.CreateOrUpdate. +// ServerTrustGroupsClientCreateOrUpdateResponse contains the response from method ServerTrustGroupsClient.BeginCreateOrUpdate. type ServerTrustGroupsClientCreateOrUpdateResponse struct { ServerTrustGroup } -// ServerTrustGroupsClientDeleteResponse contains the response from method ServerTrustGroupsClient.Delete. +// ServerTrustGroupsClientDeleteResponse contains the response from method ServerTrustGroupsClient.BeginDelete. type ServerTrustGroupsClientDeleteResponse struct { // placeholder for future response values } @@ -1954,17 +2157,17 @@ type ServerTrustGroupsClientGetResponse struct { ServerTrustGroup } -// ServerTrustGroupsClientListByInstanceResponse contains the response from method ServerTrustGroupsClient.ListByInstance. +// ServerTrustGroupsClientListByInstanceResponse contains the response from method ServerTrustGroupsClient.NewListByInstancePager. type ServerTrustGroupsClientListByInstanceResponse struct { ServerTrustGroupListResult } -// ServerTrustGroupsClientListByLocationResponse contains the response from method ServerTrustGroupsClient.ListByLocation. +// ServerTrustGroupsClientListByLocationResponse contains the response from method ServerTrustGroupsClient.NewListByLocationPager. type ServerTrustGroupsClientListByLocationResponse struct { ServerTrustGroupListResult } -// ServerUsagesClientListByServerResponse contains the response from method ServerUsagesClient.ListByServer. +// ServerUsagesClientListByServerResponse contains the response from method ServerUsagesClient.NewListByServerPager. type ServerUsagesClientListByServerResponse struct { ServerUsageListResult } @@ -1984,7 +2187,7 @@ type ServerVulnerabilityAssessmentsClientGetResponse struct { ServerVulnerabilityAssessment } -// ServerVulnerabilityAssessmentsClientListByServerResponse contains the response from method ServerVulnerabilityAssessmentsClient.ListByServer. +// ServerVulnerabilityAssessmentsClientListByServerResponse contains the response from method ServerVulnerabilityAssessmentsClient.NewListByServerPager. type ServerVulnerabilityAssessmentsClientListByServerResponse struct { ServerVulnerabilityAssessmentListResult } @@ -1994,12 +2197,12 @@ type ServersClientCheckNameAvailabilityResponse struct { CheckNameAvailabilityResponse } -// ServersClientCreateOrUpdateResponse contains the response from method ServersClient.CreateOrUpdate. +// ServersClientCreateOrUpdateResponse contains the response from method ServersClient.BeginCreateOrUpdate. type ServersClientCreateOrUpdateResponse struct { Server } -// ServersClientDeleteResponse contains the response from method ServersClient.Delete. +// ServersClientDeleteResponse contains the response from method ServersClient.BeginDelete. type ServersClientDeleteResponse struct { // placeholder for future response values } @@ -2009,34 +2212,49 @@ type ServersClientGetResponse struct { Server } -// ServersClientImportDatabaseResponse contains the response from method ServersClient.ImportDatabase. +// ServersClientImportDatabaseResponse contains the response from method ServersClient.BeginImportDatabase. type ServersClientImportDatabaseResponse struct { ImportExportOperationResult } -// ServersClientListByResourceGroupResponse contains the response from method ServersClient.ListByResourceGroup. +// ServersClientListByResourceGroupResponse contains the response from method ServersClient.NewListByResourceGroupPager. type ServersClientListByResourceGroupResponse struct { ServerListResult } -// ServersClientListResponse contains the response from method ServersClient.List. +// ServersClientListResponse contains the response from method ServersClient.NewListPager. type ServersClientListResponse struct { ServerListResult } -// ServersClientUpdateResponse contains the response from method ServersClient.Update. +// ServersClientRefreshStatusResponse contains the response from method ServersClient.BeginRefreshStatus. +type ServersClientRefreshStatusResponse struct { + RefreshExternalGovernanceStatusOperationResult +} + +// ServersClientUpdateResponse contains the response from method ServersClient.BeginUpdate. type ServersClientUpdateResponse struct { Server } -// ServiceObjectivesClientGetResponse contains the response from method ServiceObjectivesClient.Get. -type ServiceObjectivesClientGetResponse struct { - ServiceObjective +// StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse contains the response from method StartStopManagedInstanceSchedulesClient.CreateOrUpdate. +type StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse struct { + StartStopManagedInstanceSchedule } -// ServiceObjectivesClientListByServerResponse contains the response from method ServiceObjectivesClient.ListByServer. -type ServiceObjectivesClientListByServerResponse struct { - ServiceObjectiveListResult +// StartStopManagedInstanceSchedulesClientDeleteResponse contains the response from method StartStopManagedInstanceSchedulesClient.Delete. +type StartStopManagedInstanceSchedulesClientDeleteResponse struct { + // placeholder for future response values +} + +// StartStopManagedInstanceSchedulesClientGetResponse contains the response from method StartStopManagedInstanceSchedulesClient.Get. +type StartStopManagedInstanceSchedulesClientGetResponse struct { + StartStopManagedInstanceSchedule +} + +// StartStopManagedInstanceSchedulesClientListByInstanceResponse contains the response from method StartStopManagedInstanceSchedulesClient.NewListByInstancePager. +type StartStopManagedInstanceSchedulesClientListByInstanceResponse struct { + StartStopManagedInstanceScheduleListResult } // SubscriptionUsagesClientGetResponse contains the response from method SubscriptionUsagesClient.Get. @@ -2044,17 +2262,22 @@ type SubscriptionUsagesClientGetResponse struct { SubscriptionUsage } -// SubscriptionUsagesClientListByLocationResponse contains the response from method SubscriptionUsagesClient.ListByLocation. +// SubscriptionUsagesClientListByLocationResponse contains the response from method SubscriptionUsagesClient.NewListByLocationPager. type SubscriptionUsagesClientListByLocationResponse struct { SubscriptionUsageListResult } -// SyncAgentsClientCreateOrUpdateResponse contains the response from method SyncAgentsClient.CreateOrUpdate. +// SynapseLinkWorkspacesClientListByDatabaseResponse contains the response from method SynapseLinkWorkspacesClient.NewListByDatabasePager. +type SynapseLinkWorkspacesClientListByDatabaseResponse struct { + SynapseLinkWorkspaceListResult +} + +// SyncAgentsClientCreateOrUpdateResponse contains the response from method SyncAgentsClient.BeginCreateOrUpdate. type SyncAgentsClientCreateOrUpdateResponse struct { SyncAgent } -// SyncAgentsClientDeleteResponse contains the response from method SyncAgentsClient.Delete. +// SyncAgentsClientDeleteResponse contains the response from method SyncAgentsClient.BeginDelete. type SyncAgentsClientDeleteResponse struct { // placeholder for future response values } @@ -2069,12 +2292,12 @@ type SyncAgentsClientGetResponse struct { SyncAgent } -// SyncAgentsClientListByServerResponse contains the response from method SyncAgentsClient.ListByServer. +// SyncAgentsClientListByServerResponse contains the response from method SyncAgentsClient.NewListByServerPager. type SyncAgentsClientListByServerResponse struct { SyncAgentListResult } -// SyncAgentsClientListLinkedDatabasesResponse contains the response from method SyncAgentsClient.ListLinkedDatabases. +// SyncAgentsClientListLinkedDatabasesResponse contains the response from method SyncAgentsClient.NewListLinkedDatabasesPager. type SyncAgentsClientListLinkedDatabasesResponse struct { SyncAgentLinkedDatabaseListResult } @@ -2084,12 +2307,12 @@ type SyncGroupsClientCancelSyncResponse struct { // placeholder for future response values } -// SyncGroupsClientCreateOrUpdateResponse contains the response from method SyncGroupsClient.CreateOrUpdate. +// SyncGroupsClientCreateOrUpdateResponse contains the response from method SyncGroupsClient.BeginCreateOrUpdate. type SyncGroupsClientCreateOrUpdateResponse struct { SyncGroup } -// SyncGroupsClientDeleteResponse contains the response from method SyncGroupsClient.Delete. +// SyncGroupsClientDeleteResponse contains the response from method SyncGroupsClient.BeginDelete. type SyncGroupsClientDeleteResponse struct { // placeholder for future response values } @@ -2099,27 +2322,27 @@ type SyncGroupsClientGetResponse struct { SyncGroup } -// SyncGroupsClientListByDatabaseResponse contains the response from method SyncGroupsClient.ListByDatabase. +// SyncGroupsClientListByDatabaseResponse contains the response from method SyncGroupsClient.NewListByDatabasePager. type SyncGroupsClientListByDatabaseResponse struct { SyncGroupListResult } -// SyncGroupsClientListHubSchemasResponse contains the response from method SyncGroupsClient.ListHubSchemas. +// SyncGroupsClientListHubSchemasResponse contains the response from method SyncGroupsClient.NewListHubSchemasPager. type SyncGroupsClientListHubSchemasResponse struct { SyncFullSchemaPropertiesListResult } -// SyncGroupsClientListLogsResponse contains the response from method SyncGroupsClient.ListLogs. +// SyncGroupsClientListLogsResponse contains the response from method SyncGroupsClient.NewListLogsPager. type SyncGroupsClientListLogsResponse struct { SyncGroupLogListResult } -// SyncGroupsClientListSyncDatabaseIDsResponse contains the response from method SyncGroupsClient.ListSyncDatabaseIDs. +// SyncGroupsClientListSyncDatabaseIDsResponse contains the response from method SyncGroupsClient.NewListSyncDatabaseIDsPager. type SyncGroupsClientListSyncDatabaseIDsResponse struct { SyncDatabaseIDListResult } -// SyncGroupsClientRefreshHubSchemaResponse contains the response from method SyncGroupsClient.RefreshHubSchema. +// SyncGroupsClientRefreshHubSchemaResponse contains the response from method SyncGroupsClient.BeginRefreshHubSchema. type SyncGroupsClientRefreshHubSchemaResponse struct { // placeholder for future response values } @@ -2129,17 +2352,17 @@ type SyncGroupsClientTriggerSyncResponse struct { // placeholder for future response values } -// SyncGroupsClientUpdateResponse contains the response from method SyncGroupsClient.Update. +// SyncGroupsClientUpdateResponse contains the response from method SyncGroupsClient.BeginUpdate. type SyncGroupsClientUpdateResponse struct { SyncGroup } -// SyncMembersClientCreateOrUpdateResponse contains the response from method SyncMembersClient.CreateOrUpdate. +// SyncMembersClientCreateOrUpdateResponse contains the response from method SyncMembersClient.BeginCreateOrUpdate. type SyncMembersClientCreateOrUpdateResponse struct { SyncMember } -// SyncMembersClientDeleteResponse contains the response from method SyncMembersClient.Delete. +// SyncMembersClientDeleteResponse contains the response from method SyncMembersClient.BeginDelete. type SyncMembersClientDeleteResponse struct { // placeholder for future response values } @@ -2149,27 +2372,27 @@ type SyncMembersClientGetResponse struct { SyncMember } -// SyncMembersClientListBySyncGroupResponse contains the response from method SyncMembersClient.ListBySyncGroup. +// SyncMembersClientListBySyncGroupResponse contains the response from method SyncMembersClient.NewListBySyncGroupPager. type SyncMembersClientListBySyncGroupResponse struct { SyncMemberListResult } -// SyncMembersClientListMemberSchemasResponse contains the response from method SyncMembersClient.ListMemberSchemas. +// SyncMembersClientListMemberSchemasResponse contains the response from method SyncMembersClient.NewListMemberSchemasPager. type SyncMembersClientListMemberSchemasResponse struct { SyncFullSchemaPropertiesListResult } -// SyncMembersClientRefreshMemberSchemaResponse contains the response from method SyncMembersClient.RefreshMemberSchema. +// SyncMembersClientRefreshMemberSchemaResponse contains the response from method SyncMembersClient.BeginRefreshMemberSchema. type SyncMembersClientRefreshMemberSchemaResponse struct { // placeholder for future response values } -// SyncMembersClientUpdateResponse contains the response from method SyncMembersClient.Update. +// SyncMembersClientUpdateResponse contains the response from method SyncMembersClient.BeginUpdate. type SyncMembersClientUpdateResponse struct { SyncMember } -// TdeCertificatesClientCreateResponse contains the response from method TdeCertificatesClient.Create. +// TdeCertificatesClientCreateResponse contains the response from method TdeCertificatesClient.BeginCreate. type TdeCertificatesClientCreateResponse struct { // placeholder for future response values } @@ -2179,12 +2402,12 @@ type TimeZonesClientGetResponse struct { TimeZone } -// TimeZonesClientListByLocationResponse contains the response from method TimeZonesClient.ListByLocation. +// TimeZonesClientListByLocationResponse contains the response from method TimeZonesClient.NewListByLocationPager. type TimeZonesClientListByLocationResponse struct { TimeZoneListResult } -// TransparentDataEncryptionsClientCreateOrUpdateResponse contains the response from method TransparentDataEncryptionsClient.CreateOrUpdate. +// TransparentDataEncryptionsClientCreateOrUpdateResponse contains the response from method TransparentDataEncryptionsClient.BeginCreateOrUpdate. type TransparentDataEncryptionsClientCreateOrUpdateResponse struct { LogicalDatabaseTransparentDataEncryption } @@ -2194,17 +2417,17 @@ type TransparentDataEncryptionsClientGetResponse struct { LogicalDatabaseTransparentDataEncryption } -// TransparentDataEncryptionsClientListByDatabaseResponse contains the response from method TransparentDataEncryptionsClient.ListByDatabase. +// TransparentDataEncryptionsClientListByDatabaseResponse contains the response from method TransparentDataEncryptionsClient.NewListByDatabasePager. type TransparentDataEncryptionsClientListByDatabaseResponse struct { LogicalDatabaseTransparentDataEncryptionListResult } -// UsagesClientListByInstancePoolResponse contains the response from method UsagesClient.ListByInstancePool. +// UsagesClientListByInstancePoolResponse contains the response from method UsagesClient.NewListByInstancePoolPager. type UsagesClientListByInstancePoolResponse struct { UsageListResult } -// VirtualClustersClientDeleteResponse contains the response from method VirtualClustersClient.Delete. +// VirtualClustersClientDeleteResponse contains the response from method VirtualClustersClient.BeginDelete. type VirtualClustersClientDeleteResponse struct { // placeholder for future response values } @@ -2214,32 +2437,32 @@ type VirtualClustersClientGetResponse struct { VirtualCluster } -// VirtualClustersClientListByResourceGroupResponse contains the response from method VirtualClustersClient.ListByResourceGroup. +// VirtualClustersClientListByResourceGroupResponse contains the response from method VirtualClustersClient.NewListByResourceGroupPager. type VirtualClustersClientListByResourceGroupResponse struct { VirtualClusterListResult } -// VirtualClustersClientListResponse contains the response from method VirtualClustersClient.List. +// VirtualClustersClientListResponse contains the response from method VirtualClustersClient.NewListPager. type VirtualClustersClientListResponse struct { VirtualClusterListResult } -// VirtualClustersClientUpdateDNSServersResponse contains the response from method VirtualClustersClient.UpdateDNSServers. +// VirtualClustersClientUpdateDNSServersResponse contains the response from method VirtualClustersClient.BeginUpdateDNSServers. type VirtualClustersClientUpdateDNSServersResponse struct { - UpdateManagedInstanceDNSServersOperation + UpdateVirtualClusterDNSServersOperation } -// VirtualClustersClientUpdateResponse contains the response from method VirtualClustersClient.Update. +// VirtualClustersClientUpdateResponse contains the response from method VirtualClustersClient.BeginUpdate. type VirtualClustersClientUpdateResponse struct { VirtualCluster } -// VirtualNetworkRulesClientCreateOrUpdateResponse contains the response from method VirtualNetworkRulesClient.CreateOrUpdate. +// VirtualNetworkRulesClientCreateOrUpdateResponse contains the response from method VirtualNetworkRulesClient.BeginCreateOrUpdate. type VirtualNetworkRulesClientCreateOrUpdateResponse struct { VirtualNetworkRule } -// VirtualNetworkRulesClientDeleteResponse contains the response from method VirtualNetworkRulesClient.Delete. +// VirtualNetworkRulesClientDeleteResponse contains the response from method VirtualNetworkRulesClient.BeginDelete. type VirtualNetworkRulesClientDeleteResponse struct { // placeholder for future response values } @@ -2249,17 +2472,97 @@ type VirtualNetworkRulesClientGetResponse struct { VirtualNetworkRule } -// VirtualNetworkRulesClientListByServerResponse contains the response from method VirtualNetworkRulesClient.ListByServer. +// VirtualNetworkRulesClientListByServerResponse contains the response from method VirtualNetworkRulesClient.NewListByServerPager. type VirtualNetworkRulesClientListByServerResponse struct { VirtualNetworkRuleListResult } -// WorkloadClassifiersClientCreateOrUpdateResponse contains the response from method WorkloadClassifiersClient.CreateOrUpdate. +// VulnerabilityAssessmentBaselineClientGetResponse contains the response from method VulnerabilityAssessmentBaselineClient.Get. +type VulnerabilityAssessmentBaselineClientGetResponse struct { + DatabaseSQLVulnerabilityAssessmentBaselineSet +} + +// VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse contains the response from method VulnerabilityAssessmentBaselineClient.NewListBySQLVulnerabilityAssessmentPager. +type VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse struct { + DatabaseSQLVulnerabilityAssessmentBaselineSetListResult +} + +// VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse contains the response from method VulnerabilityAssessmentBaselinesClient.CreateOrUpdate. +type VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse struct { + DatabaseSQLVulnerabilityAssessmentBaselineSet +} + +// VulnerabilityAssessmentExecuteScanClientExecuteResponse contains the response from method VulnerabilityAssessmentExecuteScanClient.BeginExecute. +type VulnerabilityAssessmentExecuteScanClientExecuteResponse struct { + // placeholder for future response values +} + +// VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse contains the response from method VulnerabilityAssessmentRuleBaselineClient.CreateOrUpdate. +type VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse struct { + DatabaseSQLVulnerabilityAssessmentRuleBaseline +} + +// VulnerabilityAssessmentRuleBaselineClientGetResponse contains the response from method VulnerabilityAssessmentRuleBaselineClient.Get. +type VulnerabilityAssessmentRuleBaselineClientGetResponse struct { + DatabaseSQLVulnerabilityAssessmentRuleBaseline +} + +// VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse contains the response from method VulnerabilityAssessmentRuleBaselineClient.NewListByBaselinePager. +type VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse struct { + DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult +} + +// VulnerabilityAssessmentRuleBaselinesClientDeleteResponse contains the response from method VulnerabilityAssessmentRuleBaselinesClient.Delete. +type VulnerabilityAssessmentRuleBaselinesClientDeleteResponse struct { + // placeholder for future response values +} + +// VulnerabilityAssessmentScanResultClientGetResponse contains the response from method VulnerabilityAssessmentScanResultClient.Get. +type VulnerabilityAssessmentScanResultClientGetResponse struct { + VulnerabilityAssessmentScanResults +} + +// VulnerabilityAssessmentScanResultClientListByScanResponse contains the response from method VulnerabilityAssessmentScanResultClient.NewListByScanPager. +type VulnerabilityAssessmentScanResultClientListByScanResponse struct { + VulnerabilityAssessmentScanListResult +} + +// VulnerabilityAssessmentScansClientGetResponse contains the response from method VulnerabilityAssessmentScansClient.Get. +type VulnerabilityAssessmentScansClientGetResponse struct { + VulnerabilityAssessmentScanRecordForSQL +} + +// VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse contains the response from method VulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager. +type VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse struct { + VulnerabilityAssessmentScanRecordForSQLListResult +} + +// VulnerabilityAssessmentsClientDeleteResponse contains the response from method VulnerabilityAssessmentsClient.Delete. +type VulnerabilityAssessmentsClientDeleteResponse struct { + // placeholder for future response values +} + +// VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse contains the response from method VulnerabilityAssessmentsSettingsClient.CreateOrUpdate. +type VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse struct { + VulnerabilityAssessment +} + +// VulnerabilityAssessmentsSettingsClientGetResponse contains the response from method VulnerabilityAssessmentsSettingsClient.Get. +type VulnerabilityAssessmentsSettingsClientGetResponse struct { + VulnerabilityAssessment +} + +// VulnerabilityAssessmentsSettingsClientListByServerResponse contains the response from method VulnerabilityAssessmentsSettingsClient.NewListByServerPager. +type VulnerabilityAssessmentsSettingsClientListByServerResponse struct { + VulnerabilityAssessmentListResult +} + +// WorkloadClassifiersClientCreateOrUpdateResponse contains the response from method WorkloadClassifiersClient.BeginCreateOrUpdate. type WorkloadClassifiersClientCreateOrUpdateResponse struct { WorkloadClassifier } -// WorkloadClassifiersClientDeleteResponse contains the response from method WorkloadClassifiersClient.Delete. +// WorkloadClassifiersClientDeleteResponse contains the response from method WorkloadClassifiersClient.BeginDelete. type WorkloadClassifiersClientDeleteResponse struct { // placeholder for future response values } @@ -2269,17 +2572,17 @@ type WorkloadClassifiersClientGetResponse struct { WorkloadClassifier } -// WorkloadClassifiersClientListByWorkloadGroupResponse contains the response from method WorkloadClassifiersClient.ListByWorkloadGroup. +// WorkloadClassifiersClientListByWorkloadGroupResponse contains the response from method WorkloadClassifiersClient.NewListByWorkloadGroupPager. type WorkloadClassifiersClientListByWorkloadGroupResponse struct { WorkloadClassifierListResult } -// WorkloadGroupsClientCreateOrUpdateResponse contains the response from method WorkloadGroupsClient.CreateOrUpdate. +// WorkloadGroupsClientCreateOrUpdateResponse contains the response from method WorkloadGroupsClient.BeginCreateOrUpdate. type WorkloadGroupsClientCreateOrUpdateResponse struct { WorkloadGroup } -// WorkloadGroupsClientDeleteResponse contains the response from method WorkloadGroupsClient.Delete. +// WorkloadGroupsClientDeleteResponse contains the response from method WorkloadGroupsClient.BeginDelete. type WorkloadGroupsClientDeleteResponse struct { // placeholder for future response values } @@ -2289,7 +2592,7 @@ type WorkloadGroupsClientGetResponse struct { WorkloadGroup } -// WorkloadGroupsClientListByDatabaseResponse contains the response from method WorkloadGroupsClient.ListByDatabase. +// WorkloadGroupsClientListByDatabaseResponse contains the response from method WorkloadGroupsClient.NewListByDatabasePager. type WorkloadGroupsClientListByDatabaseResponse struct { WorkloadGroupListResult } diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_restorabledroppeddatabases_client.go b/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_restorabledroppeddatabases_client.go rename to sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_client.go index 1cac6e80a95f..8a4b0fc48ea4 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_restorabledroppeddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/restorabledroppeddatabases_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 armsql @@ -31,9 +32,9 @@ type RestorableDroppedDatabasesClient struct { } // NewRestorableDroppedDatabasesClient creates a new instance of RestorableDroppedDatabasesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRestorableDroppedDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableDroppedDatabasesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewRestorableDroppedDatabasesClient(subscriptionID string, credential azcor // Get - Gets a restorable dropped database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - RestorableDroppedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedDatabasesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - RestorableDroppedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedDatabasesClient.Get +// method. func (client *RestorableDroppedDatabasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, restorableDroppedDatabaseID string, options *RestorableDroppedDatabasesClientGetOptions) (RestorableDroppedDatabasesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, restorableDroppedDatabaseID, options) if err != nil { @@ -101,7 +103,13 @@ func (client *RestorableDroppedDatabasesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + if options != nil && options.Expand != nil { + reqQP.Set("$expand", *options.Expand) + } + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,13 +125,13 @@ func (client *RestorableDroppedDatabasesClient) getHandleResponse(resp *http.Res } // NewListByServerPager - Gets a list of restorable dropped databases. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - RestorableDroppedDatabasesClientListByServerOptions contains the optional parameters for the RestorableDroppedDatabasesClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - RestorableDroppedDatabasesClientListByServerOptions contains the optional parameters for the RestorableDroppedDatabasesClient.NewListByServerPager +// method. func (client *RestorableDroppedDatabasesClient) NewListByServerPager(resourceGroupName string, serverName string, options *RestorableDroppedDatabasesClientListByServerOptions) *runtime.Pager[RestorableDroppedDatabasesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[RestorableDroppedDatabasesClientListByServerResponse]{ More: func(page RestorableDroppedDatabasesClientListByServerResponse) bool { @@ -172,7 +180,7 @@ func (client *RestorableDroppedDatabasesClient) listByServerCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_restorabledroppedmanageddatabases_client.go b/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_restorabledroppedmanageddatabases_client.go rename to sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_client.go index a41db5c71d38..27ee8a5425df 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_restorabledroppedmanageddatabases_client.go +++ b/sdk/resourcemanager/sql/armsql/restorabledroppedmanageddatabases_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 armsql @@ -31,9 +32,9 @@ type RestorableDroppedManagedDatabasesClient struct { } // NewRestorableDroppedManagedDatabasesClient creates a new instance of RestorableDroppedManagedDatabasesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRestorableDroppedManagedDatabasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorableDroppedManagedDatabasesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewRestorableDroppedManagedDatabasesClient(subscriptionID string, credentia // Get - Gets a restorable dropped managed database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - RestorableDroppedManagedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - RestorableDroppedManagedDatabasesClientGetOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.Get +// method. func (client *RestorableDroppedManagedDatabasesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, restorableDroppedDatabaseID string, options *RestorableDroppedManagedDatabasesClientGetOptions) (RestorableDroppedManagedDatabasesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, restorableDroppedDatabaseID, options) if err != nil { @@ -101,7 +103,7 @@ func (client *RestorableDroppedManagedDatabasesClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,13 +119,13 @@ func (client *RestorableDroppedManagedDatabasesClient) getHandleResponse(resp *h } // NewListByInstancePager - Gets a list of restorable dropped managed databases. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - RestorableDroppedManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - RestorableDroppedManagedDatabasesClientListByInstanceOptions contains the optional parameters for the RestorableDroppedManagedDatabasesClient.NewListByInstancePager +// method. func (client *RestorableDroppedManagedDatabasesClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *RestorableDroppedManagedDatabasesClientListByInstanceOptions) *runtime.Pager[RestorableDroppedManagedDatabasesClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[RestorableDroppedManagedDatabasesClientListByInstanceResponse]{ More: func(page RestorableDroppedManagedDatabasesClientListByInstanceResponse) bool { @@ -172,7 +174,7 @@ func (client *RestorableDroppedManagedDatabasesClient) listByInstanceCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_restorepoints_client.go b/sdk/resourcemanager/sql/armsql/restorepoints_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_restorepoints_client.go rename to sdk/resourcemanager/sql/armsql/restorepoints_client.go index f7588a46bc98..9986eeee8da2 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_restorepoints_client.go +++ b/sdk/resourcemanager/sql/armsql/restorepoints_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 armsql @@ -31,9 +32,9 @@ type RestorePointsClient struct { } // NewRestorePointsClient creates a new instance of RestorePointsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRestorePointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestorePointsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewRestorePointsClient(subscriptionID string, credential azcore.TokenCreden // BeginCreate - Creates a restore point for a data warehouse. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// parameters - The definition for creating the restore point of this database. -// options - RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - parameters - The definition for creating the restore point of this database. +// - options - RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate +// method. func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters CreateDatabaseRestorePointDefinition, options *RestorePointsClientBeginCreateOptions) (*runtime.Poller[RestorePointsClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, serverName, databaseName, parameters, options) @@ -78,7 +80,8 @@ func (client *RestorePointsClient) BeginCreate(ctx context.Context, resourceGrou // Create - Creates a restore point for a data warehouse. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *RestorePointsClient) create(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters CreateDatabaseRestorePointDefinition, options *RestorePointsClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *RestorePointsClient) createCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *RestorePointsClient) createCreateRequest(ctx context.Context, reso // Delete - Deletes a restore point. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// restorePointName - The name of the restore point. -// options - RestorePointsClientDeleteOptions contains the optional parameters for the RestorePointsClient.Delete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - restorePointName - The name of the restore point. +// - options - RestorePointsClientDeleteOptions contains the optional parameters for the RestorePointsClient.Delete method. func (client *RestorePointsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string, options *RestorePointsClientDeleteOptions) (RestorePointsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, restorePointName, options) if err != nil { @@ -176,20 +180,21 @@ func (client *RestorePointsClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a restore point. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// restorePointName - The name of the restore point. -// options - RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - restorePointName - The name of the restore point. +// - options - RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. func (client *RestorePointsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, restorePointName string, options *RestorePointsClientGetOptions) (RestorePointsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, restorePointName, options) if err != nil { @@ -233,7 +238,7 @@ func (client *RestorePointsClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,14 +254,14 @@ func (client *RestorePointsClient) getHandleResponse(resp *http.Response) (Resto } // NewListByDatabasePager - Gets a list of database restore points. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - RestorePointsClientListByDatabaseOptions contains the optional parameters for the RestorePointsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - RestorePointsClientListByDatabaseOptions contains the optional parameters for the RestorePointsClient.NewListByDatabasePager +// method. func (client *RestorePointsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *RestorePointsClientListByDatabaseOptions) *runtime.Pager[RestorePointsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[RestorePointsClientListByDatabaseResponse]{ More: func(page RestorePointsClientListByDatabaseResponse) bool { @@ -309,7 +314,7 @@ func (client *RestorePointsClient) listByDatabaseCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_sensitivitylabels_client.go b/sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go similarity index 76% rename from sdk/resourcemanager/sql/armsql/zz_generated_sensitivitylabels_client.go rename to sdk/resourcemanager/sql/armsql/sensitivitylabels_client.go index 89cd4070794a..f287b87891f6 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_sensitivitylabels_client.go +++ b/sdk/resourcemanager/sql/armsql/sensitivitylabels_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 armsql @@ -32,9 +33,9 @@ type SensitivityLabelsClient struct { } // NewSensitivityLabelsClient creates a new instance of SensitivityLabelsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSensitivityLabelsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SensitivityLabelsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,17 +58,18 @@ func NewSensitivityLabelsClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Creates or updates the sensitivity label of a given column // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// columnName - The name of the column. -// parameters - The column sensitivity label resource. -// options - SensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the SensitivityLabelsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - columnName - The name of the column. +// - parameters - The column sensitivity label resource. +// - options - SensitivityLabelsClientCreateOrUpdateOptions contains the optional parameters for the SensitivityLabelsClient.CreateOrUpdate +// method. func (client *SensitivityLabelsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, parameters SensitivityLabel, options *SensitivityLabelsClientCreateOrUpdateOptions) (SensitivityLabelsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, parameters, options) if err != nil { @@ -120,7 +122,7 @@ func (client *SensitivityLabelsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -137,16 +139,17 @@ func (client *SensitivityLabelsClient) createOrUpdateHandleResponse(resp *http.R // Delete - Deletes the sensitivity label of a given column // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// columnName - The name of the column. -// options - SensitivityLabelsClientDeleteOptions contains the optional parameters for the SensitivityLabelsClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - columnName - The name of the column. +// - options - SensitivityLabelsClientDeleteOptions contains the optional parameters for the SensitivityLabelsClient.Delete +// method. func (client *SensitivityLabelsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, options *SensitivityLabelsClientDeleteOptions) (SensitivityLabelsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, options) if err != nil { @@ -199,23 +202,24 @@ func (client *SensitivityLabelsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // DisableRecommendation - Disables sensitivity recommendations on a given column // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// columnName - The name of the column. -// options - SensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.DisableRecommendation -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - columnName - The name of the column. +// - options - SensitivityLabelsClientDisableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.DisableRecommendation +// method. func (client *SensitivityLabelsClient) DisableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, options *SensitivityLabelsClientDisableRecommendationOptions) (SensitivityLabelsClientDisableRecommendationResponse, error) { req, err := client.disableRecommendationCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, options) if err != nil { @@ -268,7 +272,7 @@ func (client *SensitivityLabelsClient) disableRecommendationCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -276,16 +280,17 @@ func (client *SensitivityLabelsClient) disableRecommendationCreateRequest(ctx co // EnableRecommendation - Enables sensitivity recommendations on a given column (recommendations are enabled by default on // all columns) // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// columnName - The name of the column. -// options - SensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.EnableRecommendation -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - columnName - The name of the column. +// - options - SensitivityLabelsClientEnableRecommendationOptions contains the optional parameters for the SensitivityLabelsClient.EnableRecommendation +// method. func (client *SensitivityLabelsClient) EnableRecommendation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, options *SensitivityLabelsClientEnableRecommendationOptions) (SensitivityLabelsClientEnableRecommendationResponse, error) { req, err := client.enableRecommendationCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, options) if err != nil { @@ -338,23 +343,24 @@ func (client *SensitivityLabelsClient) enableRecommendationCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets the sensitivity label of a given column // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// schemaName - The name of the schema. -// tableName - The name of the table. -// columnName - The name of the column. -// sensitivityLabelSource - The source of the sensitivity label. -// options - SensitivityLabelsClientGetOptions contains the optional parameters for the SensitivityLabelsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - schemaName - The name of the schema. +// - tableName - The name of the table. +// - columnName - The name of the column. +// - sensitivityLabelSource - The source of the sensitivity label. +// - options - SensitivityLabelsClientGetOptions contains the optional parameters for the SensitivityLabelsClient.Get method. func (client *SensitivityLabelsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, schemaName string, tableName string, columnName string, sensitivityLabelSource SensitivityLabelSource, options *SensitivityLabelsClientGetOptions) (SensitivityLabelsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, schemaName, tableName, columnName, sensitivityLabelSource, options) if err != nil { @@ -410,7 +416,7 @@ func (client *SensitivityLabelsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -425,15 +431,94 @@ func (client *SensitivityLabelsClient) getHandleResponse(resp *http.Response) (S return result, nil } +// NewListByDatabasePager - Gets the sensitivity labels of a given database +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - SensitivityLabelsClientListByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListByDatabasePager +// method. +func (client *SensitivityLabelsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *SensitivityLabelsClientListByDatabaseOptions) *runtime.Pager[SensitivityLabelsClientListByDatabaseResponse] { + return runtime.NewPager(runtime.PagingHandler[SensitivityLabelsClientListByDatabaseResponse]{ + More: func(page SensitivityLabelsClientListByDatabaseResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SensitivityLabelsClientListByDatabaseResponse) (SensitivityLabelsClientListByDatabaseResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SensitivityLabelsClientListByDatabaseResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SensitivityLabelsClientListByDatabaseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SensitivityLabelsClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseHandleResponse(resp) + }, + }) +} + +// listByDatabaseCreateRequest creates the ListByDatabase request. +func (client *SensitivityLabelsClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *SensitivityLabelsClientListByDatabaseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/sensitivityLabels" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByDatabaseHandleResponse handles the ListByDatabase response. +func (client *SensitivityLabelsClient) listByDatabaseHandleResponse(resp *http.Response) (SensitivityLabelsClientListByDatabaseResponse, error) { + result := SensitivityLabelsClientListByDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SensitivityLabelListResult); err != nil { + return SensitivityLabelsClientListByDatabaseResponse{}, err + } + return result, nil +} + // NewListCurrentByDatabasePager - Gets the sensitivity labels of a given database -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - SensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.ListCurrentByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - SensitivityLabelsClientListCurrentByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListCurrentByDatabasePager +// method. func (client *SensitivityLabelsClient) NewListCurrentByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *SensitivityLabelsClientListCurrentByDatabaseOptions) *runtime.Pager[SensitivityLabelsClientListCurrentByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[SensitivityLabelsClientListCurrentByDatabaseResponse]{ More: func(page SensitivityLabelsClientListCurrentByDatabaseResponse) bool { @@ -495,7 +580,7 @@ func (client *SensitivityLabelsClient) listCurrentByDatabaseCreateRequest(ctx co if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -511,14 +596,14 @@ func (client *SensitivityLabelsClient) listCurrentByDatabaseHandleResponse(resp } // NewListRecommendedByDatabasePager - Gets the sensitivity labels of a given database -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - SensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.ListRecommendedByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - SensitivityLabelsClientListRecommendedByDatabaseOptions contains the optional parameters for the SensitivityLabelsClient.NewListRecommendedByDatabasePager +// method. func (client *SensitivityLabelsClient) NewListRecommendedByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *SensitivityLabelsClientListRecommendedByDatabaseOptions) *runtime.Pager[SensitivityLabelsClientListRecommendedByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[SensitivityLabelsClientListRecommendedByDatabaseResponse]{ More: func(page SensitivityLabelsClientListRecommendedByDatabaseResponse) bool { @@ -580,7 +665,7 @@ func (client *SensitivityLabelsClient) listRecommendedByDatabaseCreateRequest(ct if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -597,13 +682,14 @@ func (client *SensitivityLabelsClient) listRecommendedByDatabaseHandleResponse(r // Update - Update sensitivity labels of a given database using an operations batch. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - SensitivityLabelsClientUpdateOptions contains the optional parameters for the SensitivityLabelsClient.Update -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - SensitivityLabelsClientUpdateOptions contains the optional parameters for the SensitivityLabelsClient.Update +// method. func (client *SensitivityLabelsClient) Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters SensitivityLabelUpdateList, options *SensitivityLabelsClientUpdateOptions) (SensitivityLabelsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, parameters, options) if err != nil { @@ -643,7 +729,7 @@ func (client *SensitivityLabelsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, parameters) } diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serveradvancedthreatprotectionsettings_client.go b/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_serveradvancedthreatprotectionsettings_client.go rename to sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_client.go index dabcee0d9d37..8f1076299dc1 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serveradvancedthreatprotectionsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/serveradvancedthreatprotectionsettings_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 armsql @@ -31,9 +32,9 @@ type ServerAdvancedThreatProtectionSettingsClient struct { } // NewServerAdvancedThreatProtectionSettingsClient creates a new instance of ServerAdvancedThreatProtectionSettingsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerAdvancedThreatProtectionSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerAdvancedThreatProtectionSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewServerAdvancedThreatProtectionSettingsClient(subscriptionID string, cred // BeginCreateOrUpdate - Creates or updates an Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// advancedThreatProtectionName - The name of the Advanced Threat Protection state. -// parameters - The server Advanced Threat Protection state. -// options - ServerAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the -// ServerAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - advancedThreatProtectionName - The name of the Advanced Threat Protection state. +// - parameters - The server Advanced Threat Protection state. +// - options - ServerAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the +// ServerAdvancedThreatProtectionSettingsClient.BeginCreateOrUpdate method. func (client *ServerAdvancedThreatProtectionSettingsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ServerAdvancedThreatProtection, options *ServerAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerAdvancedThreatProtectionSettingsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, advancedThreatProtectionName, parameters, options) @@ -78,7 +80,8 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) BeginCreateOrUpdate( // CreateOrUpdate - Creates or updates an Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerAdvancedThreatProtectionSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, parameters ServerAdvancedThreatProtection, options *ServerAdvancedThreatProtectionSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, advancedThreatProtectionName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) createOrUpdateCreate return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) createOrUpdateCreate // Get - Get a server's Advanced Threat Protection state. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// advancedThreatProtectionName - The name of the Advanced Threat Protection state. -// options - ServerAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - advancedThreatProtectionName - The name of the Advanced Threat Protection state. +// - options - ServerAdvancedThreatProtectionSettingsClientGetOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.Get +// method. func (client *ServerAdvancedThreatProtectionSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, advancedThreatProtectionName AdvancedThreatProtectionName, options *ServerAdvancedThreatProtectionSettingsClientGetOptions) (ServerAdvancedThreatProtectionSettingsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, advancedThreatProtectionName, options) if err != nil { @@ -172,7 +176,7 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) getCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,13 +192,13 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) getHandleResponse(re } // NewListByServerPager - Get a list of the server's Advanced Threat Protection states. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerAdvancedThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerAdvancedThreatProtectionSettingsClientListByServerOptions contains the optional parameters for the ServerAdvancedThreatProtectionSettingsClient.NewListByServerPager +// method. func (client *ServerAdvancedThreatProtectionSettingsClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerAdvancedThreatProtectionSettingsClientListByServerOptions) *runtime.Pager[ServerAdvancedThreatProtectionSettingsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerAdvancedThreatProtectionSettingsClientListByServerResponse]{ More: func(page ServerAdvancedThreatProtectionSettingsClientListByServerResponse) bool { @@ -243,7 +247,7 @@ func (client *ServerAdvancedThreatProtectionSettingsClient) listByServerCreateRe return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serveradvisors_client.go b/sdk/resourcemanager/sql/armsql/serveradvisors_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_serveradvisors_client.go rename to sdk/resourcemanager/sql/armsql/serveradvisors_client.go index 98fee4654320..e3a8ed943e16 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serveradvisors_client.go +++ b/sdk/resourcemanager/sql/armsql/serveradvisors_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 armsql @@ -31,9 +32,9 @@ type ServerAdvisorsClient struct { } // NewServerAdvisorsClient creates a new instance of ServerAdvisorsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerAdvisorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerAdvisorsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewServerAdvisorsClient(subscriptionID string, credential azcore.TokenCrede // Get - Gets a server advisor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// advisorName - The name of the Server Advisor. -// options - ServerAdvisorsClientGetOptions contains the optional parameters for the ServerAdvisorsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - advisorName - The name of the Server Advisor. +// - options - ServerAdvisorsClientGetOptions contains the optional parameters for the ServerAdvisorsClient.Get method. func (client *ServerAdvisorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, advisorName string, options *ServerAdvisorsClientGetOptions) (ServerAdvisorsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, advisorName, options) if err != nil { @@ -101,7 +103,7 @@ func (client *ServerAdvisorsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,12 +120,13 @@ func (client *ServerAdvisorsClient) getHandleResponse(resp *http.Response) (Serv // ListByServer - Gets a list of server advisors. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerAdvisorsClientListByServerOptions contains the optional parameters for the ServerAdvisorsClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerAdvisorsClientListByServerOptions contains the optional parameters for the ServerAdvisorsClient.ListByServer +// method. func (client *ServerAdvisorsClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string, options *ServerAdvisorsClientListByServerOptions) (ServerAdvisorsClientListByServerResponse, error) { req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) if err != nil { @@ -162,7 +165,7 @@ func (client *ServerAdvisorsClient) listByServerCreateRequest(ctx context.Contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -179,13 +182,14 @@ func (client *ServerAdvisorsClient) listByServerHandleResponse(resp *http.Respon // Update - Updates a server advisor. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// advisorName - The name of the Server Advisor. -// parameters - The requested advisor resource state. -// options - ServerAdvisorsClientUpdateOptions contains the optional parameters for the ServerAdvisorsClient.Update method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - advisorName - The name of the Server Advisor. +// - parameters - The requested advisor resource state. +// - options - ServerAdvisorsClientUpdateOptions contains the optional parameters for the ServerAdvisorsClient.Update method. func (client *ServerAdvisorsClient) Update(ctx context.Context, resourceGroupName string, serverName string, advisorName string, parameters Advisor, options *ServerAdvisorsClientUpdateOptions) (ServerAdvisorsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, advisorName, parameters, options) if err != nil { @@ -225,7 +229,7 @@ func (client *ServerAdvisorsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverautomatictuning_client.go b/sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverautomatictuning_client.go rename to sdk/resourcemanager/sql/armsql/serverautomatictuning_client.go index ed2635a63112..e717c4d1d8e8 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverautomatictuning_client.go +++ b/sdk/resourcemanager/sql/armsql/serverautomatictuning_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 armsql @@ -31,9 +32,9 @@ type ServerAutomaticTuningClient struct { } // NewServerAutomaticTuningClient creates a new instance of ServerAutomaticTuningClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerAutomaticTuningClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerAutomaticTuningClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewServerAutomaticTuningClient(subscriptionID string, credential azcore.Tok // Get - Retrieves server automatic tuning options. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerAutomaticTuningClientGetOptions contains the optional parameters for the ServerAutomaticTuningClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerAutomaticTuningClientGetOptions contains the optional parameters for the ServerAutomaticTuningClient.Get +// method. func (client *ServerAutomaticTuningClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *ServerAutomaticTuningClientGetOptions) (ServerAutomaticTuningClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, options) if err != nil { @@ -97,7 +99,7 @@ func (client *ServerAutomaticTuningClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,13 +116,14 @@ func (client *ServerAutomaticTuningClient) getHandleResponse(resp *http.Response // Update - Update automatic tuning options on server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// parameters - The requested automatic tuning resource state. -// options - ServerAutomaticTuningClientUpdateOptions contains the optional parameters for the ServerAutomaticTuningClient.Update -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - parameters - The requested automatic tuning resource state. +// - options - ServerAutomaticTuningClientUpdateOptions contains the optional parameters for the ServerAutomaticTuningClient.Update +// method. func (client *ServerAutomaticTuningClient) Update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerAutomaticTuning, options *ServerAutomaticTuningClientUpdateOptions) (ServerAutomaticTuningClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { @@ -156,7 +159,7 @@ func (client *ServerAutomaticTuningClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverazureadadministrators_client.go b/sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverazureadadministrators_client.go rename to sdk/resourcemanager/sql/armsql/serverazureadadministrators_client.go index 96286817c8cc..8788df1f3618 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverazureadadministrators_client.go +++ b/sdk/resourcemanager/sql/armsql/serverazureadadministrators_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 armsql @@ -31,9 +32,9 @@ type ServerAzureADAdministratorsClient struct { } // NewServerAzureADAdministratorsClient creates a new instance of ServerAzureADAdministratorsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerAzureADAdministratorsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerAzureADAdministratorsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewServerAzureADAdministratorsClient(subscriptionID string, credential azco // BeginCreateOrUpdate - Creates or updates an existing Azure Active Directory administrator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// administratorName - The name of server active directory administrator. -// parameters - The requested Azure Active Directory administrator Resource state. -// options - ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAzureADAdministratorsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - administratorName - The name of server active directory administrator. +// - parameters - The requested Azure Active Directory administrator Resource state. +// - options - ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAzureADAdministratorsClient.BeginCreateOrUpdate +// method. func (client *ServerAzureADAdministratorsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, parameters ServerAzureADAdministrator, options *ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerAzureADAdministratorsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, administratorName, parameters, options) @@ -78,7 +80,8 @@ func (client *ServerAzureADAdministratorsClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Creates or updates an existing Azure Active Directory administrator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerAzureADAdministratorsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, parameters ServerAzureADAdministrator, options *ServerAzureADAdministratorsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, administratorName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *ServerAzureADAdministratorsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *ServerAzureADAdministratorsClient) createOrUpdateCreateRequest(ctx // BeginDelete - Deletes the Azure Active Directory administrator with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// administratorName - The name of server active directory administrator. -// options - ServerAzureADAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAzureADAdministratorsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - administratorName - The name of server active directory administrator. +// - options - ServerAzureADAdministratorsClientBeginDeleteOptions contains the optional parameters for the ServerAzureADAdministratorsClient.BeginDelete +// method. func (client *ServerAzureADAdministratorsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, options *ServerAzureADAdministratorsClientBeginDeleteOptions) (*runtime.Poller[ServerAzureADAdministratorsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, administratorName, options) @@ -147,7 +151,8 @@ func (client *ServerAzureADAdministratorsClient) BeginDelete(ctx context.Context // Delete - Deletes the Azure Active Directory administrator with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerAzureADAdministratorsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, options *ServerAzureADAdministratorsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, administratorName, options) if err != nil { @@ -187,20 +192,21 @@ func (client *ServerAzureADAdministratorsClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a Azure Active Directory administrator. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// administratorName - The name of server active directory administrator. -// options - ServerAzureADAdministratorsClientGetOptions contains the optional parameters for the ServerAzureADAdministratorsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - administratorName - The name of server active directory administrator. +// - options - ServerAzureADAdministratorsClientGetOptions contains the optional parameters for the ServerAzureADAdministratorsClient.Get +// method. func (client *ServerAzureADAdministratorsClient) Get(ctx context.Context, resourceGroupName string, serverName string, administratorName AdministratorName, options *ServerAzureADAdministratorsClientGetOptions) (ServerAzureADAdministratorsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, administratorName, options) if err != nil { @@ -240,7 +246,7 @@ func (client *ServerAzureADAdministratorsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -256,13 +262,13 @@ func (client *ServerAzureADAdministratorsClient) getHandleResponse(resp *http.Re } // NewListByServerPager - Gets a list of Azure Active Directory administrators in a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerAzureADAdministratorsClientListByServerOptions contains the optional parameters for the ServerAzureADAdministratorsClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerAzureADAdministratorsClientListByServerOptions contains the optional parameters for the ServerAzureADAdministratorsClient.NewListByServerPager +// method. func (client *ServerAzureADAdministratorsClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerAzureADAdministratorsClientListByServerOptions) *runtime.Pager[ServerAzureADAdministratorsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerAzureADAdministratorsClientListByServerResponse]{ More: func(page ServerAzureADAdministratorsClientListByServerResponse) bool { @@ -311,7 +317,7 @@ func (client *ServerAzureADAdministratorsClient) listByServerCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverazureadonlyauthentications_client.go b/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverazureadonlyauthentications_client.go rename to sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_client.go index 824cac245e18..6bb705a89308 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverazureadonlyauthentications_client.go +++ b/sdk/resourcemanager/sql/armsql/serverazureadonlyauthentications_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 armsql @@ -31,9 +32,9 @@ type ServerAzureADOnlyAuthenticationsClient struct { } // NewServerAzureADOnlyAuthenticationsClient creates a new instance of ServerAzureADOnlyAuthenticationsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerAzureADOnlyAuthenticationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerAzureADOnlyAuthenticationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +58,15 @@ func NewServerAzureADOnlyAuthenticationsClient(subscriptionID string, credential // BeginCreateOrUpdate - Sets Server Active Directory only authentication property or updates an existing server Active Directory // only authentication property. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// authenticationName - The name of server azure active directory only authentication. -// parameters - The required parameters for creating or updating an Active Directory only authentication property. -// options - ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - authenticationName - The name of server azure active directory only authentication. +// - parameters - The required parameters for creating or updating an Active Directory only authentication property. +// - options - ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.BeginCreateOrUpdate +// method. func (client *ServerAzureADOnlyAuthenticationsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, authenticationName AuthenticationName, parameters ServerAzureADOnlyAuthentication, options *ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerAzureADOnlyAuthenticationsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, authenticationName, parameters, options) @@ -80,7 +82,8 @@ func (client *ServerAzureADOnlyAuthenticationsClient) BeginCreateOrUpdate(ctx co // CreateOrUpdate - Sets Server Active Directory only authentication property or updates an existing server Active Directory // only authentication property. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerAzureADOnlyAuthenticationsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, authenticationName AuthenticationName, parameters ServerAzureADOnlyAuthentication, options *ServerAzureADOnlyAuthenticationsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, authenticationName, parameters, options) if err != nil { @@ -120,7 +123,7 @@ func (client *ServerAzureADOnlyAuthenticationsClient) createOrUpdateCreateReques return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -128,13 +131,14 @@ func (client *ServerAzureADOnlyAuthenticationsClient) createOrUpdateCreateReques // BeginDelete - Deletes an existing server Active Directory only authentication property. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// authenticationName - The name of server azure active directory only authentication. -// options - ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - authenticationName - The name of server azure active directory only authentication. +// - options - ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.BeginDelete +// method. func (client *ServerAzureADOnlyAuthenticationsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, authenticationName AuthenticationName, options *ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions) (*runtime.Poller[ServerAzureADOnlyAuthenticationsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, authenticationName, options) @@ -149,7 +153,8 @@ func (client *ServerAzureADOnlyAuthenticationsClient) BeginDelete(ctx context.Co // Delete - Deletes an existing server Active Directory only authentication property. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerAzureADOnlyAuthenticationsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, authenticationName AuthenticationName, options *ServerAzureADOnlyAuthenticationsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, authenticationName, options) if err != nil { @@ -189,20 +194,21 @@ func (client *ServerAzureADOnlyAuthenticationsClient) deleteCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a specific Azure Active Directory only authentication property. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// authenticationName - The name of server azure active directory only authentication. -// options - ServerAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - authenticationName - The name of server azure active directory only authentication. +// - options - ServerAzureADOnlyAuthenticationsClientGetOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.Get +// method. func (client *ServerAzureADOnlyAuthenticationsClient) Get(ctx context.Context, resourceGroupName string, serverName string, authenticationName AuthenticationName, options *ServerAzureADOnlyAuthenticationsClientGetOptions) (ServerAzureADOnlyAuthenticationsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, authenticationName, options) if err != nil { @@ -242,7 +248,7 @@ func (client *ServerAzureADOnlyAuthenticationsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,13 +264,13 @@ func (client *ServerAzureADOnlyAuthenticationsClient) getHandleResponse(resp *ht } // NewListByServerPager - Gets a list of server Azure Active Directory only authentications. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerAzureADOnlyAuthenticationsClientListByServerOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerAzureADOnlyAuthenticationsClientListByServerOptions contains the optional parameters for the ServerAzureADOnlyAuthenticationsClient.NewListByServerPager +// method. func (client *ServerAzureADOnlyAuthenticationsClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerAzureADOnlyAuthenticationsClientListByServerOptions) *runtime.Pager[ServerAzureADOnlyAuthenticationsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerAzureADOnlyAuthenticationsClientListByServerResponse]{ More: func(page ServerAzureADOnlyAuthenticationsClientListByServerResponse) bool { @@ -313,7 +319,7 @@ func (client *ServerAzureADOnlyAuthenticationsClient) listByServerCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverblobauditingpolicies_client.go b/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverblobauditingpolicies_client.go rename to sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_client.go index 4bd48f75e10d..9d1338437e5b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverblobauditingpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/serverblobauditingpolicies_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 armsql @@ -31,9 +32,9 @@ type ServerBlobAuditingPoliciesClient struct { } // NewServerBlobAuditingPoliciesClient creates a new instance of ServerBlobAuditingPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerBlobAuditingPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerBlobAuditingPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewServerBlobAuditingPoliciesClient(subscriptionID string, credential azcor // BeginCreateOrUpdate - Creates or updates a server's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// parameters - Properties of blob auditing policy -// options - ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - parameters - Properties of blob auditing policy +// - options - ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.BeginCreateOrUpdate +// method. func (client *ServerBlobAuditingPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerBlobAuditingPolicy, options *ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerBlobAuditingPoliciesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, parameters, options) @@ -77,7 +79,8 @@ func (client *ServerBlobAuditingPoliciesClient) BeginCreateOrUpdate(ctx context. // CreateOrUpdate - Creates or updates a server's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerBlobAuditingPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerBlobAuditingPolicy, options *ServerBlobAuditingPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { @@ -114,7 +117,7 @@ func (client *ServerBlobAuditingPoliciesClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,12 +125,13 @@ func (client *ServerBlobAuditingPoliciesClient) createOrUpdateCreateRequest(ctx // Get - Gets a server's blob auditing policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerBlobAuditingPoliciesClientGetOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.Get +// method. func (client *ServerBlobAuditingPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *ServerBlobAuditingPoliciesClientGetOptions) (ServerBlobAuditingPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, options) if err != nil { @@ -164,7 +168,7 @@ func (client *ServerBlobAuditingPoliciesClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,13 +184,13 @@ func (client *ServerBlobAuditingPoliciesClient) getHandleResponse(resp *http.Res } // NewListByServerPager - Lists auditing settings of a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerBlobAuditingPoliciesClientListByServerOptions contains the optional parameters for the ServerBlobAuditingPoliciesClient.NewListByServerPager +// method. func (client *ServerBlobAuditingPoliciesClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerBlobAuditingPoliciesClientListByServerOptions) *runtime.Pager[ServerBlobAuditingPoliciesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerBlobAuditingPoliciesClientListByServerResponse]{ More: func(page ServerBlobAuditingPoliciesClientListByServerResponse) bool { @@ -235,7 +239,7 @@ func (client *ServerBlobAuditingPoliciesClient) listByServerCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client.go b/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client.go new file mode 100644 index 000000000000..4d43e4edea59 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/serverconfigurationoptions_client.go @@ -0,0 +1,263 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// ServerConfigurationOptionsClient contains the methods for the ServerConfigurationOptions group. +// Don't use this type directly, use NewServerConfigurationOptionsClient() instead. +type ServerConfigurationOptionsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewServerConfigurationOptionsClient creates a new instance of ServerConfigurationOptionsClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewServerConfigurationOptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerConfigurationOptionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &ServerConfigurationOptionsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Updates managed instance server configuration option. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - serverConfigurationOptionName - The name of the server configuration option. +// - parameters - Server configuration option parameters. +// - options - ServerConfigurationOptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerConfigurationOptionsClient.BeginCreateOrUpdate +// method. +func (client *ServerConfigurationOptionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, serverConfigurationOptionName ServerConfigurationOptionName, parameters ServerConfigurationOption, options *ServerConfigurationOptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerConfigurationOptionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, serverConfigurationOptionName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[ServerConfigurationOptionsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[ServerConfigurationOptionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Updates managed instance server configuration option. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ServerConfigurationOptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, serverConfigurationOptionName ServerConfigurationOptionName, parameters ServerConfigurationOption, options *ServerConfigurationOptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, serverConfigurationOptionName, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ServerConfigurationOptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, serverConfigurationOptionName ServerConfigurationOptionName, parameters ServerConfigurationOption, options *ServerConfigurationOptionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverConfigurationOptions/{serverConfigurationOptionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if serverConfigurationOptionName == "" { + return nil, errors.New("parameter serverConfigurationOptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverConfigurationOptionName}", url.PathEscape(string(serverConfigurationOptionName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// Get - Gets managed instance server configuration option. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - serverConfigurationOptionName - The name of the server configuration option. +// - options - ServerConfigurationOptionsClientGetOptions contains the optional parameters for the ServerConfigurationOptionsClient.Get +// method. +func (client *ServerConfigurationOptionsClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, serverConfigurationOptionName ServerConfigurationOptionName, options *ServerConfigurationOptionsClientGetOptions) (ServerConfigurationOptionsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, serverConfigurationOptionName, options) + if err != nil { + return ServerConfigurationOptionsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ServerConfigurationOptionsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServerConfigurationOptionsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ServerConfigurationOptionsClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, serverConfigurationOptionName ServerConfigurationOptionName, options *ServerConfigurationOptionsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverConfigurationOptions/{serverConfigurationOptionName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if serverConfigurationOptionName == "" { + return nil, errors.New("parameter serverConfigurationOptionName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverConfigurationOptionName}", url.PathEscape(string(serverConfigurationOptionName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ServerConfigurationOptionsClient) getHandleResponse(resp *http.Response) (ServerConfigurationOptionsClientGetResponse, error) { + result := ServerConfigurationOptionsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServerConfigurationOption); err != nil { + return ServerConfigurationOptionsClientGetResponse{}, err + } + return result, nil +} + +// NewListByManagedInstancePager - Gets a list of managed instance server configuration options. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ServerConfigurationOptionsClientListByManagedInstanceOptions contains the optional parameters for the ServerConfigurationOptionsClient.NewListByManagedInstancePager +// method. +func (client *ServerConfigurationOptionsClient) NewListByManagedInstancePager(resourceGroupName string, managedInstanceName string, options *ServerConfigurationOptionsClientListByManagedInstanceOptions) *runtime.Pager[ServerConfigurationOptionsClientListByManagedInstanceResponse] { + return runtime.NewPager(runtime.PagingHandler[ServerConfigurationOptionsClientListByManagedInstanceResponse]{ + More: func(page ServerConfigurationOptionsClientListByManagedInstanceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ServerConfigurationOptionsClientListByManagedInstanceResponse) (ServerConfigurationOptionsClientListByManagedInstanceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByManagedInstanceCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ServerConfigurationOptionsClientListByManagedInstanceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ServerConfigurationOptionsClientListByManagedInstanceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ServerConfigurationOptionsClientListByManagedInstanceResponse{}, runtime.NewResponseError(resp) + } + return client.listByManagedInstanceHandleResponse(resp) + }, + }) +} + +// listByManagedInstanceCreateRequest creates the ListByManagedInstance request. +func (client *ServerConfigurationOptionsClient) listByManagedInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *ServerConfigurationOptionsClientListByManagedInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/serverConfigurationOptions" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByManagedInstanceHandleResponse handles the ListByManagedInstance response. +func (client *ServerConfigurationOptionsClient) listByManagedInstanceHandleResponse(resp *http.Response) (ServerConfigurationOptionsClientListByManagedInstanceResponse, error) { + result := ServerConfigurationOptionsClientListByManagedInstanceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ServerConfigurationOptionListResult); err != nil { + return ServerConfigurationOptionsClientListByManagedInstanceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverconnectionpolicies_client.go b/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverconnectionpolicies_client.go rename to sdk/resourcemanager/sql/armsql/serverconnectionpolicies_client.go index e06d7370d999..6f469e3cffe4 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverconnectionpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/serverconnectionpolicies_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 armsql @@ -31,9 +32,9 @@ type ServerConnectionPoliciesClient struct { } // NewServerConnectionPoliciesClient creates a new instance of ServerConnectionPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerConnectionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerConnectionPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewServerConnectionPoliciesClient(subscriptionID string, credential azcore. // BeginCreateOrUpdate - Updates a server connection policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// connectionPolicyName - The name of the connection policy. -// parameters - The required parameters for updating a server connection policy. -// options - ServerConnectionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerConnectionPoliciesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - connectionPolicyName - The name of the connection policy. +// - parameters - The required parameters for updating a server connection policy. +// - options - ServerConnectionPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerConnectionPoliciesClient.BeginCreateOrUpdate +// method. func (client *ServerConnectionPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, connectionPolicyName ConnectionPolicyName, parameters ServerConnectionPolicy, options *ServerConnectionPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerConnectionPoliciesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, connectionPolicyName, parameters, options) @@ -78,7 +80,8 @@ func (client *ServerConnectionPoliciesClient) BeginCreateOrUpdate(ctx context.Co // CreateOrUpdate - Updates a server connection policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerConnectionPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, connectionPolicyName ConnectionPolicyName, parameters ServerConnectionPolicy, options *ServerConnectionPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, connectionPolicyName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *ServerConnectionPoliciesClient) createOrUpdateCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *ServerConnectionPoliciesClient) createOrUpdateCreateRequest(ctx co // Get - Gets a server connection policy // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// connectionPolicyName - The name of the connection policy. -// options - ServerConnectionPoliciesClientGetOptions contains the optional parameters for the ServerConnectionPoliciesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - connectionPolicyName - The name of the connection policy. +// - options - ServerConnectionPoliciesClientGetOptions contains the optional parameters for the ServerConnectionPoliciesClient.Get +// method. func (client *ServerConnectionPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, connectionPolicyName ConnectionPolicyName, options *ServerConnectionPoliciesClientGetOptions) (ServerConnectionPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, connectionPolicyName, options) if err != nil { @@ -172,7 +176,7 @@ func (client *ServerConnectionPoliciesClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,13 +192,13 @@ func (client *ServerConnectionPoliciesClient) getHandleResponse(resp *http.Respo } // NewListByServerPager - Lists connection policy -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-05-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerConnectionPoliciesClientListByServerOptions contains the optional parameters for the ServerConnectionPoliciesClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerConnectionPoliciesClientListByServerOptions contains the optional parameters for the ServerConnectionPoliciesClient.NewListByServerPager +// method. func (client *ServerConnectionPoliciesClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerConnectionPoliciesClientListByServerOptions) *runtime.Pager[ServerConnectionPoliciesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerConnectionPoliciesClientListByServerResponse]{ More: func(page ServerConnectionPoliciesClientListByServerResponse) bool { @@ -243,7 +247,7 @@ func (client *ServerConnectionPoliciesClient) listByServerCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-05-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverdevopsauditsettings_client.go b/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go similarity index 78% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverdevopsauditsettings_client.go rename to sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_client.go index 14679ab5c1ac..d5fd177a0d1f 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverdevopsauditsettings_client.go +++ b/sdk/resourcemanager/sql/armsql/serverdevopsauditsettings_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 armsql @@ -31,9 +32,9 @@ type ServerDevOpsAuditSettingsClient struct { } // NewServerDevOpsAuditSettingsClient creates a new instance of ServerDevOpsAuditSettingsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerDevOpsAuditSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerDevOpsAuditSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,15 @@ func NewServerDevOpsAuditSettingsClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates or updates a server's DevOps audit settings. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// devOpsAuditingSettingsName - The name of the devops audit settings. This should always be 'default'. -// parameters - Properties of DevOps audit settings -// options - ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.BeginCreateOrUpdate -// method. -func (client *ServerDevOpsAuditSettingsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName string, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerDevOpsAuditSettingsClientCreateOrUpdateResponse], error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - parameters - Properties of DevOps audit settings +// - options - ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.BeginCreateOrUpdate +// method. +func (client *ServerDevOpsAuditSettingsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName DevOpsAuditingSettingsName, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerDevOpsAuditSettingsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, devOpsAuditingSettingsName, parameters, options) if err != nil { @@ -80,8 +81,9 @@ func (client *ServerDevOpsAuditSettingsClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates or updates a server's DevOps audit settings. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -func (client *ServerDevOpsAuditSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName string, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { +// +// Generated from API version 2022-11-01-preview +func (client *ServerDevOpsAuditSettingsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName DevOpsAuditingSettingsName, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, devOpsAuditingSettingsName, parameters, options) if err != nil { return nil, err @@ -97,7 +99,7 @@ func (client *ServerDevOpsAuditSettingsClient) createOrUpdate(ctx context.Contex } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerDevOpsAuditSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName string, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ServerDevOpsAuditSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName DevOpsAuditingSettingsName, parameters ServerDevOpsAuditingSettings, options *ServerDevOpsAuditSettingsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -110,7 +112,7 @@ func (client *ServerDevOpsAuditSettingsClient) createOrUpdateCreateRequest(ctx c if devOpsAuditingSettingsName == "" { return nil, errors.New("parameter devOpsAuditingSettingsName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{devOpsAuditingSettingsName}", url.PathEscape(devOpsAuditingSettingsName)) + urlPath = strings.ReplaceAll(urlPath, "{devOpsAuditingSettingsName}", url.PathEscape(string(devOpsAuditingSettingsName))) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -120,7 +122,7 @@ func (client *ServerDevOpsAuditSettingsClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -128,14 +130,14 @@ func (client *ServerDevOpsAuditSettingsClient) createOrUpdateCreateRequest(ctx c // Get - Gets a server's DevOps audit settings. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// devOpsAuditingSettingsName - The name of the devops audit settings. This should always be 'default'. -// options - ServerDevOpsAuditSettingsClientGetOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.Get -// method. -func (client *ServerDevOpsAuditSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName string, options *ServerDevOpsAuditSettingsClientGetOptions) (ServerDevOpsAuditSettingsClientGetResponse, error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerDevOpsAuditSettingsClientGetOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.Get +// method. +func (client *ServerDevOpsAuditSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName DevOpsAuditingSettingsName, options *ServerDevOpsAuditSettingsClientGetOptions) (ServerDevOpsAuditSettingsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, devOpsAuditingSettingsName, options) if err != nil { return ServerDevOpsAuditSettingsClientGetResponse{}, err @@ -151,7 +153,7 @@ func (client *ServerDevOpsAuditSettingsClient) Get(ctx context.Context, resource } // getCreateRequest creates the Get request. -func (client *ServerDevOpsAuditSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName string, options *ServerDevOpsAuditSettingsClientGetOptions) (*policy.Request, error) { +func (client *ServerDevOpsAuditSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, devOpsAuditingSettingsName DevOpsAuditingSettingsName, options *ServerDevOpsAuditSettingsClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/devOpsAuditingSettings/{devOpsAuditingSettingsName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -164,7 +166,7 @@ func (client *ServerDevOpsAuditSettingsClient) getCreateRequest(ctx context.Cont if devOpsAuditingSettingsName == "" { return nil, errors.New("parameter devOpsAuditingSettingsName cannot be empty") } - urlPath = strings.ReplaceAll(urlPath, "{devOpsAuditingSettingsName}", url.PathEscape(devOpsAuditingSettingsName)) + urlPath = strings.ReplaceAll(urlPath, "{devOpsAuditingSettingsName}", url.PathEscape(string(devOpsAuditingSettingsName))) if client.subscriptionID == "" { return nil, errors.New("parameter client.subscriptionID cannot be empty") } @@ -174,7 +176,7 @@ func (client *ServerDevOpsAuditSettingsClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -190,13 +192,13 @@ func (client *ServerDevOpsAuditSettingsClient) getHandleResponse(resp *http.Resp } // NewListByServerPager - Lists DevOps audit settings of a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerDevOpsAuditSettingsClientListByServerOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerDevOpsAuditSettingsClientListByServerOptions contains the optional parameters for the ServerDevOpsAuditSettingsClient.NewListByServerPager +// method. func (client *ServerDevOpsAuditSettingsClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerDevOpsAuditSettingsClientListByServerOptions) *runtime.Pager[ServerDevOpsAuditSettingsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerDevOpsAuditSettingsClientListByServerResponse]{ More: func(page ServerDevOpsAuditSettingsClientListByServerResponse) bool { @@ -245,7 +247,7 @@ func (client *ServerDevOpsAuditSettingsClient) listByServerCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverdnsaliases_client.go b/sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverdnsaliases_client.go rename to sdk/resourcemanager/sql/armsql/serverdnsaliases_client.go index f3dcf00df33b..a414632f36a1 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverdnsaliases_client.go +++ b/sdk/resourcemanager/sql/armsql/serverdnsaliases_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 armsql @@ -31,9 +32,9 @@ type ServerDNSAliasesClient struct { } // NewServerDNSAliasesClient creates a new instance of ServerDNSAliasesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerDNSAliasesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerDNSAliasesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewServerDNSAliasesClient(subscriptionID string, credential azcore.TokenCre // BeginAcquire - Acquires server DNS alias from another server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server that the alias is pointing to. -// dnsAliasName - The name of the server dns alias. -// options - ServerDNSAliasesClientBeginAcquireOptions contains the optional parameters for the ServerDNSAliasesClient.BeginAcquire -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server that the alias is pointing to. +// - dnsAliasName - The name of the server dns alias. +// - options - ServerDNSAliasesClientBeginAcquireOptions contains the optional parameters for the ServerDNSAliasesClient.BeginAcquire +// method. func (client *ServerDNSAliasesClient) BeginAcquire(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, parameters ServerDNSAliasAcquisition, options *ServerDNSAliasesClientBeginAcquireOptions) (*runtime.Poller[ServerDNSAliasesClientAcquireResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.acquire(ctx, resourceGroupName, serverName, dnsAliasName, parameters, options) @@ -77,7 +79,8 @@ func (client *ServerDNSAliasesClient) BeginAcquire(ctx context.Context, resource // Acquire - Acquires server DNS alias from another server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerDNSAliasesClient) acquire(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, parameters ServerDNSAliasAcquisition, options *ServerDNSAliasesClientBeginAcquireOptions) (*http.Response, error) { req, err := client.acquireCreateRequest(ctx, resourceGroupName, serverName, dnsAliasName, parameters, options) if err != nil { @@ -117,7 +120,7 @@ func (client *ServerDNSAliasesClient) acquireCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -125,13 +128,14 @@ func (client *ServerDNSAliasesClient) acquireCreateRequest(ctx context.Context, // BeginCreateOrUpdate - Creates a server DNS alias. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server that the alias is pointing to. -// dnsAliasName - The name of the server dns alias. -// options - ServerDNSAliasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDNSAliasesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server that the alias is pointing to. +// - dnsAliasName - The name of the server dns alias. +// - options - ServerDNSAliasesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerDNSAliasesClient.BeginCreateOrUpdate +// method. func (client *ServerDNSAliasesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerDNSAliasesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, dnsAliasName, options) @@ -146,7 +150,8 @@ func (client *ServerDNSAliasesClient) BeginCreateOrUpdate(ctx context.Context, r // CreateOrUpdate - Creates a server DNS alias. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerDNSAliasesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, dnsAliasName, options) if err != nil { @@ -186,7 +191,7 @@ func (client *ServerDNSAliasesClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -194,13 +199,14 @@ func (client *ServerDNSAliasesClient) createOrUpdateCreateRequest(ctx context.Co // BeginDelete - Deletes the server DNS alias with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server that the alias is pointing to. -// dnsAliasName - The name of the server dns alias. -// options - ServerDNSAliasesClientBeginDeleteOptions contains the optional parameters for the ServerDNSAliasesClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server that the alias is pointing to. +// - dnsAliasName - The name of the server dns alias. +// - options - ServerDNSAliasesClientBeginDeleteOptions contains the optional parameters for the ServerDNSAliasesClient.BeginDelete +// method. func (client *ServerDNSAliasesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientBeginDeleteOptions) (*runtime.Poller[ServerDNSAliasesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, dnsAliasName, options) @@ -215,7 +221,8 @@ func (client *ServerDNSAliasesClient) BeginDelete(ctx context.Context, resourceG // Delete - Deletes the server DNS alias with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerDNSAliasesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, dnsAliasName, options) if err != nil { @@ -255,19 +262,20 @@ func (client *ServerDNSAliasesClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a server DNS alias. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server that the alias is pointing to. -// dnsAliasName - The name of the server dns alias. -// options - ServerDNSAliasesClientGetOptions contains the optional parameters for the ServerDNSAliasesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server that the alias is pointing to. +// - dnsAliasName - The name of the server dns alias. +// - options - ServerDNSAliasesClientGetOptions contains the optional parameters for the ServerDNSAliasesClient.Get method. func (client *ServerDNSAliasesClient) Get(ctx context.Context, resourceGroupName string, serverName string, dnsAliasName string, options *ServerDNSAliasesClientGetOptions) (ServerDNSAliasesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, dnsAliasName, options) if err != nil { @@ -307,7 +315,7 @@ func (client *ServerDNSAliasesClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -323,13 +331,13 @@ func (client *ServerDNSAliasesClient) getHandleResponse(resp *http.Response) (Se } // NewListByServerPager - Gets a list of server DNS aliases for a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server that the alias is pointing to. -// options - ServerDNSAliasesClientListByServerOptions contains the optional parameters for the ServerDNSAliasesClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server that the alias is pointing to. +// - options - ServerDNSAliasesClientListByServerOptions contains the optional parameters for the ServerDNSAliasesClient.NewListByServerPager +// method. func (client *ServerDNSAliasesClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerDNSAliasesClientListByServerOptions) *runtime.Pager[ServerDNSAliasesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerDNSAliasesClientListByServerResponse]{ More: func(page ServerDNSAliasesClientListByServerResponse) bool { @@ -378,7 +386,7 @@ func (client *ServerDNSAliasesClient) listByServerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverkeys_client.go b/sdk/resourcemanager/sql/armsql/serverkeys_client.go similarity index 82% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverkeys_client.go rename to sdk/resourcemanager/sql/armsql/serverkeys_client.go index 998aa822cc92..424cf349c547 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverkeys_client.go +++ b/sdk/resourcemanager/sql/armsql/serverkeys_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 armsql @@ -31,9 +32,9 @@ type ServerKeysClient struct { } // NewServerKeysClient creates a new instance of ServerKeysClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerKeysClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,17 +57,18 @@ func NewServerKeysClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates a server key. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// keyName - The name of the server key to be operated on (updated or created). The key name is required to be in the format -// of 'vaultkeyversion'. For example, if the keyId is -// https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name should be formatted as: -// YourVaultNameYourKeyNameYourKeyVersion -// parameters - The requested server key resource state. -// options - ServerKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerKeysClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - keyName - The name of the server key to be operated on (updated or created). The key name is required to be in the format +// of 'vaultkeyversion'. For example, if the keyId is +// https://YourVaultName.vault.azure.net/keys/YourKeyName/YourKeyVersion, then the server key name should be formatted as: +// YourVaultNameYourKeyNameYourKeyVersion +// - parameters - The requested server key resource state. +// - options - ServerKeysClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerKeysClient.BeginCreateOrUpdate +// method. func (client *ServerKeysClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, keyName string, parameters ServerKey, options *ServerKeysClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerKeysClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, keyName, parameters, options) @@ -81,7 +83,8 @@ func (client *ServerKeysClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a server key. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerKeysClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, keyName string, parameters ServerKey, options *ServerKeysClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, keyName, parameters, options) if err != nil { @@ -121,7 +124,7 @@ func (client *ServerKeysClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -129,12 +132,13 @@ func (client *ServerKeysClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes the server key with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// keyName - The name of the server key to be deleted. -// options - ServerKeysClientBeginDeleteOptions contains the optional parameters for the ServerKeysClient.BeginDelete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - keyName - The name of the server key to be deleted. +// - options - ServerKeysClientBeginDeleteOptions contains the optional parameters for the ServerKeysClient.BeginDelete method. func (client *ServerKeysClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *ServerKeysClientBeginDeleteOptions) (*runtime.Poller[ServerKeysClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, keyName, options) @@ -149,7 +153,8 @@ func (client *ServerKeysClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes the server key with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerKeysClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *ServerKeysClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, keyName, options) if err != nil { @@ -189,19 +194,20 @@ func (client *ServerKeysClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a server key. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// keyName - The name of the server key to be retrieved. -// options - ServerKeysClientGetOptions contains the optional parameters for the ServerKeysClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - keyName - The name of the server key to be retrieved. +// - options - ServerKeysClientGetOptions contains the optional parameters for the ServerKeysClient.Get method. func (client *ServerKeysClient) Get(ctx context.Context, resourceGroupName string, serverName string, keyName string, options *ServerKeysClientGetOptions) (ServerKeysClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, keyName, options) if err != nil { @@ -241,7 +247,7 @@ func (client *ServerKeysClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,12 +263,13 @@ func (client *ServerKeysClient) getHandleResponse(resp *http.Response) (ServerKe } // NewListByServerPager - Gets a list of server keys. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerKeysClientListByServerOptions contains the optional parameters for the ServerKeysClient.ListByServer method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerKeysClientListByServerOptions contains the optional parameters for the ServerKeysClient.NewListByServerPager +// method. func (client *ServerKeysClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerKeysClientListByServerOptions) *runtime.Pager[ServerKeysClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerKeysClientListByServerResponse]{ More: func(page ServerKeysClientListByServerResponse) bool { @@ -311,7 +318,7 @@ func (client *ServerKeysClient) listByServerCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serveroperations_client.go b/sdk/resourcemanager/sql/armsql/serveroperations_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_serveroperations_client.go rename to sdk/resourcemanager/sql/armsql/serveroperations_client.go index 776683a5df5b..85197865b757 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serveroperations_client.go +++ b/sdk/resourcemanager/sql/armsql/serveroperations_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 armsql @@ -31,9 +32,9 @@ type ServerOperationsClient struct { } // NewServerOperationsClient creates a new instance of ServerOperationsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerOperationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerOperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,13 +56,13 @@ func NewServerOperationsClient(subscriptionID string, credential azcore.TokenCre } // NewListByServerPager - Gets a list of operations performed on the server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerOperationsClientListByServerOptions contains the optional parameters for the ServerOperationsClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerOperationsClientListByServerOptions contains the optional parameters for the ServerOperationsClient.NewListByServerPager +// method. func (client *ServerOperationsClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerOperationsClientListByServerOptions) *runtime.Pager[ServerOperationsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerOperationsClientListByServerResponse]{ More: func(page ServerOperationsClientListByServerResponse) bool { @@ -110,7 +111,7 @@ func (client *ServerOperationsClient) listByServerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_servers_client.go b/sdk/resourcemanager/sql/armsql/servers_client.go similarity index 76% rename from sdk/resourcemanager/sql/armsql/zz_generated_servers_client.go rename to sdk/resourcemanager/sql/armsql/servers_client.go index 1b70e7b73852..7920758adb0b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_servers_client.go +++ b/sdk/resourcemanager/sql/armsql/servers_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 armsql @@ -31,9 +32,9 @@ type ServersClient struct { } // NewServersClient creates a new instance of ServersClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,10 +57,11 @@ func NewServersClient(subscriptionID string, credential azcore.TokenCredential, // CheckNameAvailability - Determines whether a resource can be created with the specified name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// parameters - The name availability request parameters. -// options - ServersClientCheckNameAvailabilityOptions contains the optional parameters for the ServersClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-11-01-preview +// - parameters - The name availability request parameters. +// - options - ServersClientCheckNameAvailabilityOptions contains the optional parameters for the ServersClient.CheckNameAvailability +// method. func (client *ServersClient) CheckNameAvailability(ctx context.Context, parameters CheckNameAvailabilityRequest, options *ServersClientCheckNameAvailabilityOptions) (ServersClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, parameters, options) if err != nil { @@ -87,7 +89,7 @@ func (client *ServersClient) checkNameAvailabilityCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -104,13 +106,14 @@ func (client *ServersClient) checkNameAvailabilityHandleResponse(resp *http.Resp // BeginCreateOrUpdate - Creates or updates a server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// parameters - The requested server resource state. -// options - ServersClientBeginCreateOrUpdateOptions contains the optional parameters for the ServersClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - parameters - The requested server resource state. +// - options - ServersClientBeginCreateOrUpdateOptions contains the optional parameters for the ServersClient.BeginCreateOrUpdate +// method. func (client *ServersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServersClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, parameters, options) @@ -125,7 +128,8 @@ func (client *ServersClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Creates or updates a server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServersClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters Server, options *ServersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { @@ -161,7 +165,7 @@ func (client *ServersClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -169,11 +173,12 @@ func (client *ServersClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Deletes a server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServersClientBeginDeleteOptions contains the optional parameters for the ServersClient.BeginDelete method. func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*runtime.Poller[ServersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, options) @@ -188,7 +193,8 @@ func (client *ServersClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes a server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, options) if err != nil { @@ -224,18 +230,19 @@ func (client *ServersClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServersClientGetOptions contains the optional parameters for the ServersClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServersClientGetOptions contains the optional parameters for the ServersClient.Get method. func (client *ServersClient) Get(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientGetOptions) (ServersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, options) if err != nil { @@ -274,7 +281,7 @@ func (client *ServersClient) getCreateRequest(ctx context.Context, resourceGroup if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,13 +298,14 @@ func (client *ServersClient) getHandleResponse(resp *http.Response) (ServersClie // BeginImportDatabase - Imports a bacpac into a new database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// parameters - The database import request parameters. -// options - ServersClientBeginImportDatabaseOptions contains the optional parameters for the ServersClient.BeginImportDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - parameters - The database import request parameters. +// - options - ServersClientBeginImportDatabaseOptions contains the optional parameters for the ServersClient.BeginImportDatabase +// method. func (client *ServersClient) BeginImportDatabase(ctx context.Context, resourceGroupName string, serverName string, parameters ImportNewDatabaseDefinition, options *ServersClientBeginImportDatabaseOptions) (*runtime.Poller[ServersClientImportDatabaseResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.importDatabase(ctx, resourceGroupName, serverName, parameters, options) @@ -312,7 +320,8 @@ func (client *ServersClient) BeginImportDatabase(ctx context.Context, resourceGr // ImportDatabase - Imports a bacpac into a new database. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServersClient) importDatabase(ctx context.Context, resourceGroupName string, serverName string, parameters ImportNewDatabaseDefinition, options *ServersClientBeginImportDatabaseOptions) (*http.Response, error) { req, err := client.importDatabaseCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { @@ -348,16 +357,16 @@ func (client *ServersClient) importDatabaseCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } // NewListPager - Gets a list of all servers in the subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// options - ServersClientListOptions contains the optional parameters for the ServersClient.List method. +// +// Generated from API version 2022-11-01-preview +// - options - ServersClientListOptions contains the optional parameters for the ServersClient.NewListPager method. func (client *ServersClient) NewListPager(options *ServersClientListOptions) *runtime.Pager[ServersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServersClientListResponse]{ More: func(page ServersClientListResponse) bool { @@ -401,7 +410,7 @@ func (client *ServersClient) listCreateRequest(ctx context.Context, options *Ser if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -417,12 +426,12 @@ func (client *ServersClient) listHandleResponse(resp *http.Response) (ServersCli } // NewListByResourceGroupPager - Gets a list of servers in a resource groups. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - options - ServersClientListByResourceGroupOptions contains the optional parameters for the ServersClient.NewListByResourceGroupPager +// method. func (client *ServersClient) NewListByResourceGroupPager(resourceGroupName string, options *ServersClientListByResourceGroupOptions) *runtime.Pager[ServersClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[ServersClientListByResourceGroupResponse]{ More: func(page ServersClientListByResourceGroupResponse) bool { @@ -470,7 +479,7 @@ func (client *ServersClient) listByResourceGroupCreateRequest(ctx context.Contex if options != nil && options.Expand != nil { reqQP.Set("$expand", *options.Expand) } - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -485,14 +494,83 @@ func (client *ServersClient) listByResourceGroupHandleResponse(resp *http.Respon return result, nil } +// BeginRefreshStatus - Refresh external governance enablement status. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServersClientBeginRefreshStatusOptions contains the optional parameters for the ServersClient.BeginRefreshStatus +// method. +func (client *ServersClient) BeginRefreshStatus(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRefreshStatusOptions) (*runtime.Poller[ServersClientRefreshStatusResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.refreshStatus(ctx, resourceGroupName, serverName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ServersClientRefreshStatusResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ServersClientRefreshStatusResponse](options.ResumeToken, client.pl, nil) + } +} + +// RefreshStatus - Refresh external governance enablement status. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *ServersClient) refreshStatus(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRefreshStatusOptions) (*http.Response, error) { + req, err := client.refreshStatusCreateRequest(ctx, resourceGroupName, serverName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// refreshStatusCreateRequest creates the RefreshStatus request. +func (client *ServersClient) refreshStatusCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServersClientBeginRefreshStatusOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/refreshExternalGovernanceStatus" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginUpdate - Updates a server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// parameters - The requested server resource state. -// options - ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - parameters - The requested server resource state. +// - options - ServersClientBeginUpdateOptions contains the optional parameters for the ServersClient.BeginUpdate method. func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdate, options *ServersClientBeginUpdateOptions) (*runtime.Poller[ServersClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, serverName, parameters, options) @@ -507,7 +585,8 @@ func (client *ServersClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Updates a server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServersClient) update(ctx context.Context, resourceGroupName string, serverName string, parameters ServerUpdate, options *ServersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { @@ -543,7 +622,7 @@ func (client *ServersClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serversecurityalertpolicies_client.go b/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go similarity index 78% rename from sdk/resourcemanager/sql/armsql/zz_generated_serversecurityalertpolicies_client.go rename to sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_client.go index 2912e4605d90..be9edf7170e4 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serversecurityalertpolicies_client.go +++ b/sdk/resourcemanager/sql/armsql/serversecurityalertpolicies_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 armsql @@ -31,9 +32,9 @@ type ServerSecurityAlertPoliciesClient struct { } // NewServerSecurityAlertPoliciesClient creates a new instance of ServerSecurityAlertPoliciesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerSecurityAlertPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerSecurityAlertPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewServerSecurityAlertPoliciesClient(subscriptionID string, credential azco // BeginCreateOrUpdate - Creates or updates a threat detection policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// securityAlertPolicyName - The name of the threat detection policy. -// parameters - The server security alert policy. -// options - ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate -// method. -func (client *ServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerSecurityAlertPoliciesClientCreateOrUpdateResponse], error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - securityAlertPolicyName - The name of the threat detection policy. +// - parameters - The server security alert policy. +// - options - ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.BeginCreateOrUpdate +// method. +func (client *ServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerSecurityAlertPoliciesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, securityAlertPolicyName, parameters, options) if err != nil { @@ -78,8 +80,9 @@ func (client *ServerSecurityAlertPoliciesClient) BeginCreateOrUpdate(ctx context // CreateOrUpdate - Creates or updates a threat detection policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -func (client *ServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { +// +// Generated from API version 2022-11-01-preview +func (client *ServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, securityAlertPolicyName, parameters, options) if err != nil { return nil, err @@ -95,7 +98,7 @@ func (client *ServerSecurityAlertPoliciesClient) createOrUpdate(ctx context.Cont } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, parameters ServerSecurityAlertPolicy, options *ServerSecurityAlertPoliciesClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -118,7 +121,7 @@ func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,14 +129,15 @@ func (client *ServerSecurityAlertPoliciesClient) createOrUpdateCreateRequest(ctx // Get - Get a server's security alert policy. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// securityAlertPolicyName - The name of the security alert policy. -// options - ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get -// method. -func (client *ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, options *ServerSecurityAlertPoliciesClientGetOptions) (ServerSecurityAlertPoliciesClientGetResponse, error) { +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - securityAlertPolicyName - The name of the security alert policy. +// - options - ServerSecurityAlertPoliciesClientGetOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.Get +// method. +func (client *ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, options *ServerSecurityAlertPoliciesClientGetOptions) (ServerSecurityAlertPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, securityAlertPolicyName, options) if err != nil { return ServerSecurityAlertPoliciesClientGetResponse{}, err @@ -149,7 +153,7 @@ func (client *ServerSecurityAlertPoliciesClient) Get(ctx context.Context, resour } // getCreateRequest creates the Get request. -func (client *ServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyName, options *ServerSecurityAlertPoliciesClientGetOptions) (*policy.Request, error) { +func (client *ServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, securityAlertPolicyName SecurityAlertPolicyNameAutoGenerated, options *ServerSecurityAlertPoliciesClientGetOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/securityAlertPolicies/{securityAlertPolicyName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -172,7 +176,7 @@ func (client *ServerSecurityAlertPoliciesClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,13 +192,13 @@ func (client *ServerSecurityAlertPoliciesClient) getHandleResponse(resp *http.Re } // NewListByServerPager - Get the server's threat detection policies. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerSecurityAlertPoliciesClientListByServerOptions contains the optional parameters for the ServerSecurityAlertPoliciesClient.NewListByServerPager +// method. func (client *ServerSecurityAlertPoliciesClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerSecurityAlertPoliciesClientListByServerOptions) *runtime.Pager[ServerSecurityAlertPoliciesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerSecurityAlertPoliciesClientListByServerResponse]{ More: func(page ServerSecurityAlertPoliciesClientListByServerResponse) bool { @@ -243,7 +247,7 @@ func (client *ServerSecurityAlertPoliciesClient) listByServerCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_servertrustcertificates_client.go b/sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go similarity index 85% rename from sdk/resourcemanager/sql/armsql/zz_generated_servertrustcertificates_client.go rename to sdk/resourcemanager/sql/armsql/servertrustcertificates_client.go index 9153eb0f3055..ee7c1ed829cc 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_servertrustcertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/servertrustcertificates_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 armsql @@ -31,9 +32,9 @@ type ServerTrustCertificatesClient struct { } // NewServerTrustCertificatesClient creates a new instance of ServerTrustCertificatesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerTrustCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerTrustCertificatesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewServerTrustCertificatesClient(subscriptionID string, credential azcore.T // BeginCreateOrUpdate - Uploads a server trust certificate from box to Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// certificateName - Name of of the certificate to upload. -// parameters - The server trust certificate info. -// options - ServerTrustCertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerTrustCertificatesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - certificateName - Name of of the certificate to upload. +// - parameters - The server trust certificate info. +// - options - ServerTrustCertificatesClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerTrustCertificatesClient.BeginCreateOrUpdate +// method. func (client *ServerTrustCertificatesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, parameters ServerTrustCertificate, options *ServerTrustCertificatesClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerTrustCertificatesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, managedInstanceName, certificateName, parameters, options) @@ -78,7 +80,8 @@ func (client *ServerTrustCertificatesClient) BeginCreateOrUpdate(ctx context.Con // CreateOrUpdate - Uploads a server trust certificate from box to Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerTrustCertificatesClient) createOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, parameters ServerTrustCertificate, options *ServerTrustCertificatesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, certificateName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *ServerTrustCertificatesClient) createOrUpdateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *ServerTrustCertificatesClient) createOrUpdateCreateRequest(ctx con // BeginDelete - Deletes a server trust certificate that was uploaded from box to Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// certificateName - Name of of the certificate to delete. -// options - ServerTrustCertificatesClientBeginDeleteOptions contains the optional parameters for the ServerTrustCertificatesClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - certificateName - Name of of the certificate to delete. +// - options - ServerTrustCertificatesClientBeginDeleteOptions contains the optional parameters for the ServerTrustCertificatesClient.BeginDelete +// method. func (client *ServerTrustCertificatesClient) BeginDelete(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, options *ServerTrustCertificatesClientBeginDeleteOptions) (*runtime.Poller[ServerTrustCertificatesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, managedInstanceName, certificateName, options) @@ -147,7 +151,8 @@ func (client *ServerTrustCertificatesClient) BeginDelete(ctx context.Context, re // Delete - Deletes a server trust certificate that was uploaded from box to Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerTrustCertificatesClient) deleteOperation(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, options *ServerTrustCertificatesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, certificateName, options) if err != nil { @@ -187,20 +192,21 @@ func (client *ServerTrustCertificatesClient) deleteCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a server trust certificate that was uploaded from box to Sql Managed Instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// certificateName - Name of of the certificate to get. -// options - ServerTrustCertificatesClientGetOptions contains the optional parameters for the ServerTrustCertificatesClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - certificateName - Name of of the certificate to get. +// - options - ServerTrustCertificatesClientGetOptions contains the optional parameters for the ServerTrustCertificatesClient.Get +// method. func (client *ServerTrustCertificatesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, certificateName string, options *ServerTrustCertificatesClientGetOptions) (ServerTrustCertificatesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, certificateName, options) if err != nil { @@ -240,7 +246,7 @@ func (client *ServerTrustCertificatesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -257,13 +263,13 @@ func (client *ServerTrustCertificatesClient) getHandleResponse(resp *http.Respon // NewListByInstancePager - Gets a list of server trust certificates that were uploaded from box to the given Sql Managed // Instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ServerTrustCertificatesClientListByInstanceOptions contains the optional parameters for the ServerTrustCertificatesClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ServerTrustCertificatesClientListByInstanceOptions contains the optional parameters for the ServerTrustCertificatesClient.NewListByInstancePager +// method. func (client *ServerTrustCertificatesClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *ServerTrustCertificatesClientListByInstanceOptions) *runtime.Pager[ServerTrustCertificatesClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ServerTrustCertificatesClientListByInstanceResponse]{ More: func(page ServerTrustCertificatesClientListByInstanceResponse) bool { @@ -312,7 +318,7 @@ func (client *ServerTrustCertificatesClient) listByInstanceCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_servertrustgroups_client.go b/sdk/resourcemanager/sql/armsql/servertrustgroups_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_servertrustgroups_client.go rename to sdk/resourcemanager/sql/armsql/servertrustgroups_client.go index 39c7c2c6454b..87f7bffe36b2 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_servertrustgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/servertrustgroups_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 armsql @@ -31,9 +32,9 @@ type ServerTrustGroupsClient struct { } // NewServerTrustGroupsClient creates a new instance of ServerTrustGroupsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerTrustGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerTrustGroupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewServerTrustGroupsClient(subscriptionID string, credential azcore.TokenCr // BeginCreateOrUpdate - Creates or updates a server trust group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The name of the region where the resource is located. -// serverTrustGroupName - The name of the server trust group. -// parameters - The server trust group parameters. -// options - ServerTrustGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerTrustGroupsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The name of the region where the resource is located. +// - serverTrustGroupName - The name of the server trust group. +// - parameters - The server trust group parameters. +// - options - ServerTrustGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerTrustGroupsClient.BeginCreateOrUpdate +// method. func (client *ServerTrustGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, parameters ServerTrustGroup, options *ServerTrustGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerTrustGroupsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, locationName, serverTrustGroupName, parameters, options) @@ -78,7 +80,8 @@ func (client *ServerTrustGroupsClient) BeginCreateOrUpdate(ctx context.Context, // CreateOrUpdate - Creates or updates a server trust group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerTrustGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, parameters ServerTrustGroup, options *ServerTrustGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, locationName, serverTrustGroupName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *ServerTrustGroupsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *ServerTrustGroupsClient) createOrUpdateCreateRequest(ctx context.C // BeginDelete - Deletes a server trust group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The name of the region where the resource is located. -// serverTrustGroupName - The name of the server trust group. -// options - ServerTrustGroupsClientBeginDeleteOptions contains the optional parameters for the ServerTrustGroupsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The name of the region where the resource is located. +// - serverTrustGroupName - The name of the server trust group. +// - options - ServerTrustGroupsClientBeginDeleteOptions contains the optional parameters for the ServerTrustGroupsClient.BeginDelete +// method. func (client *ServerTrustGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, options *ServerTrustGroupsClientBeginDeleteOptions) (*runtime.Poller[ServerTrustGroupsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, locationName, serverTrustGroupName, options) @@ -147,7 +151,8 @@ func (client *ServerTrustGroupsClient) BeginDelete(ctx context.Context, resource // Delete - Deletes a server trust group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *ServerTrustGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, options *ServerTrustGroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, locationName, serverTrustGroupName, options) if err != nil { @@ -187,19 +192,20 @@ func (client *ServerTrustGroupsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a server trust group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The name of the region where the resource is located. -// serverTrustGroupName - The name of the server trust group. -// options - ServerTrustGroupsClientGetOptions contains the optional parameters for the ServerTrustGroupsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The name of the region where the resource is located. +// - serverTrustGroupName - The name of the server trust group. +// - options - ServerTrustGroupsClientGetOptions contains the optional parameters for the ServerTrustGroupsClient.Get method. func (client *ServerTrustGroupsClient) Get(ctx context.Context, resourceGroupName string, locationName string, serverTrustGroupName string, options *ServerTrustGroupsClientGetOptions) (ServerTrustGroupsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, locationName, serverTrustGroupName, options) if err != nil { @@ -239,7 +245,7 @@ func (client *ServerTrustGroupsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,13 +261,13 @@ func (client *ServerTrustGroupsClient) getHandleResponse(resp *http.Response) (S } // NewListByInstancePager - Gets a server trust groups by instance name. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// managedInstanceName - The name of the managed instance. -// options - ServerTrustGroupsClientListByInstanceOptions contains the optional parameters for the ServerTrustGroupsClient.ListByInstance -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - ServerTrustGroupsClientListByInstanceOptions contains the optional parameters for the ServerTrustGroupsClient.NewListByInstancePager +// method. func (client *ServerTrustGroupsClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *ServerTrustGroupsClientListByInstanceOptions) *runtime.Pager[ServerTrustGroupsClientListByInstanceResponse] { return runtime.NewPager(runtime.PagingHandler[ServerTrustGroupsClientListByInstanceResponse]{ More: func(page ServerTrustGroupsClientListByInstanceResponse) bool { @@ -310,7 +316,7 @@ func (client *ServerTrustGroupsClient) listByInstanceCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,13 +332,13 @@ func (client *ServerTrustGroupsClient) listByInstanceHandleResponse(resp *http.R } // NewListByLocationPager - Lists a server trust group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// locationName - The name of the region where the resource is located. -// options - ServerTrustGroupsClientListByLocationOptions contains the optional parameters for the ServerTrustGroupsClient.ListByLocation -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - locationName - The name of the region where the resource is located. +// - options - ServerTrustGroupsClientListByLocationOptions contains the optional parameters for the ServerTrustGroupsClient.NewListByLocationPager +// method. func (client *ServerTrustGroupsClient) NewListByLocationPager(resourceGroupName string, locationName string, options *ServerTrustGroupsClientListByLocationOptions) *runtime.Pager[ServerTrustGroupsClientListByLocationResponse] { return runtime.NewPager(runtime.PagingHandler[ServerTrustGroupsClientListByLocationResponse]{ More: func(page ServerTrustGroupsClientListByLocationResponse) bool { @@ -381,7 +387,7 @@ func (client *ServerTrustGroupsClient) listByLocationCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serverusages_client.go b/sdk/resourcemanager/sql/armsql/serverusages_client.go similarity index 80% rename from sdk/resourcemanager/sql/armsql/zz_generated_serverusages_client.go rename to sdk/resourcemanager/sql/armsql/serverusages_client.go index 603f31f793ba..96ed277bec4d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serverusages_client.go +++ b/sdk/resourcemanager/sql/armsql/serverusages_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 armsql @@ -31,9 +32,9 @@ type ServerUsagesClient struct { } // NewServerUsagesClient creates a new instance of ServerUsagesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerUsagesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,21 +55,27 @@ func NewServerUsagesClient(subscriptionID string, credential azcore.TokenCredent return client, nil } -// NewListByServerPager - Returns server usages. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerUsagesClientListByServerOptions contains the optional parameters for the ServerUsagesClient.ListByServer -// method. +// NewListByServerPager - Gets server usages. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerUsagesClientListByServerOptions contains the optional parameters for the ServerUsagesClient.NewListByServerPager +// method. func (client *ServerUsagesClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerUsagesClientListByServerOptions) *runtime.Pager[ServerUsagesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerUsagesClientListByServerResponse]{ More: func(page ServerUsagesClientListByServerResponse) bool { - return false + return page.NextLink != nil && len(*page.NextLink) > 0 }, Fetcher: func(ctx context.Context, page *ServerUsagesClientListByServerResponse) (ServerUsagesClientListByServerResponse, error) { - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + var req *policy.Request + var err error + if page == nil { + req, err = client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } if err != nil { return ServerUsagesClientListByServerResponse{}, err } @@ -87,10 +94,6 @@ func (client *ServerUsagesClient) NewListByServerPager(resourceGroupName string, // listByServerCreateRequest creates the ListByServer request. func (client *ServerUsagesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerUsagesClientListByServerOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/usages" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") } @@ -99,12 +102,16 @@ func (client *ServerUsagesClient) listByServerCreateRequest(ctx context.Context, return nil, errors.New("parameter serverName cannot be empty") } urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) if err != nil { return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_servervulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_servervulnerabilityassessments_client.go rename to sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_client.go index 3762ba82a253..eeb3595165df 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_servervulnerabilityassessments_client.go +++ b/sdk/resourcemanager/sql/armsql/servervulnerabilityassessments_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 armsql @@ -31,9 +32,9 @@ type ServerVulnerabilityAssessmentsClient struct { } // NewServerVulnerabilityAssessmentsClient creates a new instance of ServerVulnerabilityAssessmentsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServerVulnerabilityAssessmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerVulnerabilityAssessmentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +59,15 @@ func NewServerVulnerabilityAssessmentsClient(subscriptionID string, credential a // with managed identity - // https://docs.microsoft.com/azure/azure-sql/database/sql-database-vulnerability-assessment-storage // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server for which the vulnerability assessment is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// parameters - The requested resource. -// options - ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server for which the vulnerability assessment is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - parameters - The requested resource. +// - options - ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.CreateOrUpdate +// method. func (client *ServerVulnerabilityAssessmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, parameters ServerVulnerabilityAssessment, options *ServerVulnerabilityAssessmentsClientCreateOrUpdateOptions) (ServerVulnerabilityAssessmentsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, parameters, options) if err != nil { @@ -105,7 +107,7 @@ func (client *ServerVulnerabilityAssessmentsClient) createOrUpdateCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -122,13 +124,14 @@ func (client *ServerVulnerabilityAssessmentsClient) createOrUpdateHandleResponse // Delete - Removes the server's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server for which the vulnerability assessment is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// options - ServerVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Delete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server for which the vulnerability assessment is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - ServerVulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Delete +// method. func (client *ServerVulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ServerVulnerabilityAssessmentsClientDeleteOptions) (ServerVulnerabilityAssessmentsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) if err != nil { @@ -168,20 +171,21 @@ func (client *ServerVulnerabilityAssessmentsClient) deleteCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets the server's vulnerability assessment. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server for which the vulnerability assessment is defined. -// vulnerabilityAssessmentName - The name of the vulnerability assessment. -// options - ServerVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server for which the vulnerability assessment is defined. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - ServerVulnerabilityAssessmentsClientGetOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.Get +// method. func (client *ServerVulnerabilityAssessmentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *ServerVulnerabilityAssessmentsClientGetOptions) (ServerVulnerabilityAssessmentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) if err != nil { @@ -221,7 +225,7 @@ func (client *ServerVulnerabilityAssessmentsClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -237,13 +241,13 @@ func (client *ServerVulnerabilityAssessmentsClient) getHandleResponse(resp *http } // NewListByServerPager - Lists the vulnerability assessment policies associated with a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerVulnerabilityAssessmentsClientListByServerOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - ServerVulnerabilityAssessmentsClientListByServerOptions contains the optional parameters for the ServerVulnerabilityAssessmentsClient.NewListByServerPager +// method. func (client *ServerVulnerabilityAssessmentsClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerVulnerabilityAssessmentsClientListByServerOptions) *runtime.Pager[ServerVulnerabilityAssessmentsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[ServerVulnerabilityAssessmentsClientListByServerResponse]{ More: func(page ServerVulnerabilityAssessmentsClientListByServerResponse) bool { @@ -292,7 +296,7 @@ func (client *ServerVulnerabilityAssessmentsClient) listByServerCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client.go b/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client.go new file mode 100644 index 000000000000..75a23958738e --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/startstopmanagedinstanceschedules_client.go @@ -0,0 +1,310 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// StartStopManagedInstanceSchedulesClient contains the methods for the StartStopManagedInstanceSchedules group. +// Don't use this type directly, use NewStartStopManagedInstanceSchedulesClient() instead. +type StartStopManagedInstanceSchedulesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewStartStopManagedInstanceSchedulesClient creates a new instance of StartStopManagedInstanceSchedulesClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewStartStopManagedInstanceSchedulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StartStopManagedInstanceSchedulesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &StartStopManagedInstanceSchedulesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates the managed instance's Start/Stop schedule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - startStopScheduleName - Name of the managed instance Start/Stop schedule. +// - parameters - The requested managed instance Start/Stop schedule. +// - options - StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.CreateOrUpdate +// method. +func (client *StartStopManagedInstanceSchedulesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, managedInstanceName string, startStopScheduleName StartStopScheduleName, parameters StartStopManagedInstanceSchedule, options *StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions) (StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, managedInstanceName, startStopScheduleName, parameters, options) + if err != nil { + return StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *StartStopManagedInstanceSchedulesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, startStopScheduleName StartStopScheduleName, parameters StartStopManagedInstanceSchedule, options *StartStopManagedInstanceSchedulesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules/{startStopScheduleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if startStopScheduleName == "" { + return nil, errors.New("parameter startStopScheduleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{startStopScheduleName}", url.PathEscape(string(startStopScheduleName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *StartStopManagedInstanceSchedulesClient) createOrUpdateHandleResponse(resp *http.Response) (StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse, error) { + result := StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StartStopManagedInstanceSchedule); err != nil { + return StartStopManagedInstanceSchedulesClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the managed instance's Start/Stop schedule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - startStopScheduleName - Name of the managed instance Start/Stop schedule. +// - options - StartStopManagedInstanceSchedulesClientDeleteOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.Delete +// method. +func (client *StartStopManagedInstanceSchedulesClient) Delete(ctx context.Context, resourceGroupName string, managedInstanceName string, startStopScheduleName StartStopScheduleName, options *StartStopManagedInstanceSchedulesClientDeleteOptions) (StartStopManagedInstanceSchedulesClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, managedInstanceName, startStopScheduleName, options) + if err != nil { + return StartStopManagedInstanceSchedulesClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StartStopManagedInstanceSchedulesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return StartStopManagedInstanceSchedulesClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return StartStopManagedInstanceSchedulesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *StartStopManagedInstanceSchedulesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, startStopScheduleName StartStopScheduleName, options *StartStopManagedInstanceSchedulesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules/{startStopScheduleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if startStopScheduleName == "" { + return nil, errors.New("parameter startStopScheduleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{startStopScheduleName}", url.PathEscape(string(startStopScheduleName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} + +// Get - Gets the managed instance's Start/Stop schedule. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - startStopScheduleName - Name of the managed instance Start/Stop schedule. +// - options - StartStopManagedInstanceSchedulesClientGetOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.Get +// method. +func (client *StartStopManagedInstanceSchedulesClient) Get(ctx context.Context, resourceGroupName string, managedInstanceName string, startStopScheduleName StartStopScheduleName, options *StartStopManagedInstanceSchedulesClientGetOptions) (StartStopManagedInstanceSchedulesClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, managedInstanceName, startStopScheduleName, options) + if err != nil { + return StartStopManagedInstanceSchedulesClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StartStopManagedInstanceSchedulesClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StartStopManagedInstanceSchedulesClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *StartStopManagedInstanceSchedulesClient) getCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, startStopScheduleName StartStopScheduleName, options *StartStopManagedInstanceSchedulesClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules/{startStopScheduleName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if startStopScheduleName == "" { + return nil, errors.New("parameter startStopScheduleName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{startStopScheduleName}", url.PathEscape(string(startStopScheduleName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *StartStopManagedInstanceSchedulesClient) getHandleResponse(resp *http.Response) (StartStopManagedInstanceSchedulesClientGetResponse, error) { + result := StartStopManagedInstanceSchedulesClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StartStopManagedInstanceSchedule); err != nil { + return StartStopManagedInstanceSchedulesClientGetResponse{}, err + } + return result, nil +} + +// NewListByInstancePager - Lists the managed instance's Start/Stop schedules. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - managedInstanceName - The name of the managed instance. +// - options - StartStopManagedInstanceSchedulesClientListByInstanceOptions contains the optional parameters for the StartStopManagedInstanceSchedulesClient.NewListByInstancePager +// method. +func (client *StartStopManagedInstanceSchedulesClient) NewListByInstancePager(resourceGroupName string, managedInstanceName string, options *StartStopManagedInstanceSchedulesClientListByInstanceOptions) *runtime.Pager[StartStopManagedInstanceSchedulesClientListByInstanceResponse] { + return runtime.NewPager(runtime.PagingHandler[StartStopManagedInstanceSchedulesClientListByInstanceResponse]{ + More: func(page StartStopManagedInstanceSchedulesClientListByInstanceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *StartStopManagedInstanceSchedulesClientListByInstanceResponse) (StartStopManagedInstanceSchedulesClientListByInstanceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByInstanceCreateRequest(ctx, resourceGroupName, managedInstanceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return StartStopManagedInstanceSchedulesClientListByInstanceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StartStopManagedInstanceSchedulesClientListByInstanceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StartStopManagedInstanceSchedulesClientListByInstanceResponse{}, runtime.NewResponseError(resp) + } + return client.listByInstanceHandleResponse(resp) + }, + }) +} + +// listByInstanceCreateRequest creates the ListByInstance request. +func (client *StartStopManagedInstanceSchedulesClient) listByInstanceCreateRequest(ctx context.Context, resourceGroupName string, managedInstanceName string, options *StartStopManagedInstanceSchedulesClientListByInstanceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/managedInstances/{managedInstanceName}/startStopSchedules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if managedInstanceName == "" { + return nil, errors.New("parameter managedInstanceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{managedInstanceName}", url.PathEscape(managedInstanceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByInstanceHandleResponse handles the ListByInstance response. +func (client *StartStopManagedInstanceSchedulesClient) listByInstanceHandleResponse(resp *http.Response) (StartStopManagedInstanceSchedulesClientListByInstanceResponse, error) { + result := StartStopManagedInstanceSchedulesClientListByInstanceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.StartStopManagedInstanceScheduleListResult); err != nil { + return StartStopManagedInstanceSchedulesClientListByInstanceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_subscriptionusages_client.go b/sdk/resourcemanager/sql/armsql/subscriptionusages_client.go similarity index 88% rename from sdk/resourcemanager/sql/armsql/zz_generated_subscriptionusages_client.go rename to sdk/resourcemanager/sql/armsql/subscriptionusages_client.go index 1f44a0fde4f6..bf7854d5ce93 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_subscriptionusages_client.go +++ b/sdk/resourcemanager/sql/armsql/subscriptionusages_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 armsql @@ -31,9 +32,9 @@ type SubscriptionUsagesClient struct { } // NewSubscriptionUsagesClient creates a new instance of SubscriptionUsagesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSubscriptionUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionUsagesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,10 +57,11 @@ func NewSubscriptionUsagesClient(subscriptionID string, credential azcore.TokenC // Get - Gets a subscription usage metric. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// locationName - The name of the region where the resource is located. -// usageName - Name of usage metric to return. -// options - SubscriptionUsagesClientGetOptions contains the optional parameters for the SubscriptionUsagesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The name of the region where the resource is located. +// - usageName - Name of usage metric to return. +// - options - SubscriptionUsagesClientGetOptions contains the optional parameters for the SubscriptionUsagesClient.Get method. func (client *SubscriptionUsagesClient) Get(ctx context.Context, locationName string, usageName string, options *SubscriptionUsagesClientGetOptions) (SubscriptionUsagesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, locationName, usageName, options) if err != nil { @@ -95,7 +97,7 @@ func (client *SubscriptionUsagesClient) getCreateRequest(ctx context.Context, lo return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -111,11 +113,11 @@ func (client *SubscriptionUsagesClient) getHandleResponse(resp *http.Response) ( } // NewListByLocationPager - Gets all subscription usage metrics in a given location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// locationName - The name of the region where the resource is located. -// options - SubscriptionUsagesClientListByLocationOptions contains the optional parameters for the SubscriptionUsagesClient.ListByLocation -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The name of the region where the resource is located. +// - options - SubscriptionUsagesClientListByLocationOptions contains the optional parameters for the SubscriptionUsagesClient.NewListByLocationPager +// method. func (client *SubscriptionUsagesClient) NewListByLocationPager(locationName string, options *SubscriptionUsagesClientListByLocationOptions) *runtime.Pager[SubscriptionUsagesClientListByLocationResponse] { return runtime.NewPager(runtime.PagingHandler[SubscriptionUsagesClientListByLocationResponse]{ More: func(page SubscriptionUsagesClientListByLocationResponse) bool { @@ -160,7 +162,7 @@ func (client *SubscriptionUsagesClient) listByLocationCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client.go b/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client.go new file mode 100644 index 000000000000..e125427b7659 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/synapselinkworkspaces_client.go @@ -0,0 +1,132 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// SynapseLinkWorkspacesClient contains the methods for the SynapseLinkWorkspaces group. +// Don't use this type directly, use NewSynapseLinkWorkspacesClient() instead. +type SynapseLinkWorkspacesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewSynapseLinkWorkspacesClient creates a new instance of SynapseLinkWorkspacesClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewSynapseLinkWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SynapseLinkWorkspacesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &SynapseLinkWorkspacesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListByDatabasePager - Gets all synapselink workspaces for a database. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - SynapseLinkWorkspacesClientListByDatabaseOptions contains the optional parameters for the SynapseLinkWorkspacesClient.NewListByDatabasePager +// method. +func (client *SynapseLinkWorkspacesClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *SynapseLinkWorkspacesClientListByDatabaseOptions) *runtime.Pager[SynapseLinkWorkspacesClientListByDatabaseResponse] { + return runtime.NewPager(runtime.PagingHandler[SynapseLinkWorkspacesClientListByDatabaseResponse]{ + More: func(page SynapseLinkWorkspacesClientListByDatabaseResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *SynapseLinkWorkspacesClientListByDatabaseResponse) (SynapseLinkWorkspacesClientListByDatabaseResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByDatabaseCreateRequest(ctx, resourceGroupName, serverName, databaseName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SynapseLinkWorkspacesClientListByDatabaseResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SynapseLinkWorkspacesClientListByDatabaseResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SynapseLinkWorkspacesClientListByDatabaseResponse{}, runtime.NewResponseError(resp) + } + return client.listByDatabaseHandleResponse(resp) + }, + }) +} + +// listByDatabaseCreateRequest creates the ListByDatabase request. +func (client *SynapseLinkWorkspacesClient) listByDatabaseCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, options *SynapseLinkWorkspacesClientListByDatabaseOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/linkWorkspaces" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if databaseName == "" { + return nil, errors.New("parameter databaseName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{databaseName}", url.PathEscape(databaseName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByDatabaseHandleResponse handles the ListByDatabase response. +func (client *SynapseLinkWorkspacesClient) listByDatabaseHandleResponse(resp *http.Response) (SynapseLinkWorkspacesClientListByDatabaseResponse, error) { + result := SynapseLinkWorkspacesClientListByDatabaseResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.SynapseLinkWorkspaceListResult); err != nil { + return SynapseLinkWorkspacesClientListByDatabaseResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_syncagents_client.go b/sdk/resourcemanager/sql/armsql/syncagents_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_syncagents_client.go rename to sdk/resourcemanager/sql/armsql/syncagents_client.go index 8bbfef21bfbb..fae4546d1b1a 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_syncagents_client.go +++ b/sdk/resourcemanager/sql/armsql/syncagents_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 armsql @@ -31,9 +32,9 @@ type SyncAgentsClient struct { } // NewSyncAgentsClient creates a new instance of SyncAgentsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSyncAgentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SyncAgentsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewSyncAgentsClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates a sync agent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server on which the sync agent is hosted. -// syncAgentName - The name of the sync agent. -// parameters - The requested sync agent resource state. -// options - SyncAgentsClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncAgentsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server on which the sync agent is hosted. +// - syncAgentName - The name of the sync agent. +// - parameters - The requested sync agent resource state. +// - options - SyncAgentsClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncAgentsClient.BeginCreateOrUpdate +// method. func (client *SyncAgentsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, parameters SyncAgent, options *SyncAgentsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SyncAgentsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, syncAgentName, parameters, options) @@ -78,7 +80,8 @@ func (client *SyncAgentsClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a sync agent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SyncAgentsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, parameters SyncAgent, options *SyncAgentsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, syncAgentName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *SyncAgentsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,12 +129,13 @@ func (client *SyncAgentsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes a sync agent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server on which the sync agent is hosted. -// syncAgentName - The name of the sync agent. -// options - SyncAgentsClientBeginDeleteOptions contains the optional parameters for the SyncAgentsClient.BeginDelete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server on which the sync agent is hosted. +// - syncAgentName - The name of the sync agent. +// - options - SyncAgentsClientBeginDeleteOptions contains the optional parameters for the SyncAgentsClient.BeginDelete method. func (client *SyncAgentsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientBeginDeleteOptions) (*runtime.Poller[SyncAgentsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, syncAgentName, options) @@ -146,7 +150,8 @@ func (client *SyncAgentsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes a sync agent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SyncAgentsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, syncAgentName, options) if err != nil { @@ -186,19 +191,20 @@ func (client *SyncAgentsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // GenerateKey - Generates a sync agent key. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server on which the sync agent is hosted. -// syncAgentName - The name of the sync agent. -// options - SyncAgentsClientGenerateKeyOptions contains the optional parameters for the SyncAgentsClient.GenerateKey method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server on which the sync agent is hosted. +// - syncAgentName - The name of the sync agent. +// - options - SyncAgentsClientGenerateKeyOptions contains the optional parameters for the SyncAgentsClient.GenerateKey method. func (client *SyncAgentsClient) GenerateKey(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientGenerateKeyOptions) (SyncAgentsClientGenerateKeyResponse, error) { req, err := client.generateKeyCreateRequest(ctx, resourceGroupName, serverName, syncAgentName, options) if err != nil { @@ -238,7 +244,7 @@ func (client *SyncAgentsClient) generateKeyCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,12 +261,13 @@ func (client *SyncAgentsClient) generateKeyHandleResponse(resp *http.Response) ( // Get - Gets a sync agent. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server on which the sync agent is hosted. -// syncAgentName - The name of the sync agent. -// options - SyncAgentsClientGetOptions contains the optional parameters for the SyncAgentsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server on which the sync agent is hosted. +// - syncAgentName - The name of the sync agent. +// - options - SyncAgentsClientGetOptions contains the optional parameters for the SyncAgentsClient.Get method. func (client *SyncAgentsClient) Get(ctx context.Context, resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientGetOptions) (SyncAgentsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, syncAgentName, options) if err != nil { @@ -300,7 +307,7 @@ func (client *SyncAgentsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,12 +323,13 @@ func (client *SyncAgentsClient) getHandleResponse(resp *http.Response) (SyncAgen } // NewListByServerPager - Lists sync agents in a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server on which the sync agent is hosted. -// options - SyncAgentsClientListByServerOptions contains the optional parameters for the SyncAgentsClient.ListByServer method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server on which the sync agent is hosted. +// - options - SyncAgentsClientListByServerOptions contains the optional parameters for the SyncAgentsClient.NewListByServerPager +// method. func (client *SyncAgentsClient) NewListByServerPager(resourceGroupName string, serverName string, options *SyncAgentsClientListByServerOptions) *runtime.Pager[SyncAgentsClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[SyncAgentsClientListByServerResponse]{ More: func(page SyncAgentsClientListByServerResponse) bool { @@ -370,7 +378,7 @@ func (client *SyncAgentsClient) listByServerCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,14 +394,14 @@ func (client *SyncAgentsClient) listByServerHandleResponse(resp *http.Response) } // NewListLinkedDatabasesPager - Lists databases linked to a sync agent. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server on which the sync agent is hosted. -// syncAgentName - The name of the sync agent. -// options - SyncAgentsClientListLinkedDatabasesOptions contains the optional parameters for the SyncAgentsClient.ListLinkedDatabases -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server on which the sync agent is hosted. +// - syncAgentName - The name of the sync agent. +// - options - SyncAgentsClientListLinkedDatabasesOptions contains the optional parameters for the SyncAgentsClient.NewListLinkedDatabasesPager +// method. func (client *SyncAgentsClient) NewListLinkedDatabasesPager(resourceGroupName string, serverName string, syncAgentName string, options *SyncAgentsClientListLinkedDatabasesOptions) *runtime.Pager[SyncAgentsClientListLinkedDatabasesResponse] { return runtime.NewPager(runtime.PagingHandler[SyncAgentsClientListLinkedDatabasesResponse]{ More: func(page SyncAgentsClientListLinkedDatabasesResponse) bool { @@ -446,7 +454,7 @@ func (client *SyncAgentsClient) listLinkedDatabasesCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_syncgroups_client.go b/sdk/resourcemanager/sql/armsql/syncgroups_client.go similarity index 83% rename from sdk/resourcemanager/sql/armsql/zz_generated_syncgroups_client.go rename to sdk/resourcemanager/sql/armsql/syncgroups_client.go index 5cc02d7a0a08..b5819feab0a8 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_syncgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/syncgroups_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 armsql @@ -31,9 +32,9 @@ type SyncGroupsClient struct { } // NewSyncGroupsClient creates a new instance of SyncGroupsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSyncGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SyncGroupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewSyncGroupsClient(subscriptionID string, credential azcore.TokenCredentia // CancelSync - Cancels a sync group synchronization. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group. -// options - SyncGroupsClientCancelSyncOptions contains the optional parameters for the SyncGroupsClient.CancelSync method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group. +// - options - SyncGroupsClientCancelSyncOptions contains the optional parameters for the SyncGroupsClient.CancelSync method. func (client *SyncGroupsClient) CancelSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientCancelSyncOptions) (SyncGroupsClientCancelSyncResponse, error) { req, err := client.cancelSyncCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) if err != nil { @@ -106,22 +108,23 @@ func (client *SyncGroupsClient) cancelSyncCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginCreateOrUpdate - Creates or updates a sync group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group. -// parameters - The requested sync group resource state. -// options - SyncGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncGroupsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group. +// - parameters - The requested sync group resource state. +// - options - SyncGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncGroupsClient.BeginCreateOrUpdate +// method. func (client *SyncGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[SyncGroupsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters, options) @@ -136,7 +139,8 @@ func (client *SyncGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates a sync group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SyncGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters, options) if err != nil { @@ -180,7 +184,7 @@ func (client *SyncGroupsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -188,13 +192,14 @@ func (client *SyncGroupsClient) createOrUpdateCreateRequest(ctx context.Context, // BeginDelete - Deletes a sync group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group. -// options - SyncGroupsClientBeginDeleteOptions contains the optional parameters for the SyncGroupsClient.BeginDelete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group. +// - options - SyncGroupsClientBeginDeleteOptions contains the optional parameters for the SyncGroupsClient.BeginDelete method. func (client *SyncGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientBeginDeleteOptions) (*runtime.Poller[SyncGroupsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) @@ -209,7 +214,8 @@ func (client *SyncGroupsClient) BeginDelete(ctx context.Context, resourceGroupNa // Delete - Deletes a sync group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SyncGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) if err != nil { @@ -253,20 +259,21 @@ func (client *SyncGroupsClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a sync group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group. -// options - SyncGroupsClientGetOptions contains the optional parameters for the SyncGroupsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group. +// - options - SyncGroupsClientGetOptions contains the optional parameters for the SyncGroupsClient.Get method. func (client *SyncGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientGetOptions) (SyncGroupsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) if err != nil { @@ -310,7 +317,7 @@ func (client *SyncGroupsClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -326,14 +333,14 @@ func (client *SyncGroupsClient) getHandleResponse(resp *http.Response) (SyncGrou } // NewListByDatabasePager - Lists sync groups under a hub database. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// options - SyncGroupsClientListByDatabaseOptions contains the optional parameters for the SyncGroupsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - options - SyncGroupsClientListByDatabaseOptions contains the optional parameters for the SyncGroupsClient.NewListByDatabasePager +// method. func (client *SyncGroupsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *SyncGroupsClientListByDatabaseOptions) *runtime.Pager[SyncGroupsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[SyncGroupsClientListByDatabaseResponse]{ More: func(page SyncGroupsClientListByDatabaseResponse) bool { @@ -386,7 +393,7 @@ func (client *SyncGroupsClient) listByDatabaseCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -402,15 +409,15 @@ func (client *SyncGroupsClient) listByDatabaseHandleResponse(resp *http.Response } // NewListHubSchemasPager - Gets a collection of hub database schemas. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group. -// options - SyncGroupsClientListHubSchemasOptions contains the optional parameters for the SyncGroupsClient.ListHubSchemas -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group. +// - options - SyncGroupsClientListHubSchemasOptions contains the optional parameters for the SyncGroupsClient.NewListHubSchemasPager +// method. func (client *SyncGroupsClient) NewListHubSchemasPager(resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientListHubSchemasOptions) *runtime.Pager[SyncGroupsClientListHubSchemasResponse] { return runtime.NewPager(runtime.PagingHandler[SyncGroupsClientListHubSchemasResponse]{ More: func(page SyncGroupsClientListHubSchemasResponse) bool { @@ -467,7 +474,7 @@ func (client *SyncGroupsClient) listHubSchemasCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -483,17 +490,17 @@ func (client *SyncGroupsClient) listHubSchemasHandleResponse(resp *http.Response } // NewListLogsPager - Gets a collection of sync group logs. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group. -// startTime - Get logs generated after this time. -// endTime - Get logs generated before this time. -// typeParam - The types of logs to retrieve. -// options - SyncGroupsClientListLogsOptions contains the optional parameters for the SyncGroupsClient.ListLogs method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group. +// - startTime - Get logs generated after this time. +// - endTime - Get logs generated before this time. +// - typeParam - The types of logs to retrieve. +// - options - SyncGroupsClientListLogsOptions contains the optional parameters for the SyncGroupsClient.NewListLogsPager method. func (client *SyncGroupsClient) NewListLogsPager(resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParam SyncGroupsType, options *SyncGroupsClientListLogsOptions) *runtime.Pager[SyncGroupsClientListLogsResponse] { return runtime.NewPager(runtime.PagingHandler[SyncGroupsClientListLogsResponse]{ More: func(page SyncGroupsClientListLogsResponse) bool { @@ -556,7 +563,7 @@ func (client *SyncGroupsClient) listLogsCreateRequest(ctx context.Context, resou if options != nil && options.ContinuationToken != nil { reqQP.Set("continuationToken", *options.ContinuationToken) } - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -572,11 +579,11 @@ func (client *SyncGroupsClient) listLogsHandleResponse(resp *http.Response) (Syn } // NewListSyncDatabaseIDsPager - Gets a collection of sync database ids. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// locationName - The name of the region where the resource is located. -// options - SyncGroupsClientListSyncDatabaseIDsOptions contains the optional parameters for the SyncGroupsClient.ListSyncDatabaseIDs -// method. +// +// Generated from API version 2022-11-01-preview +// - locationName - The name of the region where the resource is located. +// - options - SyncGroupsClientListSyncDatabaseIDsOptions contains the optional parameters for the SyncGroupsClient.NewListSyncDatabaseIDsPager +// method. func (client *SyncGroupsClient) NewListSyncDatabaseIDsPager(locationName string, options *SyncGroupsClientListSyncDatabaseIDsOptions) *runtime.Pager[SyncGroupsClientListSyncDatabaseIDsResponse] { return runtime.NewPager(runtime.PagingHandler[SyncGroupsClientListSyncDatabaseIDsResponse]{ More: func(page SyncGroupsClientListSyncDatabaseIDsResponse) bool { @@ -621,7 +628,7 @@ func (client *SyncGroupsClient) listSyncDatabaseIDsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -638,14 +645,15 @@ func (client *SyncGroupsClient) listSyncDatabaseIDsHandleResponse(resp *http.Res // BeginRefreshHubSchema - Refreshes a hub database schema. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group. -// options - SyncGroupsClientBeginRefreshHubSchemaOptions contains the optional parameters for the SyncGroupsClient.BeginRefreshHubSchema -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group. +// - options - SyncGroupsClientBeginRefreshHubSchemaOptions contains the optional parameters for the SyncGroupsClient.BeginRefreshHubSchema +// method. func (client *SyncGroupsClient) BeginRefreshHubSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientBeginRefreshHubSchemaOptions) (*runtime.Poller[SyncGroupsClientRefreshHubSchemaResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.refreshHubSchema(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) @@ -660,7 +668,8 @@ func (client *SyncGroupsClient) BeginRefreshHubSchema(ctx context.Context, resou // RefreshHubSchema - Refreshes a hub database schema. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SyncGroupsClient) refreshHubSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientBeginRefreshHubSchemaOptions) (*http.Response, error) { req, err := client.refreshHubSchemaCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) if err != nil { @@ -704,20 +713,21 @@ func (client *SyncGroupsClient) refreshHubSchemaCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // TriggerSync - Triggers a sync group synchronization. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group. -// options - SyncGroupsClientTriggerSyncOptions contains the optional parameters for the SyncGroupsClient.TriggerSync method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group. +// - options - SyncGroupsClientTriggerSyncOptions contains the optional parameters for the SyncGroupsClient.TriggerSync method. func (client *SyncGroupsClient) TriggerSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncGroupsClientTriggerSyncOptions) (SyncGroupsClientTriggerSyncResponse, error) { req, err := client.triggerSyncCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, options) if err != nil { @@ -761,21 +771,22 @@ func (client *SyncGroupsClient) triggerSyncCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginUpdate - Updates a sync group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group. -// parameters - The requested sync group resource state. -// options - SyncGroupsClientBeginUpdateOptions contains the optional parameters for the SyncGroupsClient.BeginUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group. +// - parameters - The requested sync group resource state. +// - options - SyncGroupsClientBeginUpdateOptions contains the optional parameters for the SyncGroupsClient.BeginUpdate method. func (client *SyncGroupsClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsClientBeginUpdateOptions) (*runtime.Poller[SyncGroupsClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters, options) @@ -790,7 +801,8 @@ func (client *SyncGroupsClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates a sync group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SyncGroupsClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters SyncGroup, options *SyncGroupsClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, parameters, options) if err != nil { @@ -834,7 +846,7 @@ func (client *SyncGroupsClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_syncmembers_client.go b/sdk/resourcemanager/sql/armsql/syncmembers_client.go similarity index 83% rename from sdk/resourcemanager/sql/armsql/zz_generated_syncmembers_client.go rename to sdk/resourcemanager/sql/armsql/syncmembers_client.go index 046f844cd55c..f80fbf42bb07 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_syncmembers_client.go +++ b/sdk/resourcemanager/sql/armsql/syncmembers_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 armsql @@ -31,9 +32,9 @@ type SyncMembersClient struct { } // NewSyncMembersClient creates a new instance of SyncMembersClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSyncMembersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SyncMembersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,16 +57,17 @@ func NewSyncMembersClient(subscriptionID string, credential azcore.TokenCredenti // BeginCreateOrUpdate - Creates or updates a sync member. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group on which the sync member is hosted. -// syncMemberName - The name of the sync member. -// parameters - The requested sync member resource state. -// options - SyncMembersClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncMembersClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group on which the sync member is hosted. +// - syncMemberName - The name of the sync member. +// - parameters - The requested sync member resource state. +// - options - SyncMembersClientBeginCreateOrUpdateOptions contains the optional parameters for the SyncMembersClient.BeginCreateOrUpdate +// method. func (client *SyncMembersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember, options *SyncMembersClientBeginCreateOrUpdateOptions) (*runtime.Poller[SyncMembersClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, options) @@ -80,7 +82,8 @@ func (client *SyncMembersClient) BeginCreateOrUpdate(ctx context.Context, resour // CreateOrUpdate - Creates or updates a sync member. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SyncMembersClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember, options *SyncMembersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, options) if err != nil { @@ -128,7 +131,7 @@ func (client *SyncMembersClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -136,14 +139,15 @@ func (client *SyncMembersClient) createOrUpdateCreateRequest(ctx context.Context // BeginDelete - Deletes a sync member. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group on which the sync member is hosted. -// syncMemberName - The name of the sync member. -// options - SyncMembersClientBeginDeleteOptions contains the optional parameters for the SyncMembersClient.BeginDelete method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group on which the sync member is hosted. +// - syncMemberName - The name of the sync member. +// - options - SyncMembersClientBeginDeleteOptions contains the optional parameters for the SyncMembersClient.BeginDelete method. func (client *SyncMembersClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientBeginDeleteOptions) (*runtime.Poller[SyncMembersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, options) @@ -158,7 +162,8 @@ func (client *SyncMembersClient) BeginDelete(ctx context.Context, resourceGroupN // Delete - Deletes a sync member. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SyncMembersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, options) if err != nil { @@ -206,21 +211,22 @@ func (client *SyncMembersClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a sync member. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group on which the sync member is hosted. -// syncMemberName - The name of the sync member. -// options - SyncMembersClientGetOptions contains the optional parameters for the SyncMembersClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group on which the sync member is hosted. +// - syncMemberName - The name of the sync member. +// - options - SyncMembersClientGetOptions contains the optional parameters for the SyncMembersClient.Get method. func (client *SyncMembersClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientGetOptions) (SyncMembersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, options) if err != nil { @@ -268,7 +274,7 @@ func (client *SyncMembersClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -284,15 +290,15 @@ func (client *SyncMembersClient) getHandleResponse(resp *http.Response) (SyncMem } // NewListBySyncGroupPager - Lists sync members in the given sync group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group. -// options - SyncMembersClientListBySyncGroupOptions contains the optional parameters for the SyncMembersClient.ListBySyncGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group. +// - options - SyncMembersClientListBySyncGroupOptions contains the optional parameters for the SyncMembersClient.NewListBySyncGroupPager +// method. func (client *SyncMembersClient) NewListBySyncGroupPager(resourceGroupName string, serverName string, databaseName string, syncGroupName string, options *SyncMembersClientListBySyncGroupOptions) *runtime.Pager[SyncMembersClientListBySyncGroupResponse] { return runtime.NewPager(runtime.PagingHandler[SyncMembersClientListBySyncGroupResponse]{ More: func(page SyncMembersClientListBySyncGroupResponse) bool { @@ -349,7 +355,7 @@ func (client *SyncMembersClient) listBySyncGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -365,16 +371,16 @@ func (client *SyncMembersClient) listBySyncGroupHandleResponse(resp *http.Respon } // NewListMemberSchemasPager - Gets a sync member database schema. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group on which the sync member is hosted. -// syncMemberName - The name of the sync member. -// options - SyncMembersClientListMemberSchemasOptions contains the optional parameters for the SyncMembersClient.ListMemberSchemas -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group on which the sync member is hosted. +// - syncMemberName - The name of the sync member. +// - options - SyncMembersClientListMemberSchemasOptions contains the optional parameters for the SyncMembersClient.NewListMemberSchemasPager +// method. func (client *SyncMembersClient) NewListMemberSchemasPager(resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientListMemberSchemasOptions) *runtime.Pager[SyncMembersClientListMemberSchemasResponse] { return runtime.NewPager(runtime.PagingHandler[SyncMembersClientListMemberSchemasResponse]{ More: func(page SyncMembersClientListMemberSchemasResponse) bool { @@ -435,7 +441,7 @@ func (client *SyncMembersClient) listMemberSchemasCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -452,15 +458,16 @@ func (client *SyncMembersClient) listMemberSchemasHandleResponse(resp *http.Resp // BeginRefreshMemberSchema - Refreshes a sync member database schema. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group on which the sync member is hosted. -// syncMemberName - The name of the sync member. -// options - SyncMembersClientBeginRefreshMemberSchemaOptions contains the optional parameters for the SyncMembersClient.BeginRefreshMemberSchema -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group on which the sync member is hosted. +// - syncMemberName - The name of the sync member. +// - options - SyncMembersClientBeginRefreshMemberSchemaOptions contains the optional parameters for the SyncMembersClient.BeginRefreshMemberSchema +// method. func (client *SyncMembersClient) BeginRefreshMemberSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientBeginRefreshMemberSchemaOptions) (*runtime.Poller[SyncMembersClientRefreshMemberSchemaResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.refreshMemberSchema(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, options) @@ -475,7 +482,8 @@ func (client *SyncMembersClient) BeginRefreshMemberSchema(ctx context.Context, r // RefreshMemberSchema - Refreshes a sync member database schema. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SyncMembersClient) refreshMemberSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, options *SyncMembersClientBeginRefreshMemberSchemaOptions) (*http.Response, error) { req, err := client.refreshMemberSchemaCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, options) if err != nil { @@ -523,22 +531,23 @@ func (client *SyncMembersClient) refreshMemberSchemaCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // BeginUpdate - Updates an existing sync member. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database on which the sync group is hosted. -// syncGroupName - The name of the sync group on which the sync member is hosted. -// syncMemberName - The name of the sync member. -// parameters - The requested sync member resource state. -// options - SyncMembersClientBeginUpdateOptions contains the optional parameters for the SyncMembersClient.BeginUpdate method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database on which the sync group is hosted. +// - syncGroupName - The name of the sync group on which the sync member is hosted. +// - syncMemberName - The name of the sync member. +// - parameters - The requested sync member resource state. +// - options - SyncMembersClientBeginUpdateOptions contains the optional parameters for the SyncMembersClient.BeginUpdate method. func (client *SyncMembersClient) BeginUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember, options *SyncMembersClientBeginUpdateOptions) (*runtime.Poller[SyncMembersClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, options) @@ -553,7 +562,8 @@ func (client *SyncMembersClient) BeginUpdate(ctx context.Context, resourceGroupN // Update - Updates an existing sync member. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *SyncMembersClient) update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters SyncMember, options *SyncMembersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName, parameters, options) if err != nil { @@ -601,7 +611,7 @@ func (client *SyncMembersClient) updateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_tdecertificates_client.go b/sdk/resourcemanager/sql/armsql/tdecertificates_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_tdecertificates_client.go rename to sdk/resourcemanager/sql/armsql/tdecertificates_client.go index b23c1e2f8757..f22d3a3359fa 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_tdecertificates_client.go +++ b/sdk/resourcemanager/sql/armsql/tdecertificates_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 armsql @@ -31,9 +32,9 @@ type TdeCertificatesClient struct { } // NewTdeCertificatesClient creates a new instance of TdeCertificatesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTdeCertificatesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TdeCertificatesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewTdeCertificatesClient(subscriptionID string, credential azcore.TokenCred // BeginCreate - Creates a TDE certificate for a given server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// parameters - The requested TDE certificate to be created or updated. -// options - TdeCertificatesClientBeginCreateOptions contains the optional parameters for the TdeCertificatesClient.BeginCreate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - parameters - The requested TDE certificate to be created or updated. +// - options - TdeCertificatesClientBeginCreateOptions contains the optional parameters for the TdeCertificatesClient.BeginCreate +// method. func (client *TdeCertificatesClient) BeginCreate(ctx context.Context, resourceGroupName string, serverName string, parameters TdeCertificate, options *TdeCertificatesClientBeginCreateOptions) (*runtime.Poller[TdeCertificatesClientCreateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.create(ctx, resourceGroupName, serverName, parameters, options) @@ -77,7 +79,8 @@ func (client *TdeCertificatesClient) BeginCreate(ctx context.Context, resourceGr // Create - Creates a TDE certificate for a given server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *TdeCertificatesClient) create(ctx context.Context, resourceGroupName string, serverName string, parameters TdeCertificate, options *TdeCertificatesClientBeginCreateOptions) (*http.Response, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, serverName, parameters, options) if err != nil { @@ -113,7 +116,7 @@ func (client *TdeCertificatesClient) createCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, runtime.MarshalAsJSON(req, parameters) } diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_time_rfc3339.go b/sdk/resourcemanager/sql/armsql/time_rfc3339.go similarity index 96% rename from sdk/resourcemanager/sql/armsql/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/sql/armsql/time_rfc3339.go index 53c1ba048ed3..65cedb7496c1 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/sql/armsql/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 armsql @@ -61,7 +62,7 @@ func (t *timeRFC3339) Parse(layout, value string) error { return err } -func populateTimeRFC3339(m map[string]interface{}, k string, t *time.Time) { +func populateTimeRFC3339(m map[string]any, k string, t *time.Time) { if t == nil { return } else if azcore.IsNullValue(t) { diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_timezones_client.go b/sdk/resourcemanager/sql/armsql/timezones_client.go similarity index 90% rename from sdk/resourcemanager/sql/armsql/zz_generated_timezones_client.go rename to sdk/resourcemanager/sql/armsql/timezones_client.go index b56f1c938613..762855cd7dd8 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_timezones_client.go +++ b/sdk/resourcemanager/sql/armsql/timezones_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 armsql @@ -31,9 +32,9 @@ type TimeZonesClient struct { } // NewTimeZonesClient creates a new instance of TimeZonesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTimeZonesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TimeZonesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,8 +57,9 @@ func NewTimeZonesClient(subscriptionID string, credential azcore.TokenCredential // Get - Gets a managed instance time zone. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// options - TimeZonesClientGetOptions contains the optional parameters for the TimeZonesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - options - TimeZonesClientGetOptions contains the optional parameters for the TimeZonesClient.Get method. func (client *TimeZonesClient) Get(ctx context.Context, locationName string, timeZoneID string, options *TimeZonesClientGetOptions) (TimeZonesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, locationName, timeZoneID, options) if err != nil { @@ -93,7 +95,7 @@ func (client *TimeZonesClient) getCreateRequest(ctx context.Context, locationNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -109,10 +111,10 @@ func (client *TimeZonesClient) getHandleResponse(resp *http.Response) (TimeZones } // NewListByLocationPager - Gets a list of managed instance time zones by location. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// options - TimeZonesClientListByLocationOptions contains the optional parameters for the TimeZonesClient.ListByLocation -// method. +// +// Generated from API version 2022-11-01-preview +// - options - TimeZonesClientListByLocationOptions contains the optional parameters for the TimeZonesClient.NewListByLocationPager +// method. func (client *TimeZonesClient) NewListByLocationPager(locationName string, options *TimeZonesClientListByLocationOptions) *runtime.Pager[TimeZonesClientListByLocationResponse] { return runtime.NewPager(runtime.PagingHandler[TimeZonesClientListByLocationResponse]{ More: func(page TimeZonesClientListByLocationResponse) bool { @@ -157,7 +159,7 @@ func (client *TimeZonesClient) listByLocationCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_transparentdataencryptions_client.go b/sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go similarity index 74% rename from sdk/resourcemanager/sql/armsql/zz_generated_transparentdataencryptions_client.go rename to sdk/resourcemanager/sql/armsql/transparentdataencryptions_client.go index 86ff8f8b762f..07dcb0f7ce88 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_transparentdataencryptions_client.go +++ b/sdk/resourcemanager/sql/armsql/transparentdataencryptions_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 armsql @@ -31,9 +32,9 @@ type TransparentDataEncryptionsClient struct { } // NewTransparentDataEncryptionsClient creates a new instance of TransparentDataEncryptionsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTransparentDataEncryptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TransparentDataEncryptionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -54,34 +55,53 @@ func NewTransparentDataEncryptionsClient(subscriptionID string, credential azcor return client, nil } +// BeginCreateOrUpdate - Updates a logical database's transparent data encryption configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the logical database for which the security alert policy is defined. +// - tdeName - The name of the transparent data encryption configuration. +// - parameters - The database transparent data encryption. +// - options - TransparentDataEncryptionsClientBeginCreateOrUpdateOptions contains the optional parameters for the TransparentDataEncryptionsClient.BeginCreateOrUpdate +// method. +func (client *TransparentDataEncryptionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, parameters LogicalDatabaseTransparentDataEncryption, options *TransparentDataEncryptionsClientBeginCreateOrUpdateOptions) (*runtime.Poller[TransparentDataEncryptionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, tdeName, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[TransparentDataEncryptionsClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaAzureAsyncOp, + }) + } else { + return runtime.NewPollerFromResumeToken[TransparentDataEncryptionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + // CreateOrUpdate - Updates a logical database's transparent data encryption configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the logical database for which the security alert policy is defined. -// tdeName - The name of the transparent data encryption configuration. -// parameters - The database transparent data encryption. -// options - TransparentDataEncryptionsClientCreateOrUpdateOptions contains the optional parameters for the TransparentDataEncryptionsClient.CreateOrUpdate -// method. -func (client *TransparentDataEncryptionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, parameters LogicalDatabaseTransparentDataEncryption, options *TransparentDataEncryptionsClientCreateOrUpdateOptions) (TransparentDataEncryptionsClientCreateOrUpdateResponse, error) { +// +// Generated from API version 2022-11-01-preview +func (client *TransparentDataEncryptionsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, parameters LogicalDatabaseTransparentDataEncryption, options *TransparentDataEncryptionsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, tdeName, parameters, options) if err != nil { - return TransparentDataEncryptionsClientCreateOrUpdateResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return TransparentDataEncryptionsClientCreateOrUpdateResponse{}, err + return nil, err } if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { - return TransparentDataEncryptionsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + return nil, runtime.NewResponseError(resp) } - return client.createOrUpdateHandleResponse(resp) + return resp, nil } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *TransparentDataEncryptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, parameters LogicalDatabaseTransparentDataEncryption, options *TransparentDataEncryptionsClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *TransparentDataEncryptionsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, parameters LogicalDatabaseTransparentDataEncryption, options *TransparentDataEncryptionsClientBeginCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/transparentDataEncryption/{tdeName}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -108,31 +128,23 @@ func (client *TransparentDataEncryptionsClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } -// createOrUpdateHandleResponse handles the CreateOrUpdate response. -func (client *TransparentDataEncryptionsClient) createOrUpdateHandleResponse(resp *http.Response) (TransparentDataEncryptionsClientCreateOrUpdateResponse, error) { - result := TransparentDataEncryptionsClientCreateOrUpdateResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.LogicalDatabaseTransparentDataEncryption); err != nil { - return TransparentDataEncryptionsClientCreateOrUpdateResponse{}, err - } - return result, nil -} - // Get - Gets a logical database's transparent data encryption. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the logical database for which the transparent data encryption is defined. -// tdeName - The name of the transparent data encryption configuration. -// options - TransparentDataEncryptionsClientGetOptions contains the optional parameters for the TransparentDataEncryptionsClient.Get -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the logical database for which the transparent data encryption is defined. +// - tdeName - The name of the transparent data encryption configuration. +// - options - TransparentDataEncryptionsClientGetOptions contains the optional parameters for the TransparentDataEncryptionsClient.Get +// method. func (client *TransparentDataEncryptionsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, tdeName TransparentDataEncryptionName, options *TransparentDataEncryptionsClientGetOptions) (TransparentDataEncryptionsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, tdeName, options) if err != nil { @@ -176,7 +188,7 @@ func (client *TransparentDataEncryptionsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -192,14 +204,14 @@ func (client *TransparentDataEncryptionsClient) getHandleResponse(resp *http.Res } // NewListByDatabasePager - Gets a list of the logical database's transparent data encryption. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the logical database for which the transparent data encryption is defined. -// options - TransparentDataEncryptionsClientListByDatabaseOptions contains the optional parameters for the TransparentDataEncryptionsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the logical database for which the transparent data encryption is defined. +// - options - TransparentDataEncryptionsClientListByDatabaseOptions contains the optional parameters for the TransparentDataEncryptionsClient.NewListByDatabasePager +// method. func (client *TransparentDataEncryptionsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *TransparentDataEncryptionsClientListByDatabaseOptions) *runtime.Pager[TransparentDataEncryptionsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[TransparentDataEncryptionsClientListByDatabaseResponse]{ More: func(page TransparentDataEncryptionsClientListByDatabaseResponse) bool { @@ -252,7 +264,7 @@ func (client *TransparentDataEncryptionsClient) listByDatabaseCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_usages_client.go b/sdk/resourcemanager/sql/armsql/usages_client.go similarity index 86% rename from sdk/resourcemanager/sql/armsql/zz_generated_usages_client.go rename to sdk/resourcemanager/sql/armsql/usages_client.go index 03e954d5cbb3..88e6da98758b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_usages_client.go +++ b/sdk/resourcemanager/sql/armsql/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 armsql @@ -32,9 +33,9 @@ type UsagesClient struct { } // NewUsagesClient creates a new instance of UsagesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UsagesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,13 @@ func NewUsagesClient(subscriptionID string, credential azcore.TokenCredential, o } // NewListByInstancePoolPager - Gets all instance pool usage metrics -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-02-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// instancePoolName - The name of the instance pool to be retrieved. -// options - UsagesClientListByInstancePoolOptions contains the optional parameters for the UsagesClient.ListByInstancePool -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - instancePoolName - The name of the instance pool to be retrieved. +// - options - UsagesClientListByInstancePoolOptions contains the optional parameters for the UsagesClient.NewListByInstancePoolPager +// method. func (client *UsagesClient) NewListByInstancePoolPager(resourceGroupName string, instancePoolName string, options *UsagesClientListByInstancePoolOptions) *runtime.Pager[UsagesClientListByInstancePoolResponse] { return runtime.NewPager(runtime.PagingHandler[UsagesClientListByInstancePoolResponse]{ More: func(page UsagesClientListByInstancePoolResponse) bool { @@ -114,7 +115,7 @@ func (client *UsagesClient) listByInstancePoolCreateRequest(ctx context.Context, if options != nil && options.ExpandChildren != nil { reqQP.Set("expandChildren", strconv.FormatBool(*options.ExpandChildren)) } - reqQP.Set("api-version", "2021-02-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_virtualclusters_client.go b/sdk/resourcemanager/sql/armsql/virtualclusters_client.go similarity index 79% rename from sdk/resourcemanager/sql/armsql/zz_generated_virtualclusters_client.go rename to sdk/resourcemanager/sql/armsql/virtualclusters_client.go index 387aed686d43..e3135f051a18 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_virtualclusters_client.go +++ b/sdk/resourcemanager/sql/armsql/virtualclusters_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 armsql @@ -31,9 +32,9 @@ type VirtualClustersClient struct { } // NewVirtualClustersClient creates a new instance of VirtualClustersClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVirtualClustersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualClustersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewVirtualClustersClient(subscriptionID string, credential azcore.TokenCred // BeginDelete - Deletes a virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// virtualClusterName - The name of the virtual cluster. -// options - VirtualClustersClientBeginDeleteOptions contains the optional parameters for the VirtualClustersClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - virtualClusterName - The name of the virtual cluster. +// - options - VirtualClustersClientBeginDeleteOptions contains the optional parameters for the VirtualClustersClient.BeginDelete +// method. func (client *VirtualClustersClient) BeginDelete(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientBeginDeleteOptions) (*runtime.Poller[VirtualClustersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, virtualClusterName, options) @@ -76,7 +78,8 @@ func (client *VirtualClustersClient) BeginDelete(ctx context.Context, resourceGr // Delete - Deletes a virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *VirtualClustersClient) deleteOperation(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, virtualClusterName, options) if err != nil { @@ -112,18 +115,19 @@ func (client *VirtualClustersClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// virtualClusterName - The name of the virtual cluster. -// options - VirtualClustersClientGetOptions contains the optional parameters for the VirtualClustersClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - virtualClusterName - The name of the virtual cluster. +// - options - VirtualClustersClientGetOptions contains the optional parameters for the VirtualClustersClient.Get method. func (client *VirtualClustersClient) Get(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientGetOptions) (VirtualClustersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, virtualClusterName, options) if err != nil { @@ -159,7 +163,7 @@ func (client *VirtualClustersClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -175,9 +179,10 @@ func (client *VirtualClustersClient) getHandleResponse(resp *http.Response) (Vir } // NewListPager - Gets a list of all virtualClusters in the subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// options - VirtualClustersClientListOptions contains the optional parameters for the VirtualClustersClient.List method. +// +// Generated from API version 2022-11-01-preview +// - options - VirtualClustersClientListOptions contains the optional parameters for the VirtualClustersClient.NewListPager +// method. func (client *VirtualClustersClient) NewListPager(options *VirtualClustersClientListOptions) *runtime.Pager[VirtualClustersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[VirtualClustersClientListResponse]{ More: func(page VirtualClustersClientListResponse) bool { @@ -218,7 +223,7 @@ func (client *VirtualClustersClient) listCreateRequest(ctx context.Context, opti return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,12 +239,12 @@ func (client *VirtualClustersClient) listHandleResponse(resp *http.Response) (Vi } // NewListByResourceGroupPager - Gets a list of virtual clusters in a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// options - VirtualClustersClientListByResourceGroupOptions contains the optional parameters for the VirtualClustersClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - options - VirtualClustersClientListByResourceGroupOptions contains the optional parameters for the VirtualClustersClient.NewListByResourceGroupPager +// method. func (client *VirtualClustersClient) NewListByResourceGroupPager(resourceGroupName string, options *VirtualClustersClientListByResourceGroupOptions) *runtime.Pager[VirtualClustersClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[VirtualClustersClientListByResourceGroupResponse]{ More: func(page VirtualClustersClientListByResourceGroupResponse) bool { @@ -284,7 +289,7 @@ func (client *VirtualClustersClient) listByResourceGroupCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -299,15 +304,16 @@ func (client *VirtualClustersClient) listByResourceGroupHandleResponse(resp *htt return result, nil } -// BeginUpdate - Updates a virtual cluster. +// BeginUpdate - Updates an existing virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// virtualClusterName - The name of the virtual cluster. -// parameters - The requested virtual cluster resource state. -// options - VirtualClustersClientBeginUpdateOptions contains the optional parameters for the VirtualClustersClient.BeginUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - virtualClusterName - The name of the virtual cluster. +// - parameters - The requested virtual cluster resource state. +// - options - VirtualClustersClientBeginUpdateOptions contains the optional parameters for the VirtualClustersClient.BeginUpdate +// method. func (client *VirtualClustersClient) BeginUpdate(ctx context.Context, resourceGroupName string, virtualClusterName string, parameters VirtualClusterUpdate, options *VirtualClustersClientBeginUpdateOptions) (*runtime.Poller[VirtualClustersClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, virtualClusterName, parameters, options) @@ -320,9 +326,10 @@ func (client *VirtualClustersClient) BeginUpdate(ctx context.Context, resourceGr } } -// Update - Updates a virtual cluster. +// Update - Updates an existing virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *VirtualClustersClient) update(ctx context.Context, resourceGroupName string, virtualClusterName string, parameters VirtualClusterUpdate, options *VirtualClustersClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, virtualClusterName, parameters, options) if err != nil { @@ -358,37 +365,54 @@ func (client *VirtualClustersClient) updateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) } +// BeginUpdateDNSServers - Synchronizes the DNS server settings used by the managed instances inside the given virtual cluster. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - virtualClusterName - The name of the virtual cluster. +// - options - VirtualClustersClientBeginUpdateDNSServersOptions contains the optional parameters for the VirtualClustersClient.BeginUpdateDNSServers +// method. +func (client *VirtualClustersClient) BeginUpdateDNSServers(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientBeginUpdateDNSServersOptions) (*runtime.Poller[VirtualClustersClientUpdateDNSServersResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.updateDNSServers(ctx, resourceGroupName, virtualClusterName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[VirtualClustersClientUpdateDNSServersResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[VirtualClustersClientUpdateDNSServersResponse](options.ResumeToken, client.pl, nil) + } +} + // UpdateDNSServers - Synchronizes the DNS server settings used by the managed instances inside the given virtual cluster. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// virtualClusterName - The name of the virtual cluster. -// options - VirtualClustersClientUpdateDNSServersOptions contains the optional parameters for the VirtualClustersClient.UpdateDNSServers -// method. -func (client *VirtualClustersClient) UpdateDNSServers(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientUpdateDNSServersOptions) (VirtualClustersClientUpdateDNSServersResponse, error) { +// +// Generated from API version 2022-11-01-preview +func (client *VirtualClustersClient) updateDNSServers(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientBeginUpdateDNSServersOptions) (*http.Response, error) { req, err := client.updateDNSServersCreateRequest(ctx, resourceGroupName, virtualClusterName, options) if err != nil { - return VirtualClustersClientUpdateDNSServersResponse{}, err + return nil, err } resp, err := client.pl.Do(req) if err != nil { - return VirtualClustersClientUpdateDNSServersResponse{}, err + return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return VirtualClustersClientUpdateDNSServersResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) } - return client.updateDNSServersHandleResponse(resp) + return resp, nil } // updateDNSServersCreateRequest creates the UpdateDNSServers request. -func (client *VirtualClustersClient) updateDNSServersCreateRequest(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientUpdateDNSServersOptions) (*policy.Request, error) { +func (client *VirtualClustersClient) updateDNSServersCreateRequest(ctx context.Context, resourceGroupName string, virtualClusterName string, options *VirtualClustersClientBeginUpdateDNSServersOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/virtualClusters/{virtualClusterName}/updateManagedInstanceDnsServers" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -407,17 +431,8 @@ func (client *VirtualClustersClient) updateDNSServersCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } - -// updateDNSServersHandleResponse handles the UpdateDNSServers response. -func (client *VirtualClustersClient) updateDNSServersHandleResponse(resp *http.Response) (VirtualClustersClientUpdateDNSServersResponse, error) { - result := VirtualClustersClientUpdateDNSServersResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.UpdateManagedInstanceDNSServersOperation); err != nil { - return VirtualClustersClientUpdateDNSServersResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_virtualnetworkrules_client.go b/sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_virtualnetworkrules_client.go rename to sdk/resourcemanager/sql/armsql/virtualnetworkrules_client.go index 975183425546..0718c893dbe3 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_virtualnetworkrules_client.go +++ b/sdk/resourcemanager/sql/armsql/virtualnetworkrules_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 armsql @@ -31,9 +32,9 @@ type VirtualNetworkRulesClient struct { } // NewVirtualNetworkRulesClient creates a new instance of VirtualNetworkRulesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewVirtualNetworkRulesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VirtualNetworkRulesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewVirtualNetworkRulesClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates an existing virtual network rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// virtualNetworkRuleName - The name of the virtual network rule. -// parameters - The requested virtual Network Rule Resource state. -// options - VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - virtualNetworkRuleName - The name of the virtual network rule. +// - parameters - The requested virtual Network Rule Resource state. +// - options - VirtualNetworkRulesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginCreateOrUpdate +// method. func (client *VirtualNetworkRulesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule, options *VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (*runtime.Poller[VirtualNetworkRulesClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters, options) @@ -78,7 +80,8 @@ func (client *VirtualNetworkRulesClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates an existing virtual network rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *VirtualNetworkRulesClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, parameters VirtualNetworkRule, options *VirtualNetworkRulesClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, virtualNetworkRuleName, parameters, options) if err != nil { @@ -118,7 +121,7 @@ func (client *VirtualNetworkRulesClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -126,13 +129,14 @@ func (client *VirtualNetworkRulesClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes the virtual network rule with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// virtualNetworkRuleName - The name of the virtual network rule. -// options - VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - virtualNetworkRuleName - The name of the virtual network rule. +// - options - VirtualNetworkRulesClientBeginDeleteOptions contains the optional parameters for the VirtualNetworkRulesClient.BeginDelete +// method. func (client *VirtualNetworkRulesClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientBeginDeleteOptions) (*runtime.Poller[VirtualNetworkRulesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, virtualNetworkRuleName, options) @@ -147,7 +151,8 @@ func (client *VirtualNetworkRulesClient) BeginDelete(ctx context.Context, resour // Delete - Deletes the virtual network rule with the given name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *VirtualNetworkRulesClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, virtualNetworkRuleName, options) if err != nil { @@ -187,19 +192,20 @@ func (client *VirtualNetworkRulesClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a virtual network rule. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// virtualNetworkRuleName - The name of the virtual network rule. -// options - VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - virtualNetworkRuleName - The name of the virtual network rule. +// - options - VirtualNetworkRulesClientGetOptions contains the optional parameters for the VirtualNetworkRulesClient.Get method. func (client *VirtualNetworkRulesClient) Get(ctx context.Context, resourceGroupName string, serverName string, virtualNetworkRuleName string, options *VirtualNetworkRulesClientGetOptions) (VirtualNetworkRulesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, virtualNetworkRuleName, options) if err != nil { @@ -239,7 +245,7 @@ func (client *VirtualNetworkRulesClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,13 +261,13 @@ func (client *VirtualNetworkRulesClient) getHandleResponse(resp *http.Response) } // NewListByServerPager - Gets a list of virtual network rules in a server. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.ListByServer -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - VirtualNetworkRulesClientListByServerOptions contains the optional parameters for the VirtualNetworkRulesClient.NewListByServerPager +// method. func (client *VirtualNetworkRulesClient) NewListByServerPager(resourceGroupName string, serverName string, options *VirtualNetworkRulesClientListByServerOptions) *runtime.Pager[VirtualNetworkRulesClientListByServerResponse] { return runtime.NewPager(runtime.PagingHandler[VirtualNetworkRulesClientListByServerResponse]{ More: func(page VirtualNetworkRulesClientListByServerResponse) bool { @@ -310,7 +316,7 @@ func (client *VirtualNetworkRulesClient) listByServerCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client.go new file mode 100644 index 000000000000..5703180874cd --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaseline_client.go @@ -0,0 +1,202 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// VulnerabilityAssessmentBaselineClient contains the methods for the SQLVulnerabilityAssessmentBaseline group. +// Don't use this type directly, use NewVulnerabilityAssessmentBaselineClient() instead. +type VulnerabilityAssessmentBaselineClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewVulnerabilityAssessmentBaselineClient creates a new instance of VulnerabilityAssessmentBaselineClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVulnerabilityAssessmentBaselineClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentBaselineClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentBaselineClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Get - Gets a list of database's sql vulnerability assessment rule baselines. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - VulnerabilityAssessmentBaselineClientGetOptions contains the optional parameters for the VulnerabilityAssessmentBaselineClient.Get +// method. +func (client *VulnerabilityAssessmentBaselineClient) Get(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *VulnerabilityAssessmentBaselineClientGetOptions) (VulnerabilityAssessmentBaselineClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, baselineName, options) + if err != nil { + return VulnerabilityAssessmentBaselineClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentBaselineClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentBaselineClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VulnerabilityAssessmentBaselineClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *VulnerabilityAssessmentBaselineClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VulnerabilityAssessmentBaselineClient) getHandleResponse(resp *http.Response) (VulnerabilityAssessmentBaselineClientGetResponse, error) { + result := VulnerabilityAssessmentBaselineClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentBaselineSet); err != nil { + return VulnerabilityAssessmentBaselineClientGetResponse{}, err + } + return result, nil +} + +// NewListBySQLVulnerabilityAssessmentPager - Gets a list of database's sql vulnerability assessment rule baselines. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentOptions contains the optional parameters +// for the VulnerabilityAssessmentBaselineClient.NewListBySQLVulnerabilityAssessmentPager method. +func (client *VulnerabilityAssessmentBaselineClient) NewListBySQLVulnerabilityAssessmentPager(resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentOptions) *runtime.Pager[VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse] { + return runtime.NewPager(runtime.PagingHandler[VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse]{ + More: func(page VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse) (VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySQLVulnerabilityAssessmentCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse{}, runtime.NewResponseError(resp) + } + return client.listBySQLVulnerabilityAssessmentHandleResponse(resp) + }, + }) +} + +// listBySQLVulnerabilityAssessmentCreateRequest creates the ListBySQLVulnerabilityAssessment request. +func (client *VulnerabilityAssessmentBaselineClient) listBySQLVulnerabilityAssessmentCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySQLVulnerabilityAssessmentHandleResponse handles the ListBySQLVulnerabilityAssessment response. +func (client *VulnerabilityAssessmentBaselineClient) listBySQLVulnerabilityAssessmentHandleResponse(resp *http.Response) (VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse, error) { + result := VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentBaselineSetListResult); err != nil { + return VulnerabilityAssessmentBaselineClientListBySQLVulnerabilityAssessmentResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client.go new file mode 100644 index 000000000000..5931072991a0 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentbaselines_client.go @@ -0,0 +1,126 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// VulnerabilityAssessmentBaselinesClient contains the methods for the SQLVulnerabilityAssessmentBaselines group. +// Don't use this type directly, use NewVulnerabilityAssessmentBaselinesClient() instead. +type VulnerabilityAssessmentBaselinesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewVulnerabilityAssessmentBaselinesClient creates a new instance of VulnerabilityAssessmentBaselinesClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVulnerabilityAssessmentBaselinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentBaselinesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentBaselinesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Add a database's vulnerability assessment rule baseline list. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - parameters - The requested rule baseline resource. +// - options - VulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions contains the optional parameters for the VulnerabilityAssessmentBaselinesClient.CreateOrUpdate +// method. +func (client *VulnerabilityAssessmentBaselinesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput, options *VulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions) (VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, baselineName, parameters, options) + if err != nil { + return VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VulnerabilityAssessmentBaselinesClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineListInput, options *VulnerabilityAssessmentBaselinesClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *VulnerabilityAssessmentBaselinesClient) createOrUpdateHandleResponse(resp *http.Response) (VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse, error) { + result := VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentBaselineSet); err != nil { + return VulnerabilityAssessmentBaselinesClientCreateOrUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client.go new file mode 100644 index 000000000000..c5f7353fd4f4 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentexecutescan_client.go @@ -0,0 +1,127 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// VulnerabilityAssessmentExecuteScanClient contains the methods for the SQLVulnerabilityAssessmentExecuteScan group. +// Don't use this type directly, use NewVulnerabilityAssessmentExecuteScanClient() instead. +type VulnerabilityAssessmentExecuteScanClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewVulnerabilityAssessmentExecuteScanClient creates a new instance of VulnerabilityAssessmentExecuteScanClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVulnerabilityAssessmentExecuteScanClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentExecuteScanClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentExecuteScanClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginExecute - Executes a Vulnerability Assessment database scan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions contains the optional parameters for the VulnerabilityAssessmentExecuteScanClient.BeginExecute +// method. +func (client *VulnerabilityAssessmentExecuteScanClient) BeginExecute(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*runtime.Poller[VulnerabilityAssessmentExecuteScanClientExecuteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.execute(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller[VulnerabilityAssessmentExecuteScanClientExecuteResponse](resp, client.pl, nil) + } else { + return runtime.NewPollerFromResumeToken[VulnerabilityAssessmentExecuteScanClientExecuteResponse](options.ResumeToken, client.pl, nil) + } +} + +// Execute - Executes a Vulnerability Assessment database scan. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +func (client *VulnerabilityAssessmentExecuteScanClient) execute(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*http.Response, error) { + req, err := client.executeCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// executeCreateRequest creates the Execute request. +func (client *VulnerabilityAssessmentExecuteScanClient) executeCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentExecuteScanClientBeginExecuteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/initiateScan" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client.go new file mode 100644 index 000000000000..712076ec4765 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaseline_client.go @@ -0,0 +1,286 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// VulnerabilityAssessmentRuleBaselineClient contains the methods for the SQLVulnerabilityAssessmentRuleBaseline group. +// Don't use this type directly, use NewVulnerabilityAssessmentRuleBaselineClient() instead. +type VulnerabilityAssessmentRuleBaselineClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewVulnerabilityAssessmentRuleBaselineClient creates a new instance of VulnerabilityAssessmentRuleBaselineClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVulnerabilityAssessmentRuleBaselineClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentRuleBaselineClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentRuleBaselineClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates a database's vulnerability assessment rule baseline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - parameters - The requested rule baseline resource. +// - options - VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselineClient.CreateOrUpdate +// method. +func (client *VulnerabilityAssessmentRuleBaselineClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineInput, options *VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateOptions) (VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, baselineName, ruleID, parameters, options) + if err != nil { + return VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VulnerabilityAssessmentRuleBaselineClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, parameters DatabaseSQLVulnerabilityAssessmentRuleBaselineInput, options *VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *VulnerabilityAssessmentRuleBaselineClient) createOrUpdateHandleResponse(resp *http.Response) (VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse, error) { + result := VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentRuleBaseline); err != nil { + return VulnerabilityAssessmentRuleBaselineClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Get - Gets a system database's sql vulnerability assessment rule baseline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - options - VulnerabilityAssessmentRuleBaselineClientGetOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselineClient.Get +// method. +func (client *VulnerabilityAssessmentRuleBaselineClient) Get(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *VulnerabilityAssessmentRuleBaselineClientGetOptions) (VulnerabilityAssessmentRuleBaselineClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, baselineName, ruleID, options) + if err != nil { + return VulnerabilityAssessmentRuleBaselineClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentRuleBaselineClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentRuleBaselineClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VulnerabilityAssessmentRuleBaselineClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *VulnerabilityAssessmentRuleBaselineClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VulnerabilityAssessmentRuleBaselineClient) getHandleResponse(resp *http.Response) (VulnerabilityAssessmentRuleBaselineClientGetResponse, error) { + result := VulnerabilityAssessmentRuleBaselineClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentRuleBaseline); err != nil { + return VulnerabilityAssessmentRuleBaselineClientGetResponse{}, err + } + return result, nil +} + +// NewListByBaselinePager - Gets a system database's sql vulnerability assessment rule baseline. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - VulnerabilityAssessmentRuleBaselineClientListByBaselineOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselineClient.NewListByBaselinePager +// method. +func (client *VulnerabilityAssessmentRuleBaselineClient) NewListByBaselinePager(resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *VulnerabilityAssessmentRuleBaselineClientListByBaselineOptions) *runtime.Pager[VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse] { + return runtime.NewPager(runtime.PagingHandler[VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse]{ + More: func(page VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse) (VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByBaselineCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, baselineName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse{}, runtime.NewResponseError(resp) + } + return client.listByBaselineHandleResponse(resp) + }, + }) +} + +// listByBaselineCreateRequest creates the ListByBaseline request. +func (client *VulnerabilityAssessmentRuleBaselineClient) listByBaselineCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, options *VulnerabilityAssessmentRuleBaselineClientListByBaselineOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByBaselineHandleResponse handles the ListByBaseline response. +func (client *VulnerabilityAssessmentRuleBaselineClient) listByBaselineHandleResponse(resp *http.Response) (VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse, error) { + result := VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DatabaseSQLVulnerabilityAssessmentRuleBaselineListResult); err != nil { + return VulnerabilityAssessmentRuleBaselineClientListByBaselineResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client.go new file mode 100644 index 000000000000..36e6f4a62c15 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentrulebaselines_client.go @@ -0,0 +1,120 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// VulnerabilityAssessmentRuleBaselinesClient contains the methods for the SQLVulnerabilityAssessmentRuleBaselines group. +// Don't use this type directly, use NewVulnerabilityAssessmentRuleBaselinesClient() instead. +type VulnerabilityAssessmentRuleBaselinesClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewVulnerabilityAssessmentRuleBaselinesClient creates a new instance of VulnerabilityAssessmentRuleBaselinesClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVulnerabilityAssessmentRuleBaselinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentRuleBaselinesClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentRuleBaselinesClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Delete - Removes the database's vulnerability assessment rule baseline. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - ruleID - The vulnerability assessment rule ID. +// - options - VulnerabilityAssessmentRuleBaselinesClientDeleteOptions contains the optional parameters for the VulnerabilityAssessmentRuleBaselinesClient.Delete +// method. +func (client *VulnerabilityAssessmentRuleBaselinesClient) Delete(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *VulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (VulnerabilityAssessmentRuleBaselinesClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, baselineName, ruleID, options) + if err != nil { + return VulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return VulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return VulnerabilityAssessmentRuleBaselinesClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VulnerabilityAssessmentRuleBaselinesClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, baselineName BaselineName, ruleID string, options *VulnerabilityAssessmentRuleBaselinesClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/baselines/{baselineName}/rules/{ruleId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if baselineName == "" { + return nil, errors.New("parameter baselineName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{baselineName}", url.PathEscape(string(baselineName))) + if ruleID == "" { + return nil, errors.New("parameter ruleID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{ruleId}", url.PathEscape(ruleID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client.go new file mode 100644 index 000000000000..76f171d3fe19 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessments_client.go @@ -0,0 +1,110 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// VulnerabilityAssessmentsClient contains the methods for the SQLVulnerabilityAssessments group. +// Don't use this type directly, use NewVulnerabilityAssessmentsClient() instead. +type VulnerabilityAssessmentsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewVulnerabilityAssessmentsClient creates a new instance of VulnerabilityAssessmentsClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVulnerabilityAssessmentsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Delete - Removes SQL Vulnerability Assessment. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - options - VulnerabilityAssessmentsClientDeleteOptions contains the optional parameters for the VulnerabilityAssessmentsClient.Delete +// method. +func (client *VulnerabilityAssessmentsClient) Delete(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentsClientDeleteOptions) (VulnerabilityAssessmentsClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) + if err != nil { + return VulnerabilityAssessmentsClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentsClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return VulnerabilityAssessmentsClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return VulnerabilityAssessmentsClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *VulnerabilityAssessmentsClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentsClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + return req, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client.go new file mode 100644 index 000000000000..4c1388cd740f --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscanresult_client.go @@ -0,0 +1,213 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// VulnerabilityAssessmentScanResultClient contains the methods for the SQLVulnerabilityAssessmentScanResult group. +// Don't use this type directly, use NewVulnerabilityAssessmentScanResultClient() instead. +type VulnerabilityAssessmentScanResultClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewVulnerabilityAssessmentScanResultClient creates a new instance of VulnerabilityAssessmentScanResultClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVulnerabilityAssessmentScanResultClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentScanResultClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentScanResultClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Get - Gets a vulnerability assessment scan record of a database. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - scanID - The scan id of the SQL Vulnerability Assessment scan to retrieve result from. +// - scanResultID - The scan result id of the specific result to retrieve. +// - options - VulnerabilityAssessmentScanResultClientGetOptions contains the optional parameters for the VulnerabilityAssessmentScanResultClient.Get +// method. +func (client *VulnerabilityAssessmentScanResultClient) Get(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, scanResultID string, options *VulnerabilityAssessmentScanResultClientGetOptions) (VulnerabilityAssessmentScanResultClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, scanID, scanResultID, options) + if err != nil { + return VulnerabilityAssessmentScanResultClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentScanResultClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentScanResultClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VulnerabilityAssessmentScanResultClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, scanResultID string, options *VulnerabilityAssessmentScanResultClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults/{scanResultId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + if scanResultID == "" { + return nil, errors.New("parameter scanResultID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanResultId}", url.PathEscape(scanResultID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VulnerabilityAssessmentScanResultClient) getHandleResponse(resp *http.Response) (VulnerabilityAssessmentScanResultClientGetResponse, error) { + result := VulnerabilityAssessmentScanResultClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanResults); err != nil { + return VulnerabilityAssessmentScanResultClientGetResponse{}, err + } + return result, nil +} + +// NewListByScanPager - Gets a vulnerability assessment scan record of a database. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - scanID - The scan id of the SQL Vulnerability Assessment scan to retrieve result from. +// - options - VulnerabilityAssessmentScanResultClientListByScanOptions contains the optional parameters for the VulnerabilityAssessmentScanResultClient.NewListByScanPager +// method. +func (client *VulnerabilityAssessmentScanResultClient) NewListByScanPager(resourceGroupName string, serverName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, options *VulnerabilityAssessmentScanResultClientListByScanOptions) *runtime.Pager[VulnerabilityAssessmentScanResultClientListByScanResponse] { + return runtime.NewPager(runtime.PagingHandler[VulnerabilityAssessmentScanResultClientListByScanResponse]{ + More: func(page VulnerabilityAssessmentScanResultClientListByScanResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VulnerabilityAssessmentScanResultClientListByScanResponse) (VulnerabilityAssessmentScanResultClientListByScanResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByScanCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, scanID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VulnerabilityAssessmentScanResultClientListByScanResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentScanResultClientListByScanResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentScanResultClientListByScanResponse{}, runtime.NewResponseError(resp) + } + return client.listByScanHandleResponse(resp) + }, + }) +} + +// listByScanCreateRequest creates the ListByScan request. +func (client *VulnerabilityAssessmentScanResultClient) listByScanCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, scanID string, options *VulnerabilityAssessmentScanResultClientListByScanOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}/scanResults" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByScanHandleResponse handles the ListByScan response. +func (client *VulnerabilityAssessmentScanResultClient) listByScanHandleResponse(resp *http.Response) (VulnerabilityAssessmentScanResultClientListByScanResponse, error) { + result := VulnerabilityAssessmentScanResultClientListByScanResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanListResult); err != nil { + return VulnerabilityAssessmentScanResultClientListByScanResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client.go new file mode 100644 index 000000000000..cb5e32698481 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentscans_client.go @@ -0,0 +1,202 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// VulnerabilityAssessmentScansClient contains the methods for the SQLVulnerabilityAssessmentScans group. +// Don't use this type directly, use NewVulnerabilityAssessmentScansClient() instead. +type VulnerabilityAssessmentScansClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewVulnerabilityAssessmentScansClient creates a new instance of VulnerabilityAssessmentScansClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVulnerabilityAssessmentScansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentScansClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentScansClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Get - Get a system database vulnerability assessment scan record. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - VulnerabilityAssessmentScansClientGetOptions contains the optional parameters for the VulnerabilityAssessmentScansClient.Get +// method. +func (client *VulnerabilityAssessmentScansClient) Get(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *VulnerabilityAssessmentScansClientGetOptions) (VulnerabilityAssessmentScansClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, scanID, options) + if err != nil { + return VulnerabilityAssessmentScansClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentScansClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentScansClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VulnerabilityAssessmentScansClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, scanID string, options *VulnerabilityAssessmentScansClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans/{scanId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if scanID == "" { + return nil, errors.New("parameter scanID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{scanId}", url.PathEscape(scanID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VulnerabilityAssessmentScansClient) getHandleResponse(resp *http.Response) (VulnerabilityAssessmentScansClientGetResponse, error) { + result := VulnerabilityAssessmentScansClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanRecordForSQL); err != nil { + return VulnerabilityAssessmentScansClientGetResponse{}, err + } + return result, nil +} + +// NewListBySQLVulnerabilityAssessmentsPager - Lists the vulnerability assessment scans of a database. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the vulnerability assessment. +// - options - VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions contains the optional parameters for +// the VulnerabilityAssessmentScansClient.NewListBySQLVulnerabilityAssessmentsPager method. +func (client *VulnerabilityAssessmentScansClient) NewListBySQLVulnerabilityAssessmentsPager(resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions) *runtime.Pager[VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse] { + return runtime.NewPager(runtime.PagingHandler[VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse]{ + More: func(page VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse) (VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listBySQLVulnerabilityAssessmentsCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, runtime.NewResponseError(resp) + } + return client.listBySQLVulnerabilityAssessmentsHandleResponse(resp) + }, + }) +} + +// listBySQLVulnerabilityAssessmentsCreateRequest creates the ListBySQLVulnerabilityAssessments request. +func (client *VulnerabilityAssessmentScansClient) listBySQLVulnerabilityAssessmentsCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, options *VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}/scans" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("systemDatabaseName", "master") + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listBySQLVulnerabilityAssessmentsHandleResponse handles the ListBySQLVulnerabilityAssessments response. +func (client *VulnerabilityAssessmentScansClient) listBySQLVulnerabilityAssessmentsHandleResponse(resp *http.Response) (VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse, error) { + result := VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentScanRecordForSQLListResult); err != nil { + return VulnerabilityAssessmentScansClientListBySQLVulnerabilityAssessmentsResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client.go b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client.go new file mode 100644 index 000000000000..a52e78748b39 --- /dev/null +++ b/sdk/resourcemanager/sql/armsql/vulnerabilityassessmentssettings_client.go @@ -0,0 +1,256 @@ +//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 armsql + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// VulnerabilityAssessmentsSettingsClient contains the methods for the SQLVulnerabilityAssessmentsSettings group. +// Don't use this type directly, use NewVulnerabilityAssessmentsSettingsClient() instead. +type VulnerabilityAssessmentsSettingsClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewVulnerabilityAssessmentsSettingsClient creates a new instance of VulnerabilityAssessmentsSettingsClient with the specified values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewVulnerabilityAssessmentsSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*VulnerabilityAssessmentsSettingsClient, error) { + if options == nil { + options = &arm.ClientOptions{} + } + ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint + if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { + ep = c.Endpoint + } + pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) + if err != nil { + return nil, err + } + client := &VulnerabilityAssessmentsSettingsClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates SQL Vulnerability Assessment policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - parameters - The requested resource. +// - options - VulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions contains the optional parameters for the VulnerabilityAssessmentsSettingsClient.CreateOrUpdate +// method. +func (client *VulnerabilityAssessmentsSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, parameters VulnerabilityAssessment, options *VulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions) (VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, parameters, options) + if err != nil { + return VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *VulnerabilityAssessmentsSettingsClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName VulnerabilityAssessmentName, parameters VulnerabilityAssessment, options *VulnerabilityAssessmentsSettingsClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *VulnerabilityAssessmentsSettingsClient) createOrUpdateHandleResponse(resp *http.Response) (VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse, error) { + result := VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessment); err != nil { + return VulnerabilityAssessmentsSettingsClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Get - Gets SQL Vulnerability Assessment policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - vulnerabilityAssessmentName - The name of the SQL Vulnerability Assessment. +// - options - VulnerabilityAssessmentsSettingsClientGetOptions contains the optional parameters for the VulnerabilityAssessmentsSettingsClient.Get +// method. +func (client *VulnerabilityAssessmentsSettingsClient) Get(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, options *VulnerabilityAssessmentsSettingsClientGetOptions) (VulnerabilityAssessmentsSettingsClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, vulnerabilityAssessmentName, options) + if err != nil { + return VulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentsSettingsClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *VulnerabilityAssessmentsSettingsClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, vulnerabilityAssessmentName SQLVulnerabilityAssessmentName, options *VulnerabilityAssessmentsSettingsClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments/{vulnerabilityAssessmentName}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if vulnerabilityAssessmentName == "" { + return nil, errors.New("parameter vulnerabilityAssessmentName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vulnerabilityAssessmentName}", url.PathEscape(string(vulnerabilityAssessmentName))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *VulnerabilityAssessmentsSettingsClient) getHandleResponse(resp *http.Response) (VulnerabilityAssessmentsSettingsClientGetResponse, error) { + result := VulnerabilityAssessmentsSettingsClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessment); err != nil { + return VulnerabilityAssessmentsSettingsClientGetResponse{}, err + } + return result, nil +} + +// NewListByServerPager - Lists SQL Vulnerability Assessment policies associated with a server. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - options - VulnerabilityAssessmentsSettingsClientListByServerOptions contains the optional parameters for the VulnerabilityAssessmentsSettingsClient.NewListByServerPager +// method. +func (client *VulnerabilityAssessmentsSettingsClient) NewListByServerPager(resourceGroupName string, serverName string, options *VulnerabilityAssessmentsSettingsClientListByServerOptions) *runtime.Pager[VulnerabilityAssessmentsSettingsClientListByServerResponse] { + return runtime.NewPager(runtime.PagingHandler[VulnerabilityAssessmentsSettingsClientListByServerResponse]{ + More: func(page VulnerabilityAssessmentsSettingsClientListByServerResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *VulnerabilityAssessmentsSettingsClientListByServerResponse) (VulnerabilityAssessmentsSettingsClientListByServerResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return VulnerabilityAssessmentsSettingsClientListByServerResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return VulnerabilityAssessmentsSettingsClientListByServerResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return VulnerabilityAssessmentsSettingsClientListByServerResponse{}, runtime.NewResponseError(resp) + } + return client.listByServerHandleResponse(resp) + }, + }) +} + +// listByServerCreateRequest creates the ListByServer request. +func (client *VulnerabilityAssessmentsSettingsClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *VulnerabilityAssessmentsSettingsClientListByServerOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/sqlVulnerabilityAssessments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serverName == "" { + return nil, errors.New("parameter serverName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-11-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServerHandleResponse handles the ListByServer response. +func (client *VulnerabilityAssessmentsSettingsClient) listByServerHandleResponse(resp *http.Response) (VulnerabilityAssessmentsSettingsClientListByServerResponse, error) { + result := VulnerabilityAssessmentsSettingsClientListByServerResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.VulnerabilityAssessmentListResult); err != nil { + return VulnerabilityAssessmentsSettingsClientListByServerResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_workloadclassifiers_client.go b/sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_workloadclassifiers_client.go rename to sdk/resourcemanager/sql/armsql/workloadclassifiers_client.go index 8c4fe8652905..ab0845d2362b 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_workloadclassifiers_client.go +++ b/sdk/resourcemanager/sql/armsql/workloadclassifiers_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 armsql @@ -31,9 +32,9 @@ type WorkloadClassifiersClient struct { } // NewWorkloadClassifiersClient creates a new instance of WorkloadClassifiersClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewWorkloadClassifiersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkloadClassifiersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,16 +57,17 @@ func NewWorkloadClassifiersClient(subscriptionID string, credential azcore.Token // BeginCreateOrUpdate - Creates or updates a workload classifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// workloadGroupName - The name of the workload group from which to receive the classifier from. -// workloadClassifierName - The name of the workload classifier to create/update. -// parameters - The properties of the workload classifier. -// options - WorkloadClassifiersClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkloadClassifiersClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - workloadGroupName - The name of the workload group from which to receive the classifier from. +// - workloadClassifierName - The name of the workload classifier to create/update. +// - parameters - The properties of the workload classifier. +// - options - WorkloadClassifiersClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkloadClassifiersClient.BeginCreateOrUpdate +// method. func (client *WorkloadClassifiersClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, parameters WorkloadClassifier, options *WorkloadClassifiersClientBeginCreateOrUpdateOptions) (*runtime.Poller[WorkloadClassifiersClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, workloadClassifierName, parameters, options) @@ -80,7 +82,8 @@ func (client *WorkloadClassifiersClient) BeginCreateOrUpdate(ctx context.Context // CreateOrUpdate - Creates or updates a workload classifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *WorkloadClassifiersClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, parameters WorkloadClassifier, options *WorkloadClassifiersClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, workloadClassifierName, parameters, options) if err != nil { @@ -128,7 +131,7 @@ func (client *WorkloadClassifiersClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -136,15 +139,16 @@ func (client *WorkloadClassifiersClient) createOrUpdateCreateRequest(ctx context // BeginDelete - Deletes a workload classifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// workloadGroupName - The name of the workload group from which to receive the classifier from. -// workloadClassifierName - The name of the workload classifier to delete. -// options - WorkloadClassifiersClientBeginDeleteOptions contains the optional parameters for the WorkloadClassifiersClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - workloadGroupName - The name of the workload group from which to receive the classifier from. +// - workloadClassifierName - The name of the workload classifier to delete. +// - options - WorkloadClassifiersClientBeginDeleteOptions contains the optional parameters for the WorkloadClassifiersClient.BeginDelete +// method. func (client *WorkloadClassifiersClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, options *WorkloadClassifiersClientBeginDeleteOptions) (*runtime.Poller[WorkloadClassifiersClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, workloadClassifierName, options) @@ -159,7 +163,8 @@ func (client *WorkloadClassifiersClient) BeginDelete(ctx context.Context, resour // Delete - Deletes a workload classifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *WorkloadClassifiersClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, options *WorkloadClassifiersClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, workloadClassifierName, options) if err != nil { @@ -207,21 +212,22 @@ func (client *WorkloadClassifiersClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a workload classifier // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// workloadGroupName - The name of the workload group from which to receive the classifier from. -// workloadClassifierName - The name of the workload classifier. -// options - WorkloadClassifiersClientGetOptions contains the optional parameters for the WorkloadClassifiersClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - workloadGroupName - The name of the workload group from which to receive the classifier from. +// - workloadClassifierName - The name of the workload classifier. +// - options - WorkloadClassifiersClientGetOptions contains the optional parameters for the WorkloadClassifiersClient.Get method. func (client *WorkloadClassifiersClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, workloadClassifierName string, options *WorkloadClassifiersClientGetOptions) (WorkloadClassifiersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, workloadClassifierName, options) if err != nil { @@ -269,7 +275,7 @@ func (client *WorkloadClassifiersClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -285,15 +291,15 @@ func (client *WorkloadClassifiersClient) getHandleResponse(resp *http.Response) } // NewListByWorkloadGroupPager - Gets the list of workload classifiers for a workload group -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// workloadGroupName - The name of the workload group from which to receive the classifiers from. -// options - WorkloadClassifiersClientListByWorkloadGroupOptions contains the optional parameters for the WorkloadClassifiersClient.ListByWorkloadGroup -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - workloadGroupName - The name of the workload group from which to receive the classifiers from. +// - options - WorkloadClassifiersClientListByWorkloadGroupOptions contains the optional parameters for the WorkloadClassifiersClient.NewListByWorkloadGroupPager +// method. func (client *WorkloadClassifiersClient) NewListByWorkloadGroupPager(resourceGroupName string, serverName string, databaseName string, workloadGroupName string, options *WorkloadClassifiersClientListByWorkloadGroupOptions) *runtime.Pager[WorkloadClassifiersClientListByWorkloadGroupResponse] { return runtime.NewPager(runtime.PagingHandler[WorkloadClassifiersClientListByWorkloadGroupResponse]{ More: func(page WorkloadClassifiersClientListByWorkloadGroupResponse) bool { @@ -350,7 +356,7 @@ func (client *WorkloadClassifiersClient) listByWorkloadGroupCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_workloadgroups_client.go b/sdk/resourcemanager/sql/armsql/workloadgroups_client.go similarity index 84% rename from sdk/resourcemanager/sql/armsql/zz_generated_workloadgroups_client.go rename to sdk/resourcemanager/sql/armsql/workloadgroups_client.go index 26a3460a395c..0f6aefcb583d 100644 --- a/sdk/resourcemanager/sql/armsql/zz_generated_workloadgroups_client.go +++ b/sdk/resourcemanager/sql/armsql/workloadgroups_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 armsql @@ -31,9 +32,9 @@ type WorkloadGroupsClient struct { } // NewWorkloadGroupsClient creates a new instance of WorkloadGroupsClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription ID that identifies an Azure subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewWorkloadGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkloadGroupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewWorkloadGroupsClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates or updates a workload group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// workloadGroupName - The name of the workload group. -// parameters - The requested workload group state. -// options - WorkloadGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkloadGroupsClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - workloadGroupName - The name of the workload group. +// - parameters - The requested workload group state. +// - options - WorkloadGroupsClientBeginCreateOrUpdateOptions contains the optional parameters for the WorkloadGroupsClient.BeginCreateOrUpdate +// method. func (client *WorkloadGroupsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, parameters WorkloadGroup, options *WorkloadGroupsClientBeginCreateOrUpdateOptions) (*runtime.Poller[WorkloadGroupsClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, parameters, options) @@ -79,7 +81,8 @@ func (client *WorkloadGroupsClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates or updates a workload group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *WorkloadGroupsClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, parameters WorkloadGroup, options *WorkloadGroupsClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, parameters, options) if err != nil { @@ -123,7 +126,7 @@ func (client *WorkloadGroupsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -131,14 +134,15 @@ func (client *WorkloadGroupsClient) createOrUpdateCreateRequest(ctx context.Cont // BeginDelete - Deletes a workload group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// workloadGroupName - The name of the workload group to delete. -// options - WorkloadGroupsClientBeginDeleteOptions contains the optional parameters for the WorkloadGroupsClient.BeginDelete -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - workloadGroupName - The name of the workload group to delete. +// - options - WorkloadGroupsClientBeginDeleteOptions contains the optional parameters for the WorkloadGroupsClient.BeginDelete +// method. func (client *WorkloadGroupsClient) BeginDelete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, options *WorkloadGroupsClientBeginDeleteOptions) (*runtime.Poller[WorkloadGroupsClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, options) @@ -153,7 +157,8 @@ func (client *WorkloadGroupsClient) BeginDelete(ctx context.Context, resourceGro // Delete - Deletes a workload group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview +// +// Generated from API version 2022-11-01-preview func (client *WorkloadGroupsClient) deleteOperation(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, options *WorkloadGroupsClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, options) if err != nil { @@ -197,20 +202,21 @@ func (client *WorkloadGroupsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } // Get - Gets a workload group // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// workloadGroupName - The name of the workload group. -// options - WorkloadGroupsClientGetOptions contains the optional parameters for the WorkloadGroupsClient.Get method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - workloadGroupName - The name of the workload group. +// - options - WorkloadGroupsClientGetOptions contains the optional parameters for the WorkloadGroupsClient.Get method. func (client *WorkloadGroupsClient) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, workloadGroupName string, options *WorkloadGroupsClientGetOptions) (WorkloadGroupsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, databaseName, workloadGroupName, options) if err != nil { @@ -254,7 +260,7 @@ func (client *WorkloadGroupsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -270,14 +276,14 @@ func (client *WorkloadGroupsClient) getHandleResponse(resp *http.Response) (Work } // NewListByDatabasePager - Gets the list of workload groups -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2020-11-01-preview -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// databaseName - The name of the database. -// options - WorkloadGroupsClientListByDatabaseOptions contains the optional parameters for the WorkloadGroupsClient.ListByDatabase -// method. +// +// Generated from API version 2022-11-01-preview +// - resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure +// Resource Manager API or the portal. +// - serverName - The name of the server. +// - databaseName - The name of the database. +// - options - WorkloadGroupsClientListByDatabaseOptions contains the optional parameters for the WorkloadGroupsClient.NewListByDatabasePager +// method. func (client *WorkloadGroupsClient) NewListByDatabasePager(resourceGroupName string, serverName string, databaseName string, options *WorkloadGroupsClientListByDatabaseOptions) *runtime.Pager[WorkloadGroupsClientListByDatabaseResponse] { return runtime.NewPager(runtime.PagingHandler[WorkloadGroupsClientListByDatabaseResponse]{ More: func(page WorkloadGroupsClientListByDatabaseResponse) bool { @@ -330,7 +336,7 @@ func (client *WorkloadGroupsClient) listByDatabaseCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-11-01-preview") + reqQP.Set("api-version", "2022-11-01-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_backupshorttermretentionpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_backupshorttermretentionpolicies_client_test.go deleted file mode 100644 index 27efda761e19..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_backupshorttermretentionpolicies_client_test.go +++ /dev/null @@ -1,137 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetShortTermRetentionPolicy.json -func ExampleBackupShortTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.ShortTermRetentionPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/UpdateShortTermRetentionPolicy.json -func ExampleBackupShortTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroup", - "testsvr", - "testdb", - armsql.ShortTermRetentionPolicyNameDefault, - armsql.BackupShortTermRetentionPolicy{ - Properties: &armsql.BackupShortTermRetentionPolicyProperties{ - DiffBackupIntervalInHours: to.Ptr(armsql.DiffBackupIntervalInHours(24)), - RetentionDays: to.Ptr[int32](7), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/UpdateShortTermRetentionPolicy.json -func ExampleBackupShortTermRetentionPoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "resourceGroup", - "testsvr", - "testdb", - armsql.ShortTermRetentionPolicyNameDefault, - armsql.BackupShortTermRetentionPolicy{ - Properties: &armsql.BackupShortTermRetentionPolicyProperties{ - DiffBackupIntervalInHours: to.Ptr(armsql.DiffBackupIntervalInHours(24)), - RetentionDays: to.Ptr[int32](7), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListShortTermRetentionPoliciesByDatabase.json -func ExampleBackupShortTermRetentionPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_capabilities_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_capabilities_client_test.go deleted file mode 100644 index 2c76008cccca..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_capabilities_client_test.go +++ /dev/null @@ -1,38 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LocationCapabilityListByLocation.json -func ExampleCapabilitiesClient_ListByLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewCapabilitiesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByLocation(ctx, - "eastus", - &armsql.CapabilitiesClientListByLocationOptions{Include: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvancedthreatprotectionsettings_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvancedthreatprotectionsettings_client_test.go deleted file mode 100644 index 00f4663ad836..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvancedthreatprotectionsettings_client_test.go +++ /dev/null @@ -1,98 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsListByDatabase.json -func ExampleDatabaseAdvancedThreatProtectionSettingsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAdvancedThreatProtectionSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("threatprotection-6852", - "threatprotection-2080", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsGet.json -func ExampleDatabaseAdvancedThreatProtectionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAdvancedThreatProtectionSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "threatprotection-6852", - "threatprotection-2080", - "testdb", - armsql.AdvancedThreatProtectionNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAdvancedThreatProtectionSettingsCreateMax.json -func ExampleDatabaseAdvancedThreatProtectionSettingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAdvancedThreatProtectionSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "threatprotection-4799", - "threatprotection-6440", - "testdb", - armsql.AdvancedThreatProtectionNameDefault, - armsql.DatabaseAdvancedThreatProtection{ - Properties: &armsql.AdvancedThreatProtectionProperties{ - State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvisors_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvisors_client_test.go deleted file mode 100644 index a22a2a31e518..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseadvisors_client_test.go +++ /dev/null @@ -1,94 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorList.json -func ExampleDatabaseAdvisorsClient_ListByDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAdvisorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByDatabase(ctx, - "workloadinsight-demos", - "misosisvr", - "IndexAdvisor_test_3", - &armsql.DatabaseAdvisorsClientListByDatabaseOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorGet.json -func ExampleDatabaseAdvisorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAdvisorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "workloadinsight-demos", - "misosisvr", - "IndexAdvisor_test_3", - "CreateIndex", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAdvisorUpdate.json -func ExampleDatabaseAdvisorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAdvisorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "workloadinsight-demos", - "misosisvr", - "IndexAdvisor_test_3", - "CreateIndex", - armsql.Advisor{ - Properties: &armsql.AdvisorProperties{ - AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseautomatictuning_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseautomatictuning_client_test.go deleted file mode 100644 index 1606b734eb4c..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseautomatictuning_client_test.go +++ /dev/null @@ -1,80 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningGet.json -func ExampleDatabaseAutomaticTuningClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAutomaticTuningClient("c3aa9078-0000-0000-0000-e36f151182d7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "default-sql-onebox", - "testsvr11", - "db1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseAutomaticTuningUpdateMax.json -func ExampleDatabaseAutomaticTuningClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseAutomaticTuningClient("c3aa9078-0000-0000-0000-e36f151182d7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "default-sql-onebox", - "testsvr11", - "db1", - armsql.DatabaseAutomaticTuning{ - Properties: &armsql.DatabaseAutomaticTuningProperties{ - DesiredState: to.Ptr(armsql.AutomaticTuningModeAuto), - Options: map[string]*armsql.AutomaticTuningOptions{ - "createIndex": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOff), - }, - "dropIndex": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOn), - }, - "forceLastGoodPlan": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseblobauditingpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseblobauditingpolicies_client_test.go deleted file mode 100644 index 06eb652de73e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseblobauditingpolicies_client_test.go +++ /dev/null @@ -1,97 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAuditingSettingsList.json -func ExampleDatabaseBlobAuditingPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("blobauditingtest-6852", - "blobauditingtest-2080", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseBlobAuditingGet.json -func ExampleDatabaseBlobAuditingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "blobauditingtest-6852", - "blobauditingtest-2080", - "testdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseAzureMonitorAuditingCreateMin.json -func ExampleDatabaseBlobAuditingPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "blobauditingtest-4799", - "blobauditingtest-6440", - "testdb", - armsql.DatabaseBlobAuditingPolicy{ - Properties: &armsql.DatabaseBlobAuditingPolicyProperties{ - IsAzureMonitorTargetEnabled: to.Ptr(true), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasecolumns_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databasecolumns_client_test.go deleted file mode 100644 index 4533420193a0..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasecolumns_client_test.go +++ /dev/null @@ -1,111 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnsListByDatabaseMax.json -func ExampleDatabaseColumnsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseColumnsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("myRG", - "serverName", - "myDatabase", - &armsql.DatabaseColumnsClientListByDatabaseOptions{Schema: []string{ - "dbo"}, - Table: []string{ - "customer", - "address"}, - Column: []string{ - "username"}, - OrderBy: []string{ - "schema asc", - "table", - "column desc"}, - Skiptoken: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnListByTable.json -func ExampleDatabaseColumnsClient_NewListByTablePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseColumnsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTablePager("myRG", - "serverName", - "myDatabase", - "dbo", - "table1", - &armsql.DatabaseColumnsClientListByTableOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseColumnGet.json -func ExampleDatabaseColumnsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseColumnsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "serverName", - "myDatabase", - "dbo", - "table1", - "column1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseextensions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseextensions_client_test.go deleted file mode 100644 index 28ae08dec3f5..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseextensions_client_test.go +++ /dev/null @@ -1,103 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseExtensions.json -func ExampleDatabaseExtensionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseExtensionsClient("a3473687-7581-41e1-ac24-6bcca5843f07", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Get(ctx, - "rg_a1f9d6f8-30d5-4228-9504-8a364361bca3", - "srv_65858e0f-b1d1-4bdc-8351-a7da86ca4939", - "11aa6c5e-58ed-4693-b303-3b8e3131deaa", - "polybaseimport", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CreateOrUpdateDatabaseExtensions.json -func ExampleDatabaseExtensionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseExtensionsClient("a1c0814d-3c18-4e1e-a247-c128c12b1677", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg_20cbe0f0-c2d9-4522-9177-5469aad53029", - "srv_1ffd1cf8-9951-47fb-807d-a9c384763849", - "878e303f-1ea0-4f17-aa3d-a22ac5e9da08", - "polybaseimport", - armsql.DatabaseExtensions{ - Properties: &armsql.DatabaseExtensionsProperties{ - OperationMode: to.Ptr(armsql.OperationModePolybaseImport), - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://teststorage.blob.core.windows.net/testcontainer/Manifest.xml"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseExtensions.json -func ExampleDatabaseExtensionsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseExtensionsClient("7b2515fe-f230-4017-8cf0-695163acab85", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("rg_4007c5a9-b3b0-41e1-bd46-9eef38768a4a", - "srv_3b67ec2a-519b-43a7-8533-fb62dce3431e", - "719d8fa4-bf0f-48fc-8cd3-ef40fe6ba1fe", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseoperations_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseoperations_client_test.go deleted file mode 100644 index da7dc806a12b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseoperations_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CancelDatabaseOperation.json -func ExampleDatabaseOperationsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Cancel(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-6661", - "testdb", - "f779414b-e748-4925-8cfe-c8598f7660ae", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListDatabaseOperations.json -func ExampleDatabaseOperationsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("sqlcrudtest-7398", - "sqlcrudtest-4645", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaserecommendedactions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaserecommendedactions_client_test.go deleted file mode 100644 index f427de677af0..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaserecommendedactions_client_test.go +++ /dev/null @@ -1,99 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionList.json -func ExampleDatabaseRecommendedActionsClient_ListByDatabaseAdvisor() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseRecommendedActionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByDatabaseAdvisor(ctx, - "workloadinsight-demos", - "misosisvr", - "IndexAdvisor_test_3", - "CreateIndex", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionGet.json -func ExampleDatabaseRecommendedActionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseRecommendedActionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "workloadinsight-demos", - "misosisvr", - "IndexAdvisor_test_3", - "CreateIndex", - "IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRecommendedActionUpdate.json -func ExampleDatabaseRecommendedActionsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseRecommendedActionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "workloadinsight-demos", - "misosisvr", - "IndexAdvisor_test_3", - "CreateIndex", - "IR_[CRM]_[DataPoints]_4821CD2F9510D98184BB", - armsql.RecommendedAction{ - Properties: &armsql.RecommendedActionProperties{ - State: &armsql.RecommendedActionStateInfo{ - CurrentValue: to.Ptr(armsql.RecommendedActionCurrentStatePending), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databases_client_test.go deleted file mode 100644 index 5c1de9d5bc20..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databases_client_test.go +++ /dev/null @@ -1,476 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsListWithFilter.json -func ExampleDatabasesClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("sqlcrudtest-6730", - "sqlcrudtest-9007", - "3481", - "name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DatabaseMetricsDefinitionsList.json -func ExampleDatabasesClient_NewListMetricDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricDefinitionsPager("sqlcrudtest-6730", - "sqlcrudtest-9007", - "3481", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListVCoreDatabasesByServer.json -func ExampleDatabasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default-SQL-SouthEastAsia", - "testsvr", - &armsql.DatabasesClientListByServerOptions{SkipToken: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetVCoreDatabase.json -func ExampleDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/CreateVCoreDatabaseByServiceObjective.json -func ExampleDatabasesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.Database{ - Location: to.Ptr("southeastasia"), - SKU: &armsql.SKU{ - Name: to.Ptr("BC"), - Capacity: to.Ptr[int32](2), - Family: to.Ptr("Gen4"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/DeleteDatabase.json -func ExampleDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/PatchVCoreDatabaseAssignMaintenanceConfiguration.json -func ExampleDatabasesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.DatabaseUpdate{ - Properties: &armsql.DatabaseUpdateProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_SouthEastAsia_1"), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("BC_Gen5_4"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ExportDatabaseWithNetworkIsolation.json -func ExampleDatabasesClient_BeginExport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginExport(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.ExportDatabaseDefinition{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("password"), - AuthenticationType: to.Ptr("Sql"), - NetworkIsolation: &armsql.NetworkIsolationSettings{ - SQLServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr"), - StorageAccountResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"), - }, - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/FailoverDatabase.json -func ExampleDatabasesClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "group1", - "testServer", - "testDatabase", - &armsql.DatabasesClientBeginFailoverOptions{ReplicaType: to.Ptr(armsql.ReplicaTypePrimary)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ImportDatabaseWithNetworkIsolation.json -func ExampleDatabasesClient_BeginImport() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginImport(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.ImportExistingDatabaseDefinition{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("password"), - AuthenticationType: to.Ptr("Sql"), - NetworkIsolation: &armsql.NetworkIsolationSettings{ - SQLServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr"), - StorageAccountResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"), - }, - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/RenameDatabase.json -func ExampleDatabasesClient_Rename() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Rename(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.ResourceMoveDefinition{ - ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr/databases/newtestdb"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/PauseDatabase.json -func ExampleDatabasesClient_BeginPause() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPause(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdwdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResumeDatabase.json -func ExampleDatabasesClient_BeginResume() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginResume(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdwdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/UpgradeDataWarehouse.json -func ExampleDatabasesClient_BeginUpgradeDataWarehouse() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpgradeDataWarehouse(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdwdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListDatabasesByElasticPool.json -func ExampleDatabasesClient_NewListByElasticPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByElasticPoolPager("Default-SQL-SouthEastAsia", - "testsvr", - "pool1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListVCoreInaccessibleDatabasesByServer.json -func ExampleDatabasesClient_NewListInaccessibleByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListInaccessibleByServerPager("Default-SQL-SouthEastAsia", - "testsvr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseschemas_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseschemas_client_test.go deleted file mode 100644 index b4947c660003..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseschemas_client_test.go +++ /dev/null @@ -1,68 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaListByDatabase.json -func ExampleDatabaseSchemasClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseSchemasClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("myRG", - "serverName", - "myDatabase", - &armsql.DatabaseSchemasClientListByDatabaseOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSchemaGet.json -func ExampleDatabaseSchemasClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseSchemasClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "serverName", - "myDatabase", - "dbo", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasesecurityalertpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databasesecurityalertpolicies_client_test.go deleted file mode 100644 index 32d6c65c59d9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasesecurityalertpolicies_client_test.go +++ /dev/null @@ -1,108 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertGet.json -func ExampleDatabaseSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "securityalert-6852", - "securityalert-2080", - "testdb", - armsql.SecurityAlertPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertCreateMax.json -func ExampleDatabaseSecurityAlertPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "securityalert-4799", - "securityalert-6440", - "testdb", - armsql.SecurityAlertPolicyNameDefault, - armsql.DatabaseSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertsPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Sql_Injection"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("test@microsoft.com"), - to.Ptr("user@microsoft.com")}, - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseSecurityAlertListByDatabase.json -func ExampleDatabaseSecurityAlertPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("securityalert-6852", - "securityalert-2080", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasetables_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databasetables_client_test.go deleted file mode 100644 index 7615df6cf8b3..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasetables_client_test.go +++ /dev/null @@ -1,70 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableListBySchema.json -func ExampleDatabaseTablesClient_NewListBySchemaPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseTablesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySchemaPager("myRG", - "serverName", - "myDatabase", - "dbo", - &armsql.DatabaseTablesClientListBySchemaOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseTableGet.json -func ExampleDatabaseTablesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseTablesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "serverName", - "myDatabase", - "dbo", - "table1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseusages_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseusages_client_test.go deleted file mode 100644 index 4988de486d63..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databaseusages_client_test.go +++ /dev/null @@ -1,44 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/GetDatabaseUsages.json -func ExampleDatabaseUsagesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseUsagesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentrulebaselines_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentrulebaselines_client_test.go deleted file mode 100644 index ca4a361bb954..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentrulebaselines_client_test.go +++ /dev/null @@ -1,115 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineGet.json -func ExampleDatabaseVulnerabilityAssessmentRuleBaselinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityaseessmenttest-4711", - "vulnerabilityaseessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "VA1001", - armsql.VulnerabilityAssessmentPolicyBaselineNameMaster, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineCreate.json -func ExampleDatabaseVulnerabilityAssessmentRuleBaselinesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "VA1001", - armsql.VulnerabilityAssessmentPolicyBaselineNameDefault, - armsql.DatabaseVulnerabilityAssessmentRuleBaseline{ - Properties: &armsql.DatabaseVulnerabilityAssessmentRuleBaselineProperties{ - BaselineResults: []*armsql.DatabaseVulnerabilityAssessmentRuleBaselineItem{ - { - Result: []*string{ - to.Ptr("userA"), - to.Ptr("SELECT")}, - }, - { - Result: []*string{ - to.Ptr("userB"), - to.Ptr("SELECT")}, - }, - { - Result: []*string{ - to.Ptr("userC"), - to.Ptr("SELECT"), - to.Ptr("tableId_4")}, - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentRuleBaselineDelete.json -func ExampleDatabaseVulnerabilityAssessmentRuleBaselinesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentRuleBaselinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "VA1001", - armsql.VulnerabilityAssessmentPolicyBaselineNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessments_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessments_client_test.go deleted file mode 100644 index 7f86e75280e2..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessments_client_test.go +++ /dev/null @@ -1,129 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentGet.json -func ExampleDatabaseVulnerabilityAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentCreateMax.json -func ExampleDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - armsql.DatabaseVulnerabilityAssessment{ - Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - EmailSubscriptionAdmins: to.Ptr(true), - Emails: []*string{ - to.Ptr("email1@mail.com"), - to.Ptr("email2@mail.com")}, - IsEnabled: to.Ptr(true), - }, - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentDelete.json -func ExampleDatabaseVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentListByDatabase.json -func ExampleDatabaseVulnerabilityAssessmentsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentscans_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentscans_client_test.go deleted file mode 100644 index feb50e728370..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_databasevulnerabilityassessmentscans_client_test.go +++ /dev/null @@ -1,122 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScansExecute.json -func ExampleDatabaseVulnerabilityAssessmentScansClient_BeginInitiateScan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginInitiateScan(ctx, - "vulnerabilityassessmenttest-4711", - "vulnerabilityassessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "scan01", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json -func ExampleDatabaseVulnerabilityAssessmentScansClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("vulnerabilityassessmenttest-4711", - "vulnerabilityassessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanRecordsGet.json -func ExampleDatabaseVulnerabilityAssessmentScansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityassessmenttest-4711", - "vulnerabilityassessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "scan001", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseVulnerabilityAssessmentScanExport.json -func ExampleDatabaseVulnerabilityAssessmentScansClient_Export() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Export(ctx, - "vulnerabilityassessmenttest-4799", - "vulnerabilityassessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "scan001", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingpolicies_client_test.go deleted file mode 100644 index 21ea94a34fbd..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingpolicies_client_test.go +++ /dev/null @@ -1,70 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyCreateOrUpdateMax.json -func ExampleDataMaskingPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDataMaskingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "sqlcrudtest-6852", - "sqlcrudtest-2080", - "sqlcrudtest-331", - armsql.DataMaskingPolicy{ - Properties: &armsql.DataMaskingPolicyProperties{ - DataMaskingState: to.Ptr(armsql.DataMaskingStateEnabled), - ExemptPrincipals: to.Ptr("testuser;"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingPolicyGet.json -func ExampleDataMaskingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDataMaskingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-6852", - "sqlcrudtest-2080", - "sqlcrudtest-331", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingrules_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingrules_client_test.go deleted file mode 100644 index 161176297e18..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_datamaskingrules_client_test.go +++ /dev/null @@ -1,79 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleCreateOrUpdateDefaultMax.json -func ExampleDataMaskingRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDataMaskingRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "sqlcrudtest-6852", - "sqlcrudtest-2080", - "sqlcrudtest-331", - "rule1", - armsql.DataMaskingRule{ - Properties: &armsql.DataMaskingRuleProperties{ - AliasName: to.Ptr("nickname"), - ColumnName: to.Ptr("test1"), - MaskingFunction: to.Ptr(armsql.DataMaskingFunctionDefault), - RuleState: to.Ptr(armsql.DataMaskingRuleStateEnabled), - SchemaName: to.Ptr("dbo"), - TableName: to.Ptr("Table_1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/DataMaskingRuleList.json -func ExampleDataMaskingRulesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDataMaskingRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("sqlcrudtest-6852", - "sqlcrudtest-2080", - "sqlcrudtest-331", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_datawarehouseuseractivities_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_datawarehouseuseractivities_client_test.go deleted file mode 100644 index e8d11ad83c3c..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_datawarehouseuseractivities_client_test.go +++ /dev/null @@ -1,68 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetDataWarehouseUserActivities.json -func ExampleDataWarehouseUserActivitiesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDataWarehouseUserActivitiesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.DataWarehouseUserActivityNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListDataWarehouseUserActivities.json -func ExampleDataWarehouseUserActivitiesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDataWarehouseUserActivitiesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_deletedservers_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_deletedservers_client_test.go deleted file mode 100644 index 414f8a7a4fbd..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_deletedservers_client_test.go +++ /dev/null @@ -1,114 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerListBySubscription.json -func ExampleDeletedServersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDeletedServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerGet.json -func ExampleDeletedServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDeletedServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "japaneast", - "sqlcrudtest-d-1414", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerList.json -func ExampleDeletedServersClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDeletedServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("japaneast", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeletedServerRecover.json -func ExampleDeletedServersClient_BeginRecover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDeletedServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRecover(ctx, - "japaneast", - "sqlcrudtest-d-1414", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_distributedavailabilitygroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_distributedavailabilitygroups_client_test.go deleted file mode 100644 index 70e4229f024f..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_distributedavailabilitygroups_client_test.go +++ /dev/null @@ -1,159 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsListByInstance.json -func ExampleDistributedAvailabilityGroupsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDistributedAvailabilityGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("testrg", - "testcl", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsGet.json -func ExampleDistributedAvailabilityGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDistributedAvailabilityGroupsClient("f2669dff-5f08-45dd-b857-b2a60b72cdc9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "testcl", - "dag", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsCreate.json -func ExampleDistributedAvailabilityGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDistributedAvailabilityGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testrg", - "testcl", - "dag", - armsql.DistributedAvailabilityGroup{ - Properties: &armsql.DistributedAvailabilityGroupProperties{ - PrimaryAvailabilityGroupName: to.Ptr("BoxLocalAg1"), - SecondaryAvailabilityGroupName: to.Ptr("testcl"), - SourceEndpoint: to.Ptr("TCP://SERVER:7022"), - TargetDatabase: to.Ptr("testdb"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsDelete.json -func ExampleDistributedAvailabilityGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDistributedAvailabilityGroupsClient("f2669dff-5f08-45dd-b857-b2a60b72cdc9", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testrg", - "testcl", - "dag", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DistributedAvailabilityGroupsUpdate.json -func ExampleDistributedAvailabilityGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewDistributedAvailabilityGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "testrg", - "testcl", - "dag", - armsql.DistributedAvailabilityGroup{ - Properties: &armsql.DistributedAvailabilityGroupProperties{ - ReplicationMode: to.Ptr(armsql.ReplicationModeSync), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpoolactivities_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpoolactivities_client_test.go deleted file mode 100644 index 9f46cbd0cbc9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpoolactivities_client_test.go +++ /dev/null @@ -1,44 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolActivityList.json -func ExampleElasticPoolActivitiesClient_NewListByElasticPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolActivitiesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByElasticPoolPager("sqlcrudtest-4291", - "sqlcrudtest-6574", - "8749", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooldatabaseactivities_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooldatabaseactivities_client_test.go deleted file mode 100644 index 2e31a34f38f9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooldatabaseactivities_client_test.go +++ /dev/null @@ -1,44 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ElasticPoolDatabaseActivityList.json -func ExampleElasticPoolDatabaseActivitiesClient_NewListByElasticPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolDatabaseActivitiesClient("9d4e2ad0-e20b-4464-9219-353bded52513", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByElasticPoolPager("sqlcrudtest-4673", - "sqlcrudtest-603", - "7537", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooloperations_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooloperations_client_test.go deleted file mode 100644 index d9e293f7fc82..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpooloperations_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelElasticPoolOperation.json -func ExampleElasticPoolOperationsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Cancel(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-6661", - "testpool", - "f779414b-e748-4925-8cfe-c8598f7660ae", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListElasticPoolOperations.json -func ExampleElasticPoolOperationsClient_NewListByElasticPoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByElasticPoolPager("sqlcrudtestgroup", - "sqlcrudtestserver", - "testpool", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpools_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpools_client_test.go deleted file mode 100644 index a4d5d9f21d43..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_elasticpools_client_test.go +++ /dev/null @@ -1,240 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsListWithFilter.json -func ExampleElasticPoolsClient_NewListMetricsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricsPager("sqlcrudtest-6730", - "sqlcrudtest-9007", - "3481", - "name/value eq 'cpu_percent' and timeGrain eq '00:10:00' and startTime eq '2017-06-02T18:35:00Z' and endTime eq '2017-06-02T18:55:00Z'", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ElasticPoolMetricsDefinitionsList.json -func ExampleElasticPoolsClient_NewListMetricDefinitionsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMetricDefinitionsPager("sqlcrudtest-6730", - "sqlcrudtest-9007", - "3481", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolListByServer.json -func ExampleElasticPoolsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-2369", - "sqlcrudtest-8069", - &armsql.ElasticPoolsClientListByServerOptions{Skip: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolGet.json -func ExampleElasticPoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-2369", - "sqlcrudtest-8069", - "sqlcrudtest-8102", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/HyperscaleElasticPoolCreateOrUpdateSetHighAvailabilityReplicaCount.json -func ExampleElasticPoolsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-2369", - "sqlcrudtest-8069", - "sqlcrudtest-8102", - armsql.ElasticPool{ - Location: to.Ptr("Japan East"), - Properties: &armsql.ElasticPoolProperties{ - HighAvailabilityReplicaCount: to.Ptr[int32](2), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("HS_Gen5_4"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolDelete.json -func ExampleElasticPoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-3129", - "sqlcrudtest-228", - "sqlcrudtest-3851", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/ElasticPoolUpdateAssignMaintenanceConfiguration.json -func ExampleElasticPoolsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "sqlcrudtest-2369", - "sqlcrudtest-8069", - "sqlcrudtest-8102", - armsql.ElasticPoolUpdate{ - Properties: &armsql.ElasticPoolUpdateProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-08-01-preview/examples/FailoverElasticPool.json -func ExampleElasticPoolsClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewElasticPoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "group1", - "testServer", - "testElasticPool", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_encryptionprotectors_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_encryptionprotectors_client_test.go deleted file mode 100644 index 3164fc80d597..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_encryptionprotectors_client_test.go +++ /dev/null @@ -1,126 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorList.json -func ExampleEncryptionProtectorsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorGet.json -func ExampleEncryptionProtectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.EncryptionProtectorNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorCreateOrUpdateKeyVault.json -func ExampleEncryptionProtectorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.EncryptionProtectorNameCurrent, - armsql.EncryptionProtector{ - Properties: &armsql.EncryptionProtectorProperties{ - AutoRotationEnabled: to.Ptr(false), - ServerKeyName: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/EncryptionProtectorRevalidate.json -func ExampleEncryptionProtectorsClient_BeginRevalidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRevalidate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.EncryptionProtectorNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_endpointcertificates_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_endpointcertificates_client_test.go deleted file mode 100644 index 67012fef2d01..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_endpointcertificates_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesListByInstance.json -func ExampleEndpointCertificatesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewEndpointCertificatesClient("38e0dc56-907f-45ba-a97c-74233baad471", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("testrg", - "testcl", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/EndpointCertificatesGet.json -func ExampleEndpointCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewEndpointCertificatesClient("38e0dc56-907f-45ba-a97c-74233baad471", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "testcl", - "DATABASE_MIRRORING", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_extendeddatabaseblobauditingpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_extendeddatabaseblobauditingpolicies_client_test.go deleted file mode 100644 index 9a373079f601..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_extendeddatabaseblobauditingpolicies_client_test.go +++ /dev/null @@ -1,97 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/DatabaseExtendedAuditingSettingsList.json -func ExampleExtendedDatabaseBlobAuditingPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewExtendedDatabaseBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("blobauditingtest-6852", - "blobauditingtest-2080", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseBlobAuditingGet.json -func ExampleExtendedDatabaseBlobAuditingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewExtendedDatabaseBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "blobauditingtest-6852", - "blobauditingtest-2080", - "testdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedDatabaseAzureMonitorAuditingCreateMin.json -func ExampleExtendedDatabaseBlobAuditingPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewExtendedDatabaseBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "blobauditingtest-4799", - "blobauditingtest-6440", - "testdb", - armsql.ExtendedDatabaseBlobAuditingPolicy{ - Properties: &armsql.ExtendedDatabaseBlobAuditingPolicyProperties{ - IsAzureMonitorTargetEnabled: to.Ptr(true), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_extendedserverblobauditingpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_extendedserverblobauditingpolicies_client_test.go deleted file mode 100644 index 614009eb4849..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_extendedserverblobauditingpolicies_client_test.go +++ /dev/null @@ -1,109 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerExtendedAuditingSettingsList.json -func ExampleExtendedServerBlobAuditingPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewExtendedServerBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("blobauditingtest-4799", - "blobauditingtest-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingGet.json -func ExampleExtendedServerBlobAuditingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewExtendedServerBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "blobauditingtest-4799", - "blobauditingtest-6440", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ExtendedServerBlobAuditingCreateMax.json -func ExampleExtendedServerBlobAuditingPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewExtendedServerBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "blobauditingtest-4799", - "blobauditingtest-6440", - armsql.ExtendedServerBlobAuditingPolicy{ - Properties: &armsql.ExtendedServerBlobAuditingPolicyProperties{ - AuditActionsAndGroups: []*string{ - to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - to.Ptr("BATCH_COMPLETED_GROUP")}, - IsAzureMonitorTargetEnabled: to.Ptr(true), - IsStorageSecondaryKeyInUse: to.Ptr(false), - PredicateExpression: to.Ptr("object_name = 'SensitiveData'"), - QueueDelayMs: to.Ptr[int32](4000), - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_failovergroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_failovergroups_client_test.go deleted file mode 100644 index f51d71a4f9af..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_failovergroups_client_test.go +++ /dev/null @@ -1,228 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupGet.json -func ExampleFailoverGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "failover-group-primary-server", - "failover-group-test", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupCreateOrUpdate.json -func ExampleFailoverGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "failover-group-primary-server", - "failover-group-test-3", - armsql.FailoverGroup{ - Properties: &armsql.FailoverGroupProperties{ - Databases: []*string{ - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1"), - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-2")}, - PartnerServers: []*armsql.PartnerInfo{ - { - ID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-secondary-server"), - }}, - ReadOnlyEndpoint: &armsql.FailoverGroupReadOnlyEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - }, - ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupDelete.json -func ExampleFailoverGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "failover-group-primary-server", - "failover-group-test-1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupUpdate.json -func ExampleFailoverGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "Default", - "failover-group-primary-server", - "failover-group-test-1", - armsql.FailoverGroupUpdate{ - Properties: &armsql.FailoverGroupUpdateProperties{ - Databases: []*string{ - to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/failover-group-primary-server/databases/testdb-1")}, - ReadWriteEndpoint: &armsql.FailoverGroupReadWriteEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](120), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupList.json -func ExampleFailoverGroupsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "failover-group-primary-server", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupFailover.json -func ExampleFailoverGroupsClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "Default", - "failover-group-secondary-server", - "failover-group-test-3", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FailoverGroupForceFailoverAllowDataLoss.json -func ExampleFailoverGroupsClient_BeginForceFailoverAllowDataLoss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginForceFailoverAllowDataLoss(ctx, - "Default", - "failover-group-secondary-server", - "failover-group-test-3", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_firewallrules_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_firewallrules_client_test.go deleted file mode 100644 index fa97241716a0..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_firewallrules_client_test.go +++ /dev/null @@ -1,149 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleGet.json -func ExampleFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - "firewallrulecrudtest-2304", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleCreate.json -func ExampleFirewallRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - "firewallrulecrudtest-5370", - armsql.FirewallRule{ - Properties: &armsql.ServerFirewallRuleProperties{ - EndIPAddress: to.Ptr("0.0.0.3"), - StartIPAddress: to.Ptr("0.0.0.3"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleDelete.json -func ExampleFirewallRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "firewallrulecrudtest-9886", - "firewallrulecrudtest-2368", - "firewallrulecrudtest-7011", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleList.json -func ExampleFirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/FirewallRuleReplace.json -func ExampleFirewallRulesClient_Replace() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Replace(ctx, - "firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - armsql.FirewallRuleList{ - Values: []*armsql.FirewallRule{ - { - Name: to.Ptr("firewallrulecrudtest-5370 "), - Properties: &armsql.ServerFirewallRuleProperties{ - EndIPAddress: to.Ptr("100.0.0.0"), - StartIPAddress: to.Ptr("0.0.0.0"), - }, - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_geobackuppolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_geobackuppolicies_client_test.go deleted file mode 100644 index 064776f4c6f1..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_geobackuppolicies_client_test.go +++ /dev/null @@ -1,98 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesCreateOrUpdate.json -func ExampleGeoBackupPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewGeoBackupPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-5961", - "testdw", - armsql.GeoBackupPolicyNameDefault, - armsql.GeoBackupPolicy{ - Properties: &armsql.GeoBackupPolicyProperties{ - State: to.Ptr(armsql.GeoBackupPolicyStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesGet.json -func ExampleGeoBackupPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewGeoBackupPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-5961", - "testdw", - armsql.GeoBackupPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/GeoBackupPoliciesList.json -func ExampleGeoBackupPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewGeoBackupPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("sqlcrudtest-4799", - "sqlcrudtest-5961", - "testdw", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_instancefailovergroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_instancefailovergroups_client_test.go deleted file mode 100644 index 154535b30a3e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_instancefailovergroups_client_test.go +++ /dev/null @@ -1,193 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupGet.json -func ExampleInstanceFailoverGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstanceFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "Japan East", - "failover-group-test", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupCreateOrUpdate.json -func ExampleInstanceFailoverGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstanceFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "Japan East", - "failover-group-test-3", - armsql.InstanceFailoverGroup{ - Properties: &armsql.InstanceFailoverGroupProperties{ - ManagedInstancePairs: []*armsql.ManagedInstancePairInfo{ - { - PartnerManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-secondary-mngdInstance"), - PrimaryManagedInstanceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/failover-group-primary-mngdInstance"), - }}, - PartnerRegions: []*armsql.PartnerRegionInfo{ - { - Location: to.Ptr("Japan West"), - }}, - ReadOnlyEndpoint: &armsql.InstanceFailoverGroupReadOnlyEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadOnlyEndpointFailoverPolicyDisabled), - }, - ReadWriteEndpoint: &armsql.InstanceFailoverGroupReadWriteEndpoint{ - FailoverPolicy: to.Ptr(armsql.ReadWriteEndpointFailoverPolicyAutomatic), - FailoverWithDataLossGracePeriodMinutes: to.Ptr[int32](480), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupDelete.json -func ExampleInstanceFailoverGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstanceFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "Japan East", - "failover-group-test-1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupList.json -func ExampleInstanceFailoverGroupsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstanceFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("Default", - "Japan East", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupFailover.json -func ExampleInstanceFailoverGroupsClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstanceFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "Default", - "Japan West", - "failover-group-test-3", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InstanceFailoverGroupForceFailoverAllowDataLoss.json -func ExampleInstanceFailoverGroupsClient_BeginForceFailoverAllowDataLoss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstanceFailoverGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginForceFailoverAllowDataLoss(ctx, - "Default", - "Japan West", - "failover-group-test-3", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_instancepools_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_instancepools_client_test.go deleted file mode 100644 index 92fc9b8637a1..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_instancepools_client_test.go +++ /dev/null @@ -1,186 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetInstancePool.json -func ExampleInstancePoolsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstancePoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "testIP", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateInstancePoolMax.json -func ExampleInstancePoolsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstancePoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "group1", - "testIP", - armsql.InstancePool{ - Location: to.Ptr("japaneast"), - Tags: map[string]*string{ - "a": to.Ptr("b"), - }, - Properties: &armsql.InstancePoolProperties{ - LicenseType: to.Ptr(armsql.InstancePoolLicenseTypeLicenseIncluded), - SubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Network/virtualNetworks/myvnet/subnets/mysubnet1"), - VCores: to.Ptr[int32](8), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen5"), - Family: to.Ptr("Gen5"), - Tier: to.Ptr("GeneralPurpose"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteInstancePool.json -func ExampleInstancePoolsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstancePoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "group1", - "testIP", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PatchInstancePool.json -func ExampleInstancePoolsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstancePoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "group1", - "testIP", - armsql.InstancePoolUpdate{ - Tags: map[string]*string{ - "x": to.Ptr("y"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListInstancePoolsByResourceGroup.json -func ExampleInstancePoolsClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstancePoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("group1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListInstancePoolsBySubscriptionId.json -func ExampleInstancePoolsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewInstancePoolsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_ipv6firewallrules_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_ipv6firewallrules_client_test.go deleted file mode 100644 index 472bd9e50245..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_ipv6firewallrules_client_test.go +++ /dev/null @@ -1,117 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleList.json -func ExampleIPv6FirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewIPv6FirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleGet.json -func ExampleIPv6FirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewIPv6FirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - "firewallrulecrudtest-2304", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleCreate.json -func ExampleIPv6FirewallRulesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewIPv6FirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "firewallrulecrudtest-12", - "firewallrulecrudtest-6285", - "firewallrulecrudtest-5370", - armsql.IPv6FirewallRule{ - Properties: &armsql.IPv6ServerFirewallRuleProperties{ - EndIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0003"), - StartIPv6Address: to.Ptr("0000:0000:0000:0000:0000:ffff:0000:0003"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/IPv6FirewallRuleDelete.json -func ExampleIPv6FirewallRulesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewIPv6FirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "firewallrulecrudtest-9886", - "firewallrulecrudtest-2368", - "firewallrulecrudtest-7011", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobagents_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobagents_client_test.go deleted file mode 100644 index 6b5c5290e4f3..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobagents_client_test.go +++ /dev/null @@ -1,157 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobAgentsByServer.json -func ExampleJobAgentsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("group1", - "server1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobAgent.json -func ExampleJobAgentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobAgent.json -func ExampleJobAgentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "group1", - "server1", - "agent1", - armsql.JobAgent{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.JobAgentProperties{ - DatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/databases/db1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobAgent.json -func ExampleJobAgentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "group1", - "server1", - "agent1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateJobAgent.json -func ExampleJobAgentsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "group1", - "server1", - "agent1", - armsql.JobAgentUpdate{ - Tags: map[string]*string{ - "mytag1": to.Ptr("myvalue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobcredentials_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobcredentials_client_test.go deleted file mode 100644 index a7b72a6a7a5c..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobcredentials_client_test.go +++ /dev/null @@ -1,121 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobCredentialsByAgent.json -func ExampleJobCredentialsClient_NewListByAgentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobCredentialsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAgentPager("group1", - "server1", - "agent1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobCredential.json -func ExampleJobCredentialsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobCredentialsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "cred1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobCredential.json -func ExampleJobCredentialsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobCredentialsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "group1", - "server1", - "agent1", - "cred1", - armsql.JobCredential{ - Properties: &armsql.JobCredentialProperties{ - Password: to.Ptr(""), - Username: to.Ptr("myuser"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobCredential.json -func ExampleJobCredentialsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobCredentialsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "group1", - "server1", - "agent1", - "cred1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobexecutions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobexecutions_client_test.go deleted file mode 100644 index 3eaea9f7640c..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobexecutions_client_test.go +++ /dev/null @@ -1,194 +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 armsql_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByAgentWithFilter.json -func ExampleJobExecutionsClient_NewListByAgentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAgentPager("group1", - "server1", - "agent1", - &armsql.JobExecutionsClientListByAgentOptions{CreateTimeMin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:00:00Z"); return t }()), - CreateTimeMax: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:05:00Z"); return t }()), - EndTimeMin: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:20:00Z"); return t }()), - EndTimeMax: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-03-21T19:25:00Z"); return t }()), - IsActive: to.Ptr(false), - Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelJobExecution.json -func ExampleJobExecutionsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Cancel(ctx, - "group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateJobExecution.json -func ExampleJobExecutionsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "group1", - "server1", - "agent1", - "job1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionsByJob.json -func ExampleJobExecutionsClient_NewListByJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByJobPager("group1", - "server1", - "agent1", - "job1", - &armsql.JobExecutionsClientListByJobOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecution.json -func ExampleJobExecutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobExecution.json -func ExampleJobExecutionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobs_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobs_client_test.go deleted file mode 100644 index eb774b46ac0d..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobs_client_test.go +++ /dev/null @@ -1,129 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobsByAgent.json -func ExampleJobsClient_NewListByAgentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAgentPager("group1", - "server1", - "agent1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJob.json -func ExampleJobsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "job1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobMax.json -func ExampleJobsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "group1", - "server1", - "agent1", - "job1", - armsql.Job{ - Properties: &armsql.JobProperties{ - Description: to.Ptr("my favourite job"), - Schedule: &armsql.JobSchedule{ - Type: to.Ptr(armsql.JobScheduleTypeRecurring), - Enabled: to.Ptr(true), - EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T23:59:59Z"); return t }()), - Interval: to.Ptr("PT5M"), - StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2015-09-24T18:30:01Z"); return t }()), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJob.json -func ExampleJobsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "group1", - "server1", - "agent1", - "job1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobstepexecutions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobstepexecutions_client_test.go deleted file mode 100644 index b86d9d5f29d2..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobstepexecutions_client_test.go +++ /dev/null @@ -1,79 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionSteps.json -func ExampleJobStepExecutionsClient_NewListByJobExecutionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByJobExecutionPager("group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - &armsql.JobStepExecutionsClientListByJobExecutionOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionStep.json -func ExampleJobStepExecutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - "step1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobsteps_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobsteps_client_test.go deleted file mode 100644 index 0e154b291172..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobsteps_client_test.go +++ /dev/null @@ -1,203 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByVersion.json -func ExampleJobStepsClient_NewListByVersionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByVersionPager("group1", - "server1", - "agent1", - "job1", - 1, - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByVersion.json -func ExampleJobStepsClient_GetByVersion() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByVersion(ctx, - "group1", - "server1", - "agent1", - "job1", - 1, - "step1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobStepsByJob.json -func ExampleJobStepsClient_NewListByJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByJobPager("group1", - "server1", - "agent1", - "job1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobStepByJob.json -func ExampleJobStepsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "job1", - "step1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobStepMax.json -func ExampleJobStepsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "group1", - "server1", - "agent1", - "job1", - "step1", - armsql.JobStep{ - Properties: &armsql.JobStepProperties{ - Action: &armsql.JobStepAction{ - Type: to.Ptr(armsql.JobStepActionTypeTSQL), - Source: to.Ptr(armsql.JobStepActionSourceInline), - Value: to.Ptr("select 2"), - }, - Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred1"), - ExecutionOptions: &armsql.JobStepExecutionOptions{ - InitialRetryIntervalSeconds: to.Ptr[int32](11), - MaximumRetryIntervalSeconds: to.Ptr[int32](222), - RetryAttempts: to.Ptr[int32](42), - RetryIntervalBackoffMultiplier: to.Ptr[float32](3), - TimeoutSeconds: to.Ptr[int32](1234), - }, - Output: &armsql.JobStepOutput{ - Type: to.Ptr(armsql.JobStepOutputTypeSQLDatabase), - Credential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/cred0"), - DatabaseName: to.Ptr("database3"), - ResourceGroupName: to.Ptr("group3"), - SchemaName: to.Ptr("myschema1234"), - ServerName: to.Ptr("server3"), - SubscriptionID: to.Ptr("3501b905-a848-4b5d-96e8-b253f62d735a"), - TableName: to.Ptr("mytable5678"), - }, - StepID: to.Ptr[int32](1), - TargetGroup: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/targetGroups/targetGroup1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobStep.json -func ExampleJobStepsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobStepsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "group1", - "server1", - "agent1", - "job1", - "step1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetexecutions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetexecutions_client_test.go deleted file mode 100644 index a0f1641e425f..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetexecutions_client_test.go +++ /dev/null @@ -1,117 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByExecution.json -func ExampleJobTargetExecutionsClient_NewListByJobExecutionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByJobExecutionPager("group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - &armsql.JobTargetExecutionsClientListByJobExecutionOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobExecutionTargetsByStep.json -func ExampleJobTargetExecutionsClient_NewListByStepPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByStepPager("group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - "step1", - &armsql.JobTargetExecutionsClientListByStepOptions{CreateTimeMin: nil, - CreateTimeMax: nil, - EndTimeMin: nil, - EndTimeMax: nil, - IsActive: nil, - Skip: nil, - Top: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobExecutionTarget.json -func ExampleJobTargetExecutionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetExecutionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "job1", - "5A86BF65-43AC-F258-2524-9E92992F97CA", - "step1", - "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetgroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetgroups_client_test.go deleted file mode 100644 index 1b96f037bd37..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobtargetgroups_client_test.go +++ /dev/null @@ -1,146 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobTargetGroups.json -func ExampleJobTargetGroupsClient_NewListByAgentPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByAgentPager("group1", - "server1", - "agent1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobTargetGroup.json -func ExampleJobTargetGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "targetGroup1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateJobTargetGroupMax.json -func ExampleJobTargetGroupsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "group1", - "server1", - "agent1", - "targetGroup1", - armsql.JobTargetGroup{ - Properties: &armsql.JobTargetGroupProperties{ - Members: []*armsql.JobTarget{ - { - Type: to.Ptr(armsql.JobTargetTypeSQLDatabase), - DatabaseName: to.Ptr("database1"), - MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeExclude), - ServerName: to.Ptr("server1"), - }, - { - Type: to.Ptr(armsql.JobTargetTypeSQLServer), - MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - ServerName: to.Ptr("server1"), - }, - { - Type: to.Ptr(armsql.JobTargetTypeSQLElasticPool), - ElasticPoolName: to.Ptr("pool1"), - MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - ServerName: to.Ptr("server2"), - }, - { - Type: to.Ptr(armsql.JobTargetTypeSQLShardMap), - MembershipType: to.Ptr(armsql.JobTargetGroupMembershipTypeInclude), - RefreshCredential: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/server1/jobAgents/agent1/credentials/testCredential"), - ServerName: to.Ptr("server3"), - ShardMapName: to.Ptr("shardMap1"), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteJobTargetGroup.json -func ExampleJobTargetGroupsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobTargetGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "group1", - "server1", - "agent1", - "targetGroup1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobversions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_jobversions_client_test.go deleted file mode 100644 index 495c5eaaf491..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_jobversions_client_test.go +++ /dev/null @@ -1,70 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListJobVersions.json -func ExampleJobVersionsClient_NewListByJobPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByJobPager("group1", - "server1", - "agent1", - "job1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetJobVersion.json -func ExampleJobVersionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewJobVersionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "server1", - "agent1", - "job1", - 1, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_ledgerdigestuploads_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_ledgerdigestuploads_client_test.go deleted file mode 100644 index 3f3b419a09a7..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_ledgerdigestuploads_client_test.go +++ /dev/null @@ -1,130 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsGet.json -func ExampleLedgerDigestUploadsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLedgerDigestUploadsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "ledgertestrg", - "ledgertestserver", - "testdb", - armsql.LedgerDigestUploadsNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsEnable.json -func ExampleLedgerDigestUploadsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLedgerDigestUploadsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "ledgertestrg", - "ledgertestserver", - "testdb", - armsql.LedgerDigestUploadsNameCurrent, - armsql.LedgerDigestUploads{ - Properties: &armsql.LedgerDigestUploadsProperties{ - DigestStorageEndpoint: to.Ptr("https://MyAccount.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsList.json -func ExampleLedgerDigestUploadsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLedgerDigestUploadsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("ledgertestrg", - "ledgertestserver", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/LedgerDigestUploadsDisable.json -func ExampleLedgerDigestUploadsClient_BeginDisable() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLedgerDigestUploadsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDisable(ctx, - "ledgertestrg", - "ledgertestserver", - "testdb", - armsql.LedgerDigestUploadsNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionbackups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionbackups_client_test.go deleted file mode 100644 index ffac0a224ebf..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionbackups_client_test.go +++ /dev/null @@ -1,429 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupCopy.json -func ExampleLongTermRetentionBackupsClient_BeginCopy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCopy(ctx, - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - armsql.CopyLongTermRetentionBackupParameters{ - Properties: &armsql.CopyLongTermRetentionBackupParametersProperties{ - TargetBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - TargetDatabaseName: to.Ptr("testDatabase2"), - TargetServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver2"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupUpdate.json -func ExampleLongTermRetentionBackupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - armsql.UpdateLongTermRetentionBackupParameters{ - Properties: &armsql.UpdateLongTermRetentionBackupParametersProperties{ - RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupGet.json -func ExampleLongTermRetentionBackupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupDelete.json -func ExampleLongTermRetentionBackupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByDatabase.json -func ExampleLongTermRetentionBackupsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("japaneast", - "testserver", - "testDatabase", - &armsql.LongTermRetentionBackupsClientListByDatabaseOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByLocation.json -func ExampleLongTermRetentionBackupsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("japaneast", - &armsql.LongTermRetentionBackupsClientListByLocationOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/LongTermRetentionBackupListByServer.json -func ExampleLongTermRetentionBackupsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("japaneast", - "testserver", - &armsql.LongTermRetentionBackupsClientListByServerOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupCopy.json -func ExampleLongTermRetentionBackupsClient_BeginCopyByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCopyByResourceGroup(ctx, - "testResourceGroup", - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - armsql.CopyLongTermRetentionBackupParameters{ - Properties: &armsql.CopyLongTermRetentionBackupParametersProperties{ - TargetBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - TargetDatabaseName: to.Ptr("testDatabase2"), - TargetServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver2"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupUpdate.json -func ExampleLongTermRetentionBackupsClient_BeginUpdateByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdateByResourceGroup(ctx, - "testResourceGroup", - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - armsql.UpdateLongTermRetentionBackupParameters{ - Properties: &armsql.UpdateLongTermRetentionBackupParametersProperties{ - RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupGet.json -func ExampleLongTermRetentionBackupsClient_GetByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByResourceGroup(ctx, - "testResourceGroup", - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupDelete.json -func ExampleLongTermRetentionBackupsClient_BeginDeleteByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteByResourceGroup(ctx, - "testResourceGroup", - "japaneast", - "testserver", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByDatabase.json -func ExampleLongTermRetentionBackupsClient_NewListByResourceGroupDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupDatabasePager("testResourceGroup", - "japaneast", - "testserver", - "testDatabase", - &armsql.LongTermRetentionBackupsClientListByResourceGroupDatabaseOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByLocation.json -func ExampleLongTermRetentionBackupsClient_NewListByResourceGroupLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupLocationPager("testResourceGroup", - "japaneast", - &armsql.LongTermRetentionBackupsClientListByResourceGroupLocationOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedLongTermRetentionBackupListByServer.json -func ExampleLongTermRetentionBackupsClient_NewListByResourceGroupServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupServerPager("testResourceGroup", - "japaneast", - "testserver", - &armsql.LongTermRetentionBackupsClientListByResourceGroupServerOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionmanagedinstancebackups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionmanagedinstancebackups_client_test.go deleted file mode 100644 index d9b2c957510e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionmanagedinstancebackups_client_test.go +++ /dev/null @@ -1,290 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupGet.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "japaneast", - "testInstance", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupDelete.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "japaneast", - "testInstance", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByDatabase.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("japaneast", - "testInstance", - "testDatabase", - &armsql.LongTermRetentionManagedInstanceBackupsClientListByDatabaseOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByInstance.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("japaneast", - "testInstance", - &armsql.LongTermRetentionManagedInstanceBackupsClientListByInstanceOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceLongTermRetentionBackupListByLocation.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("japaneast", - &armsql.LongTermRetentionManagedInstanceBackupsClientListByLocationOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupGet.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_GetByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByResourceGroup(ctx, - "testResourceGroup", - "japaneast", - "testInstance", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupDelete.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_BeginDeleteByResourceGroup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeleteByResourceGroup(ctx, - "testResourceGroup", - "japaneast", - "testInstance", - "testDatabase", - "55555555-6666-7777-8888-999999999999;131637960820000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByDatabase.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByResourceGroupDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupDatabasePager("testResourceGroup", - "japaneast", - "testInstance", - "testDatabase", - &armsql.LongTermRetentionManagedInstanceBackupsClientListByResourceGroupDatabaseOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByInstance.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByResourceGroupInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupInstancePager("testResourceGroup", - "japaneast", - "testInstance", - &armsql.LongTermRetentionManagedInstanceBackupsClientListByResourceGroupInstanceOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ResourceGroupBasedManagedInstanceLongTermRetentionBackupListByLocation.json -func ExampleLongTermRetentionManagedInstanceBackupsClient_NewListByResourceGroupLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionManagedInstanceBackupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupLocationPager("testResourceGroup", - "japaneast", - &armsql.LongTermRetentionManagedInstanceBackupsClientListByResourceGroupLocationOptions{OnlyLatestPerDatabase: nil, - DatabaseState: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionpolicies_client_test.go deleted file mode 100644 index 86ebbbc4fb1b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_longtermretentionpolicies_client_test.go +++ /dev/null @@ -1,105 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyGet.json -func ExampleLongTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "resourceGroup", - "testserver", - "testDatabase", - armsql.LongTermRetentionPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyCreateOrUpdate.json -func ExampleLongTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroup", - "testserver", - "testDatabase", - armsql.LongTermRetentionPolicyNameDefault, - armsql.LongTermRetentionPolicy{ - Properties: &armsql.BaseLongTermRetentionPolicyProperties{ - MonthlyRetention: to.Ptr("P1Y"), - WeekOfYear: to.Ptr[int32](5), - WeeklyRetention: to.Ptr("P1M"), - YearlyRetention: to.Ptr("P5Y"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/LongTermRetentionPolicyListByDatabase.json -func ExampleLongTermRetentionPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewLongTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("resourceGroup", - "testserver", - "testDatabase", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindowoptions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindowoptions_client_test.go deleted file mode 100644 index 809911a9e3cb..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindowoptions_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindowOptions.json -func ExampleMaintenanceWindowOptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewMaintenanceWindowOptionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "current", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindows_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindows_client_test.go deleted file mode 100644 index 8d4ef52de1d3..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_maintenancewindows_client_test.go +++ /dev/null @@ -1,74 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetMaintenanceWindows.json -func ExampleMaintenanceWindowsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewMaintenanceWindowsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "current", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateMaintenanceWindows.json -func ExampleMaintenanceWindowsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewMaintenanceWindowsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdwdb", - "current", - armsql.MaintenanceWindows{ - Properties: &armsql.MaintenanceWindowsProperties{ - TimeRanges: []*armsql.MaintenanceWindowTimeRange{ - { - DayOfWeek: to.Ptr(armsql.DayOfWeekSaturday), - Duration: to.Ptr("PT60M"), - StartTime: to.Ptr("00:00:00"), - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedbackupshorttermretentionpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedbackupshorttermretentionpolicies_client_test.go deleted file mode 100644 index 0f74df9ee8c8..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedbackupshorttermretentionpolicies_client_test.go +++ /dev/null @@ -1,135 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicy.json -func ExampleManagedBackupShortTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - armsql.ManagedShortTermRetentionPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicy.json -func ExampleManagedBackupShortTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroup", - "testsvr", - "testdb", - armsql.ManagedShortTermRetentionPolicyNameDefault, - armsql.ManagedBackupShortTermRetentionPolicy{ - Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - RetentionDays: to.Ptr[int32](14), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicy.json -func ExampleManagedBackupShortTermRetentionPoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "resourceGroup", - "testsvr", - "testdb", - armsql.ManagedShortTermRetentionPolicyNameDefault, - armsql.ManagedBackupShortTermRetentionPolicy{ - Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - RetentionDays: to.Ptr[int32](14), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicy.json -func ExampleManagedBackupShortTermRetentionPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasecolumns_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasecolumns_client_test.go deleted file mode 100644 index d40d92a46bb9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasecolumns_client_test.go +++ /dev/null @@ -1,111 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedColumnsListByDatabaseMax.json -func ExampleManagedDatabaseColumnsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseColumnsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("myRG", - "serverName", - "myDatabase", - &armsql.ManagedDatabaseColumnsClientListByDatabaseOptions{Schema: []string{ - "dbo"}, - Table: []string{ - "customer", - "address"}, - Column: []string{ - "username"}, - OrderBy: []string{ - "schema asc", - "table", - "column desc"}, - Skiptoken: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnListByTable.json -func ExampleManagedDatabaseColumnsClient_NewListByTablePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseColumnsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTablePager("myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "table1", - &armsql.ManagedDatabaseColumnsClientListByTableOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnGet.json -func ExampleManagedDatabaseColumnsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseColumnsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "table1", - "column1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasequeries_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasequeries_client_test.go deleted file mode 100644 index a0a16bde27d4..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasequeries_client_test.go +++ /dev/null @@ -1,72 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryGet.json -func ExampleManagedDatabaseQueriesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseQueriesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "database_1", - "42", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceQueryStatisticsList.json -func ExampleManagedDatabaseQueriesClient_NewListByQueryPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseQueriesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByQueryPager("sqlcrudtest-7398", - "sqlcrudtest-4645", - "database_1", - "42", - &armsql.ManagedDatabaseQueriesClientListByQueryOptions{StartTime: nil, - EndTime: nil, - Interval: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserecommendedsensitivitylabels_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserecommendedsensitivitylabels_client_test.go deleted file mode 100644 index cb64618822e5..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserecommendedsensitivitylabels_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsRecommendedUpdate.json -func ExampleManagedDatabaseRecommendedSensitivityLabelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseRecommendedSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - armsql.RecommendedSensitivityLabelUpdateList{ - Operations: []*armsql.RecommendedSensitivityLabelUpdate{ - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column1"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindEnable), - Table: to.Ptr("table1"), - }, - }, - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column2"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindDisable), - Table: to.Ptr("table2"), - }, - }, - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("Column3"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindDisable), - Table: to.Ptr("Table1"), - }, - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserestoredetails_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserestoredetails_client_test.go deleted file mode 100644 index 65b84b194bc5..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaserestoredetails_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRestoreDetails.json -func ExampleManagedDatabaseRestoreDetailsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseRestoreDetailsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - "testdb", - armsql.RestoreDetailsNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabases_client_test.go deleted file mode 100644 index 6eeb0a42d16f..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabases_client_test.go +++ /dev/null @@ -1,216 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseListByManagedInstance.json -func ExampleManagedDatabasesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("Test1", - "managedInstance", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseGet.json -func ExampleManagedDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Test1", - "managedInstance", - "managedDatabase", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCreateRestoreExternalBackup.json -func ExampleManagedDatabasesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - "managedDatabase", - armsql.ManagedDatabase{ - Location: to.Ptr("southeastasia"), - Properties: &armsql.ManagedDatabaseProperties{ - AutoCompleteRestore: to.Ptr(true), - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - CreateMode: to.Ptr(armsql.ManagedDatabaseCreateModeRestoreExternalBackup), - LastBackupName: to.Ptr("last_backup_name"), - StorageContainerSasToken: to.Ptr("sv=2015-12-11&sr=c&sp=rl&sig=1234"), - StorageContainerURI: to.Ptr("https://myaccountname.blob.core.windows.net/backups"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseDelete.json -func ExampleManagedDatabasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - "testdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseUpdateMax.json -func ExampleManagedDatabasesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - "testdb", - armsql.ManagedDatabaseUpdate{ - Tags: map[string]*string{ - "tagKey1": to.Ptr("TagValue1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseCompleteExternalRestore.json -func ExampleManagedDatabasesClient_BeginCompleteRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCompleteRestore(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - armsql.CompleteDatabaseRestoreDefinition{ - LastBackupName: to.Ptr("testdb1_log4"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/InaccessibleManagedDatabaseListByManagedInstance.json -func ExampleManagedDatabasesClient_NewListInaccessibleByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListInaccessibleByInstancePager("testrg", - "testcl", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaseschemas_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaseschemas_client_test.go deleted file mode 100644 index 2059c0b9a32b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabaseschemas_client_test.go +++ /dev/null @@ -1,68 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaListByDatabase.json -func ExampleManagedDatabaseSchemasClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSchemasClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("myRG", - "myManagedInstanceName", - "myDatabase", - &armsql.ManagedDatabaseSchemasClientListByDatabaseOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSchemaGet.json -func ExampleManagedDatabaseSchemasClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSchemasClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityalertpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityalertpolicies_client_test.go deleted file mode 100644 index 70b2d7655211..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityalertpolicies_client_test.go +++ /dev/null @@ -1,108 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertGet.json -func ExampleManagedDatabaseSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "securityalert-6852", - "securityalert-2080", - "testdb", - armsql.SecurityAlertPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertCreateMax.json -func ExampleManagedDatabaseSecurityAlertPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "securityalert-4799", - "securityalert-6440", - "testdb", - armsql.SecurityAlertPolicyNameDefault, - armsql.ManagedDatabaseSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Sql_Injection"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("test@contoso.com"), - to.Ptr("user@contoso.com")}, - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.SecurityAlertPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityAlertListByDatabase.json -func ExampleManagedDatabaseSecurityAlertPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("securityalert-6852", - "securityalert-2080", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityevents_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityevents_client_test.go deleted file mode 100644 index 7165f705a4f0..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesecurityevents_client_test.go +++ /dev/null @@ -1,49 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSecurityEventsGetMax.json -func ExampleManagedDatabaseSecurityEventsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSecurityEventsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("testrg", - "testcl", - "database1", - &armsql.ManagedDatabaseSecurityEventsClientListByDatabaseOptions{Filter: to.Ptr("ShowServerRecords eq true"), - Skip: to.Ptr[int32](0), - Top: to.Ptr[int32](1), - Skiptoken: to.Ptr("eyJCbG9iTmFtZURhdGVUaW1lIjoiXC9EYXRlKDE1MTIyODg4MTIwMTArMDIwMClcLyIsIkJsb2JOYW1lUm9sbG92ZXJJbmRleCI6IjAiLCJFbmREYXRlIjoiXC9EYXRlKDE1MTI0NjYyMDA1MjkpXC8iLCJJc1NraXBUb2tlblNldCI6ZmFsc2UsIklzVjJCbG9iVGltZUZvcm1hdCI6dHJ1ZSwiU2hvd1NlcnZlclJlY29yZHMiOmZhbHNlLCJTa2lwVmFsdWUiOjAsIlRha2VWYWx1ZSI6MTB9"), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesensitivitylabels_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesensitivitylabels_client_test.go deleted file mode 100644 index 66d929de8db1..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasesensitivitylabels_client_test.go +++ /dev/null @@ -1,276 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelGet.json -func ExampleManagedDatabaseSensitivityLabelsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "myTable", - "myColumn", - armsql.SensitivityLabelSourceCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelCreate.json -func ExampleManagedDatabaseSensitivityLabelsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "myTable", - "myColumn", - armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("PhoneNumber"), - InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - LabelName: to.Ptr("PII"), - Rank: to.Ptr(armsql.SensitivityLabelRankHigh), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseColumnSensitivityLabelDelete.json -func ExampleManagedDatabaseSensitivityLabelsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "myTable", - "myColumn", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelDisable.json -func ExampleManagedDatabaseSensitivityLabelsClient_DisableRecommendation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DisableRecommendation(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "myTable", - "myColumn", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseRecommendedColumnSensitivityLabelEnable.json -func ExampleManagedDatabaseSensitivityLabelsClient_EnableRecommendation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.EnableRecommendation(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "myTable", - "myColumn", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseCurrent.json -func ExampleManagedDatabaseSensitivityLabelsClient_NewListCurrentByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListCurrentByDatabasePager("myRG", - "myManagedInstanceName", - "myDatabase", - &armsql.ManagedDatabaseSensitivityLabelsClientListCurrentByDatabaseOptions{SkipToken: nil, - Count: nil, - Filter: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsCurrentUpdate.json -func ExampleManagedDatabaseSensitivityLabelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - armsql.SensitivityLabelUpdateList{ - Operations: []*armsql.SensitivityLabelUpdate{ - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column1"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindSet), - SensitivityLabel: &armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("Financial"), - InformationTypeID: to.Ptr("1D3652D6-422C-4115-82F1-65DAEBC665C8"), - LabelID: to.Ptr("3A477B16-9423-432B-AA97-6069B481CEC3"), - LabelName: to.Ptr("Highly Confidential"), - }, - }, - Table: to.Ptr("table1"), - }, - }, - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column2"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindSet), - SensitivityLabel: &armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("PhoneNumber"), - InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - LabelName: to.Ptr("PII"), - }, - }, - Table: to.Ptr("table2"), - }, - }, - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("Column3"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindRemove), - Table: to.Ptr("Table1"), - }, - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseSensitivityLabelsListByDatabaseRecommended.json -func ExampleManagedDatabaseSensitivityLabelsClient_NewListRecommendedByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListRecommendedByDatabasePager("myRG", - "myManagedInstanceName", - "myDatabase", - &armsql.ManagedDatabaseSensitivityLabelsClientListRecommendedByDatabaseOptions{SkipToken: nil, - IncludeDisabledRecommendations: nil, - Filter: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetables_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetables_client_test.go deleted file mode 100644 index 8bb2a6341c34..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetables_client_test.go +++ /dev/null @@ -1,70 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableListBySchema.json -func ExampleManagedDatabaseTablesClient_NewListBySchemaPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseTablesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySchemaPager("myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - &armsql.ManagedDatabaseTablesClientListBySchemaOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseTableGet.json -func ExampleManagedDatabaseTablesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseTablesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "myManagedInstanceName", - "myDatabase", - "dbo", - "table1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetransparentdataencryption_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetransparentdataencryption_client_test.go deleted file mode 100644 index 4c0b3fa42563..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasetransparentdataencryption_client_test.go +++ /dev/null @@ -1,98 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionGet.json -func ExampleManagedDatabaseTransparentDataEncryptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseTransparentDataEncryptionClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "security-tde-resourcegroup", - "securitytde", - "testdb", - armsql.TransparentDataEncryptionNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionUpdate.json -func ExampleManagedDatabaseTransparentDataEncryptionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseTransparentDataEncryptionClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "securitytde-42-rg", - "securitytde-42", - "testdb", - armsql.TransparentDataEncryptionNameCurrent, - armsql.ManagedTransparentDataEncryption{ - Properties: &armsql.ManagedTransparentDataEncryptionProperties{ - State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedTransparentDataEncryptionList.json -func ExampleManagedDatabaseTransparentDataEncryptionClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseTransparentDataEncryptionClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("security-tde-resourcegroup", - "securitytde", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentrulebaselines_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentrulebaselines_client_test.go deleted file mode 100644 index 8eaa451aa4a9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentrulebaselines_client_test.go +++ /dev/null @@ -1,115 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineGet.json -func ExampleManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityaseessmenttest-4711", - "vulnerabilityaseessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "VA1001", - armsql.VulnerabilityAssessmentPolicyBaselineNameMaster, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineCreate.json -func ExampleManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "VA1001", - armsql.VulnerabilityAssessmentPolicyBaselineNameDefault, - armsql.DatabaseVulnerabilityAssessmentRuleBaseline{ - Properties: &armsql.DatabaseVulnerabilityAssessmentRuleBaselineProperties{ - BaselineResults: []*armsql.DatabaseVulnerabilityAssessmentRuleBaselineItem{ - { - Result: []*string{ - to.Ptr("userA"), - to.Ptr("SELECT")}, - }, - { - Result: []*string{ - to.Ptr("userB"), - to.Ptr("SELECT")}, - }, - { - Result: []*string{ - to.Ptr("userC"), - to.Ptr("SELECT"), - to.Ptr("tableId_4")}, - }}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentRuleBaselineDelete.json -func ExampleManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentRuleBaselinesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "VA1001", - armsql.VulnerabilityAssessmentPolicyBaselineNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessments_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessments_client_test.go deleted file mode 100644 index 18d269f4de41..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessments_client_test.go +++ /dev/null @@ -1,128 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentGet.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentCreateMax.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - armsql.DatabaseVulnerabilityAssessment{ - Properties: &armsql.DatabaseVulnerabilityAssessmentProperties{ - RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - EmailSubscriptionAdmins: to.Ptr(true), - Emails: []*string{ - to.Ptr("email1@mail.com"), - to.Ptr("email2@mail.com")}, - IsEnabled: to.Ptr(true), - }, - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentDelete.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentListByDatabase.json -func ExampleManagedDatabaseVulnerabilityAssessmentsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentscans_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentscans_client_test.go deleted file mode 100644 index a2b6a8958ea7..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_manageddatabasevulnerabilityassessmentscans_client_test.go +++ /dev/null @@ -1,122 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScansExecute.json -func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_BeginInitiateScan() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginInitiateScan(ctx, - "vulnerabilityassessmenttest-4711", - "vulnerabilityassessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "scan01", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanExport.json -func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_Export() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Export(ctx, - "vulnerabilityassessmenttest-4799", - "vulnerabilityassessmenttest-6440", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "scan001", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsListByDatabase.json -func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("vulnerabilityassessmenttest-4711", - "vulnerabilityassessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedDatabaseVulnerabilityAssessmentScanRecordsGet.json -func ExampleManagedDatabaseVulnerabilityAssessmentScansClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedDatabaseVulnerabilityAssessmentScansClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityassessmenttest-4711", - "vulnerabilityassessmenttest-6411", - "testdb", - armsql.VulnerabilityAssessmentNameDefault, - "scan001", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceadministrators_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceadministrators_client_test.go deleted file mode 100644 index d2791389a5d7..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceadministrators_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorListByInstance.json -func ExampleManagedInstanceAdministratorsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("Default-SQL-SouthEastAsia", - "managedInstance", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorGet.json -func ExampleManagedInstanceAdministratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - armsql.AdministratorNameActiveDirectory, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorCreate.json -func ExampleManagedInstanceAdministratorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - armsql.AdministratorNameActiveDirectory, - armsql.ManagedInstanceAdministrator{ - Properties: &armsql.ManagedInstanceAdministratorProperties{ - AdministratorType: to.Ptr(armsql.ManagedInstanceAdministratorTypeActiveDirectory), - Login: to.Ptr("bob@contoso.com"), - Sid: to.Ptr("44444444-3333-2222-1111-000000000000"), - TenantID: to.Ptr("55555555-4444-3333-2222-111111111111"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAdministratorDelete.json -func ExampleManagedInstanceAdministratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - armsql.AdministratorNameActiveDirectory, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceazureadonlyauthentications_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceazureadonlyauthentications_client_test.go deleted file mode 100644 index b189add1e479..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceazureadonlyauthentications_client_test.go +++ /dev/null @@ -1,124 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthGet.json -func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - armsql.AuthenticationNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthCreateOrUpdate.json -func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - armsql.AuthenticationNameDefault, - armsql.ManagedInstanceAzureADOnlyAuthentication{ - Properties: &armsql.ManagedInstanceAzureADOnlyAuthProperties{ - AzureADOnlyAuthentication: to.Ptr(false), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthDelete.json -func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default-SQL-SouthEastAsia", - "managedInstance", - armsql.AuthenticationNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceAzureADOnlyAuthListByInstance.json -func ExampleManagedInstanceAzureADOnlyAuthenticationsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("Default-SQL-SouthEastAsia", - "managedInstance", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceencryptionprotectors_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceencryptionprotectors_client_test.go deleted file mode 100644 index 7682fcd3257c..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceencryptionprotectors_client_test.go +++ /dev/null @@ -1,126 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorRevalidate.json -func ExampleManagedInstanceEncryptionProtectorsClient_BeginRevalidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRevalidate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.EncryptionProtectorNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorList.json -func ExampleManagedInstanceEncryptionProtectorsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorGet.json -func ExampleManagedInstanceEncryptionProtectorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.EncryptionProtectorNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceEncryptionProtectorCreateOrUpdateKeyVault.json -func ExampleManagedInstanceEncryptionProtectorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceEncryptionProtectorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.EncryptionProtectorNameCurrent, - armsql.ManagedInstanceEncryptionProtector{ - Properties: &armsql.ManagedInstanceEncryptionProtectorProperties{ - AutoRotationEnabled: to.Ptr(false), - ServerKeyName: to.Ptr("someVault_someKey_01234567890123456789012345678901"), - ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancekeys_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancekeys_client_test.go deleted file mode 100644 index fc784472d9ec..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancekeys_client_test.go +++ /dev/null @@ -1,125 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyList.json -func ExampleManagedInstanceKeysClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("sqlcrudtest-7398", - "sqlcrudtest-4645", - &armsql.ManagedInstanceKeysClientListByInstanceOptions{Filter: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyGet.json -func ExampleManagedInstanceKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "someVault_someKey_01234567890123456789012345678901", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyCreateOrUpdate.json -func ExampleManagedInstanceKeysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "someVault_someKey_01234567890123456789012345678901", - armsql.ManagedInstanceKey{ - Properties: &armsql.ManagedInstanceKeyProperties{ - ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceKeyDelete.json -func ExampleManagedInstanceKeysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "someVault_someKey_01234567890123456789012345678901", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancelongtermretentionpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancelongtermretentionpolicies_client_test.go deleted file mode 100644 index 9f00a7f84eba..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancelongtermretentionpolicies_client_test.go +++ /dev/null @@ -1,105 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyGet.json -func ExampleManagedInstanceLongTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceLongTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testResourceGroup", - "testInstance", - "testDatabase", - armsql.ManagedInstanceLongTermRetentionPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyCreateOrUpdate.json -func ExampleManagedInstanceLongTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceLongTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testResourceGroup", - "testInstance", - "testDatabase", - armsql.ManagedInstanceLongTermRetentionPolicyNameDefault, - armsql.ManagedInstanceLongTermRetentionPolicy{ - Properties: &armsql.BaseLongTermRetentionPolicyProperties{ - MonthlyRetention: to.Ptr("P1Y"), - WeekOfYear: to.Ptr[int32](5), - WeeklyRetention: to.Ptr("P1M"), - YearlyRetention: to.Ptr("P5Y"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceLongTermRetentionPolicyListByDatabase.json -func ExampleManagedInstanceLongTermRetentionPoliciesClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceLongTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("testResourceGroup", - "testInstance", - "testDatabase", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceoperations_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceoperations_client_test.go deleted file mode 100644 index 22974b7d0f72..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceoperations_client_test.go +++ /dev/null @@ -1,87 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListManagedInstanceOperations.json -func ExampleManagedInstanceOperationsClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByManagedInstancePager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedInstanceOperation.json -func ExampleManagedInstanceOperationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "00000000-1111-2222-3333-444444444444", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CancelManagedInstanceOperation.json -func ExampleManagedInstanceOperationsClient_Cancel() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Cancel(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "11111111-1111-1111-1111-111111111111", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivateendpointconnections_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivateendpointconnections_client_test.go deleted file mode 100644 index f8c25add4e98..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivateendpointconnections_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionGet.json -func ExampleManagedInstancePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancePrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "test-cl", - "private-endpoint-connection-name", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionUpdate.json -func ExampleManagedInstancePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancePrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "test-cl", - "private-endpoint-connection-name", - armsql.ManagedInstancePrivateEndpointConnection{ - Properties: &armsql.ManagedInstancePrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armsql.ManagedInstancePrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr("Approved"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionDelete.json -func ExampleManagedInstancePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancePrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "test-cl", - "private-endpoint-connection-name", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateEndpointConnectionList.json -func ExampleManagedInstancePrivateEndpointConnectionsClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancePrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByManagedInstancePager("Default", - "test-cl", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivatelinkresources_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivatelinkresources_client_test.go deleted file mode 100644 index aa84a42f3dfd..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstanceprivatelinkresources_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesList.json -func ExampleManagedInstancePrivateLinkResourcesClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancePrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByManagedInstancePager("Default", - "test-cl", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstancePrivateLinkResourcesGet.json -func ExampleManagedInstancePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancePrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "test-cl", - "plr", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstances_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstances_client_test.go deleted file mode 100644 index 330d672246fa..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstances_client_test.go +++ /dev/null @@ -1,290 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByInstancePool.json -func ExampleManagedInstancesClient_NewListByInstancePoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePoolPager("Test1", - "pool1", - &armsql.ManagedInstancesClientListByInstancePoolOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceList.json -func ExampleManagedInstancesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsql.ManagedInstancesClientListOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceListByResourceGroup.json -func ExampleManagedInstancesClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("Test1", - &armsql.ManagedInstancesClientListByResourceGroupOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceGet.json -func ExampleManagedInstancesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "testinstance", - &armsql.ManagedInstancesClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceCreateMax.json -func ExampleManagedInstancesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testrg", - "testinstance", - armsql.ManagedInstance{ - Location: to.Ptr("Japan East"), - Tags: map[string]*string{ - "tagKey1": to.Ptr("TagValue1"), - }, - Properties: &armsql.ManagedInstanceProperties{ - AdministratorLogin: to.Ptr("dummylogin"), - AdministratorLoginPassword: to.Ptr("PLACEHOLDER"), - Administrators: &armsql.ManagedInstanceExternalAdministrator{ - AzureADOnlyAuthentication: to.Ptr(true), - Login: to.Ptr("bob@contoso.com"), - PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - }, - Collation: to.Ptr("SQL_Latin1_General_CP1_CI_AS"), - DNSZonePartner: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/managedInstances/testinstance"), - InstancePoolID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Sql/instancePools/pool1"), - LicenseType: to.Ptr(armsql.ManagedInstanceLicenseTypeLicenseIncluded), - MaintenanceConfigurationID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_JapanEast_MI_1"), - MinimalTLSVersion: to.Ptr("1.2"), - ProxyOverride: to.Ptr(armsql.ManagedInstanceProxyOverrideRedirect), - PublicDataEndpointEnabled: to.Ptr(false), - RequestedBackupStorageRedundancy: to.Ptr(armsql.BackupStorageRedundancyGeo), - ServicePrincipal: &armsql.ServicePrincipal{ - Type: to.Ptr(armsql.ServicePrincipalTypeSystemAssigned), - }, - StorageSizeInGB: to.Ptr[int32](1024), - SubnetID: to.Ptr("/subscriptions/20D7082A-0FC7-4468-82BD-542694D5042B/resourceGroups/testrg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - TimezoneID: to.Ptr("UTC"), - VCores: to.Ptr[int32](8), - }, - SKU: &armsql.SKU{ - Name: to.Ptr("GP_Gen5"), - Tier: to.Ptr("GeneralPurpose"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceDelete.json -func ExampleManagedInstancesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testrg", - "testinstance", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceRemoveMaintenanceConfiguration.json -func ExampleManagedInstancesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("20D7082A-0FC7-4468-82BD-542694D5042B", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "testrg", - "testinstance", - armsql.ManagedInstanceUpdate{ - Properties: &armsql.ManagedInstanceProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/20d7082a-0fc7-4468-82bd-542694d5042b/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/SQL_Default"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ManagedInstanceTopQueriesList.json -func ExampleManagedInstancesClient_NewListByManagedInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByManagedInstancePager("sqlcrudtest-7398", - "sqlcrudtest-4645", - &armsql.ManagedInstancesClientListByManagedInstanceOptions{NumberOfQueries: nil, - Databases: nil, - StartTime: nil, - EndTime: nil, - Interval: to.Ptr(armsql.QueryTimeGrainTypePT1H), - AggregationFunction: nil, - ObservationMetric: to.Ptr(armsql.MetricTypeDuration), - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/FailoverManagedInstance.json -func ExampleManagedInstancesClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstancesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "group1", - "instanceName", - &armsql.ManagedInstancesClientBeginFailoverOptions{ReplicaType: to.Ptr(armsql.ReplicaTypePrimary)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancetdecertificates_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancetdecertificates_client_test.go deleted file mode 100644 index 60df7934964b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancetdecertificates_client_test.go +++ /dev/null @@ -1,47 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTdeCertificate.json -func ExampleManagedInstanceTdeCertificatesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceTdeCertificatesClient("00000000-0000-0000-0000-000000000001", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "testtdecert", - "testtdecert", - armsql.TdeCertificate{ - Properties: &armsql.TdeCertificateProperties{ - PrivateBlob: to.Ptr("MIIXXXXXXXX"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancevulnerabilityassessments_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancevulnerabilityassessments_client_test.go deleted file mode 100644 index a3f6ef2c5010..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedinstancevulnerabilityassessments_client_test.go +++ /dev/null @@ -1,125 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentGet.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentCreateMax.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - armsql.VulnerabilityAssessmentNameDefault, - armsql.ManagedInstanceVulnerabilityAssessment{ - Properties: &armsql.ManagedInstanceVulnerabilityAssessmentProperties{ - RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - EmailSubscriptionAdmins: to.Ptr(true), - Emails: []*string{ - to.Ptr("email1@mail.com"), - to.Ptr("email2@mail.com")}, - IsEnabled: to.Ptr(true), - }, - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentDelete.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceVulnerabilityAssessmentListByInstance.json -func ExampleManagedInstanceVulnerabilityAssessmentsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedInstanceVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_test.go deleted file mode 100644 index 0869f41bb170..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedrestorabledroppeddatabasebackupshorttermretentionpolicies_client_test.go +++ /dev/null @@ -1,135 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetManagedShortTermRetentionPolicyRestorableDropped.json -func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb,131403269876900000", - armsql.ManagedShortTermRetentionPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.json -func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "resourceGroup", - "testsvr", - "testdb,131403269876900000", - armsql.ManagedShortTermRetentionPolicyNameDefault, - armsql.ManagedBackupShortTermRetentionPolicy{ - Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - RetentionDays: to.Ptr[int32](14), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/UpdateManagedShortTermRetentionPolicyRestorableDropped.json -func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "resourceGroup", - "testsvr", - "testdb,131403269876900000", - armsql.ManagedShortTermRetentionPolicyNameDefault, - armsql.ManagedBackupShortTermRetentionPolicy{ - Properties: &armsql.ManagedBackupShortTermRetentionPolicyProperties{ - RetentionDays: to.Ptr[int32](14), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetListManagedShortTermRetentionPolicyRestorableDropped.json -func ExampleManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient_NewListByRestorableDroppedDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedRestorableDroppedDatabaseBackupShortTermRetentionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByRestorableDroppedDatabasePager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb,131403269876900000", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedserversecurityalertpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_managedserversecurityalertpolicies_client_test.go deleted file mode 100644 index ceacbed1882b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_managedserversecurityalertpolicies_client_test.go +++ /dev/null @@ -1,108 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertGet.json -func ExampleManagedServerSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "securityalert-4799", - "securityalert-6440", - armsql.SecurityAlertPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertCreateMax.json -func ExampleManagedServerSecurityAlertPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "securityalert-4799", - "securityalert-6440", - armsql.SecurityAlertPolicyNameDefault, - armsql.ManagedServerSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertsPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Access_Anomaly"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("testSecurityAlert@microsoft.com")}, - RetentionDays: to.Ptr[int32](5), - State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedServerSecurityAlertListByInstance.json -func ExampleManagedServerSecurityAlertPoliciesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewManagedServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("securityalert-4799", - "securityalert-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_outboundfirewallrules_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_outboundfirewallrules_client_test.go deleted file mode 100644 index 1b6d8f815f3e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_outboundfirewallrules_client_test.go +++ /dev/null @@ -1,119 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleGet.json -func ExampleOutboundFirewallRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewOutboundFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "server.database.windows.net", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleCreate.json -func ExampleOutboundFirewallRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewOutboundFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "server.database.windows.net", - armsql.OutboundFirewallRule{}, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleDelete.json -func ExampleOutboundFirewallRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewOutboundFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-6661", - "server.database.windows.net", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/OutboundFirewallRuleList.json -func ExampleOutboundFirewallRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewOutboundFirewallRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_privateendpointconnections_client_test.go deleted file mode 100644 index 41fa7d7d2535..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_privateendpointconnections_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionGet.json -func ExamplePrivateEndpointConnectionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "test-svr", - "private-endpoint-connection-name", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionUpdate.json -func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "test-svr", - "private-endpoint-connection-name", - armsql.PrivateEndpointConnection{ - Properties: &armsql.PrivateEndpointConnectionProperties{ - PrivateLinkServiceConnectionState: &armsql.PrivateLinkServiceConnectionStateProperty{ - Description: to.Ptr("Approved by johndoe@contoso.com"), - Status: to.Ptr(armsql.PrivateLinkServiceConnectionStateStatusApproved), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionDelete.json -func ExamplePrivateEndpointConnectionsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "test-svr", - "private-endpoint-connection-name", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateEndpointConnectionList.json -func ExamplePrivateEndpointConnectionsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewPrivateEndpointConnectionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "test-svr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_privatelinkresources_client_test.go deleted file mode 100644 index 6ec92d273555..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_privatelinkresources_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesList.json -func ExamplePrivateLinkResourcesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewPrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "test-svr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/PrivateLinkResourcesGet.json -func ExamplePrivateLinkResourcesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewPrivateLinkResourcesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "test-svr", - "plr", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_recommendedsensitivitylabels_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_recommendedsensitivitylabels_client_test.go deleted file mode 100644 index 36abe219822c..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_recommendedsensitivitylabels_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsRecommendedUpdate.json -func ExampleRecommendedSensitivityLabelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRecommendedSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "myRG", - "myServer", - "myDatabase", - armsql.RecommendedSensitivityLabelUpdateList{ - Operations: []*armsql.RecommendedSensitivityLabelUpdate{ - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column1"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindEnable), - Table: to.Ptr("table1"), - }, - }, - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column2"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindEnable), - Table: to.Ptr("table2"), - }, - }, - { - Properties: &armsql.RecommendedSensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column3"), - Op: to.Ptr(armsql.RecommendedSensitivityLabelUpdateKindDisable), - Table: to.Ptr("table1"), - }, - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_recoverabledatabases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_recoverabledatabases_client_test.go deleted file mode 100644 index d46e1a3c7a84..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_recoverabledatabases_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/RecoverableDatabaseGet.json -func ExampleRecoverableDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRecoverableDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "recoverabledatabasetest-6852", - "recoverabledatabasetest-2080", - "recoverabledatabasetest-9187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/RecoverableDatabaseList.json -func ExampleRecoverableDatabasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRecoverableDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("recoverabledatabasetest-1234", - "recoverabledatabasetest-7177", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_recoverablemanageddatabases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_recoverablemanageddatabases_client_test.go deleted file mode 100644 index 52873a2af9c7..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_recoverablemanageddatabases_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListRecoverableManagedDatabasesByServer.json -func ExampleRecoverableManagedDatabasesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRecoverableManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("Test1", - "managedInstance", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetRecoverableManagedDatabase.json -func ExampleRecoverableManagedDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRecoverableManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Test1", - "managedInstance", - "testdb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_replicationlinks_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_replicationlinks_client_test.go deleted file mode 100644 index 0ce91ab01a8d..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_replicationlinks_client_test.go +++ /dev/null @@ -1,172 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkListByDatabase.json -func ExampleReplicationLinksClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewReplicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("Default", - "sourcesvr", - "tetha-db", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkGet.json -func ExampleReplicationLinksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewReplicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "sourcesvr", - "gamma-db", - "4891ca10-ebd0-47d7-9182-c722651780fb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkDelete.json -func ExampleReplicationLinksClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewReplicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "Default", - "sourcesvr", - "gamma-db", - "4891ca10-ebd0-47d7-9182-c722651780fb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkFailover.json -func ExampleReplicationLinksClient_BeginFailover() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewReplicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailover(ctx, - "Default", - "sourcesvr", - "gamma-db", - "4891ca10-ebd0-47d7-9182-c722651780fb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkFailoverAllowDataLoss.json -func ExampleReplicationLinksClient_BeginFailoverAllowDataLoss() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewReplicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginFailoverAllowDataLoss(ctx, - "Default", - "sourcesvr", - "gamma-db", - "4891ca10-ebd0-47d7-9182-c722651780fb", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ReplicationLinkListByServer.json -func ExampleReplicationLinksClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewReplicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "sourcesvr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppeddatabases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppeddatabases_client_test.go deleted file mode 100644 index 878858323c01..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppeddatabases_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ListRestorableDroppedDatabasesByServer.json -func ExampleRestorableDroppedDatabasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorableDroppedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default-SQL-SouthEastAsia", - "testsvr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedDatabase.json -func ExampleRestorableDroppedDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorableDroppedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb,131403269876900000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppedmanageddatabases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppedmanageddatabases_client_test.go deleted file mode 100644 index a59f3bcc1104..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_restorabledroppedmanageddatabases_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/RestorableDroppedManagedDatabaseListByManagedInstance.json -func ExampleRestorableDroppedManagedDatabasesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorableDroppedManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("Test1", - "managedInstance", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/GetRestorableDroppedManagedDatabase.json -func ExampleRestorableDroppedManagedDatabasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorableDroppedManagedDatabasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Test1", - "managedInstance", - "testdb,131403269876900000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_restorepoints_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_restorepoints_client_test.go deleted file mode 100644 index 7156dde9ff3a..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_restorepoints_client_test.go +++ /dev/null @@ -1,121 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsListByDatabase.json -func ExampleRestorePointsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorePointsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("sqlcrudtest-6730", - "sqlcrudtest-9007", - "3481", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsPost.json -func ExampleRestorePointsClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorePointsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "Default-SQL-SouthEastAsia", - "testserver", - "testDatabase", - armsql.CreateDatabaseRestorePointDefinition{ - RestorePointLabel: to.Ptr("mylabel"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsGet.json -func ExampleRestorePointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorePointsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testserver", - "testDatabase", - "131546477590000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DatabaseRestorePointsDelete.json -func ExampleRestorePointsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewRestorePointsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "Default-SQL-SouthEastAsia", - "testserver", - "testDatabase", - "131546477590000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_sensitivitylabels_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_sensitivitylabels_client_test.go deleted file mode 100644 index e1f3943e82dd..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_sensitivitylabels_client_test.go +++ /dev/null @@ -1,278 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceCurrent.json -func ExampleSensitivityLabelsClient_NewListCurrentByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListCurrentByDatabasePager("myRG", - "myServer", - "myDatabase", - &armsql.SensitivityLabelsClientListCurrentByDatabaseOptions{SkipToken: nil, - Count: nil, - Filter: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsCurrentUpdate.json -func ExampleSensitivityLabelsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "myRG", - "myServer", - "myDatabase", - armsql.SensitivityLabelUpdateList{ - Operations: []*armsql.SensitivityLabelUpdate{ - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column1"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindSet), - SensitivityLabel: &armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("Financial"), - InformationTypeID: to.Ptr("1D3652D6-422C-4115-82F1-65DAEBC665C8"), - LabelID: to.Ptr("3A477B16-9423-432B-AA97-6069B481CEC3"), - LabelName: to.Ptr("Highly Confidential"), - Rank: to.Ptr(armsql.SensitivityLabelRankLow), - }, - }, - Table: to.Ptr("table1"), - }, - }, - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("column2"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindSet), - SensitivityLabel: &armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("PhoneNumber"), - InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - LabelName: to.Ptr("PII"), - Rank: to.Ptr(armsql.SensitivityLabelRankCritical), - }, - }, - Table: to.Ptr("table2"), - }, - }, - { - Properties: &armsql.SensitivityLabelUpdateProperties{ - Schema: to.Ptr("dbo"), - Column: to.Ptr("Column3"), - Op: to.Ptr(armsql.SensitivityLabelUpdateKindRemove), - Table: to.Ptr("Table1"), - }, - }}, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SensitivityLabelsListByDatabaseWithSourceRecommended.json -func ExampleSensitivityLabelsClient_NewListRecommendedByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListRecommendedByDatabasePager("myRG", - "myServer", - "myDatabase", - &armsql.SensitivityLabelsClientListRecommendedByDatabaseOptions{SkipToken: nil, - IncludeDisabledRecommendations: nil, - Filter: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelEnable.json -func ExampleSensitivityLabelsClient_EnableRecommendation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.EnableRecommendation(ctx, - "myRG", - "myServer", - "myDatabase", - "dbo", - "myTable", - "myColumn", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/RecommendedColumnSensitivityLabelDisable.json -func ExampleSensitivityLabelsClient_DisableRecommendation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DisableRecommendation(ctx, - "myRG", - "myServer", - "myDatabase", - "dbo", - "myTable", - "myColumn", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelGet.json -func ExampleSensitivityLabelsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myRG", - "myServer", - "myDatabase", - "dbo", - "myTable", - "myColumn", - armsql.SensitivityLabelSourceCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelCreateMax.json -func ExampleSensitivityLabelsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "myRG", - "myServer", - "myDatabase", - "dbo", - "myTable", - "myColumn", - armsql.SensitivityLabel{ - Properties: &armsql.SensitivityLabelProperties{ - InformationType: to.Ptr("PhoneNumber"), - InformationTypeID: to.Ptr("d22fa6e9-5ee4-3bde-4c2b-a409604c4646"), - LabelID: to.Ptr("bf91e08c-f4f0-478a-b016-25164b2a65ff"), - LabelName: to.Ptr("PII"), - Rank: to.Ptr(armsql.SensitivityLabelRankLow), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ColumnSensitivityLabelDelete.json -func ExampleSensitivityLabelsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSensitivityLabelsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "myRG", - "myServer", - "myDatabase", - "dbo", - "myTable", - "myColumn", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvancedthreatprotectionsettings_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvancedthreatprotectionsettings_client_test.go deleted file mode 100644 index c36d0ed1fc8d..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvancedthreatprotectionsettings_client_test.go +++ /dev/null @@ -1,99 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsListByServer.json -func ExampleServerAdvancedThreatProtectionSettingsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAdvancedThreatProtectionSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("threatprotection-4799", - "threatprotection-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsGet.json -func ExampleServerAdvancedThreatProtectionSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAdvancedThreatProtectionSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "threatprotection-4799", - "threatprotection-6440", - armsql.AdvancedThreatProtectionNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAdvancedThreatProtectionSettingsCreateMax.json -func ExampleServerAdvancedThreatProtectionSettingsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAdvancedThreatProtectionSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "threatprotection-4799", - "threatprotection-6440", - armsql.AdvancedThreatProtectionNameDefault, - armsql.ServerAdvancedThreatProtection{ - Properties: &armsql.AdvancedThreatProtectionProperties{ - State: to.Ptr(armsql.AdvancedThreatProtectionStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvisors_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvisors_client_test.go deleted file mode 100644 index 17ce003f2107..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serveradvisors_client_test.go +++ /dev/null @@ -1,91 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorList.json -func ExampleServerAdvisorsClient_ListByServer() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAdvisorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByServer(ctx, - "workloadinsight-demos", - "misosisvr", - &armsql.ServerAdvisorsClientListByServerOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorGet.json -func ExampleServerAdvisorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAdvisorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "workloadinsight-demos", - "misosisvr", - "CreateIndex", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAdvisorUpdate.json -func ExampleServerAdvisorsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAdvisorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "workloadinsight-demos", - "misosisvr", - "CreateIndex", - armsql.Advisor{ - Properties: &armsql.AdvisorProperties{ - AutoExecuteStatus: to.Ptr(armsql.AutoExecuteStatusDisabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverautomatictuning_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverautomatictuning_client_test.go deleted file mode 100644 index bdd5bb530be6..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverautomatictuning_client_test.go +++ /dev/null @@ -1,78 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningGet.json -func ExampleServerAutomaticTuningClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAutomaticTuningClient("c3aa9078-0000-0000-0000-e36f151182d7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "default-sql-onebox", - "testsvr11", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerAutomaticTuningUpdateMax.json -func ExampleServerAutomaticTuningClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAutomaticTuningClient("c3aa9078-0000-0000-0000-e36f151182d7", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "default-sql-onebox", - "testsvr11", - armsql.ServerAutomaticTuning{ - Properties: &armsql.AutomaticTuningServerProperties{ - DesiredState: to.Ptr(armsql.AutomaticTuningServerModeAuto), - Options: map[string]*armsql.AutomaticTuningServerOptions{ - "createIndex": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOff), - }, - "dropIndex": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredOn), - }, - "forceLastGoodPlan": { - DesiredState: to.Ptr(armsql.AutomaticTuningOptionModeDesiredDefault), - }, - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadadministrators_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadadministrators_client_test.go deleted file mode 100644 index 3e221c21f122..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadadministrators_client_test.go +++ /dev/null @@ -1,127 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorGet.json -func ExampleServerAzureADAdministratorsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-6440", - armsql.AdministratorNameActiveDirectory, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorCreateOrUpdate.json -func ExampleServerAzureADAdministratorsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-6440", - armsql.AdministratorNameActiveDirectory, - armsql.ServerAzureADAdministrator{ - Properties: &armsql.AdministratorProperties{ - AdministratorType: to.Ptr(armsql.AdministratorTypeActiveDirectory), - Login: to.Ptr("bob@contoso.com"), - Sid: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - TenantID: to.Ptr("c6b82b90-a647-49cb-8a62-0d2d3cb7ac7c"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorDelete.json -func ExampleServerAzureADAdministratorsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-6440", - armsql.AdministratorNameActiveDirectory, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AdministratorList.json -func ExampleServerAzureADAdministratorsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADAdministratorsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-4799", - "sqlcrudtest-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadonlyauthentications_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadonlyauthentications_client_test.go deleted file mode 100644 index 1d1efc37f961..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverazureadonlyauthentications_client_test.go +++ /dev/null @@ -1,124 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthGet.json -func ExampleServerAzureADOnlyAuthenticationsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-6440", - armsql.AuthenticationNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthCreateOrUpdate.json -func ExampleServerAzureADOnlyAuthenticationsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-6440", - armsql.AuthenticationNameDefault, - armsql.ServerAzureADOnlyAuthentication{ - Properties: &armsql.AzureADOnlyAuthProperties{ - AzureADOnlyAuthentication: to.Ptr(false), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthDelete.json -func ExampleServerAzureADOnlyAuthenticationsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-4799", - "sqlcrudtest-6440", - armsql.AuthenticationNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/AzureADOnlyAuthList.json -func ExampleServerAzureADOnlyAuthenticationsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerAzureADOnlyAuthenticationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-4799", - "sqlcrudtest-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverblobauditingpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverblobauditingpolicies_client_test.go deleted file mode 100644 index 157e298aa865..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverblobauditingpolicies_client_test.go +++ /dev/null @@ -1,108 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerAuditingSettingsList.json -func ExampleServerBlobAuditingPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("blobauditingtest-4799", - "blobauditingtest-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingGet.json -func ExampleServerBlobAuditingPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "blobauditingtest-4799", - "blobauditingtest-6440", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerBlobAuditingCreateMax.json -func ExampleServerBlobAuditingPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerBlobAuditingPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "blobauditingtest-4799", - "blobauditingtest-6440", - armsql.ServerBlobAuditingPolicy{ - Properties: &armsql.ServerBlobAuditingPolicyProperties{ - AuditActionsAndGroups: []*string{ - to.Ptr("SUCCESSFUL_DATABASE_AUTHENTICATION_GROUP"), - to.Ptr("FAILED_DATABASE_AUTHENTICATION_GROUP"), - to.Ptr("BATCH_COMPLETED_GROUP")}, - IsAzureMonitorTargetEnabled: to.Ptr(true), - IsStorageSecondaryKeyInUse: to.Ptr(false), - QueueDelayMs: to.Ptr[int32](4000), - RetentionDays: to.Ptr[int32](6), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_servercommunicationlinks_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_servercommunicationlinks_client_test.go deleted file mode 100644 index 5b1eec7a1c07..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_servercommunicationlinks_client_test.go +++ /dev/null @@ -1,118 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkDelete.json -func ExampleServerCommunicationLinksClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerCommunicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "link1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkGet.json -func ExampleServerCommunicationLinksClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerCommunicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "link1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkCreateOrUpdate.json -func ExampleServerCommunicationLinksClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerCommunicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "link1", - armsql.ServerCommunicationLink{ - Properties: &armsql.ServerCommunicationLinkProperties{ - PartnerServer: to.Ptr("sqldcrudtest-test"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServerCommunicationLinkList.json -func ExampleServerCommunicationLinksClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerCommunicationLinksClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverconnectionpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverconnectionpolicies_client_test.go deleted file mode 100644 index 2df12bf98758..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverconnectionpolicies_client_test.go +++ /dev/null @@ -1,99 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesGet.json -func ExampleServerConnectionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerConnectionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rgtest-12", - "servertest-6285", - armsql.ConnectionPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesUpdate.json -func ExampleServerConnectionPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerConnectionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testrg", - "testserver", - armsql.ConnectionPolicyNameDefault, - armsql.ServerConnectionPolicy{ - Properties: &armsql.ServerConnectionPolicyProperties{ - ConnectionType: to.Ptr(armsql.ServerConnectionTypeRedirect), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-05-01-preview/examples/ServerConnectionPoliciesList.json -func ExampleServerConnectionPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerConnectionPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("rgtest-12", - "servertest-6285", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverdevopsauditsettings_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverdevopsauditsettings_client_test.go deleted file mode 100644 index 8b99bd5f5ac9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverdevopsauditsettings_client_test.go +++ /dev/null @@ -1,103 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDevOpsAuditGet.json -func ExampleServerDevOpsAuditSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDevOpsAuditSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "devAuditTestRG", - "devOpsAuditTestSvr", - "default", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDevOpsAuditCreateMax.json -func ExampleServerDevOpsAuditSettingsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDevOpsAuditSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "devAuditTestRG", - "devOpsAuditTestSvr", - "default", - armsql.ServerDevOpsAuditingSettings{ - Properties: &armsql.ServerDevOpsAuditSettingsProperties{ - IsAzureMonitorTargetEnabled: to.Ptr(true), - State: to.Ptr(armsql.BlobAuditingPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageAccountSubscriptionID: to.Ptr("00000000-1234-0000-5678-000000000000"), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDevOpsAuditSettingsList.json -func ExampleServerDevOpsAuditSettingsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDevOpsAuditSettingsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("devAuditTestRG", - "devOpsAuditTestSvr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverdnsaliases_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverdnsaliases_client_test.go deleted file mode 100644 index 29d8369eb7d2..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverdnsaliases_client_test.go +++ /dev/null @@ -1,149 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasGet.json -func ExampleServerDNSAliasesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDNSAliasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "dns-alias-server", - "dns-alias-name-1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasCreateOrUpdate.json -func ExampleServerDNSAliasesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDNSAliasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "dns-alias-server", - "dns-alias-name-1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasDelete.json -func ExampleServerDNSAliasesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDNSAliasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "dns-alias-server", - "dns-alias-name-1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasList.json -func ExampleServerDNSAliasesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDNSAliasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "dns-alias-server", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerDnsAliasAcquire.json -func ExampleServerDNSAliasesClient_BeginAcquire() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerDNSAliasesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginAcquire(ctx, - "Default", - "dns-alias-new-server", - "dns-alias-name-1", - armsql.ServerDNSAliasAcquisition{ - OldServerDNSAliasID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/servers/dns-alias-old-server/dnsAliases/dns-alias-name-1"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverkeys_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverkeys_client_test.go deleted file mode 100644 index 5da7af9019f4..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverkeys_client_test.go +++ /dev/null @@ -1,125 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyList.json -func ExampleServerKeysClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyGet.json -func ExampleServerKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "someVault_someKey_01234567890123456789012345678901", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyCreateOrUpdate.json -func ExampleServerKeysClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "someVault_someKey_01234567890123456789012345678901", - armsql.ServerKey{ - Properties: &armsql.ServerKeyProperties{ - ServerKeyType: to.Ptr(armsql.ServerKeyTypeAzureKeyVault), - URI: to.Ptr("https://someVault.vault.azure.net/keys/someKey/01234567890123456789012345678901"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerKeyDelete.json -func ExampleServerKeysClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerKeysClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - "someVault_someKey_01234567890123456789012345678901", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serveroperations_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serveroperations_client_test.go deleted file mode 100644 index 8b355d0c0c94..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serveroperations_client_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ListServerOperations.json -func ExampleServerOperationsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerOperationsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_servers_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_servers_client_test.go deleted file mode 100644 index a4048f3bc346..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_servers_client_test.go +++ /dev/null @@ -1,252 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerListByResourceGroup.json -func ExampleServersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("sqlcrudtest-7398", - &armsql.ServersClientListByResourceGroupOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerGet.json -func ExampleServersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - &armsql.ServersClientGetOptions{Expand: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerCreate.json -func ExampleServersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.Server{ - Location: to.Ptr("Japan East"), - Properties: &armsql.ServerProperties{ - AdministratorLogin: to.Ptr("dummylogin"), - AdministratorLoginPassword: to.Ptr("PLACEHOLDER"), - Administrators: &armsql.ServerExternalAdministrator{ - AzureADOnlyAuthentication: to.Ptr(true), - Login: to.Ptr("bob@contoso.com"), - PrincipalType: to.Ptr(armsql.PrincipalTypeUser), - Sid: to.Ptr("00000011-1111-2222-2222-123456789111"), - TenantID: to.Ptr("00000011-1111-2222-2222-123456789111"), - }, - PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerDelete.json -func ExampleServersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-6661", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerUpdate.json -func ExampleServersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.ServerUpdate{ - Properties: &armsql.ServerProperties{ - AdministratorLogin: to.Ptr("dummylogin"), - AdministratorLoginPassword: to.Ptr("placeholder"), - PublicNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagDisabled), - RestrictOutboundNetworkAccess: to.Ptr(armsql.ServerNetworkAccessFlagEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ServerList.json -func ExampleServersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(&armsql.ServersClientListOptions{Expand: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ImportNewDatabaseWithNetworkIsolation.json -func ExampleServersClient_BeginImportDatabase() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginImportDatabase(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - armsql.ImportNewDatabaseDefinition{ - AdministratorLogin: to.Ptr("login"), - AdministratorLoginPassword: to.Ptr("password"), - AuthenticationType: to.Ptr("Sql"), - DatabaseName: to.Ptr("testdb"), - NetworkIsolation: &armsql.NetworkIsolationSettings{ - SQLServerResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Sql/servers/testsvr"), - StorageAccountResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-SouthEastAsia/providers/Microsoft.Storage/storageAccounts/test-privatelink"), - }, - StorageKey: to.Ptr("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=="), - StorageKeyType: to.Ptr(armsql.StorageKeyTypeStorageAccessKey), - StorageURI: to.Ptr("https://test.blob.core.windows.net/test.bacpac"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/CheckNameAvailabilityServerAlreadyExists.json -func ExampleServersClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - armsql.CheckNameAvailabilityRequest{ - Name: to.Ptr("server1"), - Type: to.Ptr("Microsoft.Sql/servers"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serversecurityalertpolicies_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serversecurityalertpolicies_client_test.go deleted file mode 100644 index 4cda37389802..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serversecurityalertpolicies_client_test.go +++ /dev/null @@ -1,108 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsGet.json -func ExampleServerSecurityAlertPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "securityalert-4799", - "securityalert-6440", - armsql.SecurityAlertPolicyNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsCreateMax.json -func ExampleServerSecurityAlertPoliciesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "securityalert-4799", - "securityalert-6440", - armsql.SecurityAlertPolicyNameDefault, - armsql.ServerSecurityAlertPolicy{ - Properties: &armsql.SecurityAlertsPolicyProperties{ - DisabledAlerts: []*string{ - to.Ptr("Access_Anomaly"), - to.Ptr("Usage_Anomaly")}, - EmailAccountAdmins: to.Ptr(true), - EmailAddresses: []*string{ - to.Ptr("testSecurityAlert@microsoft.com")}, - RetentionDays: to.Ptr[int32](5), - State: to.Ptr(armsql.SecurityAlertsPolicyStateEnabled), - StorageAccountAccessKey: to.Ptr("sdlfkjabc+sdlfkjsdlkfsjdfLDKFTERLKFDFKLjsdfksjdflsdkfD2342309432849328476458/3RSD=="), - StorageEndpoint: to.Ptr("https://mystorage.blob.core.windows.net"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerSecurityAlertsListByServer.json -func ExampleServerSecurityAlertPoliciesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerSecurityAlertPoliciesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("securityalert-4799", - "securityalert-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustcertificates_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustcertificates_client_test.go deleted file mode 100644 index 783e473114c0..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustcertificates_client_test.go +++ /dev/null @@ -1,124 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesListByInstance.json -func ExampleServerTrustCertificatesClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustCertificatesClient("38e0dc56-907f-45ba-a97c-74233baad471", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("testrg", - "testcl", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesGet.json -func ExampleServerTrustCertificatesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustCertificatesClient("38e0dc56-907f-45ba-a97c-74233baad471", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "testcl", - "customerCertificateName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesCreate.json -func ExampleServerTrustCertificatesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustCertificatesClient("0574222d-5c7f-489c-a172-b3013eafab53", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "testrg", - "testcl", - "customerCertificateName", - armsql.ServerTrustCertificate{ - Properties: &armsql.ServerTrustCertificateProperties{ - PublicBlob: to.Ptr("308203AE30820296A0030201020210"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-11-01-preview/examples/ServerTrustCertificatesDelete.json -func ExampleServerTrustCertificatesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustCertificatesClient("38e0dc56-907f-45ba-a97c-74233baad471", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testrg", - "testcl", - "customerCertificateName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustgroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustgroups_client_test.go deleted file mode 100644 index 8c037bf8fe4e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_servertrustgroups_client_test.go +++ /dev/null @@ -1,159 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupGet.json -func ExampleServerTrustGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "Japan East", - "server-trust-group-test", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupCreate.json -func ExampleServerTrustGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "Japan East", - "server-trust-group-test", - armsql.ServerTrustGroup{ - Properties: &armsql.ServerTrustGroupProperties{ - GroupMembers: []*armsql.ServerInfo{ - { - ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-1"), - }, - { - ServerID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Sql/managedInstances/managedInstance-2"), - }}, - TrustScopes: []*armsql.ServerTrustGroupPropertiesTrustScopesItem{ - to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemGlobalTransactions), - to.Ptr(armsql.ServerTrustGroupPropertiesTrustScopesItemServiceBroker)}, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupDelete.json -func ExampleServerTrustGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "Japan East", - "server-trust-group-test", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupList.json -func ExampleServerTrustGroupsClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("Default", - "Japan East", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerTrustGroupListByManagedInstance.json -func ExampleServerTrustGroupsClient_NewListByInstancePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerTrustGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePager("Default-SQL-SouthEastAsia", - "managedInstance-1", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverusages_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serverusages_client_test.go deleted file mode 100644 index 231c51c0144e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serverusages_client_test.go +++ /dev/null @@ -1,43 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01-legacy/examples/ServerUsageMetricsList.json -func ExampleServerUsagesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerUsagesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("sqlcrudtest-6730", - "sqlcrudtest-9007", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_servervulnerabilityassessments_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_servervulnerabilityassessments_client_test.go deleted file mode 100644 index 80eb58980dd9..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_servervulnerabilityassessments_client_test.go +++ /dev/null @@ -1,125 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentGet.json -func ExampleServerVulnerabilityAssessmentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentCreateMax.json -func ExampleServerVulnerabilityAssessmentsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - armsql.VulnerabilityAssessmentNameDefault, - armsql.ServerVulnerabilityAssessment{ - Properties: &armsql.ServerVulnerabilityAssessmentProperties{ - RecurringScans: &armsql.VulnerabilityAssessmentRecurringScansProperties{ - EmailSubscriptionAdmins: to.Ptr(true), - Emails: []*string{ - to.Ptr("email1@mail.com"), - to.Ptr("email2@mail.com")}, - IsEnabled: to.Ptr(true), - }, - StorageAccountAccessKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - StorageContainerPath: to.Ptr("https://myStorage.blob.core.windows.net/vulnerability-assessment/"), - StorageContainerSasKey: to.Ptr("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentDelete.json -func ExampleServerVulnerabilityAssessmentsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - armsql.VulnerabilityAssessmentNameDefault, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ServerVulnerabilityAssessmentListByServer.json -func ExampleServerVulnerabilityAssessmentsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServerVulnerabilityAssessmentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("vulnerabilityaseessmenttest-4799", - "vulnerabilityaseessmenttest-6440", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_serviceobjectives_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_serviceobjectives_client_test.go deleted file mode 100644 index a45e66d0e42d..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_serviceobjectives_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveGet.json -func ExampleServiceObjectivesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServiceObjectivesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "group1", - "sqlcrudtest", - "29dd7459-4a7c-4e56-be22-f0adda49440d", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/stable/2014-04-01/examples/ServiceObjectiveList.json -func ExampleServiceObjectivesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewServiceObjectivesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("group1", - "sqlcrudtest", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_sqlagent_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_sqlagent_client_test.go deleted file mode 100644 index 0b7758ad186e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_sqlagent_client_test.go +++ /dev/null @@ -1,67 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationGet.json -func ExampleAgentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewAgentClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlAgentConfigurationPut.json -func ExampleAgentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewAgentClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "sqlcrudtest-7398", - "sqlcrudtest-4645", - armsql.AgentConfiguration{ - Properties: &armsql.AgentConfigurationProperties{ - State: to.Ptr(armsql.SQLAgentConfigurationPropertiesStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_subscriptionusages_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_subscriptionusages_client_test.go deleted file mode 100644 index f5bef8b73003..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_subscriptionusages_client_test.go +++ /dev/null @@ -1,64 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageListByLocation.json -func ExampleSubscriptionUsagesClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSubscriptionUsagesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("WestUS", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SubscriptionUsageGet.json -func ExampleSubscriptionUsagesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSubscriptionUsagesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "WestUS", - "ServerQuota", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_syncagents_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_syncagents_client_test.go deleted file mode 100644 index e4c44c0304fe..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_syncagents_client_test.go +++ /dev/null @@ -1,174 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGet.json -func ExampleSyncAgentsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "syncagentcrud-65440", - "syncagentcrud-8475", - "syncagentcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentCreate.json -func ExampleSyncAgentsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "syncagentcrud-65440", - "syncagentcrud-8475", - "syncagentcrud-3187", - armsql.SyncAgent{ - Properties: &armsql.SyncAgentProperties{ - SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default-SQL-Onebox/providers/Microsoft.Sql/servers/syncagentcrud-8475/databases/sync"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentDelete.json -func ExampleSyncAgentsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "syncagentcrud-65440", - "syncagentcrud-8475", - "syncagentcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentListByServer.json -func ExampleSyncAgentsClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("syncagentcrud-65440", - "syncagentcrud-8475", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGenerateKey.json -func ExampleSyncAgentsClient_GenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GenerateKey(ctx, - "syncagentcrud-65440", - "syncagentcrud-8475", - "syncagentcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncAgentGetLinkedDatabases.json -func ExampleSyncAgentsClient_NewListLinkedDatabasesPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncAgentsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListLinkedDatabasesPager("syncagentcrud-65440", - "syncagentcrud-8475", - "syncagentcrud-3187", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_syncgroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_syncgroups_client_test.go deleted file mode 100644 index 2b481e6b4f6f..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_syncgroups_client_test.go +++ /dev/null @@ -1,299 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupRefreshHubSchema.json -func ExampleSyncGroupsClient_BeginRefreshHubSchema() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRefreshHubSchema(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetHubSchema.json -func ExampleSyncGroupsClient_NewListHubSchemasPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListHubSchemasPager("syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGetLog.json -func ExampleSyncGroupsClient_NewListLogsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListLogsPager("syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "2017-01-01T00:00:00", - "2017-12-31T00:00:00", - armsql.SyncGroupsTypeAll, - &armsql.SyncGroupsClientListLogsOptions{ContinuationToken: nil}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCancelSync.json -func ExampleSyncGroupsClient_CancelSync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CancelSync(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupTriggerSync.json -func ExampleSyncGroupsClient_TriggerSync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.TriggerSync(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupGet.json -func ExampleSyncGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupCreate.json -func ExampleSyncGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - armsql.SyncGroup{ - Properties: &armsql.SyncGroupProperties{ - ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - HubDatabaseUserName: to.Ptr("hubUser"), - Interval: to.Ptr[int32](-1), - SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: to.Ptr(true), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupDelete.json -func ExampleSyncGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupPatch.json -func ExampleSyncGroupsClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - armsql.SyncGroup{ - Properties: &armsql.SyncGroupProperties{ - ConflictResolutionPolicy: to.Ptr(armsql.SyncConflictResolutionPolicyHubWin), - HubDatabasePassword: to.Ptr("hubPassword"), - HubDatabaseUserName: to.Ptr("hubUser"), - Interval: to.Ptr[int32](-1), - SyncDatabaseID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-3521/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: to.Ptr(true), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncGroupListByDatabase.json -func ExampleSyncGroupsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_syncmembers_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_syncmembers_client_test.go deleted file mode 100644 index 723b33a906b0..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_syncmembers_client_test.go +++ /dev/null @@ -1,234 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGet.json -func ExampleSyncMembersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "syncmembercrud-4879", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberCreate.json -func ExampleSyncMembersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "syncmembercrud-4879", - armsql.SyncMember{ - Properties: &armsql.SyncMemberProperties{ - DatabaseName: to.Ptr("syncgroupcrud-7421"), - DatabaseType: to.Ptr(armsql.SyncMemberDbTypeAzureSQLDatabase), - ServerName: to.Ptr("syncgroupcrud-3379.database.windows.net"), - SyncDirection: to.Ptr(armsql.SyncDirectionBidirectional), - SyncMemberAzureDatabaseResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: to.Ptr(true), - UserName: to.Ptr("myUser"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberDelete.json -func ExampleSyncMembersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "syncgroupcrud-4879", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberPatch.json -func ExampleSyncMembersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "syncmembercrud-4879", - armsql.SyncMember{ - Properties: &armsql.SyncMemberProperties{ - DatabaseName: to.Ptr("syncgroupcrud-7421"), - DatabaseType: to.Ptr(armsql.SyncMemberDbTypeAzureSQLDatabase), - ServerName: to.Ptr("syncgroupcrud-3379.database.windows.net"), - SyncDirection: to.Ptr(armsql.SyncDirectionBidirectional), - SyncMemberAzureDatabaseResourceID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/syncgroupcrud-65440/providers/Microsoft.Sql/servers/syncgroupcrud-8475/databases/syncgroupcrud-4328"), - UsePrivateLinkConnection: to.Ptr(true), - UserName: to.Ptr("myUser"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberListBySyncGroup.json -func ExampleSyncMembersClient_NewListBySyncGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySyncGroupPager("syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberGetSchema.json -func ExampleSyncMembersClient_NewListMemberSchemasPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListMemberSchemasPager("syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "syncgroupcrud-4879", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SyncMemberRefreshSchema.json -func ExampleSyncMembersClient_BeginRefreshMemberSchema() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewSyncMembersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRefreshMemberSchema(ctx, - "syncgroupcrud-65440", - "syncgroupcrud-8475", - "syncgroupcrud-4328", - "syncgroupcrud-3187", - "syncgroupcrud-4879", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_tdecertificates_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_tdecertificates_client_test.go deleted file mode 100644 index 28dc5a30e9c5..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_tdecertificates_client_test.go +++ /dev/null @@ -1,47 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/SqlTdeCertificateCreate.json -func ExampleTdeCertificatesClient_BeginCreate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewTdeCertificatesClient("00000000-0000-0000-0000-000000000001", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreate(ctx, - "testtdecert", - "testtdecert", - armsql.TdeCertificate{ - Properties: &armsql.TdeCertificateProperties{ - PrivateBlob: to.Ptr("MIIXXXXXXXX"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_timezones_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_timezones_client_test.go deleted file mode 100644 index fd3c549bf421..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_timezones_client_test.go +++ /dev/null @@ -1,64 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneListByLocation.json -func ExampleTimeZonesClient_NewListByLocationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewTimeZonesClient("37d5e605-6142-4d79-b564-28b6dbfeec0f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByLocationPager("canadaeast", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/ManagedInstanceTimeZoneGet.json -func ExampleTimeZonesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewTimeZonesClient("37d5e605-6142-4d79-b564-28b6dbfeec0f", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "canadaeast", - "Haiti Standard Time", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_transparentdataencryptions_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_transparentdataencryptions_client_test.go deleted file mode 100644 index 30f1d041e34b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_transparentdataencryptions_client_test.go +++ /dev/null @@ -1,98 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionGet.json -func ExampleTransparentDataEncryptionsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewTransparentDataEncryptionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "security-tde-resourcegroup", - "securitytde", - "testdb", - armsql.TransparentDataEncryptionNameCurrent, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionUpdate.json -func ExampleTransparentDataEncryptionsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewTransparentDataEncryptionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "securitytde-42-rg", - "securitytde-42", - "testdb", - armsql.TransparentDataEncryptionNameCurrent, - armsql.LogicalDatabaseTransparentDataEncryption{ - Properties: &armsql.TransparentDataEncryptionProperties{ - State: to.Ptr(armsql.TransparentDataEncryptionStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/TransparentDataEncryptionList.json -func ExampleTransparentDataEncryptionsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewTransparentDataEncryptionsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("security-tde-resourcegroup", - "securitytde", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_usages_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_usages_client_test.go deleted file mode 100644 index 046e942d5da7..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_usages_client_test.go +++ /dev/null @@ -1,44 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/examples/ListInstancePoolUsageExpanded.json -func ExampleUsagesClient_NewListByInstancePoolPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewUsagesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByInstancePoolPager("group1", - "testIP", - &armsql.UsagesClientListByInstancePoolOptions{ExpandChildren: to.Ptr(true)}) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_virtualclusters_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_virtualclusters_client_test.go deleted file mode 100644 index 1929737a8b49..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_virtualclusters_client_test.go +++ /dev/null @@ -1,144 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterList.json -func ExampleVirtualClustersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualClustersClient("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterListByResourceGroup.json -func ExampleVirtualClustersClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualClustersClient("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("testrg", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterGet.json -func ExampleVirtualClustersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualClustersClient("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testrg", - "vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterDelete.json -func ExampleVirtualClustersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualClustersClient("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "testrg", - "vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualClusterUpdate.json -func ExampleVirtualClustersClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualClustersClient("20d7082a-0fc7-4468-82bd-542694d5042b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "testrg", - "vc-subnet1-f769ed71-b3ad-491a-a9d5-26eeceaa6be2", - armsql.VirtualClusterUpdate{ - Properties: &armsql.VirtualClusterProperties{ - MaintenanceConfigurationID: to.Ptr("/subscriptions/ab0e51c0-83c0-4380-8ae9-025516df392f/resourceGroups/Federation/providers/Microsoft.Maintenance/maintenanceConfigurations/MiPolicy1"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_virtualnetworkrules_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_virtualnetworkrules_client_test.go deleted file mode 100644 index f0338607b03b..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_virtualnetworkrules_client_test.go +++ /dev/null @@ -1,125 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesGet.json -func ExampleVirtualNetworkRulesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualNetworkRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default", - "vnet-test-svr", - "vnet-firewall-rule", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesCreateOrUpdate.json -func ExampleVirtualNetworkRulesClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualNetworkRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default", - "vnet-test-svr", - "vnet-firewall-rule", - armsql.VirtualNetworkRule{ - Properties: &armsql.VirtualNetworkRuleProperties{ - IgnoreMissingVnetServiceEndpoint: to.Ptr(false), - VirtualNetworkSubnetID: to.Ptr("/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/Default/providers/Microsoft.Network/virtualNetworks/testvnet/subnets/testsubnet"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesDelete.json -func ExampleVirtualNetworkRulesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualNetworkRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default", - "vnet-test-svr", - "vnet-firewall-rule", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/VirtualNetworkRulesList.json -func ExampleVirtualNetworkRulesClient_NewListByServerPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewVirtualNetworkRulesClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServerPager("Default", - "vnet-test-svr", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_workloadclassifiers_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_workloadclassifiers_client_test.go deleted file mode 100644 index d59ffc63255e..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_workloadclassifiers_client_test.go +++ /dev/null @@ -1,137 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifier.json -func ExampleWorkloadClassifiersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadClassifiersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "wlm_workloadgroup", - "wlm_classifier", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadClassifierMax.json -func ExampleWorkloadClassifiersClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadClassifiersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "wlm_workloadgroup", - "wlm_workloadclassifier", - armsql.WorkloadClassifier{ - Properties: &armsql.WorkloadClassifierProperties{ - Context: to.Ptr("test_context"), - EndTime: to.Ptr("14:00"), - Importance: to.Ptr("high"), - Label: to.Ptr("test_label"), - MemberName: to.Ptr("dbo"), - StartTime: to.Ptr("12:00"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadClassifier.json -func ExampleWorkloadClassifiersClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadClassifiersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "wlm_workloadgroup", - "wlm_workloadclassifier", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadClassifierList.json -func ExampleWorkloadClassifiersClient_NewListByWorkloadGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadClassifiersClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByWorkloadGroupPager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "wlm_workloadgroup", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/ze_generated_example_workloadgroups_client_test.go b/sdk/resourcemanager/sql/armsql/ze_generated_example_workloadgroups_client_test.go deleted file mode 100644 index 92e86fc4cce4..000000000000 --- a/sdk/resourcemanager/sql/armsql/ze_generated_example_workloadgroups_client_test.go +++ /dev/null @@ -1,133 +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 armsql_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/sql/armsql" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroup.json -func ExampleWorkloadGroupsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "smallrc", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/CreateOrUpdateWorkloadGroupMax.json -func ExampleWorkloadGroupsClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "smallrc", - armsql.WorkloadGroup{ - Properties: &armsql.WorkloadGroupProperties{ - Importance: to.Ptr("normal"), - MaxResourcePercent: to.Ptr[int32](100), - MaxResourcePercentPerRequest: to.Ptr[float64](3), - MinResourcePercent: to.Ptr[int32](0), - MinResourcePercentPerRequest: to.Ptr[float64](3), - QueryExecutionTimeout: to.Ptr[int32](0), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/DeleteWorkloadGroup.json -func ExampleWorkloadGroupsClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - "wlm_workloadgroup", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - _, err = poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/examples/GetWorkloadGroupList.json -func ExampleWorkloadGroupsClient_NewListByDatabasePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armsql.NewWorkloadGroupsClient("00000000-1111-2222-3333-444444444444", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByDatabasePager("Default-SQL-SouthEastAsia", - "testsvr", - "testdb", - nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpoolactivities_client.go b/sdk/resourcemanager/sql/armsql/zz_generated_elasticpoolactivities_client.go deleted file mode 100644 index 418d5aa7b428..000000000000 --- a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpoolactivities_client.go +++ /dev/null @@ -1,125 +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 armsql - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ElasticPoolActivitiesClient contains the methods for the ElasticPoolActivities group. -// Don't use this type directly, use NewElasticPoolActivitiesClient() instead. -type ElasticPoolActivitiesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewElasticPoolActivitiesClient creates a new instance of ElasticPoolActivitiesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewElasticPoolActivitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ElasticPoolActivitiesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ElasticPoolActivitiesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListByElasticPoolPager - Returns elastic pool activities. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// elasticPoolName - The name of the elastic pool for which to get the current activity. -// options - ElasticPoolActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolActivitiesClient.ListByElasticPool -// method. -func (client *ElasticPoolActivitiesClient) NewListByElasticPoolPager(resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolActivitiesClientListByElasticPoolOptions) *runtime.Pager[ElasticPoolActivitiesClientListByElasticPoolResponse] { - return runtime.NewPager(runtime.PagingHandler[ElasticPoolActivitiesClientListByElasticPoolResponse]{ - More: func(page ElasticPoolActivitiesClientListByElasticPoolResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ElasticPoolActivitiesClientListByElasticPoolResponse) (ElasticPoolActivitiesClientListByElasticPoolResponse, error) { - req, err := client.listByElasticPoolCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) - if err != nil { - return ElasticPoolActivitiesClientListByElasticPoolResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ElasticPoolActivitiesClientListByElasticPoolResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ElasticPoolActivitiesClientListByElasticPoolResponse{}, runtime.NewResponseError(resp) - } - return client.listByElasticPoolHandleResponse(resp) - }, - }) -} - -// listByElasticPoolCreateRequest creates the ListByElasticPool request. -func (client *ElasticPoolActivitiesClient) listByElasticPoolCreateRequest(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolActivitiesClientListByElasticPoolOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolActivity" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if elasticPoolName == "" { - return nil, errors.New("parameter elasticPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{elasticPoolName}", url.PathEscape(elasticPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByElasticPoolHandleResponse handles the ListByElasticPool response. -func (client *ElasticPoolActivitiesClient) listByElasticPoolHandleResponse(resp *http.Response) (ElasticPoolActivitiesClientListByElasticPoolResponse, error) { - result := ElasticPoolActivitiesClientListByElasticPoolResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ElasticPoolActivityListResult); err != nil { - return ElasticPoolActivitiesClientListByElasticPoolResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpooldatabaseactivities_client.go b/sdk/resourcemanager/sql/armsql/zz_generated_elasticpooldatabaseactivities_client.go deleted file mode 100644 index e9a4059b61dd..000000000000 --- a/sdk/resourcemanager/sql/armsql/zz_generated_elasticpooldatabaseactivities_client.go +++ /dev/null @@ -1,125 +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 armsql - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ElasticPoolDatabaseActivitiesClient contains the methods for the ElasticPoolDatabaseActivities group. -// Don't use this type directly, use NewElasticPoolDatabaseActivitiesClient() instead. -type ElasticPoolDatabaseActivitiesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewElasticPoolDatabaseActivitiesClient creates a new instance of ElasticPoolDatabaseActivitiesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewElasticPoolDatabaseActivitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ElasticPoolDatabaseActivitiesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ElasticPoolDatabaseActivitiesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// NewListByElasticPoolPager - Returns activity on databases inside of an elastic pool. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// elasticPoolName - The name of the elastic pool. -// options - ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions contains the optional parameters for the ElasticPoolDatabaseActivitiesClient.ListByElasticPool -// method. -func (client *ElasticPoolDatabaseActivitiesClient) NewListByElasticPoolPager(resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions) *runtime.Pager[ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse] { - return runtime.NewPager(runtime.PagingHandler[ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse]{ - More: func(page ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse) (ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse, error) { - req, err := client.listByElasticPoolCreateRequest(ctx, resourceGroupName, serverName, elasticPoolName, options) - if err != nil { - return ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse{}, runtime.NewResponseError(resp) - } - return client.listByElasticPoolHandleResponse(resp) - }, - }) -} - -// listByElasticPoolCreateRequest creates the ListByElasticPool request. -func (client *ElasticPoolDatabaseActivitiesClient) listByElasticPoolCreateRequest(ctx context.Context, resourceGroupName string, serverName string, elasticPoolName string, options *ElasticPoolDatabaseActivitiesClientListByElasticPoolOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/elasticPools/{elasticPoolName}/elasticPoolDatabaseActivity" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if elasticPoolName == "" { - return nil, errors.New("parameter elasticPoolName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{elasticPoolName}", url.PathEscape(elasticPoolName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByElasticPoolHandleResponse handles the ListByElasticPool response. -func (client *ElasticPoolDatabaseActivitiesClient) listByElasticPoolHandleResponse(resp *http.Response) (ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse, error) { - result := ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ElasticPoolDatabaseActivityListResult); err != nil { - return ElasticPoolDatabaseActivitiesClientListByElasticPoolResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_models_serde.go b/sdk/resourcemanager/sql/armsql/zz_generated_models_serde.go deleted file mode 100644 index 442fac28f2c5..000000000000 --- a/sdk/resourcemanager/sql/armsql/zz_generated_models_serde.go +++ /dev/null @@ -1,3330 +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 armsql - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type AdvancedThreatProtectionProperties. -func (a AdvancedThreatProtectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationTime", a.CreationTime) - populate(objectMap, "state", a.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdvancedThreatProtectionProperties. -func (a *AdvancedThreatProtectionProperties) UnmarshalJSON(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 "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &a.CreationTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &a.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type Advisor. -func (a Advisor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "kind", a.Kind) - populate(objectMap, "location", a.Location) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AdvisorProperties. -func (a AdvisorProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "advisorStatus", a.AdvisorStatus) - populate(objectMap, "autoExecuteStatus", a.AutoExecuteStatus) - populate(objectMap, "autoExecuteStatusInheritedFrom", a.AutoExecuteStatusInheritedFrom) - populateTimeRFC3339(objectMap, "lastChecked", a.LastChecked) - populate(objectMap, "recommendationsStatus", a.RecommendationsStatus) - populate(objectMap, "recommendedActions", a.RecommendedActions) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AdvisorProperties. -func (a *AdvisorProperties) UnmarshalJSON(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 "advisorStatus": - err = unpopulate(val, "AdvisorStatus", &a.AdvisorStatus) - delete(rawMsg, key) - case "autoExecuteStatus": - err = unpopulate(val, "AutoExecuteStatus", &a.AutoExecuteStatus) - delete(rawMsg, key) - case "autoExecuteStatusInheritedFrom": - err = unpopulate(val, "AutoExecuteStatusInheritedFrom", &a.AutoExecuteStatusInheritedFrom) - delete(rawMsg, key) - case "lastChecked": - err = unpopulateTimeRFC3339(val, "LastChecked", &a.LastChecked) - delete(rawMsg, key) - case "recommendationsStatus": - err = unpopulate(val, "RecommendationsStatus", &a.RecommendationsStatus) - delete(rawMsg, key) - case "recommendedActions": - err = unpopulate(val, "RecommendedActions", &a.RecommendedActions) - 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 AutomaticTuningServerProperties. -func (a AutomaticTuningServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actualState", a.ActualState) - populate(objectMap, "desiredState", a.DesiredState) - populate(objectMap, "options", a.Options) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackupShortTermRetentionPolicy. -func (b BackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", b.ID) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Database. -func (d Database) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "kind", d.Kind) - populate(objectMap, "location", d.Location) - populate(objectMap, "managedBy", d.ManagedBy) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAutomaticTuning. -func (d DatabaseAutomaticTuning) 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) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseAutomaticTuningProperties. -func (d DatabaseAutomaticTuningProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actualState", d.ActualState) - populate(objectMap, "desiredState", d.DesiredState) - populate(objectMap, "options", d.Options) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseBlobAuditingPolicyProperties. -func (d DatabaseBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "auditActionsAndGroups", d.AuditActionsAndGroups) - populate(objectMap, "isAzureMonitorTargetEnabled", d.IsAzureMonitorTargetEnabled) - populate(objectMap, "isManagedIdentityInUse", d.IsManagedIdentityInUse) - populate(objectMap, "isStorageSecondaryKeyInUse", d.IsStorageSecondaryKeyInUse) - populate(objectMap, "queueDelayMs", d.QueueDelayMs) - populate(objectMap, "retentionDays", d.RetentionDays) - populate(objectMap, "state", d.State) - populate(objectMap, "storageAccountAccessKey", d.StorageAccountAccessKey) - populate(objectMap, "storageAccountSubscriptionId", d.StorageAccountSubscriptionID) - populate(objectMap, "storageEndpoint", d.StorageEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseIdentity. -func (d DatabaseIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tenantId", d.TenantID) - populate(objectMap, "type", d.Type) - populate(objectMap, "userAssignedIdentities", d.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseOperationProperties. -func (d DatabaseOperationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseName", d.DatabaseName) - populate(objectMap, "description", d.Description) - populate(objectMap, "errorCode", d.ErrorCode) - populate(objectMap, "errorDescription", d.ErrorDescription) - populate(objectMap, "errorSeverity", d.ErrorSeverity) - populateTimeRFC3339(objectMap, "estimatedCompletionTime", d.EstimatedCompletionTime) - populate(objectMap, "isCancellable", d.IsCancellable) - populate(objectMap, "isUserError", d.IsUserError) - populate(objectMap, "operation", d.Operation) - populate(objectMap, "operationFriendlyName", d.OperationFriendlyName) - populate(objectMap, "percentComplete", d.PercentComplete) - populate(objectMap, "serverName", d.ServerName) - populateTimeRFC3339(objectMap, "startTime", d.StartTime) - populate(objectMap, "state", d.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseOperationProperties. -func (d *DatabaseOperationProperties) UnmarshalJSON(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 "databaseName": - err = unpopulate(val, "DatabaseName", &d.DatabaseName) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &d.Description) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &d.ErrorCode) - delete(rawMsg, key) - case "errorDescription": - err = unpopulate(val, "ErrorDescription", &d.ErrorDescription) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &d.ErrorSeverity) - delete(rawMsg, key) - case "estimatedCompletionTime": - err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &d.EstimatedCompletionTime) - delete(rawMsg, key) - case "isCancellable": - err = unpopulate(val, "IsCancellable", &d.IsCancellable) - delete(rawMsg, key) - case "isUserError": - err = unpopulate(val, "IsUserError", &d.IsUserError) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &d.Operation) - delete(rawMsg, key) - case "operationFriendlyName": - err = unpopulate(val, "OperationFriendlyName", &d.OperationFriendlyName) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &d.PercentComplete) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &d.ServerName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &d.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &d.State) - 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 DatabaseProperties. -func (d DatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoPauseDelay", d.AutoPauseDelay) - populate(objectMap, "catalogCollation", d.CatalogCollation) - populate(objectMap, "collation", d.Collation) - populate(objectMap, "createMode", d.CreateMode) - populateTimeRFC3339(objectMap, "creationDate", d.CreationDate) - populate(objectMap, "currentBackupStorageRedundancy", d.CurrentBackupStorageRedundancy) - populate(objectMap, "currentSku", d.CurrentSKU) - populate(objectMap, "currentServiceObjectiveName", d.CurrentServiceObjectiveName) - populate(objectMap, "databaseId", d.DatabaseID) - populate(objectMap, "defaultSecondaryLocation", d.DefaultSecondaryLocation) - populateTimeRFC3339(objectMap, "earliestRestoreDate", d.EarliestRestoreDate) - populate(objectMap, "elasticPoolId", d.ElasticPoolID) - populate(objectMap, "failoverGroupId", d.FailoverGroupID) - populate(objectMap, "federatedClientId", d.FederatedClientID) - populate(objectMap, "highAvailabilityReplicaCount", d.HighAvailabilityReplicaCount) - populate(objectMap, "isInfraEncryptionEnabled", d.IsInfraEncryptionEnabled) - populate(objectMap, "isLedgerOn", d.IsLedgerOn) - populate(objectMap, "licenseType", d.LicenseType) - populate(objectMap, "longTermRetentionBackupResourceId", d.LongTermRetentionBackupResourceID) - populate(objectMap, "maintenanceConfigurationId", d.MaintenanceConfigurationID) - populate(objectMap, "maxLogSizeBytes", d.MaxLogSizeBytes) - populate(objectMap, "maxSizeBytes", d.MaxSizeBytes) - populate(objectMap, "minCapacity", d.MinCapacity) - populateTimeRFC3339(objectMap, "pausedDate", d.PausedDate) - populate(objectMap, "readScale", d.ReadScale) - populate(objectMap, "recoverableDatabaseId", d.RecoverableDatabaseID) - populate(objectMap, "recoveryServicesRecoveryPointId", d.RecoveryServicesRecoveryPointID) - populate(objectMap, "requestedBackupStorageRedundancy", d.RequestedBackupStorageRedundancy) - populate(objectMap, "requestedServiceObjectiveName", d.RequestedServiceObjectiveName) - populate(objectMap, "restorableDroppedDatabaseId", d.RestorableDroppedDatabaseID) - populateTimeRFC3339(objectMap, "restorePointInTime", d.RestorePointInTime) - populateTimeRFC3339(objectMap, "resumedDate", d.ResumedDate) - populate(objectMap, "sampleName", d.SampleName) - populate(objectMap, "secondaryType", d.SecondaryType) - populateTimeRFC3339(objectMap, "sourceDatabaseDeletionDate", d.SourceDatabaseDeletionDate) - populate(objectMap, "sourceDatabaseId", d.SourceDatabaseID) - populate(objectMap, "sourceResourceId", d.SourceResourceID) - populate(objectMap, "status", d.Status) - populate(objectMap, "zoneRedundant", d.ZoneRedundant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseProperties. -func (d *DatabaseProperties) UnmarshalJSON(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 "autoPauseDelay": - err = unpopulate(val, "AutoPauseDelay", &d.AutoPauseDelay) - delete(rawMsg, key) - case "catalogCollation": - err = unpopulate(val, "CatalogCollation", &d.CatalogCollation) - delete(rawMsg, key) - case "collation": - err = unpopulate(val, "Collation", &d.Collation) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &d.CreateMode) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &d.CreationDate) - delete(rawMsg, key) - case "currentBackupStorageRedundancy": - err = unpopulate(val, "CurrentBackupStorageRedundancy", &d.CurrentBackupStorageRedundancy) - delete(rawMsg, key) - case "currentSku": - err = unpopulate(val, "CurrentSKU", &d.CurrentSKU) - delete(rawMsg, key) - case "currentServiceObjectiveName": - err = unpopulate(val, "CurrentServiceObjectiveName", &d.CurrentServiceObjectiveName) - delete(rawMsg, key) - case "databaseId": - err = unpopulate(val, "DatabaseID", &d.DatabaseID) - delete(rawMsg, key) - case "defaultSecondaryLocation": - err = unpopulate(val, "DefaultSecondaryLocation", &d.DefaultSecondaryLocation) - delete(rawMsg, key) - case "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &d.EarliestRestoreDate) - delete(rawMsg, key) - case "elasticPoolId": - err = unpopulate(val, "ElasticPoolID", &d.ElasticPoolID) - delete(rawMsg, key) - case "failoverGroupId": - err = unpopulate(val, "FailoverGroupID", &d.FailoverGroupID) - delete(rawMsg, key) - case "federatedClientId": - err = unpopulate(val, "FederatedClientID", &d.FederatedClientID) - delete(rawMsg, key) - case "highAvailabilityReplicaCount": - err = unpopulate(val, "HighAvailabilityReplicaCount", &d.HighAvailabilityReplicaCount) - delete(rawMsg, key) - case "isInfraEncryptionEnabled": - err = unpopulate(val, "IsInfraEncryptionEnabled", &d.IsInfraEncryptionEnabled) - delete(rawMsg, key) - case "isLedgerOn": - err = unpopulate(val, "IsLedgerOn", &d.IsLedgerOn) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &d.LicenseType) - delete(rawMsg, key) - case "longTermRetentionBackupResourceId": - err = unpopulate(val, "LongTermRetentionBackupResourceID", &d.LongTermRetentionBackupResourceID) - delete(rawMsg, key) - case "maintenanceConfigurationId": - err = unpopulate(val, "MaintenanceConfigurationID", &d.MaintenanceConfigurationID) - delete(rawMsg, key) - case "maxLogSizeBytes": - err = unpopulate(val, "MaxLogSizeBytes", &d.MaxLogSizeBytes) - delete(rawMsg, key) - case "maxSizeBytes": - err = unpopulate(val, "MaxSizeBytes", &d.MaxSizeBytes) - delete(rawMsg, key) - case "minCapacity": - err = unpopulate(val, "MinCapacity", &d.MinCapacity) - delete(rawMsg, key) - case "pausedDate": - err = unpopulateTimeRFC3339(val, "PausedDate", &d.PausedDate) - delete(rawMsg, key) - case "readScale": - err = unpopulate(val, "ReadScale", &d.ReadScale) - delete(rawMsg, key) - case "recoverableDatabaseId": - err = unpopulate(val, "RecoverableDatabaseID", &d.RecoverableDatabaseID) - delete(rawMsg, key) - case "recoveryServicesRecoveryPointId": - err = unpopulate(val, "RecoveryServicesRecoveryPointID", &d.RecoveryServicesRecoveryPointID) - delete(rawMsg, key) - case "requestedBackupStorageRedundancy": - err = unpopulate(val, "RequestedBackupStorageRedundancy", &d.RequestedBackupStorageRedundancy) - delete(rawMsg, key) - case "requestedServiceObjectiveName": - err = unpopulate(val, "RequestedServiceObjectiveName", &d.RequestedServiceObjectiveName) - delete(rawMsg, key) - case "restorableDroppedDatabaseId": - err = unpopulate(val, "RestorableDroppedDatabaseID", &d.RestorableDroppedDatabaseID) - delete(rawMsg, key) - case "restorePointInTime": - err = unpopulateTimeRFC3339(val, "RestorePointInTime", &d.RestorePointInTime) - delete(rawMsg, key) - case "resumedDate": - err = unpopulateTimeRFC3339(val, "ResumedDate", &d.ResumedDate) - delete(rawMsg, key) - case "sampleName": - err = unpopulate(val, "SampleName", &d.SampleName) - delete(rawMsg, key) - case "secondaryType": - err = unpopulate(val, "SecondaryType", &d.SecondaryType) - delete(rawMsg, key) - case "sourceDatabaseDeletionDate": - err = unpopulateTimeRFC3339(val, "SourceDatabaseDeletionDate", &d.SourceDatabaseDeletionDate) - delete(rawMsg, key) - case "sourceDatabaseId": - err = unpopulate(val, "SourceDatabaseID", &d.SourceDatabaseID) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &d.ZoneRedundant) - 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 DatabaseUpdate. -func (d DatabaseUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", d.Identity) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "sku", d.SKU) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseUpdateProperties. -func (d DatabaseUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoPauseDelay", d.AutoPauseDelay) - populate(objectMap, "catalogCollation", d.CatalogCollation) - populate(objectMap, "collation", d.Collation) - populate(objectMap, "createMode", d.CreateMode) - populateTimeRFC3339(objectMap, "creationDate", d.CreationDate) - populate(objectMap, "currentBackupStorageRedundancy", d.CurrentBackupStorageRedundancy) - populate(objectMap, "currentSku", d.CurrentSKU) - populate(objectMap, "currentServiceObjectiveName", d.CurrentServiceObjectiveName) - populate(objectMap, "databaseId", d.DatabaseID) - populate(objectMap, "defaultSecondaryLocation", d.DefaultSecondaryLocation) - populateTimeRFC3339(objectMap, "earliestRestoreDate", d.EarliestRestoreDate) - populate(objectMap, "elasticPoolId", d.ElasticPoolID) - populate(objectMap, "failoverGroupId", d.FailoverGroupID) - populate(objectMap, "federatedClientId", d.FederatedClientID) - populate(objectMap, "highAvailabilityReplicaCount", d.HighAvailabilityReplicaCount) - populate(objectMap, "isInfraEncryptionEnabled", d.IsInfraEncryptionEnabled) - populate(objectMap, "isLedgerOn", d.IsLedgerOn) - populate(objectMap, "licenseType", d.LicenseType) - populate(objectMap, "longTermRetentionBackupResourceId", d.LongTermRetentionBackupResourceID) - populate(objectMap, "maintenanceConfigurationId", d.MaintenanceConfigurationID) - populate(objectMap, "maxLogSizeBytes", d.MaxLogSizeBytes) - populate(objectMap, "maxSizeBytes", d.MaxSizeBytes) - populate(objectMap, "minCapacity", d.MinCapacity) - populateTimeRFC3339(objectMap, "pausedDate", d.PausedDate) - populate(objectMap, "readScale", d.ReadScale) - populate(objectMap, "recoverableDatabaseId", d.RecoverableDatabaseID) - populate(objectMap, "recoveryServicesRecoveryPointId", d.RecoveryServicesRecoveryPointID) - populate(objectMap, "requestedBackupStorageRedundancy", d.RequestedBackupStorageRedundancy) - populate(objectMap, "requestedServiceObjectiveName", d.RequestedServiceObjectiveName) - populate(objectMap, "restorableDroppedDatabaseId", d.RestorableDroppedDatabaseID) - populateTimeRFC3339(objectMap, "restorePointInTime", d.RestorePointInTime) - populateTimeRFC3339(objectMap, "resumedDate", d.ResumedDate) - populate(objectMap, "sampleName", d.SampleName) - populate(objectMap, "secondaryType", d.SecondaryType) - populateTimeRFC3339(objectMap, "sourceDatabaseDeletionDate", d.SourceDatabaseDeletionDate) - populate(objectMap, "sourceDatabaseId", d.SourceDatabaseID) - populate(objectMap, "status", d.Status) - populate(objectMap, "zoneRedundant", d.ZoneRedundant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DatabaseUpdateProperties. -func (d *DatabaseUpdateProperties) UnmarshalJSON(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 "autoPauseDelay": - err = unpopulate(val, "AutoPauseDelay", &d.AutoPauseDelay) - delete(rawMsg, key) - case "catalogCollation": - err = unpopulate(val, "CatalogCollation", &d.CatalogCollation) - delete(rawMsg, key) - case "collation": - err = unpopulate(val, "Collation", &d.Collation) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &d.CreateMode) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &d.CreationDate) - delete(rawMsg, key) - case "currentBackupStorageRedundancy": - err = unpopulate(val, "CurrentBackupStorageRedundancy", &d.CurrentBackupStorageRedundancy) - delete(rawMsg, key) - case "currentSku": - err = unpopulate(val, "CurrentSKU", &d.CurrentSKU) - delete(rawMsg, key) - case "currentServiceObjectiveName": - err = unpopulate(val, "CurrentServiceObjectiveName", &d.CurrentServiceObjectiveName) - delete(rawMsg, key) - case "databaseId": - err = unpopulate(val, "DatabaseID", &d.DatabaseID) - delete(rawMsg, key) - case "defaultSecondaryLocation": - err = unpopulate(val, "DefaultSecondaryLocation", &d.DefaultSecondaryLocation) - delete(rawMsg, key) - case "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &d.EarliestRestoreDate) - delete(rawMsg, key) - case "elasticPoolId": - err = unpopulate(val, "ElasticPoolID", &d.ElasticPoolID) - delete(rawMsg, key) - case "failoverGroupId": - err = unpopulate(val, "FailoverGroupID", &d.FailoverGroupID) - delete(rawMsg, key) - case "federatedClientId": - err = unpopulate(val, "FederatedClientID", &d.FederatedClientID) - delete(rawMsg, key) - case "highAvailabilityReplicaCount": - err = unpopulate(val, "HighAvailabilityReplicaCount", &d.HighAvailabilityReplicaCount) - delete(rawMsg, key) - case "isInfraEncryptionEnabled": - err = unpopulate(val, "IsInfraEncryptionEnabled", &d.IsInfraEncryptionEnabled) - delete(rawMsg, key) - case "isLedgerOn": - err = unpopulate(val, "IsLedgerOn", &d.IsLedgerOn) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &d.LicenseType) - delete(rawMsg, key) - case "longTermRetentionBackupResourceId": - err = unpopulate(val, "LongTermRetentionBackupResourceID", &d.LongTermRetentionBackupResourceID) - delete(rawMsg, key) - case "maintenanceConfigurationId": - err = unpopulate(val, "MaintenanceConfigurationID", &d.MaintenanceConfigurationID) - delete(rawMsg, key) - case "maxLogSizeBytes": - err = unpopulate(val, "MaxLogSizeBytes", &d.MaxLogSizeBytes) - delete(rawMsg, key) - case "maxSizeBytes": - err = unpopulate(val, "MaxSizeBytes", &d.MaxSizeBytes) - delete(rawMsg, key) - case "minCapacity": - err = unpopulate(val, "MinCapacity", &d.MinCapacity) - delete(rawMsg, key) - case "pausedDate": - err = unpopulateTimeRFC3339(val, "PausedDate", &d.PausedDate) - delete(rawMsg, key) - case "readScale": - err = unpopulate(val, "ReadScale", &d.ReadScale) - delete(rawMsg, key) - case "recoverableDatabaseId": - err = unpopulate(val, "RecoverableDatabaseID", &d.RecoverableDatabaseID) - delete(rawMsg, key) - case "recoveryServicesRecoveryPointId": - err = unpopulate(val, "RecoveryServicesRecoveryPointID", &d.RecoveryServicesRecoveryPointID) - delete(rawMsg, key) - case "requestedBackupStorageRedundancy": - err = unpopulate(val, "RequestedBackupStorageRedundancy", &d.RequestedBackupStorageRedundancy) - delete(rawMsg, key) - case "requestedServiceObjectiveName": - err = unpopulate(val, "RequestedServiceObjectiveName", &d.RequestedServiceObjectiveName) - delete(rawMsg, key) - case "restorableDroppedDatabaseId": - err = unpopulate(val, "RestorableDroppedDatabaseID", &d.RestorableDroppedDatabaseID) - delete(rawMsg, key) - case "restorePointInTime": - err = unpopulateTimeRFC3339(val, "RestorePointInTime", &d.RestorePointInTime) - delete(rawMsg, key) - case "resumedDate": - err = unpopulateTimeRFC3339(val, "ResumedDate", &d.ResumedDate) - delete(rawMsg, key) - case "sampleName": - err = unpopulate(val, "SampleName", &d.SampleName) - delete(rawMsg, key) - case "secondaryType": - err = unpopulate(val, "SecondaryType", &d.SecondaryType) - delete(rawMsg, key) - case "sourceDatabaseDeletionDate": - err = unpopulateTimeRFC3339(val, "SourceDatabaseDeletionDate", &d.SourceDatabaseDeletionDate) - delete(rawMsg, key) - case "sourceDatabaseId": - err = unpopulate(val, "SourceDatabaseID", &d.SourceDatabaseID) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) - delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &d.ZoneRedundant) - 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 DatabaseVulnerabilityAssessmentRuleBaselineItem. -func (d DatabaseVulnerabilityAssessmentRuleBaselineItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "result", d.Result) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DatabaseVulnerabilityAssessmentRuleBaselineProperties. -func (d DatabaseVulnerabilityAssessmentRuleBaselineProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "baselineResults", d.BaselineResults) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DeletedServerProperties. -func (d DeletedServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "deletionTime", d.DeletionTime) - populate(objectMap, "fullyQualifiedDomainName", d.FullyQualifiedDomainName) - populate(objectMap, "originalId", d.OriginalID) - populate(objectMap, "version", d.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServerProperties. -func (d *DeletedServerProperties) UnmarshalJSON(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 "deletionTime": - err = unpopulateTimeRFC3339(val, "DeletionTime", &d.DeletionTime) - delete(rawMsg, key) - case "fullyQualifiedDomainName": - err = unpopulate(val, "FullyQualifiedDomainName", &d.FullyQualifiedDomainName) - delete(rawMsg, key) - case "originalId": - err = unpopulate(val, "OriginalID", &d.OriginalID) - delete(rawMsg, key) - case "version": - err = unpopulate(val, "Version", &d.Version) - 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 DistributedAvailabilityGroup. -func (d DistributedAvailabilityGroup) 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) -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPool. -func (e ElasticPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", e.ID) - populate(objectMap, "kind", e.Kind) - populate(objectMap, "location", e.Location) - populate(objectMap, "name", e.Name) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "sku", e.SKU) - populate(objectMap, "tags", e.Tags) - populate(objectMap, "type", e.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ElasticPoolActivityProperties. -func (e ElasticPoolActivityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "elasticPoolName", e.ElasticPoolName) - populateTimeRFC3339(objectMap, "endTime", e.EndTime) - populate(objectMap, "errorCode", e.ErrorCode) - populate(objectMap, "errorMessage", e.ErrorMessage) - populate(objectMap, "errorSeverity", e.ErrorSeverity) - populate(objectMap, "operation", e.Operation) - populate(objectMap, "operationId", e.OperationID) - populate(objectMap, "percentComplete", e.PercentComplete) - populate(objectMap, "requestedDatabaseDtuCap", e.RequestedDatabaseDtuCap) - populate(objectMap, "requestedDatabaseDtuGuarantee", e.RequestedDatabaseDtuGuarantee) - populate(objectMap, "requestedDatabaseDtuMax", e.RequestedDatabaseDtuMax) - populate(objectMap, "requestedDatabaseDtuMin", e.RequestedDatabaseDtuMin) - populate(objectMap, "requestedDtu", e.RequestedDtu) - populate(objectMap, "requestedDtuGuarantee", e.RequestedDtuGuarantee) - populate(objectMap, "requestedElasticPoolName", e.RequestedElasticPoolName) - populate(objectMap, "requestedStorageLimitInGB", e.RequestedStorageLimitInGB) - populate(objectMap, "requestedStorageLimitInMB", e.RequestedStorageLimitInMB) - populate(objectMap, "serverName", e.ServerName) - populateTimeRFC3339(objectMap, "startTime", e.StartTime) - populate(objectMap, "state", e.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolActivityProperties. -func (e *ElasticPoolActivityProperties) UnmarshalJSON(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 "elasticPoolName": - err = unpopulate(val, "ElasticPoolName", &e.ElasticPoolName) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &e.ErrorCode) - delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &e.ErrorMessage) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &e.Operation) - delete(rawMsg, key) - case "operationId": - err = unpopulate(val, "OperationID", &e.OperationID) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &e.PercentComplete) - delete(rawMsg, key) - case "requestedDatabaseDtuCap": - err = unpopulate(val, "RequestedDatabaseDtuCap", &e.RequestedDatabaseDtuCap) - delete(rawMsg, key) - case "requestedDatabaseDtuGuarantee": - err = unpopulate(val, "RequestedDatabaseDtuGuarantee", &e.RequestedDatabaseDtuGuarantee) - delete(rawMsg, key) - case "requestedDatabaseDtuMax": - err = unpopulate(val, "RequestedDatabaseDtuMax", &e.RequestedDatabaseDtuMax) - delete(rawMsg, key) - case "requestedDatabaseDtuMin": - err = unpopulate(val, "RequestedDatabaseDtuMin", &e.RequestedDatabaseDtuMin) - delete(rawMsg, key) - case "requestedDtu": - err = unpopulate(val, "RequestedDtu", &e.RequestedDtu) - delete(rawMsg, key) - case "requestedDtuGuarantee": - err = unpopulate(val, "RequestedDtuGuarantee", &e.RequestedDtuGuarantee) - delete(rawMsg, key) - case "requestedElasticPoolName": - err = unpopulate(val, "RequestedElasticPoolName", &e.RequestedElasticPoolName) - delete(rawMsg, key) - case "requestedStorageLimitInGB": - err = unpopulate(val, "RequestedStorageLimitInGB", &e.RequestedStorageLimitInGB) - delete(rawMsg, key) - case "requestedStorageLimitInMB": - err = unpopulate(val, "RequestedStorageLimitInMB", &e.RequestedStorageLimitInMB) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &e.ServerName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - 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 ElasticPoolDatabaseActivityProperties. -func (e ElasticPoolDatabaseActivityProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "currentElasticPoolName", e.CurrentElasticPoolName) - populate(objectMap, "currentServiceObjective", e.CurrentServiceObjective) - populate(objectMap, "databaseName", e.DatabaseName) - populateTimeRFC3339(objectMap, "endTime", e.EndTime) - populate(objectMap, "errorCode", e.ErrorCode) - populate(objectMap, "errorMessage", e.ErrorMessage) - populate(objectMap, "errorSeverity", e.ErrorSeverity) - populate(objectMap, "operation", e.Operation) - populate(objectMap, "operationId", e.OperationID) - populate(objectMap, "percentComplete", e.PercentComplete) - populate(objectMap, "requestedElasticPoolName", e.RequestedElasticPoolName) - populate(objectMap, "requestedServiceObjective", e.RequestedServiceObjective) - populate(objectMap, "serverName", e.ServerName) - populateTimeRFC3339(objectMap, "startTime", e.StartTime) - populate(objectMap, "state", e.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolDatabaseActivityProperties. -func (e *ElasticPoolDatabaseActivityProperties) UnmarshalJSON(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 "currentElasticPoolName": - err = unpopulate(val, "CurrentElasticPoolName", &e.CurrentElasticPoolName) - delete(rawMsg, key) - case "currentServiceObjective": - err = unpopulate(val, "CurrentServiceObjective", &e.CurrentServiceObjective) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &e.DatabaseName) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &e.EndTime) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &e.ErrorCode) - delete(rawMsg, key) - case "errorMessage": - err = unpopulate(val, "ErrorMessage", &e.ErrorMessage) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &e.Operation) - delete(rawMsg, key) - case "operationId": - err = unpopulate(val, "OperationID", &e.OperationID) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &e.PercentComplete) - delete(rawMsg, key) - case "requestedElasticPoolName": - err = unpopulate(val, "RequestedElasticPoolName", &e.RequestedElasticPoolName) - delete(rawMsg, key) - case "requestedServiceObjective": - err = unpopulate(val, "RequestedServiceObjective", &e.RequestedServiceObjective) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &e.ServerName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - 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 ElasticPoolOperationProperties. -func (e ElasticPoolOperationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", e.Description) - populate(objectMap, "elasticPoolName", e.ElasticPoolName) - populate(objectMap, "errorCode", e.ErrorCode) - populate(objectMap, "errorDescription", e.ErrorDescription) - populate(objectMap, "errorSeverity", e.ErrorSeverity) - populateTimeRFC3339(objectMap, "estimatedCompletionTime", e.EstimatedCompletionTime) - populate(objectMap, "isCancellable", e.IsCancellable) - populate(objectMap, "isUserError", e.IsUserError) - populate(objectMap, "operation", e.Operation) - populate(objectMap, "operationFriendlyName", e.OperationFriendlyName) - populate(objectMap, "percentComplete", e.PercentComplete) - populate(objectMap, "serverName", e.ServerName) - populateTimeRFC3339(objectMap, "startTime", e.StartTime) - populate(objectMap, "state", e.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolOperationProperties. -func (e *ElasticPoolOperationProperties) UnmarshalJSON(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 "description": - err = unpopulate(val, "Description", &e.Description) - delete(rawMsg, key) - case "elasticPoolName": - err = unpopulate(val, "ElasticPoolName", &e.ElasticPoolName) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &e.ErrorCode) - delete(rawMsg, key) - case "errorDescription": - err = unpopulate(val, "ErrorDescription", &e.ErrorDescription) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &e.ErrorSeverity) - delete(rawMsg, key) - case "estimatedCompletionTime": - err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &e.EstimatedCompletionTime) - delete(rawMsg, key) - case "isCancellable": - err = unpopulate(val, "IsCancellable", &e.IsCancellable) - delete(rawMsg, key) - case "isUserError": - err = unpopulate(val, "IsUserError", &e.IsUserError) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &e.Operation) - delete(rawMsg, key) - case "operationFriendlyName": - err = unpopulate(val, "OperationFriendlyName", &e.OperationFriendlyName) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &e.PercentComplete) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &e.ServerName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &e.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - 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 ElasticPoolProperties. -func (e ElasticPoolProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationDate", e.CreationDate) - populate(objectMap, "highAvailabilityReplicaCount", e.HighAvailabilityReplicaCount) - populate(objectMap, "licenseType", e.LicenseType) - populate(objectMap, "maintenanceConfigurationId", e.MaintenanceConfigurationID) - populate(objectMap, "maxSizeBytes", e.MaxSizeBytes) - populate(objectMap, "perDatabaseSettings", e.PerDatabaseSettings) - populate(objectMap, "state", e.State) - populate(objectMap, "zoneRedundant", e.ZoneRedundant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ElasticPoolProperties. -func (e *ElasticPoolProperties) UnmarshalJSON(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 "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &e.CreationDate) - delete(rawMsg, key) - case "highAvailabilityReplicaCount": - err = unpopulate(val, "HighAvailabilityReplicaCount", &e.HighAvailabilityReplicaCount) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &e.LicenseType) - delete(rawMsg, key) - case "maintenanceConfigurationId": - err = unpopulate(val, "MaintenanceConfigurationID", &e.MaintenanceConfigurationID) - delete(rawMsg, key) - case "maxSizeBytes": - err = unpopulate(val, "MaxSizeBytes", &e.MaxSizeBytes) - delete(rawMsg, key) - case "perDatabaseSettings": - err = unpopulate(val, "PerDatabaseSettings", &e.PerDatabaseSettings) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &e.State) - delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &e.ZoneRedundant) - 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 ElasticPoolUpdate. -func (e ElasticPoolUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", e.Properties) - populate(objectMap, "sku", e.SKU) - populate(objectMap, "tags", e.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ExtendedDatabaseBlobAuditingPolicyProperties. -func (e ExtendedDatabaseBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "auditActionsAndGroups", e.AuditActionsAndGroups) - populate(objectMap, "isAzureMonitorTargetEnabled", e.IsAzureMonitorTargetEnabled) - populate(objectMap, "isManagedIdentityInUse", e.IsManagedIdentityInUse) - populate(objectMap, "isStorageSecondaryKeyInUse", e.IsStorageSecondaryKeyInUse) - populate(objectMap, "predicateExpression", e.PredicateExpression) - populate(objectMap, "queueDelayMs", e.QueueDelayMs) - populate(objectMap, "retentionDays", e.RetentionDays) - populate(objectMap, "state", e.State) - populate(objectMap, "storageAccountAccessKey", e.StorageAccountAccessKey) - populate(objectMap, "storageAccountSubscriptionId", e.StorageAccountSubscriptionID) - populate(objectMap, "storageEndpoint", e.StorageEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ExtendedServerBlobAuditingPolicyProperties. -func (e ExtendedServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "auditActionsAndGroups", e.AuditActionsAndGroups) - populate(objectMap, "isAzureMonitorTargetEnabled", e.IsAzureMonitorTargetEnabled) - populate(objectMap, "isDevopsAuditEnabled", e.IsDevopsAuditEnabled) - populate(objectMap, "isManagedIdentityInUse", e.IsManagedIdentityInUse) - populate(objectMap, "isStorageSecondaryKeyInUse", e.IsStorageSecondaryKeyInUse) - populate(objectMap, "predicateExpression", e.PredicateExpression) - populate(objectMap, "queueDelayMs", e.QueueDelayMs) - populate(objectMap, "retentionDays", e.RetentionDays) - populate(objectMap, "state", e.State) - populate(objectMap, "storageAccountAccessKey", e.StorageAccountAccessKey) - populate(objectMap, "storageAccountSubscriptionId", e.StorageAccountSubscriptionID) - populate(objectMap, "storageEndpoint", e.StorageEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FailoverGroup. -func (f FailoverGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", f.ID) - populate(objectMap, "location", f.Location) - populate(objectMap, "name", f.Name) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "tags", f.Tags) - populate(objectMap, "type", f.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FailoverGroupProperties. -func (f FailoverGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databases", f.Databases) - populate(objectMap, "partnerServers", f.PartnerServers) - populate(objectMap, "readOnlyEndpoint", f.ReadOnlyEndpoint) - populate(objectMap, "readWriteEndpoint", f.ReadWriteEndpoint) - populate(objectMap, "replicationRole", f.ReplicationRole) - populate(objectMap, "replicationState", f.ReplicationState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FailoverGroupUpdate. -func (f FailoverGroupUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", f.Properties) - populate(objectMap, "tags", f.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FailoverGroupUpdateProperties. -func (f FailoverGroupUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databases", f.Databases) - populate(objectMap, "readOnlyEndpoint", f.ReadOnlyEndpoint) - populate(objectMap, "readWriteEndpoint", f.ReadWriteEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type FirewallRuleList. -func (f FirewallRuleList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "values", f.Values) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ImportExportOperationResultProperties. -func (i ImportExportOperationResultProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blobUri", i.BlobURI) - populate(objectMap, "databaseName", i.DatabaseName) - populate(objectMap, "errorMessage", i.ErrorMessage) - populate(objectMap, "lastModifiedTime", i.LastModifiedTime) - populate(objectMap, "privateEndpointConnections", i.PrivateEndpointConnections) - populate(objectMap, "queuedTime", i.QueuedTime) - populate(objectMap, "requestId", i.RequestID) - populate(objectMap, "requestType", i.RequestType) - populate(objectMap, "serverName", i.ServerName) - populate(objectMap, "status", i.Status) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InstanceFailoverGroupProperties. -func (i InstanceFailoverGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "managedInstancePairs", i.ManagedInstancePairs) - populate(objectMap, "partnerRegions", i.PartnerRegions) - populate(objectMap, "readOnlyEndpoint", i.ReadOnlyEndpoint) - populate(objectMap, "readWriteEndpoint", i.ReadWriteEndpoint) - populate(objectMap, "replicationRole", i.ReplicationRole) - populate(objectMap, "replicationState", i.ReplicationState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InstancePool. -func (i InstancePool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "sku", i.SKU) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type InstancePoolUpdate. -func (i InstancePoolUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", i.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type JobAgent. -func (j JobAgent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", j.ID) - populate(objectMap, "location", j.Location) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "sku", j.SKU) - populate(objectMap, "tags", j.Tags) - populate(objectMap, "type", j.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type JobAgentUpdate. -func (j JobAgentUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", j.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type JobExecutionProperties. -func (j JobExecutionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createTime", j.CreateTime) - populateTimeRFC3339(objectMap, "currentAttemptStartTime", j.CurrentAttemptStartTime) - populate(objectMap, "currentAttempts", j.CurrentAttempts) - populateTimeRFC3339(objectMap, "endTime", j.EndTime) - populate(objectMap, "jobExecutionId", j.JobExecutionID) - populate(objectMap, "jobVersion", j.JobVersion) - populate(objectMap, "lastMessage", j.LastMessage) - populate(objectMap, "lifecycle", j.Lifecycle) - populate(objectMap, "provisioningState", j.ProvisioningState) - populateTimeRFC3339(objectMap, "startTime", j.StartTime) - populate(objectMap, "stepId", j.StepID) - populate(objectMap, "stepName", j.StepName) - populate(objectMap, "target", j.Target) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobExecutionProperties. -func (j *JobExecutionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createTime": - err = unpopulateTimeRFC3339(val, "CreateTime", &j.CreateTime) - delete(rawMsg, key) - case "currentAttemptStartTime": - err = unpopulateTimeRFC3339(val, "CurrentAttemptStartTime", &j.CurrentAttemptStartTime) - delete(rawMsg, key) - case "currentAttempts": - err = unpopulate(val, "CurrentAttempts", &j.CurrentAttempts) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) - delete(rawMsg, key) - case "jobExecutionId": - err = unpopulate(val, "JobExecutionID", &j.JobExecutionID) - delete(rawMsg, key) - case "jobVersion": - err = unpopulate(val, "JobVersion", &j.JobVersion) - delete(rawMsg, key) - case "lastMessage": - err = unpopulate(val, "LastMessage", &j.LastMessage) - delete(rawMsg, key) - case "lifecycle": - err = unpopulate(val, "Lifecycle", &j.Lifecycle) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &j.ProvisioningState) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) - delete(rawMsg, key) - case "stepId": - err = unpopulate(val, "StepID", &j.StepID) - delete(rawMsg, key) - case "stepName": - err = unpopulate(val, "StepName", &j.StepName) - delete(rawMsg, key) - case "target": - err = unpopulate(val, "Target", &j.Target) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type JobSchedule. -func (j JobSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enabled", j.Enabled) - populateTimeRFC3339(objectMap, "endTime", j.EndTime) - populate(objectMap, "interval", j.Interval) - populateTimeRFC3339(objectMap, "startTime", j.StartTime) - populate(objectMap, "type", j.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type JobSchedule. -func (j *JobSchedule) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "enabled": - err = unpopulate(val, "Enabled", &j.Enabled) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) - delete(rawMsg, key) - case "interval": - err = unpopulate(val, "Interval", &j.Interval) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type JobTargetGroupProperties. -func (j JobTargetGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "members", j.Members) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionBackupProperties. -func (l LongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "backupExpirationTime", l.BackupExpirationTime) - populate(objectMap, "backupStorageRedundancy", l.BackupStorageRedundancy) - populateTimeRFC3339(objectMap, "backupTime", l.BackupTime) - populateTimeRFC3339(objectMap, "databaseDeletionTime", l.DatabaseDeletionTime) - populate(objectMap, "databaseName", l.DatabaseName) - populate(objectMap, "requestedBackupStorageRedundancy", l.RequestedBackupStorageRedundancy) - populateTimeRFC3339(objectMap, "serverCreateTime", l.ServerCreateTime) - populate(objectMap, "serverName", l.ServerName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionBackupProperties. -func (l *LongTermRetentionBackupProperties) UnmarshalJSON(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 "backupExpirationTime": - err = unpopulateTimeRFC3339(val, "BackupExpirationTime", &l.BackupExpirationTime) - delete(rawMsg, key) - case "backupStorageRedundancy": - err = unpopulate(val, "BackupStorageRedundancy", &l.BackupStorageRedundancy) - delete(rawMsg, key) - case "backupTime": - err = unpopulateTimeRFC3339(val, "BackupTime", &l.BackupTime) - delete(rawMsg, key) - case "databaseDeletionTime": - err = unpopulateTimeRFC3339(val, "DatabaseDeletionTime", &l.DatabaseDeletionTime) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &l.DatabaseName) - delete(rawMsg, key) - case "requestedBackupStorageRedundancy": - err = unpopulate(val, "RequestedBackupStorageRedundancy", &l.RequestedBackupStorageRedundancy) - delete(rawMsg, key) - case "serverCreateTime": - err = unpopulateTimeRFC3339(val, "ServerCreateTime", &l.ServerCreateTime) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &l.ServerName) - 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 MaintenanceWindowOptionsProperties. -func (m MaintenanceWindowOptionsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowMultipleMaintenanceWindowsPerCycle", m.AllowMultipleMaintenanceWindowsPerCycle) - populate(objectMap, "defaultDurationInMinutes", m.DefaultDurationInMinutes) - populate(objectMap, "isEnabled", m.IsEnabled) - populate(objectMap, "maintenanceWindowCycles", m.MaintenanceWindowCycles) - populate(objectMap, "minCycles", m.MinCycles) - populate(objectMap, "minDurationInMinutes", m.MinDurationInMinutes) - populate(objectMap, "timeGranularityInMinutes", m.TimeGranularityInMinutes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MaintenanceWindowsProperties. -func (m MaintenanceWindowsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "timeRanges", m.TimeRanges) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedBackupShortTermRetentionPolicy. -func (m ManagedBackupShortTermRetentionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedDatabase. -func (m ManagedDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedDatabaseProperties. -func (m ManagedDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoCompleteRestore", m.AutoCompleteRestore) - populate(objectMap, "catalogCollation", m.CatalogCollation) - populate(objectMap, "collation", m.Collation) - populate(objectMap, "createMode", m.CreateMode) - populateTimeRFC3339(objectMap, "creationDate", m.CreationDate) - populate(objectMap, "defaultSecondaryLocation", m.DefaultSecondaryLocation) - populateTimeRFC3339(objectMap, "earliestRestorePoint", m.EarliestRestorePoint) - populate(objectMap, "failoverGroupId", m.FailoverGroupID) - populate(objectMap, "lastBackupName", m.LastBackupName) - populate(objectMap, "longTermRetentionBackupResourceId", m.LongTermRetentionBackupResourceID) - populate(objectMap, "recoverableDatabaseId", m.RecoverableDatabaseID) - populate(objectMap, "restorableDroppedDatabaseId", m.RestorableDroppedDatabaseID) - populateTimeRFC3339(objectMap, "restorePointInTime", m.RestorePointInTime) - populate(objectMap, "sourceDatabaseId", m.SourceDatabaseID) - populate(objectMap, "status", m.Status) - populate(objectMap, "storageContainerSasToken", m.StorageContainerSasToken) - populate(objectMap, "storageContainerUri", m.StorageContainerURI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseProperties. -func (m *ManagedDatabaseProperties) UnmarshalJSON(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 "autoCompleteRestore": - err = unpopulate(val, "AutoCompleteRestore", &m.AutoCompleteRestore) - delete(rawMsg, key) - case "catalogCollation": - err = unpopulate(val, "CatalogCollation", &m.CatalogCollation) - delete(rawMsg, key) - case "collation": - err = unpopulate(val, "Collation", &m.Collation) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &m.CreateMode) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &m.CreationDate) - delete(rawMsg, key) - case "defaultSecondaryLocation": - err = unpopulate(val, "DefaultSecondaryLocation", &m.DefaultSecondaryLocation) - delete(rawMsg, key) - case "earliestRestorePoint": - err = unpopulateTimeRFC3339(val, "EarliestRestorePoint", &m.EarliestRestorePoint) - delete(rawMsg, key) - case "failoverGroupId": - err = unpopulate(val, "FailoverGroupID", &m.FailoverGroupID) - delete(rawMsg, key) - case "lastBackupName": - err = unpopulate(val, "LastBackupName", &m.LastBackupName) - delete(rawMsg, key) - case "longTermRetentionBackupResourceId": - err = unpopulate(val, "LongTermRetentionBackupResourceID", &m.LongTermRetentionBackupResourceID) - delete(rawMsg, key) - case "recoverableDatabaseId": - err = unpopulate(val, "RecoverableDatabaseID", &m.RecoverableDatabaseID) - delete(rawMsg, key) - case "restorableDroppedDatabaseId": - err = unpopulate(val, "RestorableDroppedDatabaseID", &m.RestorableDroppedDatabaseID) - delete(rawMsg, key) - case "restorePointInTime": - err = unpopulateTimeRFC3339(val, "RestorePointInTime", &m.RestorePointInTime) - delete(rawMsg, key) - case "sourceDatabaseId": - err = unpopulate(val, "SourceDatabaseID", &m.SourceDatabaseID) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - case "storageContainerSasToken": - err = unpopulate(val, "StorageContainerSasToken", &m.StorageContainerSasToken) - delete(rawMsg, key) - case "storageContainerUri": - err = unpopulate(val, "StorageContainerURI", &m.StorageContainerURI) - 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 ManagedDatabaseRestoreDetailsProperties. -func (m ManagedDatabaseRestoreDetailsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "blockReason", m.BlockReason) - populate(objectMap, "currentRestoringFileName", m.CurrentRestoringFileName) - populate(objectMap, "lastRestoredFileName", m.LastRestoredFileName) - populateTimeRFC3339(objectMap, "lastRestoredFileTime", m.LastRestoredFileTime) - populate(objectMap, "lastUploadedFileName", m.LastUploadedFileName) - populateTimeRFC3339(objectMap, "lastUploadedFileTime", m.LastUploadedFileTime) - populate(objectMap, "numberOfFilesDetected", m.NumberOfFilesDetected) - populate(objectMap, "percentCompleted", m.PercentCompleted) - populate(objectMap, "status", m.Status) - populate(objectMap, "unrestorableFiles", m.UnrestorableFiles) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedDatabaseRestoreDetailsProperties. -func (m *ManagedDatabaseRestoreDetailsProperties) UnmarshalJSON(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 "blockReason": - err = unpopulate(val, "BlockReason", &m.BlockReason) - delete(rawMsg, key) - case "currentRestoringFileName": - err = unpopulate(val, "CurrentRestoringFileName", &m.CurrentRestoringFileName) - delete(rawMsg, key) - case "lastRestoredFileName": - err = unpopulate(val, "LastRestoredFileName", &m.LastRestoredFileName) - delete(rawMsg, key) - case "lastRestoredFileTime": - err = unpopulateTimeRFC3339(val, "LastRestoredFileTime", &m.LastRestoredFileTime) - delete(rawMsg, key) - case "lastUploadedFileName": - err = unpopulate(val, "LastUploadedFileName", &m.LastUploadedFileName) - delete(rawMsg, key) - case "lastUploadedFileTime": - err = unpopulateTimeRFC3339(val, "LastUploadedFileTime", &m.LastUploadedFileTime) - delete(rawMsg, key) - case "numberOfFilesDetected": - err = unpopulate(val, "NumberOfFilesDetected", &m.NumberOfFilesDetected) - delete(rawMsg, key) - case "percentCompleted": - err = unpopulate(val, "PercentCompleted", &m.PercentCompleted) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - case "unrestorableFiles": - err = unpopulate(val, "UnrestorableFiles", &m.UnrestorableFiles) - 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 ManagedDatabaseUpdate. -func (m ManagedDatabaseUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "tags", m.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedInstance. -func (m ManagedInstance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "location", m.Location) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "sku", m.SKU) - populate(objectMap, "tags", m.Tags) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceKeyProperties. -func (m ManagedInstanceKeyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoRotationEnabled", m.AutoRotationEnabled) - populateTimeRFC3339(objectMap, "creationDate", m.CreationDate) - populate(objectMap, "serverKeyType", m.ServerKeyType) - populate(objectMap, "thumbprint", m.Thumbprint) - populate(objectMap, "uri", m.URI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceKeyProperties. -func (m *ManagedInstanceKeyProperties) UnmarshalJSON(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 "autoRotationEnabled": - err = unpopulate(val, "AutoRotationEnabled", &m.AutoRotationEnabled) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &m.CreationDate) - delete(rawMsg, key) - case "serverKeyType": - err = unpopulate(val, "ServerKeyType", &m.ServerKeyType) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &m.Thumbprint) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &m.URI) - 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 ManagedInstanceLongTermRetentionBackupProperties. -func (m ManagedInstanceLongTermRetentionBackupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "backupExpirationTime", m.BackupExpirationTime) - populate(objectMap, "backupStorageRedundancy", m.BackupStorageRedundancy) - populateTimeRFC3339(objectMap, "backupTime", m.BackupTime) - populateTimeRFC3339(objectMap, "databaseDeletionTime", m.DatabaseDeletionTime) - populate(objectMap, "databaseName", m.DatabaseName) - populateTimeRFC3339(objectMap, "managedInstanceCreateTime", m.ManagedInstanceCreateTime) - populate(objectMap, "managedInstanceName", m.ManagedInstanceName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceLongTermRetentionBackupProperties. -func (m *ManagedInstanceLongTermRetentionBackupProperties) UnmarshalJSON(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 "backupExpirationTime": - err = unpopulateTimeRFC3339(val, "BackupExpirationTime", &m.BackupExpirationTime) - delete(rawMsg, key) - case "backupStorageRedundancy": - err = unpopulate(val, "BackupStorageRedundancy", &m.BackupStorageRedundancy) - delete(rawMsg, key) - case "backupTime": - err = unpopulateTimeRFC3339(val, "BackupTime", &m.BackupTime) - delete(rawMsg, key) - case "databaseDeletionTime": - err = unpopulateTimeRFC3339(val, "DatabaseDeletionTime", &m.DatabaseDeletionTime) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &m.DatabaseName) - delete(rawMsg, key) - case "managedInstanceCreateTime": - err = unpopulateTimeRFC3339(val, "ManagedInstanceCreateTime", &m.ManagedInstanceCreateTime) - delete(rawMsg, key) - case "managedInstanceName": - err = unpopulate(val, "ManagedInstanceName", &m.ManagedInstanceName) - 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 ManagedInstanceOperationProperties. -func (m ManagedInstanceOperationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", m.Description) - populate(objectMap, "errorCode", m.ErrorCode) - populate(objectMap, "errorDescription", m.ErrorDescription) - populate(objectMap, "errorSeverity", m.ErrorSeverity) - populateTimeRFC3339(objectMap, "estimatedCompletionTime", m.EstimatedCompletionTime) - populate(objectMap, "isCancellable", m.IsCancellable) - populate(objectMap, "isUserError", m.IsUserError) - populate(objectMap, "managedInstanceName", m.ManagedInstanceName) - populate(objectMap, "operation", m.Operation) - populate(objectMap, "operationFriendlyName", m.OperationFriendlyName) - populate(objectMap, "operationParameters", m.OperationParameters) - populate(objectMap, "operationSteps", m.OperationSteps) - populate(objectMap, "percentComplete", m.PercentComplete) - populateTimeRFC3339(objectMap, "startTime", m.StartTime) - populate(objectMap, "state", m.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceOperationProperties. -func (m *ManagedInstanceOperationProperties) UnmarshalJSON(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 "description": - err = unpopulate(val, "Description", &m.Description) - delete(rawMsg, key) - case "errorCode": - err = unpopulate(val, "ErrorCode", &m.ErrorCode) - delete(rawMsg, key) - case "errorDescription": - err = unpopulate(val, "ErrorDescription", &m.ErrorDescription) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &m.ErrorSeverity) - delete(rawMsg, key) - case "estimatedCompletionTime": - err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &m.EstimatedCompletionTime) - delete(rawMsg, key) - case "isCancellable": - err = unpopulate(val, "IsCancellable", &m.IsCancellable) - delete(rawMsg, key) - case "isUserError": - err = unpopulate(val, "IsUserError", &m.IsUserError) - delete(rawMsg, key) - case "managedInstanceName": - err = unpopulate(val, "ManagedInstanceName", &m.ManagedInstanceName) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &m.Operation) - delete(rawMsg, key) - case "operationFriendlyName": - err = unpopulate(val, "OperationFriendlyName", &m.OperationFriendlyName) - delete(rawMsg, key) - case "operationParameters": - err = unpopulate(val, "OperationParameters", &m.OperationParameters) - delete(rawMsg, key) - case "operationSteps": - err = unpopulate(val, "OperationSteps", &m.OperationSteps) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &m.PercentComplete) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) - 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 ManagedInstanceOperationSteps. -func (m ManagedInstanceOperationSteps) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "currentStep", m.CurrentStep) - populate(objectMap, "stepsList", m.StepsList) - populate(objectMap, "totalSteps", m.TotalSteps) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedInstancePrivateLinkProperties. -func (m ManagedInstancePrivateLinkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", m.GroupID) - populate(objectMap, "requiredMembers", m.RequiredMembers) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ManagedInstanceProperties. -func (m ManagedInstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "administratorLogin", m.AdministratorLogin) - populate(objectMap, "administratorLoginPassword", m.AdministratorLoginPassword) - populate(objectMap, "administrators", m.Administrators) - populate(objectMap, "collation", m.Collation) - populate(objectMap, "currentBackupStorageRedundancy", m.CurrentBackupStorageRedundancy) - populate(objectMap, "dnsZone", m.DNSZone) - populate(objectMap, "dnsZonePartner", m.DNSZonePartner) - populate(objectMap, "fullyQualifiedDomainName", m.FullyQualifiedDomainName) - populate(objectMap, "instancePoolId", m.InstancePoolID) - populate(objectMap, "keyId", m.KeyID) - populate(objectMap, "licenseType", m.LicenseType) - populate(objectMap, "maintenanceConfigurationId", m.MaintenanceConfigurationID) - populate(objectMap, "managedInstanceCreateMode", m.ManagedInstanceCreateMode) - populate(objectMap, "minimalTlsVersion", m.MinimalTLSVersion) - populate(objectMap, "primaryUserAssignedIdentityId", m.PrimaryUserAssignedIdentityID) - populate(objectMap, "privateEndpointConnections", m.PrivateEndpointConnections) - populate(objectMap, "provisioningState", m.ProvisioningState) - populate(objectMap, "proxyOverride", m.ProxyOverride) - populate(objectMap, "publicDataEndpointEnabled", m.PublicDataEndpointEnabled) - populate(objectMap, "requestedBackupStorageRedundancy", m.RequestedBackupStorageRedundancy) - populateTimeRFC3339(objectMap, "restorePointInTime", m.RestorePointInTime) - populate(objectMap, "servicePrincipal", m.ServicePrincipal) - populate(objectMap, "sourceManagedInstanceId", m.SourceManagedInstanceID) - populate(objectMap, "state", m.State) - populate(objectMap, "storageSizeInGB", m.StorageSizeInGB) - populate(objectMap, "subnetId", m.SubnetID) - populate(objectMap, "timezoneId", m.TimezoneID) - populate(objectMap, "vCores", m.VCores) - populate(objectMap, "zoneRedundant", m.ZoneRedundant) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ManagedInstanceProperties. -func (m *ManagedInstanceProperties) UnmarshalJSON(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 "administratorLogin": - err = unpopulate(val, "AdministratorLogin", &m.AdministratorLogin) - delete(rawMsg, key) - case "administratorLoginPassword": - err = unpopulate(val, "AdministratorLoginPassword", &m.AdministratorLoginPassword) - delete(rawMsg, key) - case "administrators": - err = unpopulate(val, "Administrators", &m.Administrators) - delete(rawMsg, key) - case "collation": - err = unpopulate(val, "Collation", &m.Collation) - delete(rawMsg, key) - case "currentBackupStorageRedundancy": - err = unpopulate(val, "CurrentBackupStorageRedundancy", &m.CurrentBackupStorageRedundancy) - delete(rawMsg, key) - case "dnsZone": - err = unpopulate(val, "DNSZone", &m.DNSZone) - delete(rawMsg, key) - case "dnsZonePartner": - err = unpopulate(val, "DNSZonePartner", &m.DNSZonePartner) - delete(rawMsg, key) - case "fullyQualifiedDomainName": - err = unpopulate(val, "FullyQualifiedDomainName", &m.FullyQualifiedDomainName) - delete(rawMsg, key) - case "instancePoolId": - err = unpopulate(val, "InstancePoolID", &m.InstancePoolID) - delete(rawMsg, key) - case "keyId": - err = unpopulate(val, "KeyID", &m.KeyID) - delete(rawMsg, key) - case "licenseType": - err = unpopulate(val, "LicenseType", &m.LicenseType) - delete(rawMsg, key) - case "maintenanceConfigurationId": - err = unpopulate(val, "MaintenanceConfigurationID", &m.MaintenanceConfigurationID) - delete(rawMsg, key) - case "managedInstanceCreateMode": - err = unpopulate(val, "ManagedInstanceCreateMode", &m.ManagedInstanceCreateMode) - delete(rawMsg, key) - case "minimalTlsVersion": - err = unpopulate(val, "MinimalTLSVersion", &m.MinimalTLSVersion) - delete(rawMsg, key) - case "primaryUserAssignedIdentityId": - err = unpopulate(val, "PrimaryUserAssignedIdentityID", &m.PrimaryUserAssignedIdentityID) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &m.PrivateEndpointConnections) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &m.ProvisioningState) - delete(rawMsg, key) - case "proxyOverride": - err = unpopulate(val, "ProxyOverride", &m.ProxyOverride) - delete(rawMsg, key) - case "publicDataEndpointEnabled": - err = unpopulate(val, "PublicDataEndpointEnabled", &m.PublicDataEndpointEnabled) - delete(rawMsg, key) - case "requestedBackupStorageRedundancy": - err = unpopulate(val, "RequestedBackupStorageRedundancy", &m.RequestedBackupStorageRedundancy) - delete(rawMsg, key) - case "restorePointInTime": - err = unpopulateTimeRFC3339(val, "RestorePointInTime", &m.RestorePointInTime) - delete(rawMsg, key) - case "servicePrincipal": - err = unpopulate(val, "ServicePrincipal", &m.ServicePrincipal) - delete(rawMsg, key) - case "sourceManagedInstanceId": - err = unpopulate(val, "SourceManagedInstanceID", &m.SourceManagedInstanceID) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &m.State) - delete(rawMsg, key) - case "storageSizeInGB": - err = unpopulate(val, "StorageSizeInGB", &m.StorageSizeInGB) - delete(rawMsg, key) - case "subnetId": - err = unpopulate(val, "SubnetID", &m.SubnetID) - delete(rawMsg, key) - case "timezoneId": - err = unpopulate(val, "TimezoneID", &m.TimezoneID) - delete(rawMsg, key) - case "vCores": - err = unpopulate(val, "VCores", &m.VCores) - delete(rawMsg, key) - case "zoneRedundant": - err = unpopulate(val, "ZoneRedundant", &m.ZoneRedundant) - 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 ManagedInstanceUpdate. -func (m ManagedInstanceUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", m.Identity) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "sku", m.SKU) - populate(objectMap, "tags", m.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Metric. -func (m *Metric) UnmarshalJSON(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 "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) - delete(rawMsg, key) - case "metricValues": - err = unpopulate(val, "MetricValues", &m.MetricValues) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &m.Name) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) - delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &m.TimeGrain) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &m.Unit) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MetricValue. -func (m *MetricValue) UnmarshalJSON(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 "average": - err = unpopulate(val, "Average", &m.Average) - delete(rawMsg, key) - case "count": - err = unpopulate(val, "Count", &m.Count) - delete(rawMsg, key) - case "maximum": - err = unpopulate(val, "Maximum", &m.Maximum) - delete(rawMsg, key) - case "minimum": - err = unpopulate(val, "Minimum", &m.Minimum) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &m.Timestamp) - delete(rawMsg, key) - case "total": - err = unpopulate(val, "Total", &m.Total) - 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 PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type QueryMetricInterval. -func (q QueryMetricInterval) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "executionCount", q.ExecutionCount) - populate(objectMap, "intervalStartTime", q.IntervalStartTime) - populate(objectMap, "intervalType", q.IntervalType) - populate(objectMap, "metrics", q.Metrics) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type QueryStatisticsProperties. -func (q QueryStatisticsProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "databaseName", q.DatabaseName) - populate(objectMap, "endTime", q.EndTime) - populate(objectMap, "intervals", q.Intervals) - populate(objectMap, "queryId", q.QueryID) - populate(objectMap, "startTime", q.StartTime) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RecommendedAction. -func (r RecommendedAction) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "kind", r.Kind) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RecommendedActionMetricInfo. -func (r RecommendedActionMetricInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "metricName", r.MetricName) - populateTimeRFC3339(objectMap, "startTime", r.StartTime) - populate(objectMap, "timeGrain", r.TimeGrain) - populate(objectMap, "unit", r.Unit) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionMetricInfo. -func (r *RecommendedActionMetricInfo) UnmarshalJSON(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 "metricName": - err = unpopulate(val, "MetricName", &r.MetricName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &r.StartTime) - delete(rawMsg, key) - case "timeGrain": - err = unpopulate(val, "TimeGrain", &r.TimeGrain) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &r.Unit) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &r.Value) - 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 RecommendedActionProperties. -func (r RecommendedActionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "details", r.Details) - populate(objectMap, "errorDetails", r.ErrorDetails) - populate(objectMap, "estimatedImpact", r.EstimatedImpact) - populate(objectMap, "executeActionDuration", r.ExecuteActionDuration) - populate(objectMap, "executeActionInitiatedBy", r.ExecuteActionInitiatedBy) - populateTimeRFC3339(objectMap, "executeActionInitiatedTime", r.ExecuteActionInitiatedTime) - populateTimeRFC3339(objectMap, "executeActionStartTime", r.ExecuteActionStartTime) - populate(objectMap, "implementationDetails", r.ImplementationDetails) - populate(objectMap, "isArchivedAction", r.IsArchivedAction) - populate(objectMap, "isExecutableAction", r.IsExecutableAction) - populate(objectMap, "isRevertableAction", r.IsRevertableAction) - populateTimeRFC3339(objectMap, "lastRefresh", r.LastRefresh) - populate(objectMap, "linkedObjects", r.LinkedObjects) - populate(objectMap, "observedImpact", r.ObservedImpact) - populate(objectMap, "recommendationReason", r.RecommendationReason) - populate(objectMap, "revertActionDuration", r.RevertActionDuration) - populate(objectMap, "revertActionInitiatedBy", r.RevertActionInitiatedBy) - populateTimeRFC3339(objectMap, "revertActionInitiatedTime", r.RevertActionInitiatedTime) - populateTimeRFC3339(objectMap, "revertActionStartTime", r.RevertActionStartTime) - populate(objectMap, "score", r.Score) - populate(objectMap, "state", r.State) - populate(objectMap, "timeSeries", r.TimeSeries) - populateTimeRFC3339(objectMap, "validSince", r.ValidSince) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionProperties. -func (r *RecommendedActionProperties) UnmarshalJSON(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 "details": - err = unpopulate(val, "Details", &r.Details) - delete(rawMsg, key) - case "errorDetails": - err = unpopulate(val, "ErrorDetails", &r.ErrorDetails) - delete(rawMsg, key) - case "estimatedImpact": - err = unpopulate(val, "EstimatedImpact", &r.EstimatedImpact) - delete(rawMsg, key) - case "executeActionDuration": - err = unpopulate(val, "ExecuteActionDuration", &r.ExecuteActionDuration) - delete(rawMsg, key) - case "executeActionInitiatedBy": - err = unpopulate(val, "ExecuteActionInitiatedBy", &r.ExecuteActionInitiatedBy) - delete(rawMsg, key) - case "executeActionInitiatedTime": - err = unpopulateTimeRFC3339(val, "ExecuteActionInitiatedTime", &r.ExecuteActionInitiatedTime) - delete(rawMsg, key) - case "executeActionStartTime": - err = unpopulateTimeRFC3339(val, "ExecuteActionStartTime", &r.ExecuteActionStartTime) - delete(rawMsg, key) - case "implementationDetails": - err = unpopulate(val, "ImplementationDetails", &r.ImplementationDetails) - delete(rawMsg, key) - case "isArchivedAction": - err = unpopulate(val, "IsArchivedAction", &r.IsArchivedAction) - delete(rawMsg, key) - case "isExecutableAction": - err = unpopulate(val, "IsExecutableAction", &r.IsExecutableAction) - delete(rawMsg, key) - case "isRevertableAction": - err = unpopulate(val, "IsRevertableAction", &r.IsRevertableAction) - delete(rawMsg, key) - case "lastRefresh": - err = unpopulateTimeRFC3339(val, "LastRefresh", &r.LastRefresh) - delete(rawMsg, key) - case "linkedObjects": - err = unpopulate(val, "LinkedObjects", &r.LinkedObjects) - delete(rawMsg, key) - case "observedImpact": - err = unpopulate(val, "ObservedImpact", &r.ObservedImpact) - delete(rawMsg, key) - case "recommendationReason": - err = unpopulate(val, "RecommendationReason", &r.RecommendationReason) - delete(rawMsg, key) - case "revertActionDuration": - err = unpopulate(val, "RevertActionDuration", &r.RevertActionDuration) - delete(rawMsg, key) - case "revertActionInitiatedBy": - err = unpopulate(val, "RevertActionInitiatedBy", &r.RevertActionInitiatedBy) - delete(rawMsg, key) - case "revertActionInitiatedTime": - err = unpopulateTimeRFC3339(val, "RevertActionInitiatedTime", &r.RevertActionInitiatedTime) - delete(rawMsg, key) - case "revertActionStartTime": - err = unpopulateTimeRFC3339(val, "RevertActionStartTime", &r.RevertActionStartTime) - delete(rawMsg, key) - case "score": - err = unpopulate(val, "Score", &r.Score) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &r.State) - delete(rawMsg, key) - case "timeSeries": - err = unpopulate(val, "TimeSeries", &r.TimeSeries) - delete(rawMsg, key) - case "validSince": - err = unpopulateTimeRFC3339(val, "ValidSince", &r.ValidSince) - 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 RecommendedActionStateInfo. -func (r RecommendedActionStateInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionInitiatedBy", r.ActionInitiatedBy) - populate(objectMap, "currentValue", r.CurrentValue) - populateTimeRFC3339(objectMap, "lastModified", r.LastModified) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecommendedActionStateInfo. -func (r *RecommendedActionStateInfo) UnmarshalJSON(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 "actionInitiatedBy": - err = unpopulate(val, "ActionInitiatedBy", &r.ActionInitiatedBy) - delete(rawMsg, key) - case "currentValue": - err = unpopulate(val, "CurrentValue", &r.CurrentValue) - delete(rawMsg, key) - case "lastModified": - err = unpopulateTimeRFC3339(val, "LastModified", &r.LastModified) - 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 RecommendedSensitivityLabelUpdateList. -func (r RecommendedSensitivityLabelUpdateList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "operations", r.Operations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RecoverableDatabaseProperties. -func (r RecoverableDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "edition", r.Edition) - populate(objectMap, "elasticPoolName", r.ElasticPoolName) - populateTimeRFC3339(objectMap, "lastAvailableBackupDate", r.LastAvailableBackupDate) - populate(objectMap, "serviceLevelObjective", r.ServiceLevelObjective) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RecoverableDatabaseProperties. -func (r *RecoverableDatabaseProperties) UnmarshalJSON(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 "edition": - err = unpopulate(val, "Edition", &r.Edition) - delete(rawMsg, key) - case "elasticPoolName": - err = unpopulate(val, "ElasticPoolName", &r.ElasticPoolName) - delete(rawMsg, key) - case "lastAvailableBackupDate": - err = unpopulateTimeRFC3339(val, "LastAvailableBackupDate", &r.LastAvailableBackupDate) - delete(rawMsg, key) - case "serviceLevelObjective": - err = unpopulate(val, "ServiceLevelObjective", &r.ServiceLevelObjective) - 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 ReplicationLinkProperties. -func (r ReplicationLinkProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "isTerminationAllowed", r.IsTerminationAllowed) - populate(objectMap, "linkType", r.LinkType) - populate(objectMap, "partnerDatabase", r.PartnerDatabase) - populate(objectMap, "partnerLocation", r.PartnerLocation) - populate(objectMap, "partnerRole", r.PartnerRole) - populate(objectMap, "partnerServer", r.PartnerServer) - populate(objectMap, "percentComplete", r.PercentComplete) - populate(objectMap, "replicationMode", r.ReplicationMode) - populate(objectMap, "replicationState", r.ReplicationState) - populate(objectMap, "role", r.Role) - populateTimeRFC3339(objectMap, "startTime", r.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ReplicationLinkProperties. -func (r *ReplicationLinkProperties) UnmarshalJSON(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 "isTerminationAllowed": - err = unpopulate(val, "IsTerminationAllowed", &r.IsTerminationAllowed) - delete(rawMsg, key) - case "linkType": - err = unpopulate(val, "LinkType", &r.LinkType) - delete(rawMsg, key) - case "partnerDatabase": - err = unpopulate(val, "PartnerDatabase", &r.PartnerDatabase) - delete(rawMsg, key) - case "partnerLocation": - err = unpopulate(val, "PartnerLocation", &r.PartnerLocation) - delete(rawMsg, key) - case "partnerRole": - err = unpopulate(val, "PartnerRole", &r.PartnerRole) - delete(rawMsg, key) - case "partnerServer": - err = unpopulate(val, "PartnerServer", &r.PartnerServer) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &r.PercentComplete) - delete(rawMsg, key) - case "replicationMode": - err = unpopulate(val, "ReplicationMode", &r.ReplicationMode) - delete(rawMsg, key) - case "replicationState": - err = unpopulate(val, "ReplicationState", &r.ReplicationState) - delete(rawMsg, key) - case "role": - err = unpopulate(val, "Role", &r.Role) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &r.StartTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceIdentity. -func (r ResourceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", r.PrincipalID) - populate(objectMap, "tenantId", r.TenantID) - populate(objectMap, "type", r.Type) - populate(objectMap, "userAssignedIdentities", r.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabase. -func (r RestorableDroppedDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "sku", r.SKU) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedDatabaseProperties. -func (r RestorableDroppedDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupStorageRedundancy", r.BackupStorageRedundancy) - populateTimeRFC3339(objectMap, "creationDate", r.CreationDate) - populate(objectMap, "databaseName", r.DatabaseName) - populateTimeRFC3339(objectMap, "deletionDate", r.DeletionDate) - populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) - populate(objectMap, "maxSizeBytes", r.MaxSizeBytes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedDatabaseProperties. -func (r *RestorableDroppedDatabaseProperties) UnmarshalJSON(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 "backupStorageRedundancy": - err = unpopulate(val, "BackupStorageRedundancy", &r.BackupStorageRedundancy) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &r.CreationDate) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &r.DatabaseName) - delete(rawMsg, key) - case "deletionDate": - err = unpopulateTimeRFC3339(val, "DeletionDate", &r.DeletionDate) - delete(rawMsg, key) - case "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) - delete(rawMsg, key) - case "maxSizeBytes": - err = unpopulate(val, "MaxSizeBytes", &r.MaxSizeBytes) - 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 RestorableDroppedManagedDatabase. -func (r RestorableDroppedManagedDatabase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "properties", r.Properties) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestorableDroppedManagedDatabaseProperties. -func (r RestorableDroppedManagedDatabaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationDate", r.CreationDate) - populate(objectMap, "databaseName", r.DatabaseName) - populateTimeRFC3339(objectMap, "deletionDate", r.DeletionDate) - populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorableDroppedManagedDatabaseProperties. -func (r *RestorableDroppedManagedDatabaseProperties) UnmarshalJSON(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 "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &r.CreationDate) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &r.DatabaseName) - delete(rawMsg, key) - case "deletionDate": - err = unpopulateTimeRFC3339(val, "DeletionDate", &r.DeletionDate) - delete(rawMsg, key) - case "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) - 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 RestorePointProperties. -func (r RestorePointProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "earliestRestoreDate", r.EarliestRestoreDate) - populateTimeRFC3339(objectMap, "restorePointCreationDate", r.RestorePointCreationDate) - populate(objectMap, "restorePointLabel", r.RestorePointLabel) - populate(objectMap, "restorePointType", r.RestorePointType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestorePointProperties. -func (r *RestorePointProperties) UnmarshalJSON(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 "earliestRestoreDate": - err = unpopulateTimeRFC3339(val, "EarliestRestoreDate", &r.EarliestRestoreDate) - delete(rawMsg, key) - case "restorePointCreationDate": - err = unpopulateTimeRFC3339(val, "RestorePointCreationDate", &r.RestorePointCreationDate) - delete(rawMsg, key) - case "restorePointLabel": - err = unpopulate(val, "RestorePointLabel", &r.RestorePointLabel) - delete(rawMsg, key) - case "restorePointType": - err = unpopulate(val, "RestorePointType", &r.RestorePointType) - 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 SecurityAlertPolicyProperties. -func (s SecurityAlertPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationTime", s.CreationTime) - populate(objectMap, "disabledAlerts", s.DisabledAlerts) - populate(objectMap, "emailAccountAdmins", s.EmailAccountAdmins) - populate(objectMap, "emailAddresses", s.EmailAddresses) - populate(objectMap, "retentionDays", s.RetentionDays) - populate(objectMap, "state", s.State) - populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) - populate(objectMap, "storageEndpoint", s.StorageEndpoint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertPolicyProperties. -func (s *SecurityAlertPolicyProperties) UnmarshalJSON(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 "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) - delete(rawMsg, key) - case "disabledAlerts": - err = unpopulate(val, "DisabledAlerts", &s.DisabledAlerts) - delete(rawMsg, key) - case "emailAccountAdmins": - err = unpopulate(val, "EmailAccountAdmins", &s.EmailAccountAdmins) - delete(rawMsg, key) - case "emailAddresses": - err = unpopulate(val, "EmailAddresses", &s.EmailAddresses) - delete(rawMsg, key) - case "retentionDays": - err = unpopulate(val, "RetentionDays", &s.RetentionDays) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - case "storageAccountAccessKey": - err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) - delete(rawMsg, key) - case "storageEndpoint": - err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) - 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 SecurityAlertsPolicyProperties. -func (s SecurityAlertsPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "creationTime", s.CreationTime) - populate(objectMap, "disabledAlerts", s.DisabledAlerts) - populate(objectMap, "emailAccountAdmins", s.EmailAccountAdmins) - populate(objectMap, "emailAddresses", s.EmailAddresses) - populate(objectMap, "retentionDays", s.RetentionDays) - populate(objectMap, "state", s.State) - populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) - populate(objectMap, "storageEndpoint", s.StorageEndpoint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityAlertsPolicyProperties. -func (s *SecurityAlertsPolicyProperties) UnmarshalJSON(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 "creationTime": - err = unpopulateTimeRFC3339(val, "CreationTime", &s.CreationTime) - delete(rawMsg, key) - case "disabledAlerts": - err = unpopulate(val, "DisabledAlerts", &s.DisabledAlerts) - delete(rawMsg, key) - case "emailAccountAdmins": - err = unpopulate(val, "EmailAccountAdmins", &s.EmailAccountAdmins) - delete(rawMsg, key) - case "emailAddresses": - err = unpopulate(val, "EmailAddresses", &s.EmailAddresses) - delete(rawMsg, key) - case "retentionDays": - err = unpopulate(val, "RetentionDays", &s.RetentionDays) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - case "storageAccountAccessKey": - err = unpopulate(val, "StorageAccountAccessKey", &s.StorageAccountAccessKey) - delete(rawMsg, key) - case "storageEndpoint": - err = unpopulate(val, "StorageEndpoint", &s.StorageEndpoint) - 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 SecurityEventProperties. -func (s SecurityEventProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationName", s.ApplicationName) - populate(objectMap, "clientIp", s.ClientIP) - populate(objectMap, "database", s.Database) - populateTimeRFC3339(objectMap, "eventTime", s.EventTime) - populate(objectMap, "principalName", s.PrincipalName) - populate(objectMap, "securityEventSqlInjectionAdditionalProperties", s.SecurityEventSQLInjectionAdditionalProperties) - populate(objectMap, "securityEventType", s.SecurityEventType) - populate(objectMap, "server", s.Server) - populate(objectMap, "subscription", s.Subscription) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventProperties. -func (s *SecurityEventProperties) UnmarshalJSON(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 "applicationName": - err = unpopulate(val, "ApplicationName", &s.ApplicationName) - delete(rawMsg, key) - case "clientIp": - err = unpopulate(val, "ClientIP", &s.ClientIP) - delete(rawMsg, key) - case "database": - err = unpopulate(val, "Database", &s.Database) - delete(rawMsg, key) - case "eventTime": - err = unpopulateTimeRFC3339(val, "EventTime", &s.EventTime) - delete(rawMsg, key) - case "principalName": - err = unpopulate(val, "PrincipalName", &s.PrincipalName) - delete(rawMsg, key) - case "securityEventSqlInjectionAdditionalProperties": - err = unpopulate(val, "SecurityEventSQLInjectionAdditionalProperties", &s.SecurityEventSQLInjectionAdditionalProperties) - delete(rawMsg, key) - case "securityEventType": - err = unpopulate(val, "SecurityEventType", &s.SecurityEventType) - delete(rawMsg, key) - case "server": - err = unpopulate(val, "Server", &s.Server) - delete(rawMsg, key) - case "subscription": - err = unpopulate(val, "Subscription", &s.Subscription) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityEventsFilterParameters. -func (s *SecurityEventsFilterParameters) UnmarshalJSON(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 "eventTime": - err = unpopulateTimeRFC3339(val, "EventTime", &s.EventTime) - delete(rawMsg, key) - case "showServerRecords": - err = unpopulate(val, "ShowServerRecords", &s.ShowServerRecords) - 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 SensitivityLabelUpdateList. -func (s SensitivityLabelUpdateList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "operations", s.Operations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Server. -func (s Server) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "kind", s.Kind) - populate(objectMap, "location", s.Location) - 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 ServerAutomaticTuning. -func (s ServerAutomaticTuning) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServerBlobAuditingPolicyProperties. -func (s ServerBlobAuditingPolicyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "auditActionsAndGroups", s.AuditActionsAndGroups) - populate(objectMap, "isAzureMonitorTargetEnabled", s.IsAzureMonitorTargetEnabled) - populate(objectMap, "isDevopsAuditEnabled", s.IsDevopsAuditEnabled) - populate(objectMap, "isManagedIdentityInUse", s.IsManagedIdentityInUse) - populate(objectMap, "isStorageSecondaryKeyInUse", s.IsStorageSecondaryKeyInUse) - populate(objectMap, "queueDelayMs", s.QueueDelayMs) - populate(objectMap, "retentionDays", s.RetentionDays) - populate(objectMap, "state", s.State) - populate(objectMap, "storageAccountAccessKey", s.StorageAccountAccessKey) - populate(objectMap, "storageAccountSubscriptionId", s.StorageAccountSubscriptionID) - populate(objectMap, "storageEndpoint", s.StorageEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServerKeyProperties. -func (s ServerKeyProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "autoRotationEnabled", s.AutoRotationEnabled) - populateTimeRFC3339(objectMap, "creationDate", s.CreationDate) - populate(objectMap, "serverKeyType", s.ServerKeyType) - populate(objectMap, "subregion", s.Subregion) - populate(objectMap, "thumbprint", s.Thumbprint) - populate(objectMap, "uri", s.URI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerKeyProperties. -func (s *ServerKeyProperties) UnmarshalJSON(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 "autoRotationEnabled": - err = unpopulate(val, "AutoRotationEnabled", &s.AutoRotationEnabled) - delete(rawMsg, key) - case "creationDate": - err = unpopulateTimeRFC3339(val, "CreationDate", &s.CreationDate) - delete(rawMsg, key) - case "serverKeyType": - err = unpopulate(val, "ServerKeyType", &s.ServerKeyType) - delete(rawMsg, key) - case "subregion": - err = unpopulate(val, "Subregion", &s.Subregion) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &s.Thumbprint) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, "URI", &s.URI) - 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 ServerOperationProperties. -func (s ServerOperationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", s.Description) - populate(objectMap, "errorCode", s.ErrorCode) - populate(objectMap, "errorDescription", s.ErrorDescription) - populate(objectMap, "errorSeverity", s.ErrorSeverity) - populateTimeRFC3339(objectMap, "estimatedCompletionTime", s.EstimatedCompletionTime) - populate(objectMap, "isCancellable", s.IsCancellable) - populate(objectMap, "isUserError", s.IsUserError) - populate(objectMap, "operation", s.Operation) - populate(objectMap, "operationFriendlyName", s.OperationFriendlyName) - populate(objectMap, "percentComplete", s.PercentComplete) - populate(objectMap, "serverName", s.ServerName) - populateTimeRFC3339(objectMap, "startTime", s.StartTime) - populate(objectMap, "state", s.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerOperationProperties. -func (s *ServerOperationProperties) UnmarshalJSON(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 "errorCode": - err = unpopulate(val, "ErrorCode", &s.ErrorCode) - delete(rawMsg, key) - case "errorDescription": - err = unpopulate(val, "ErrorDescription", &s.ErrorDescription) - delete(rawMsg, key) - case "errorSeverity": - err = unpopulate(val, "ErrorSeverity", &s.ErrorSeverity) - delete(rawMsg, key) - case "estimatedCompletionTime": - err = unpopulateTimeRFC3339(val, "EstimatedCompletionTime", &s.EstimatedCompletionTime) - delete(rawMsg, key) - case "isCancellable": - err = unpopulate(val, "IsCancellable", &s.IsCancellable) - delete(rawMsg, key) - case "isUserError": - err = unpopulate(val, "IsUserError", &s.IsUserError) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &s.Operation) - delete(rawMsg, key) - case "operationFriendlyName": - err = unpopulate(val, "OperationFriendlyName", &s.OperationFriendlyName) - delete(rawMsg, key) - case "percentComplete": - err = unpopulate(val, "PercentComplete", &s.PercentComplete) - delete(rawMsg, key) - case "serverName": - err = unpopulate(val, "ServerName", &s.ServerName) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &s.StartTime) - 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 ServerProperties. -func (s ServerProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "administratorLogin", s.AdministratorLogin) - populate(objectMap, "administratorLoginPassword", s.AdministratorLoginPassword) - populate(objectMap, "administrators", s.Administrators) - populate(objectMap, "federatedClientId", s.FederatedClientID) - populate(objectMap, "fullyQualifiedDomainName", s.FullyQualifiedDomainName) - populate(objectMap, "keyId", s.KeyID) - populate(objectMap, "minimalTlsVersion", s.MinimalTLSVersion) - populate(objectMap, "primaryUserAssignedIdentityId", s.PrimaryUserAssignedIdentityID) - populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "restrictOutboundNetworkAccess", s.RestrictOutboundNetworkAccess) - populate(objectMap, "state", s.State) - populate(objectMap, "version", s.Version) - populate(objectMap, "workspaceFeature", s.WorkspaceFeature) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServerTrustGroupProperties. -func (s ServerTrustGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupMembers", s.GroupMembers) - populate(objectMap, "trustScopes", s.TrustScopes) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServerUpdate. -func (s ServerUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServerUsage. -func (s *ServerUsage) UnmarshalJSON(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 "currentValue": - err = unpopulate(val, "CurrentValue", &s.CurrentValue) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &s.DisplayName) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &s.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "nextResetTime": - err = unpopulateTimeRFC3339(val, "NextResetTime", &s.NextResetTime) - delete(rawMsg, key) - case "resourceName": - err = unpopulate(val, "ResourceName", &s.ResourceName) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &s.Unit) - 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 SyncAgentProperties. -func (s SyncAgentProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "expiryTime", s.ExpiryTime) - populate(objectMap, "isUpToDate", s.IsUpToDate) - populateTimeRFC3339(objectMap, "lastAliveTime", s.LastAliveTime) - populate(objectMap, "name", s.Name) - populate(objectMap, "state", s.State) - populate(objectMap, "syncDatabaseId", s.SyncDatabaseID) - populate(objectMap, "version", s.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncAgentProperties. -func (s *SyncAgentProperties) UnmarshalJSON(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 "expiryTime": - err = unpopulateTimeRFC3339(val, "ExpiryTime", &s.ExpiryTime) - delete(rawMsg, key) - case "isUpToDate": - err = unpopulate(val, "IsUpToDate", &s.IsUpToDate) - delete(rawMsg, key) - case "lastAliveTime": - err = unpopulateTimeRFC3339(val, "LastAliveTime", &s.LastAliveTime) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &s.Name) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - case "syncDatabaseId": - err = unpopulate(val, "SyncDatabaseID", &s.SyncDatabaseID) - 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 -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncFullSchemaProperties. -func (s *SyncFullSchemaProperties) UnmarshalJSON(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 "lastUpdateTime": - err = unpopulateTimeRFC3339(val, "LastUpdateTime", &s.LastUpdateTime) - 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 SyncGroup. -func (s SyncGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupLogProperties. -func (s *SyncGroupLogProperties) UnmarshalJSON(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 "details": - err = unpopulate(val, "Details", &s.Details) - delete(rawMsg, key) - case "operationStatus": - err = unpopulate(val, "OperationStatus", &s.OperationStatus) - delete(rawMsg, key) - case "source": - err = unpopulate(val, "Source", &s.Source) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &s.Timestamp) - delete(rawMsg, key) - case "tracingId": - err = unpopulate(val, "TracingID", &s.TracingID) - 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 SyncGroupProperties. -func (s SyncGroupProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "conflictLoggingRetentionInDays", s.ConflictLoggingRetentionInDays) - populate(objectMap, "conflictResolutionPolicy", s.ConflictResolutionPolicy) - populate(objectMap, "enableConflictLogging", s.EnableConflictLogging) - populate(objectMap, "hubDatabasePassword", s.HubDatabasePassword) - populate(objectMap, "hubDatabaseUserName", s.HubDatabaseUserName) - populate(objectMap, "interval", s.Interval) - populateTimeRFC3339(objectMap, "lastSyncTime", s.LastSyncTime) - populate(objectMap, "privateEndpointName", s.PrivateEndpointName) - populate(objectMap, "schema", s.Schema) - populate(objectMap, "syncDatabaseId", s.SyncDatabaseID) - populate(objectMap, "syncState", s.SyncState) - populate(objectMap, "usePrivateLinkConnection", s.UsePrivateLinkConnection) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SyncGroupProperties. -func (s *SyncGroupProperties) UnmarshalJSON(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 "conflictLoggingRetentionInDays": - err = unpopulate(val, "ConflictLoggingRetentionInDays", &s.ConflictLoggingRetentionInDays) - delete(rawMsg, key) - case "conflictResolutionPolicy": - err = unpopulate(val, "ConflictResolutionPolicy", &s.ConflictResolutionPolicy) - delete(rawMsg, key) - case "enableConflictLogging": - err = unpopulate(val, "EnableConflictLogging", &s.EnableConflictLogging) - delete(rawMsg, key) - case "hubDatabasePassword": - err = unpopulate(val, "HubDatabasePassword", &s.HubDatabasePassword) - delete(rawMsg, key) - case "hubDatabaseUserName": - err = unpopulate(val, "HubDatabaseUserName", &s.HubDatabaseUserName) - delete(rawMsg, key) - case "interval": - err = unpopulate(val, "Interval", &s.Interval) - delete(rawMsg, key) - case "lastSyncTime": - err = unpopulateTimeRFC3339(val, "LastSyncTime", &s.LastSyncTime) - delete(rawMsg, key) - case "privateEndpointName": - err = unpopulate(val, "PrivateEndpointName", &s.PrivateEndpointName) - delete(rawMsg, key) - case "schema": - err = unpopulate(val, "Schema", &s.Schema) - delete(rawMsg, key) - case "syncDatabaseId": - err = unpopulate(val, "SyncDatabaseID", &s.SyncDatabaseID) - delete(rawMsg, key) - case "syncState": - err = unpopulate(val, "SyncState", &s.SyncState) - delete(rawMsg, key) - case "usePrivateLinkConnection": - err = unpopulate(val, "UsePrivateLinkConnection", &s.UsePrivateLinkConnection) - 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 SyncGroupSchema. -func (s SyncGroupSchema) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "masterSyncMemberName", s.MasterSyncMemberName) - populate(objectMap, "tables", s.Tables) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SyncGroupSchemaTable. -func (s SyncGroupSchemaTable) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "columns", s.Columns) - populate(objectMap, "quotedName", s.QuotedName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SyncMember. -func (s SyncMember) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", s.ID) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "type", s.Type) - 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 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) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualCluster. -func (v VirtualCluster) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", v.ID) - populate(objectMap, "location", v.Location) - populate(objectMap, "name", v.Name) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - populate(objectMap, "type", v.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualClusterProperties. -func (v VirtualClusterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "childResources", v.ChildResources) - populate(objectMap, "family", v.Family) - populate(objectMap, "maintenanceConfigurationId", v.MaintenanceConfigurationID) - populate(objectMap, "subnetId", v.SubnetID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VirtualClusterUpdate. -func (v VirtualClusterUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", v.Properties) - populate(objectMap, "tags", v.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentRecurringScansProperties. -func (v VulnerabilityAssessmentRecurringScansProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "emailSubscriptionAdmins", v.EmailSubscriptionAdmins) - populate(objectMap, "emails", v.Emails) - populate(objectMap, "isEnabled", v.IsEnabled) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VulnerabilityAssessmentScanRecordProperties. -func (v VulnerabilityAssessmentScanRecordProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", v.EndTime) - populate(objectMap, "errors", v.Errors) - populate(objectMap, "numberOfFailedSecurityChecks", v.NumberOfFailedSecurityChecks) - populate(objectMap, "scanId", v.ScanID) - populateTimeRFC3339(objectMap, "startTime", v.StartTime) - populate(objectMap, "state", v.State) - populate(objectMap, "storageContainerPath", v.StorageContainerPath) - populate(objectMap, "triggerType", v.TriggerType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VulnerabilityAssessmentScanRecordProperties. -func (v *VulnerabilityAssessmentScanRecordProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &v.EndTime) - delete(rawMsg, key) - case "errors": - err = unpopulate(val, "Errors", &v.Errors) - delete(rawMsg, key) - case "numberOfFailedSecurityChecks": - err = unpopulate(val, "NumberOfFailedSecurityChecks", &v.NumberOfFailedSecurityChecks) - delete(rawMsg, key) - case "scanId": - err = unpopulate(val, "ScanID", &v.ScanID) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &v.StartTime) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &v.State) - delete(rawMsg, key) - case "storageContainerPath": - err = unpopulate(val, "StorageContainerPath", &v.StorageContainerPath) - delete(rawMsg, key) - case "triggerType": - err = unpopulate(val, "TriggerType", &v.TriggerType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, 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/sql/armsql/zz_generated_servercommunicationlinks_client.go b/sdk/resourcemanager/sql/armsql/zz_generated_servercommunicationlinks_client.go deleted file mode 100644 index 3dcf9925eff8..000000000000 --- a/sdk/resourcemanager/sql/armsql/zz_generated_servercommunicationlinks_client.go +++ /dev/null @@ -1,306 +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 armsql - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ServerCommunicationLinksClient contains the methods for the ServerCommunicationLinks group. -// Don't use this type directly, use NewServerCommunicationLinksClient() instead. -type ServerCommunicationLinksClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewServerCommunicationLinksClient creates a new instance of ServerCommunicationLinksClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewServerCommunicationLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServerCommunicationLinksClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ServerCommunicationLinksClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// BeginCreateOrUpdate - Creates a server communication link. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// communicationLinkName - The name of the server communication link. -// parameters - The required parameters for creating a server communication link. -// options - ServerCommunicationLinksClientBeginCreateOrUpdateOptions contains the optional parameters for the ServerCommunicationLinksClient.BeginCreateOrUpdate -// method. -func (client *ServerCommunicationLinksClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters ServerCommunicationLink, options *ServerCommunicationLinksClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServerCommunicationLinksClientCreateOrUpdateResponse], error) { - if options == nil || options.ResumeToken == "" { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serverName, communicationLinkName, parameters, options) - if err != nil { - return nil, err - } - return runtime.NewPoller[ServerCommunicationLinksClientCreateOrUpdateResponse](resp, client.pl, nil) - } else { - return runtime.NewPollerFromResumeToken[ServerCommunicationLinksClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) - } -} - -// CreateOrUpdate - Creates a server communication link. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -func (client *ServerCommunicationLinksClient) createOrUpdate(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters ServerCommunicationLink, options *ServerCommunicationLinksClientBeginCreateOrUpdateOptions) (*http.Response, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serverName, communicationLinkName, parameters, options) - if err != nil { - return nil, err - } - resp, err := client.pl.Do(req) - if err != nil { - return nil, err - } - if !runtime.HasStatusCode(resp, http.StatusCreated, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) - } - return resp, nil -} - -// createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ServerCommunicationLinksClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, parameters ServerCommunicationLink, options *ServerCommunicationLinksClientBeginCreateOrUpdateOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if communicationLinkName == "" { - return nil, errors.New("parameter communicationLinkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{communicationLinkName}", url.PathEscape(communicationLinkName)) - req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) -} - -// Delete - Deletes a server communication link. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// communicationLinkName - The name of the server communication link. -// options - ServerCommunicationLinksClientDeleteOptions contains the optional parameters for the ServerCommunicationLinksClient.Delete -// method. -func (client *ServerCommunicationLinksClient) Delete(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, options *ServerCommunicationLinksClientDeleteOptions) (ServerCommunicationLinksClientDeleteResponse, error) { - req, err := client.deleteCreateRequest(ctx, resourceGroupName, serverName, communicationLinkName, options) - if err != nil { - return ServerCommunicationLinksClientDeleteResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServerCommunicationLinksClientDeleteResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerCommunicationLinksClientDeleteResponse{}, runtime.NewResponseError(resp) - } - return ServerCommunicationLinksClientDeleteResponse{}, nil -} - -// deleteCreateRequest creates the Delete request. -func (client *ServerCommunicationLinksClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, options *ServerCommunicationLinksClientDeleteOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if communicationLinkName == "" { - return nil, errors.New("parameter communicationLinkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{communicationLinkName}", url.PathEscape(communicationLinkName)) - req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - return req, nil -} - -// Get - Returns a server communication link. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// communicationLinkName - The name of the server communication link. -// options - ServerCommunicationLinksClientGetOptions contains the optional parameters for the ServerCommunicationLinksClient.Get -// method. -func (client *ServerCommunicationLinksClient) Get(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, options *ServerCommunicationLinksClientGetOptions) (ServerCommunicationLinksClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, communicationLinkName, options) - if err != nil { - return ServerCommunicationLinksClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServerCommunicationLinksClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerCommunicationLinksClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ServerCommunicationLinksClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, communicationLinkName string, options *ServerCommunicationLinksClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks/{communicationLinkName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if communicationLinkName == "" { - return nil, errors.New("parameter communicationLinkName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{communicationLinkName}", url.PathEscape(communicationLinkName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ServerCommunicationLinksClient) getHandleResponse(resp *http.Response) (ServerCommunicationLinksClientGetResponse, error) { - result := ServerCommunicationLinksClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerCommunicationLink); err != nil { - return ServerCommunicationLinksClientGetResponse{}, err - } - return result, nil -} - -// NewListByServerPager - Gets a list of server communication links. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServerCommunicationLinksClientListByServerOptions contains the optional parameters for the ServerCommunicationLinksClient.ListByServer -// method. -func (client *ServerCommunicationLinksClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServerCommunicationLinksClientListByServerOptions) *runtime.Pager[ServerCommunicationLinksClientListByServerResponse] { - return runtime.NewPager(runtime.PagingHandler[ServerCommunicationLinksClientListByServerResponse]{ - More: func(page ServerCommunicationLinksClientListByServerResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ServerCommunicationLinksClientListByServerResponse) (ServerCommunicationLinksClientListByServerResponse, error) { - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) - if err != nil { - return ServerCommunicationLinksClientListByServerResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServerCommunicationLinksClientListByServerResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServerCommunicationLinksClientListByServerResponse{}, runtime.NewResponseError(resp) - } - return client.listByServerHandleResponse(resp) - }, - }) -} - -// listByServerCreateRequest creates the ListByServer request. -func (client *ServerCommunicationLinksClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServerCommunicationLinksClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/communicationLinks" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByServerHandleResponse handles the ListByServer response. -func (client *ServerCommunicationLinksClient) listByServerHandleResponse(resp *http.Response) (ServerCommunicationLinksClientListByServerResponse, error) { - result := ServerCommunicationLinksClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServerCommunicationLinkListResult); err != nil { - return ServerCommunicationLinksClientListByServerResponse{}, err - } - return result, nil -} diff --git a/sdk/resourcemanager/sql/armsql/zz_generated_serviceobjectives_client.go b/sdk/resourcemanager/sql/armsql/zz_generated_serviceobjectives_client.go deleted file mode 100644 index 90a95399985c..000000000000 --- a/sdk/resourcemanager/sql/armsql/zz_generated_serviceobjectives_client.go +++ /dev/null @@ -1,182 +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 armsql - -import ( - "context" - "errors" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "net/url" - "strings" -) - -// ServiceObjectivesClient contains the methods for the ServiceObjectives group. -// Don't use this type directly, use NewServiceObjectivesClient() instead. -type ServiceObjectivesClient struct { - host string - subscriptionID string - pl runtime.Pipeline -} - -// NewServiceObjectivesClient creates a new instance of ServiceObjectivesClient with the specified values. -// subscriptionID - The subscription ID that identifies an Azure subscription. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. -func NewServiceObjectivesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceObjectivesClient, error) { - if options == nil { - options = &arm.ClientOptions{} - } - ep := cloud.AzurePublic.Services[cloud.ResourceManager].Endpoint - if c, ok := options.Cloud.Services[cloud.ResourceManager]; ok { - ep = c.Endpoint - } - pl, err := armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, options) - if err != nil { - return nil, err - } - client := &ServiceObjectivesClient{ - subscriptionID: subscriptionID, - host: ep, - pl: pl, - } - return client, nil -} - -// Get - Gets a database service objective. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// serviceObjectiveName - The name of the service objective to retrieve. -// options - ServiceObjectivesClientGetOptions contains the optional parameters for the ServiceObjectivesClient.Get method. -func (client *ServiceObjectivesClient) Get(ctx context.Context, resourceGroupName string, serverName string, serviceObjectiveName string, options *ServiceObjectivesClientGetOptions) (ServiceObjectivesClientGetResponse, error) { - req, err := client.getCreateRequest(ctx, resourceGroupName, serverName, serviceObjectiveName, options) - if err != nil { - return ServiceObjectivesClientGetResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServiceObjectivesClientGetResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceObjectivesClientGetResponse{}, runtime.NewResponseError(resp) - } - return client.getHandleResponse(resp) -} - -// getCreateRequest creates the Get request. -func (client *ServiceObjectivesClient) getCreateRequest(ctx context.Context, resourceGroupName string, serverName string, serviceObjectiveName string, options *ServiceObjectivesClientGetOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives/{serviceObjectiveName}" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - if serviceObjectiveName == "" { - return nil, errors.New("parameter serviceObjectiveName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serviceObjectiveName}", url.PathEscape(serviceObjectiveName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// getHandleResponse handles the Get response. -func (client *ServiceObjectivesClient) getHandleResponse(resp *http.Response) (ServiceObjectivesClientGetResponse, error) { - result := ServiceObjectivesClientGetResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceObjective); err != nil { - return ServiceObjectivesClientGetResponse{}, err - } - return result, nil -} - -// NewListByServerPager - Returns database service objectives. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2014-04-01 -// resourceGroupName - The name of the resource group that contains the resource. You can obtain this value from the Azure -// Resource Manager API or the portal. -// serverName - The name of the server. -// options - ServiceObjectivesClientListByServerOptions contains the optional parameters for the ServiceObjectivesClient.ListByServer -// method. -func (client *ServiceObjectivesClient) NewListByServerPager(resourceGroupName string, serverName string, options *ServiceObjectivesClientListByServerOptions) *runtime.Pager[ServiceObjectivesClientListByServerResponse] { - return runtime.NewPager(runtime.PagingHandler[ServiceObjectivesClientListByServerResponse]{ - More: func(page ServiceObjectivesClientListByServerResponse) bool { - return false - }, - Fetcher: func(ctx context.Context, page *ServiceObjectivesClientListByServerResponse) (ServiceObjectivesClientListByServerResponse, error) { - req, err := client.listByServerCreateRequest(ctx, resourceGroupName, serverName, options) - if err != nil { - return ServiceObjectivesClientListByServerResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return ServiceObjectivesClientListByServerResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ServiceObjectivesClientListByServerResponse{}, runtime.NewResponseError(resp) - } - return client.listByServerHandleResponse(resp) - }, - }) -} - -// listByServerCreateRequest creates the ListByServer request. -func (client *ServiceObjectivesClient) listByServerCreateRequest(ctx context.Context, resourceGroupName string, serverName string, options *ServiceObjectivesClientListByServerOptions) (*policy.Request, error) { - urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/serviceObjectives" - if client.subscriptionID == "" { - return nil, errors.New("parameter client.subscriptionID cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) - if resourceGroupName == "" { - return nil, errors.New("parameter resourceGroupName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) - if serverName == "" { - return nil, errors.New("parameter serverName cannot be empty") - } - urlPath = strings.ReplaceAll(urlPath, "{serverName}", url.PathEscape(serverName)) - req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) - if err != nil { - return nil, err - } - reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2014-04-01") - req.Raw().URL.RawQuery = reqQP.Encode() - req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil -} - -// listByServerHandleResponse handles the ListByServer response. -func (client *ServiceObjectivesClient) listByServerHandleResponse(resp *http.Response) (ServiceObjectivesClientListByServerResponse, error) { - result := ServiceObjectivesClientListByServerResponse{} - if err := runtime.UnmarshalAsJSON(resp, &result.ServiceObjectiveListResult); err != nil { - return ServiceObjectivesClientListByServerResponse{}, err - } - return result, nil -}