From ec1d71ebb68423d8b341faad1fd01071d20d3b61 Mon Sep 17 00:00:00 2001 From: tadelesh Date: Thu, 19 Jan 2023 11:18:58 +0800 Subject: [PATCH 1/2] [Release] sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/2.0.0 generation from spec commit: 3751704f5318f1175875c94b66af769db917f2d3 --- .../armrecoveryservicesbackup/CHANGELOG.md | 84 + .../armrecoveryservicesbackup/autorest.md | 6 +- ...ines_client.go => backupengines_client.go} | 32 +- .../backupengines_client_example_test.go | 136 + ...kupjobs_client.go => backupjobs_client.go} | 19 +- .../backupjobs_client_example_test.go | 191 + ...nt.go => backupoperationresults_client.go} | 22 +- ...upoperationresults_client_example_test.go} | 11 +- ...t.go => backupoperationstatuses_client.go} | 22 +- ...upoperationstatuses_client_example_test.go | 45 + ...ies_client.go => backuppolicies_client.go} | 19 +- .../backuppolicies_client_example_test.go | 292 + ...nt.go => backupprotectableitems_client.go} | 21 +- ...kupprotectableitems_client_example_test.go | 62 + ...ient.go => backupprotecteditems_client.go} | 21 +- ...ackupprotecteditems_client_example_test.go | 71 + ...o => backupprotectioncontainers_client.go} | 21 +- ...rotectioncontainers_client_example_test.go | 61 + ...nt.go => backupprotectionintent_client.go} | 21 +- ...kupprotectionintent_client_example_test.go | 59 + ...backupresourceencryptionconfigs_client.go} | 35 +- ...ceencryptionconfigs_client_example_test.go | 77 + ...kupresourcestorageconfigsnoncrr_client.go} | 50 +- ...torageconfigsnoncrr_client_example_test.go | 106 + ...o => backupresourcevaultconfigs_client.go} | 50 +- ...esourcevaultconfigs_client_example_test.go | 113 + ...ed_backups_client.go => backups_client.go} | 26 +- ...test.go => backups_client_example_test.go} | 20 +- ...tatus_client.go => backupstatus_client.go} | 18 +- .../backupstatus_client_example_test.go | 52 + ...ient.go => backupusagesummaries_client.go} | 21 +- ...ackupusagesummaries_client_example_test.go | 151 + ...lient.go => backupworkloaditems_client.go} | 25 +- ...backupworkloaditems_client_example_test.go | 75 + ...spreparedatamoveoperationresult_client.go} | 20 +- ...oveoperationresult_client_example_test.go} | 19 +- .../{zz_generated_client.go => client.go} | 70 +- .../client_example_test.go | 122 + ...zz_generated_constants.go => constants.go} | 204 +- .../deletedprotectioncontainers_client.go | 129 + ...rotectioncontainers_client_example_test.go | 61 + ...o => exportjobsoperationresults_client.go} | 22 +- ...obsoperationresults_client_example_test.go | 47 + ...ort_client.go => featuresupport_client.go} | 18 +- ... => featuresupport_client_example_test.go} | 24 +- .../armrecoveryservicesbackup/go.mod | 8 +- .../armrecoveryservicesbackup/go.sum | 15 +- ...=> itemlevelrecoveryconnections_client.go} | 55 +- ...ecoveryconnections_client_example_test.go} | 40 +- ...s_client.go => jobcancellations_client.go} | 22 +- ...> jobcancellations_client_example_test.go} | 11 +- ...details_client.go => jobdetails_client.go} | 20 +- .../jobdetails_client_example_test.go | 70 + ...lient.go => joboperationresults_client.go} | 22 +- ...oboperationresults_client_example_test.go} | 12 +- ...enerated_jobs_client.go => jobs_client.go} | 18 +- ...nt_test.go => jobs_client_example_test.go} | 10 +- .../{zz_generated_models.go => models.go} | 831 +- ...erated_models_serde.go => models_serde.go} | 11000 ++++++++++++---- ...peration_client.go => operation_client.go} | 20 +- .../operation_client_example_test.go | 121 + ...rations_client.go => operations_client.go} | 13 +- .../operations_client_example_test.go | 496 + ...phic_helpers.go => polymorphic_helpers.go} | 71 +- ...nt_client.go => privateendpoint_client.go} | 24 +- .../privateendpoint_client_example_test.go | 45 + ...go => privateendpointconnection_client.go} | 60 +- ...eendpointconnection_client_example_test.go | 125 + ...ent.go => protectablecontainers_client.go} | 21 +- ...otectablecontainers_client_example_test.go | 71 + ...> protecteditemoperationresults_client.go} | 28 +- ...temoperationresults_client_example_test.go | 59 + ... protecteditemoperationstatuses_client.go} | 28 +- ...emoperationstatuses_client_example_test.go | 49 + ...ems_client.go => protecteditems_client.go} | 62 +- .../protecteditems_client_example_test.go | 214 + ...ectioncontaineroperationresults_client.go} | 26 +- ...neroperationresults_client_example_test.go | 77 + ...ontainerrefreshoperationresults_client.go} | 24 +- ...shoperationresults_client_example_test.go} | 12 +- ...ient.go => protectioncontainers_client.go} | 92 +- ...rotectioncontainers_client_example_test.go | 171 + ...t_client.go => protectionintent_client.go} | 69 +- .../protectionintent_client_example_test.go | 137 + ...client.go => protectionpolicies_client.go} | 55 +- .../protectionpolicies_client_example_test.go | 1232 ++ ...rotectionpolicyoperationresults_client.go} | 24 +- ...icyoperationresults_client_example_test.go | 66 + ...otectionpolicyoperationstatuses_client.go} | 24 +- ...cyoperationstatuses_client_example_test.go | 52 + ...nts_client.go => recoverypoints_client.go} | 44 +- .../recoverypoints_client_example_test.go | 167 + ...ecoverypointsrecommendedformove_client.go} | 23 +- ...srecommendedformove_client_example_test.go | 123 + ...ient.go => resourceguardproxies_client.go} | 21 +- ...esourceguardproxies_client_example_test.go | 65 + ...client.go => resourceguardproxy_client.go} | 59 +- .../resourceguardproxy_client_example_test.go | 145 + ...ed_response_types.go => response_types.go} | 50 +- ..._restores_client.go => restores_client.go} | 31 +- .../restores_client_example_test.go | 267 + ...ypins_client.go => securitypins_client.go} | 18 +- ...go => securitypins_client_example_test.go} | 18 +- ...erated_time_rfc3339.go => time_rfc3339.go} | 3 +- ..._client.go => validateoperation_client.go} | 25 +- .../validateoperation_client_example_test.go | 59 + ....go => validateoperationresults_client.go} | 22 +- ...ateoperationresults_client_example_test.go | 49 + ...go => validateoperationstatuses_client.go} | 22 +- ...teoperationstatuses_client_example_test.go | 57 + ...rated_example_backupengines_client_test.go | 70 - ...enerated_example_backupjobs_client_test.go | 45 - ...ple_backupoperationstatuses_client_test.go | 40 - ...ated_example_backuppolicies_client_test.go | 44 - ...mple_backupprotectableitems_client_test.go | 46 - ...xample_backupprotecteditems_client_test.go | 46 - ..._backupprotectioncontainers_client_test.go | 44 - ...mple_backupprotectionintent_client_test.go | 45 - ...upresourceencryptionconfigs_client_test.go | 68 - ...esourcestorageconfigsnoncrr_client_test.go | 94 - ..._backupresourcevaultconfigs_client_test.go | 95 - ...erated_example_backupstatus_client_test.go | 43 - ...xample_backupusagesummaries_client_test.go | 46 - ...example_backupworkloaditems_client_test.go | 48 - ..._exportjobsoperationresults_client_test.go | 40 - ...enerated_example_jobdetails_client_test.go | 40 - ...generated_example_operation_client_test.go | 60 - ...enerated_example_operations_client_test.go | 41 - ...ted_example_privateendpoint_client_test.go | 41 - ...e_privateendpointconnection_client_test.go | 105 - ...ample_protectablecontainers_client_test.go | 45 - ...otecteditemoperationresults_client_test.go | 43 - ...tecteditemoperationstatuses_client_test.go | 43 - ...ated_example_protecteditems_client_test.go | 98 - ...oncontaineroperationresults_client_test.go | 42 - ...xample_protectioncontainers_client_test.go | 140 - ...ed_example_protectionintent_client_test.go | 122 - ..._example_protectionpolicies_client_test.go | 157 - ...ctionpolicyoperationresults_client_test.go | 41 - ...tionpolicyoperationstatuses_client_test.go | 41 - ...ated_example_recoverypoints_client_test.go | 72 - ...erypointsrecommendedformove_client_test.go | 53 - ...ecoveryservicesbackupclient_client_test.go | 133 - ...xample_resourceguardproxies_client_test.go | 43 - ..._example_resourceguardproxy_client_test.go | 118 - ..._generated_example_restores_client_test.go | 65 - ...d_example_validateoperation_client_test.go | 62 - ...le_validateoperationresults_client_test.go | 40 - ...e_validateoperationstatuses_client_test.go | 40 - 149 files changed, 15789 insertions(+), 6451 deletions(-) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupengines_client.go => backupengines_client.go} (88%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupjobs_client.go => backupjobs_client.go} (88%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupoperationresults_client.go => backupoperationresults_client.go} (87%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{ze_generated_example_backupoperationresults_client_test.go => backupoperationresults_client_example_test.go} (72%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupoperationstatuses_client.go => backupoperationstatuses_client.go} (87%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backuppolicies_client.go => backuppolicies_client.go} (88%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupprotectableitems_client.go => backupprotectableitems_client.go} (89%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupprotecteditems_client.go => backupprotecteditems_client.go} (88%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupprotectioncontainers_client.go => backupprotectioncontainers_client.go} (88%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupprotectionintent_client.go => backupprotectionintent_client.go} (89%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupresourceencryptionconfigs_client.go => backupresourceencryptionconfigs_client.go} (86%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupresourcestorageconfigsnoncrr_client.go => backupresourcestorageconfigsnoncrr_client.go} (86%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupresourcevaultconfigs_client.go => backupresourcevaultconfigs_client.go} (86%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backups_client.go => backups_client.go} (85%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{ze_generated_example_backups_client_test.go => backups_client_example_test.go} (64%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupstatus_client.go => backupstatus_client.go} (88%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupusagesummaries_client.go => backupusagesummaries_client.go} (88%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_backupworkloaditems_client.go => backupworkloaditems_client.go} (88%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_bmspreparedatamoveoperationresult_client.go => bmspreparedatamoveoperationresult_client.go} (88%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{ze_generated_example_bmspreparedatamoveoperationresult_client_test.go => bmspreparedatamoveoperationresult_client_example_test.go} (52%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_client.go => client.go} (87%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_constants.go => constants.go} (85%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_exportjobsoperationresults_client.go => exportjobsoperationresults_client.go} (87%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_featuresupport_client.go => featuresupport_client.go} (88%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{ze_generated_example_featuresupport_client_test.go => featuresupport_client_example_test.go} (52%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_itemlevelrecoveryconnections_client.go => itemlevelrecoveryconnections_client.go} (83%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{ze_generated_example_itemlevelrecoveryconnections_client_test.go => itemlevelrecoveryconnections_client_example_test.go} (54%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_jobcancellations_client.go => jobcancellations_client.go} (86%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{ze_generated_example_jobcancellations_client_test.go => jobcancellations_client_example_test.go} (74%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_jobdetails_client.go => jobdetails_client.go} (87%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_joboperationresults_client.go => joboperationresults_client.go} (85%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{ze_generated_example_joboperationresults_client_test.go => joboperationresults_client_example_test.go} (71%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_jobs_client.go => jobs_client.go} (87%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{ze_generated_example_jobs_client_test.go => jobs_client_example_test.go} (72%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_models.go => models.go} (92%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_models_serde.go => models_serde.go} (64%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_operation_client.go => operation_client.go} (87%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_operations_client.go => operations_client.go} (89%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_polymorphic_helpers.go => polymorphic_helpers.go} (90%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_privateendpoint_client.go => privateendpoint_client.go} (87%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_privateendpointconnection_client.go => privateendpointconnection_client.go} (86%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_protectablecontainers_client.go => protectablecontainers_client.go} (89%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_protecteditemoperationresults_client.go => protecteditemoperationresults_client.go} (85%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_protecteditemoperationstatuses_client.go => protecteditemoperationstatuses_client.go} (86%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_protecteditems_client.go => protecteditems_client.go} (85%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_protectioncontaineroperationresults_client.go => protectioncontaineroperationresults_client.go} (86%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_protectioncontainerrefreshoperationresults_client.go => protectioncontainerrefreshoperationresults_client.go} (85%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{ze_generated_example_protectioncontainerrefreshoperationresults_client_test.go => protectioncontainerrefreshoperationresults_client_example_test.go} (73%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_protectioncontainers_client.go => protectioncontainers_client.go} (85%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_protectionintent_client.go => protectionintent_client.go} (86%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_protectionpolicies_client.go => protectionpolicies_client.go} (87%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_protectionpolicyoperationresults_client.go => protectionpolicyoperationresults_client.go} (86%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_protectionpolicyoperationstatuses_client.go => protectionpolicyoperationstatuses_client.go} (86%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_recoverypoints_client.go => recoverypoints_client.go} (86%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_recoverypointsrecommendedformove_client.go => recoverypointsrecommendedformove_client.go} (89%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_resourceguardproxies_client.go => resourceguardproxies_client.go} (88%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_resourceguardproxy_client.go => resourceguardproxy_client.go} (87%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_response_types.go => response_types.go} (92%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_restores_client.go => restores_client.go} (86%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_securitypins_client.go => securitypins_client.go} (88%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{ze_generated_example_securitypins_client_test.go => securitypins_client_example_test.go} (54%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_time_rfc3339.go => time_rfc3339.go} (96%) rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_validateoperation_client.go => validateoperation_client.go} (87%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_validateoperationresults_client.go => validateoperationresults_client.go} (86%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client_example_test.go rename sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/{zz_generated_validateoperationstatuses_client.go => validateoperationstatuses_client.go} (87%) create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupengines_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupjobs_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationstatuses_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backuppolicies_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectableitems_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotecteditems_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectioncontainers_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectionintent_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourceencryptionconfigs_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcestorageconfigsnoncrr_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcevaultconfigs_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupstatus_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupusagesummaries_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupworkloaditems_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_exportjobsoperationresults_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobdetails_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operation_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operations_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpoint_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpointconnection_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectablecontainers_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationresults_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationstatuses_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditems_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontaineroperationresults_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainers_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionintent_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicies_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationresults_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationstatuses_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypoints_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypointsrecommendedformove_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoveryservicesbackupclient_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxies_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxy_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_restores_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperation_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationresults_client_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationstatuses_client_test.go diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md index 570542552efa..8a779f6f1408 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md @@ -1,5 +1,89 @@ # Release History +## 2.0.0 (2023-01-19) +### Breaking Changes + +- Type of `AzureBackupServerContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureIaaSClassicComputeVMContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureIaaSComputeVMContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureSQLAGWorkloadContainerProtectionContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureSQLContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureStorageContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureStorageProtectableContainer.ProtectableContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureVMAppContainerProtectableContainer.ProtectableContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureVMAppContainerProtectionContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `AzureWorkloadContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `DpmContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `ErrorAdditionalInfo.Info` has been changed from `interface{}` to `any` +- Type of `GenericContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `IaaSVMContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `MabContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `ProtectableContainer.ProtectableContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Type of `ProtectionContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` +- Const `ContainerTypeAzureWorkloadContainer`, `ContainerTypeMicrosoftClassicComputeVirtualMachines`, `ContainerTypeMicrosoftComputeVirtualMachines` from type alias `ContainerType` has been removed +- Struct `CloudError` has been removed +- Struct `CloudErrorBody` has been removed + +### Features Added + +- New value `BackupItemTypeSAPHanaDBInstance` added to type alias `BackupItemType` +- New value `BackupTypeSnapshotCopyOnlyFull`, `BackupTypeSnapshotFull` added to type alias `BackupType` +- New value `ContainerTypeHanaHSRContainer` added to type alias `ContainerType` +- New value `DataSourceTypeSAPHanaDBInstance` added to type alias `DataSourceType` +- New value `PolicyTypeSnapshotCopyOnlyFull`, `PolicyTypeSnapshotFull` added to type alias `PolicyType` +- New value `ProtectedItemStateBackupsSuspended` added to type alias `ProtectedItemState` +- New value `ProtectionStateBackupsSuspended` added to type alias `ProtectionState` +- New value `RestorePointQueryTypeSnapshotCopyOnlyFull`, `RestorePointQueryTypeSnapshotFull` added to type alias `RestorePointQueryType` +- New value `RestorePointTypeSnapshotCopyOnlyFull`, `RestorePointTypeSnapshotFull` added to type alias `RestorePointType` +- New value `WorkloadItemTypeSAPHanaDBInstance` added to type alias `WorkloadItemType` +- New value `WorkloadTypeSAPHanaDBInstance` added to type alias `WorkloadType` +- New type alias `ProtectableContainerType` with values `ProtectableContainerTypeAzureBackupServerContainer`, `ProtectableContainerTypeAzureSQLContainer`, `ProtectableContainerTypeAzureWorkloadContainer`, `ProtectableContainerTypeCluster`, `ProtectableContainerTypeDPMContainer`, `ProtectableContainerTypeGenericContainer`, `ProtectableContainerTypeIaasVMContainer`, `ProtectableContainerTypeIaasVMServiceContainer`, `ProtectableContainerTypeInvalid`, `ProtectableContainerTypeMABContainer`, `ProtectableContainerTypeMicrosoftClassicComputeVirtualMachines`, `ProtectableContainerTypeMicrosoftComputeVirtualMachines`, `ProtectableContainerTypeSQLAGWorkLoadContainer`, `ProtectableContainerTypeStorageContainer`, `ProtectableContainerTypeUnknown`, `ProtectableContainerTypeVCenter`, `ProtectableContainerTypeVMAppContainer`, `ProtectableContainerTypeWindows` +- New type alias `TieringMode` with values `TieringModeDoNotTier`, `TieringModeInvalid`, `TieringModeTierAfter`, `TieringModeTierRecommended` +- New function `*AzureVMWorkloadSAPHanaDBInstance.GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem` +- New function `*AzureVMWorkloadSAPHanaDBInstance.GetWorkloadProtectableItem() *WorkloadProtectableItem` +- New function `*AzureVMWorkloadSAPHanaDBInstanceProtectedItem.GetAzureVMWorkloadProtectedItem() *AzureVMWorkloadProtectedItem` +- New function `*AzureVMWorkloadSAPHanaDBInstanceProtectedItem.GetProtectedItem() *ProtectedItem` +- New function `*AzureVMWorkloadSAPHanaHSR.GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem` +- New function `*AzureVMWorkloadSAPHanaHSR.GetWorkloadProtectableItem() *WorkloadProtectableItem` +- New function `NewDeletedProtectionContainersClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DeletedProtectionContainersClient, error)` +- New function `*DeletedProtectionContainersClient.NewListPager(string, string, *DeletedProtectionContainersClientListOptions) *runtime.Pager[DeletedProtectionContainersClientListResponse]` +- New struct `AzureVMWorkloadSAPHanaDBInstance` +- New struct `AzureVMWorkloadSAPHanaDBInstanceProtectedItem` +- New struct `AzureVMWorkloadSAPHanaHSR` +- New struct `DeletedProtectionContainersClient` +- New struct `DeletedProtectionContainersClientListResponse` +- New struct `RecoveryPointProperties` +- New struct `TieringPolicy` +- New field `RecoveryPointProperties` in struct `AzureFileShareRecoveryPoint` +- New field `SoftDeleteRetentionPeriod` in struct `AzureFileshareProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `AzureIaaSClassicComputeVMProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `AzureIaaSComputeVMProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `AzureIaaSVMProtectedItem` +- New field `NewestRecoveryPointInArchive` in struct `AzureIaaSVMProtectedItemExtendedInfo` +- New field `OldestRecoveryPointInArchive` in struct `AzureIaaSVMProtectedItemExtendedInfo` +- New field `OldestRecoveryPointInVault` in struct `AzureIaaSVMProtectedItemExtendedInfo` +- New field `TieringPolicy` in struct `AzureIaaSVMProtectionPolicy` +- New field `SoftDeleteRetentionPeriod` in struct `AzureSQLProtectedItem` +- New field `NewestRecoveryPointInArchive` in struct `AzureVMWorkloadProtectedItemExtendedInfo` +- New field `OldestRecoveryPointInArchive` in struct `AzureVMWorkloadProtectedItemExtendedInfo` +- New field `OldestRecoveryPointInVault` in struct `AzureVMWorkloadProtectedItemExtendedInfo` +- New field `SoftDeleteRetentionPeriod` in struct `AzureVMWorkloadSAPAseDatabaseProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `AzureVMWorkloadSAPHanaDatabaseProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `AzureVMWorkloadSQLDatabaseProtectedItem` +- New field `RecoveryPointProperties` in struct `AzureWorkloadPointInTimeRecoveryPoint` +- New field `RecoveryPointProperties` in struct `AzureWorkloadRecoveryPoint` +- New field `RecoveryPointProperties` in struct `AzureWorkloadSAPHanaPointInTimeRecoveryPoint` +- New field `RecoveryPointProperties` in struct `AzureWorkloadSAPHanaRecoveryPoint` +- New field `RecoveryPointProperties` in struct `AzureWorkloadSQLPointInTimeRecoveryPoint` +- New field `RecoveryPointProperties` in struct `AzureWorkloadSQLRecoveryPoint` +- New field `SoftDeleteRetentionPeriod` in struct `DPMProtectedItem` +- New field `SoftDeleteRetentionPeriod` in struct `GenericProtectedItem` +- New field `RecoveryPointProperties` in struct `GenericRecoveryPoint` +- New field `RecoveryPointProperties` in struct `IaasVMRecoveryPoint` +- New field `SoftDeleteRetentionPeriod` in struct `MabFileFolderProtectedItem` +- New field `TieringPolicy` in struct `SubProtectionPolicy` + + ## 1.0.0 (2022-05-17) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup` 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/recoveryservices/armrecoveryservicesbackup/autorest.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/autorest.md index affdb2038ba4..620a4177e3bf 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/autorest.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/recoveryservicesbackup/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/7a2ac91de424f271cf91cc8009f3fe9ee8249086/specification/recoveryservicesbackup/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 1.0.0 +module-version: 2.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupengines_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client.go similarity index 88% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupengines_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client.go index 825be418ee2f..7bb1d90952be 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupengines_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupEnginesClient struct { } // NewBackupEnginesClient creates a new instance of BackupEnginesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupEnginesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupEnginesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewBackupEnginesClient(subscriptionID string, credential azcore.TokenCreden // Get - Returns backup management server registered to Recovery Services Vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// backupEngineName - Name of the backup management server. -// options - BackupEnginesClientGetOptions contains the optional parameters for the BackupEnginesClient.Get method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - backupEngineName - Name of the backup management server. +// - options - BackupEnginesClientGetOptions contains the optional parameters for the BackupEnginesClient.Get method. func (client *BackupEnginesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, options *BackupEnginesClientGetOptions) (BackupEnginesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, backupEngineName, options) if err != nil { @@ -100,7 +102,7 @@ func (client *BackupEnginesClient) getCreateRequest(ctx context.Context, vaultNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -122,11 +124,11 @@ func (client *BackupEnginesClient) getHandleResponse(resp *http.Response) (Backu } // NewListPager - Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - BackupEnginesClientListOptions contains the optional parameters for the BackupEnginesClient.List method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - BackupEnginesClientListOptions contains the optional parameters for the BackupEnginesClient.NewListPager method. func (client *BackupEnginesClient) NewListPager(vaultName string, resourceGroupName string, options *BackupEnginesClientListOptions) *runtime.Pager[BackupEnginesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BackupEnginesClientListResponse]{ More: func(page BackupEnginesClientListResponse) bool { @@ -175,7 +177,7 @@ func (client *BackupEnginesClient) listCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client_example_test.go new file mode 100644 index 000000000000..993911d23bc9 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client_example_test.go @@ -0,0 +1,136 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Dpm/BackupEngines_List.json +func ExampleBackupEnginesClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupEnginesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("testVault", "testRG", &armrecoveryservicesbackup.BackupEnginesClientListOptions{Filter: nil, + SkipToken: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.BackupEngineBaseResourceList = armrecoveryservicesbackup.BackupEngineBaseResourceList{ + // Value: []*armrecoveryservicesbackup.BackupEngineBaseResource{ + // { + // Name: to.Ptr("testServer1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupEngines"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupEngines/testServer1"), + // Properties: &armrecoveryservicesbackup.DpmBackupEngine{ + // AzureBackupAgentVersion: to.Ptr("2.0.9532.0"), + // BackupEngineState: to.Ptr("Active"), + // BackupEngineType: to.Ptr(armrecoveryservicesbackup.BackupEngineTypeDpmBackupEngine), + // DpmVersion: to.Ptr("5.1.348.0"), + // ExtendedInfo: &armrecoveryservicesbackup.BackupEngineExtendedInfo{ + // AvailableDiskSpace: to.Ptr[float64](50), + // DiskCount: to.Ptr[int32](5), + // ProtectedItemsCount: to.Ptr[int32](35), + // ProtectedServersCount: to.Ptr[int32](21), + // UsedDiskSpace: to.Ptr[float64](20), + // }, + // FriendlyName: to.Ptr("testServer1"), + // IsAzureBackupAgentUpgradeAvailable: to.Ptr(false), + // IsDpmUpgradeAvailable: to.Ptr(false), + // RegistrationStatus: to.Ptr("Registered"), + // }, + // }, + // { + // Name: to.Ptr("testServer5"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupEngines"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupEngines/testServer5"), + // Properties: &armrecoveryservicesbackup.DpmBackupEngine{ + // AzureBackupAgentVersion: to.Ptr("2.0.9530.0"), + // BackupEngineState: to.Ptr("Active"), + // BackupEngineType: to.Ptr(armrecoveryservicesbackup.BackupEngineTypeDpmBackupEngine), + // DpmVersion: to.Ptr("5.1.348.0"), + // ExtendedInfo: &armrecoveryservicesbackup.BackupEngineExtendedInfo{ + // AvailableDiskSpace: to.Ptr[float64](50), + // DiskCount: to.Ptr[int32](5), + // ProtectedItemsCount: to.Ptr[int32](35), + // ProtectedServersCount: to.Ptr[int32](21), + // UsedDiskSpace: to.Ptr[float64](20), + // }, + // FriendlyName: to.Ptr("testServer5"), + // IsAzureBackupAgentUpgradeAvailable: to.Ptr(false), + // IsDpmUpgradeAvailable: to.Ptr(false), + // RegistrationStatus: to.Ptr("Registered"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Dpm/BackupEngines_Get.json +func ExampleBackupEnginesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupEnginesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "testVault", "testRG", "testServer", &armrecoveryservicesbackup.BackupEnginesClientGetOptions{Filter: nil, + SkipToken: nil, + }) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.BackupEngineBaseResource = armrecoveryservicesbackup.BackupEngineBaseResource{ + // Name: to.Ptr("testServer"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupEngines"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupEngines/testServer"), + // Properties: &armrecoveryservicesbackup.DpmBackupEngine{ + // AzureBackupAgentVersion: to.Ptr("2.0.9532.0"), + // BackupEngineState: to.Ptr("Active"), + // BackupEngineType: to.Ptr(armrecoveryservicesbackup.BackupEngineTypeDpmBackupEngine), + // DpmVersion: to.Ptr("5.1.348.0"), + // ExtendedInfo: &armrecoveryservicesbackup.BackupEngineExtendedInfo{ + // AvailableDiskSpace: to.Ptr[float64](50), + // DiskCount: to.Ptr[int32](5), + // ProtectedItemsCount: to.Ptr[int32](35), + // ProtectedServersCount: to.Ptr[int32](21), + // UsedDiskSpace: to.Ptr[float64](20), + // }, + // FriendlyName: to.Ptr("testServer"), + // IsAzureBackupAgentUpgradeAvailable: to.Ptr(false), + // IsDpmUpgradeAvailable: to.Ptr(false), + // RegistrationStatus: to.Ptr("Registered"), + // }, + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupjobs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client.go similarity index 88% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupjobs_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client.go index ad52f1dd33b3..332e9036ccae 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupjobs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupJobsClient struct { } // NewBackupJobsClient creates a new instance of BackupJobsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupJobsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,11 +56,11 @@ func NewBackupJobsClient(subscriptionID string, credential azcore.TokenCredentia } // NewListPager - Provides a pageable list of jobs. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - BackupJobsClientListOptions contains the optional parameters for the BackupJobsClient.List method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - BackupJobsClientListOptions contains the optional parameters for the BackupJobsClient.NewListPager method. func (client *BackupJobsClient) NewListPager(vaultName string, resourceGroupName string, options *BackupJobsClientListOptions) *runtime.Pager[BackupJobsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BackupJobsClientListResponse]{ More: func(page BackupJobsClientListResponse) bool { @@ -108,7 +109,7 @@ func (client *BackupJobsClient) listCreateRequest(ctx context.Context, vaultName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client_example_test.go new file mode 100644 index 000000000000..db9e563fdf00 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client_example_test.go @@ -0,0 +1,191 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/ListJobs.json +func ExampleBackupJobsClient_NewListPager_listAllJobs() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupJobsClientListOptions{Filter: nil, + SkipToken: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.JobResourceList = armrecoveryservicesbackup.JobResourceList{ + // Value: []*armrecoveryservicesbackup.JobResource{ + // { + // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ + // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // EntityFriendlyName: to.Ptr("testvm"), + // JobType: to.Ptr("AzureIaaSVMJob"), + // Operation: to.Ptr("Backup"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:07.014604Z"); return t}()), + // Status: to.Ptr("InProgress"), + // Duration: to.Ptr("PT12.4272909S"), + // VirtualMachineVersion: to.Ptr("Compute"), + // }, + // }, + // { + // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ + // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:03.7553376Z"); return t}()), + // EntityFriendlyName: to.Ptr("testvm"), + // JobType: to.Ptr("AzureIaaSVMJob"), + // Operation: to.Ptr("ConfigureBackup"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:30:32.4487085Z"); return t}()), + // Status: to.Ptr("Completed"), + // Duration: to.Ptr("PT31.3066291S"), + // VirtualMachineVersion: to.Ptr("Compute"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/ListJobsWithAllSupportedFilters.json +func ExampleBackupJobsClient_NewListPager_listJobsWithFilters() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupJobsClientListOptions{Filter: to.Ptr("startTime eq '2016-01-01 00:00:00 AM' and endTime eq '2017-11-29 00:00:00 AM' and operation eq 'Backup' and backupManagementType eq 'AzureIaasVM' and status eq 'InProgress'"), + SkipToken: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.JobResourceList = armrecoveryservicesbackup.JobResourceList{ + // Value: []*armrecoveryservicesbackup.JobResource{ + // { + // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ + // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // EntityFriendlyName: to.Ptr("testvm"), + // JobType: to.Ptr("AzureIaaSVMJob"), + // Operation: to.Ptr("Backup"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:07.014604Z"); return t}()), + // Status: to.Ptr("InProgress"), + // Duration: to.Ptr("PT12.4272909S"), + // VirtualMachineVersion: to.Ptr("Compute"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/ListJobsWithStartTimeAndEndTimeFilters.json +func ExampleBackupJobsClient_NewListPager_listJobsWithTimeFilter() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupJobsClientListOptions{Filter: to.Ptr("startTime eq '2016-01-01 00:00:00 AM' and endTime eq '2017-11-29 00:00:00 AM'"), + SkipToken: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.JobResourceList = armrecoveryservicesbackup.JobResourceList{ + // Value: []*armrecoveryservicesbackup.JobResource{ + // { + // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ + // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // EntityFriendlyName: to.Ptr("testvm"), + // JobType: to.Ptr("AzureIaaSVMJob"), + // Operation: to.Ptr("Backup"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:07.014604Z"); return t}()), + // Status: to.Ptr("InProgress"), + // Duration: to.Ptr("PT12.4272909S"), + // VirtualMachineVersion: to.Ptr("Compute"), + // }, + // }, + // { + // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ + // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:03.7553376Z"); return t}()), + // EntityFriendlyName: to.Ptr("testvm"), + // JobType: to.Ptr("AzureIaaSVMJob"), + // Operation: to.Ptr("ConfigureBackup"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:30:32.4487085Z"); return t}()), + // Status: to.Ptr("Completed"), + // Duration: to.Ptr("PT31.3066291S"), + // VirtualMachineVersion: to.Ptr("Compute"), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client.go similarity index 87% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupoperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client.go index bf532720ee21..6ae65d38853e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupOperationResultsClient struct { } // NewBackupOperationResultsClient creates a new instance of BackupOperationResultsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupOperationResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -59,12 +60,13 @@ func NewBackupOperationResultsClient(subscriptionID string, credential azcore.To // till it reaches completion. On successful completion, the status code will be OK. This method expects OperationID as an // argument. OperationID is part of the Location header of the operation response. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// operationID - OperationID which represents the operation. -// options - BackupOperationResultsClientGetOptions contains the optional parameters for the BackupOperationResultsClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - operationID - OperationID which represents the operation. +// - options - BackupOperationResultsClientGetOptions contains the optional parameters for the BackupOperationResultsClient.Get +// method. func (client *BackupOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *BackupOperationResultsClientGetOptions) (BackupOperationResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { @@ -104,7 +106,7 @@ func (client *BackupOperationResultsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client_example_test.go similarity index 72% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationresults_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client_example_test.go index d5930bab2b7f..76e0f6d2035e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationresults_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client_example_test.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 armrecoveryservicesbackup_test @@ -13,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/ProtectedItem_Delete_OperationResult.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/ProtectedItem_Delete_OperationResult.json func ExampleBackupOperationResultsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -27,11 +28,7 @@ func ExampleBackupOperationResultsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Get(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - "00000000-0000-0000-0000-000000000000", - nil) + _, err = client.Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "00000000-0000-0000-0000-000000000000", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client.go similarity index 87% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupoperationstatuses_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client.go index e3e5bdd205ff..ddb0290d14bc 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupOperationStatusesClient struct { } // NewBackupOperationStatusesClient creates a new instance of BackupOperationStatusesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupOperationStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupOperationStatusesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +59,13 @@ func NewBackupOperationStatusesClient(subscriptionID string, credential azcore.T // or failed. You can refer to the OperationStatus enum for all the possible states of an // operation. Some operations create jobs. This method returns the list of jobs when the operation is complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// operationID - OperationID which represents the operation. -// options - BackupOperationStatusesClientGetOptions contains the optional parameters for the BackupOperationStatusesClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - operationID - OperationID which represents the operation. +// - options - BackupOperationStatusesClientGetOptions contains the optional parameters for the BackupOperationStatusesClient.Get +// method. func (client *BackupOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *BackupOperationStatusesClientGetOptions) (BackupOperationStatusesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { @@ -103,7 +105,7 @@ func (client *BackupOperationStatusesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client_example_test.go new file mode 100644 index 000000000000..7e2edcc94edf --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client_example_test.go @@ -0,0 +1,45 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/ProtectedItem_Delete_OperationStatus.json +func ExampleBackupOperationStatusesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "00000000-0000-0000-0000-000000000000", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.OperationStatus = armrecoveryservicesbackup.OperationStatus{ + // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T00:00:00.00000Z"); return t}()), + // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T06:52:53.886027Z"); return t}()), + // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesInProgress), + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backuppolicies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client.go similarity index 88% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backuppolicies_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client.go index fa66d2309dd4..14c881e34ae5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backuppolicies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupPoliciesClient struct { } // NewBackupPoliciesClient creates a new instance of BackupPoliciesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,11 @@ func NewBackupPoliciesClient(subscriptionID string, credential azcore.TokenCrede // NewListPager - Lists of backup policies associated with Recovery Services Vault. API provides pagination parameters to // fetch scoped results. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.List method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.NewListPager method. func (client *BackupPoliciesClient) NewListPager(vaultName string, resourceGroupName string, options *BackupPoliciesClientListOptions) *runtime.Pager[BackupPoliciesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BackupPoliciesClientListResponse]{ More: func(page BackupPoliciesClientListResponse) bool { @@ -109,7 +110,7 @@ func (client *BackupPoliciesClient) listCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client_example_test.go new file mode 100644 index 000000000000..3ce15f8b8653 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client_example_test.go @@ -0,0 +1,292 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/BackupPolicies_List.json +func ExampleBackupPoliciesClient_NewListPager_listProtectionPoliciesWithBackupManagementTypeFilterAsAzureIaasVm() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupPoliciesClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'")}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ProtectionPolicyResourceList = armrecoveryservicesbackup.ProtectionPolicyResourceList{ + // Value: []*armrecoveryservicesbackup.ProtectionPolicyResource{ + // { + // Name: to.Ptr("DefaultPolicy"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/DefaultPolicy"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // ProtectedItemsCount: to.Ptr[int32](0), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](30), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00Z"); return t}())}, + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // }, + // }, + // { + // Name: to.Ptr("testPolicy1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // ProtectedItemsCount: to.Ptr[int32](0), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](1), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // TimeZone: to.Ptr("Pacific Standard Time"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/V2Policy/v2-List-Policies.json +func ExampleBackupPoliciesClient_NewListPager_listProtectionPoliciesWithBackupManagementTypeFilterAsAzureIaasVmWithBothV1AndV2Policies() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupPoliciesClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'")}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ProtectionPolicyResourceList = armrecoveryservicesbackup.ProtectionPolicyResourceList{ + // Value: []*armrecoveryservicesbackup.ProtectionPolicyResource{ + // { + // Name: to.Ptr("DefaultPolicy"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/DefaultPolicy"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // ProtectedItemsCount: to.Ptr[int32](0), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](30), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00Z"); return t}())}, + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // }, + // }, + // { + // Name: to.Ptr("testPolicy1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // ProtectedItemsCount: to.Ptr[int32](0), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](1), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // TimeZone: to.Ptr("Pacific Standard Time"), + // }, + // }, + // { + // Name: to.Ptr("v2-daily-policy"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/v2-daily-policy"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // ProtectedItemsCount: to.Ptr[int32](0), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](1), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), + // DailySchedule: &armrecoveryservicesbackup.DailySchedule{ + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, + // }, + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + // }, + // TimeZone: to.Ptr("Pacific Standard Time"), + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureWorkload/BackupPolicies_List.json +func ExampleBackupPoliciesClient_NewListPager_listProtectionPoliciesWithBackupManagementTypeFilterAsAzureWorkload() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupPoliciesClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'")}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ProtectionPolicyResourceList = armrecoveryservicesbackup.ProtectionPolicyResourceList{ + // Value: []*armrecoveryservicesbackup.ProtectionPolicyResource{ + // { + // Name: to.Ptr("HourlyLogBackup"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/HourlyLogBackup"), + // Properties: &armrecoveryservicesbackup.AzureVMWorkloadProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureWorkload"), + // ProtectedItemsCount: to.Ptr[int32](0), + // Settings: &armrecoveryservicesbackup.Settings{ + // Issqlcompression: to.Ptr(false), + // TimeZone: to.Ptr("UTC"), + // }, + // SubProtectionPolicy: []*armrecoveryservicesbackup.SubProtectionPolicy{ + // { + // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeFull), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](30), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00Z"); return t}())}, + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // }, + // { + // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeLog), + // RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ + // RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](30), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.LogSchedulePolicy{ + // SchedulePolicyType: to.Ptr("LogSchedulePolicy"), + // ScheduleFrequencyInMins: to.Ptr[int32](60), + // }, + // }}, + // WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeSQLDataBase), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectableitems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client.go similarity index 89% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectableitems_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client.go index 0c65e5ddc444..7dab731f008e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectableitems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupProtectableItemsClient struct { } // NewBackupProtectableItemsClient creates a new instance of BackupProtectableItemsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupProtectableItemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupProtectableItemsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,12 @@ func NewBackupProtectableItemsClient(subscriptionID string, credential azcore.To // NewListPager - Provides a pageable list of protectable objects within your subscription according to the query filter and // the pagination parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - BackupProtectableItemsClientListOptions contains the optional parameters for the BackupProtectableItemsClient.List -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - BackupProtectableItemsClientListOptions contains the optional parameters for the BackupProtectableItemsClient.NewListPager +// method. func (client *BackupProtectableItemsClient) NewListPager(vaultName string, resourceGroupName string, options *BackupProtectableItemsClientListOptions) *runtime.Pager[BackupProtectableItemsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BackupProtectableItemsClientListResponse]{ More: func(page BackupProtectableItemsClientListResponse) bool { @@ -110,7 +111,7 @@ func (client *BackupProtectableItemsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client_example_test.go new file mode 100644 index 000000000000..680df455e172 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client_example_test.go @@ -0,0 +1,62 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/BackupProtectableItems_List.json +func ExampleBackupProtectableItemsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupProtectableItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupProtectableItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'"), + SkipToken: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.WorkloadProtectableItemResourceList = armrecoveryservicesbackup.WorkloadProtectableItemResourceList{ + // Value: []*armrecoveryservicesbackup.WorkloadProtectableItemResource{ + // { + // Name: to.Ptr("VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/protectionContainers/IaasVMContainer;iaasvmcontainer;iaasvm-rg;iaasvm-1/protectableItems/VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSClassicComputeVMProtectableItem{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // FriendlyName: to.Ptr("iaasvm-1"), + // ProtectableItemType: to.Ptr("Microsoft.ClassicCompute/virtualMachines"), + // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStatusNotProtected), + // WorkloadType: to.Ptr("VM"), + // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotecteditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client.go similarity index 88% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotecteditems_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client.go index 415d0499eacb..5f7b02271174 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotecteditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupProtectedItemsClient struct { } // NewBackupProtectedItemsClient creates a new instance of BackupProtectedItemsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupProtectedItemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupProtectedItemsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,12 +56,12 @@ func NewBackupProtectedItemsClient(subscriptionID string, credential azcore.Toke } // NewListPager - Provides a pageable list of all items that are backed up within a vault. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - BackupProtectedItemsClientListOptions contains the optional parameters for the BackupProtectedItemsClient.List -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - BackupProtectedItemsClientListOptions contains the optional parameters for the BackupProtectedItemsClient.NewListPager +// method. func (client *BackupProtectedItemsClient) NewListPager(vaultName string, resourceGroupName string, options *BackupProtectedItemsClientListOptions) *runtime.Pager[BackupProtectedItemsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BackupProtectedItemsClientListResponse]{ More: func(page BackupProtectedItemsClientListResponse) bool { @@ -109,7 +110,7 @@ func (client *BackupProtectedItemsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client_example_test.go new file mode 100644 index 000000000000..3e226e257c31 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client_example_test.go @@ -0,0 +1,71 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/BackupProtectedItems_List.json +func ExampleBackupProtectedItemsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupProtectedItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM' and itemType eq 'VM'"), + SkipToken: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ProtectedItemResourceList = armrecoveryservicesbackup.ProtectedItemResourceList{ + // Value: []*armrecoveryservicesbackup.ProtectedItemResource{ + // { + // Name: to.Ptr("VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/protectionContainers/IaasVMContainer;iaasvmcontainer;iaasvm-rg;iaasvm-1/protectedItems/VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSClassicComputeVMProtectedItem{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // ContainerName: to.Ptr("iaasvmcontainer;iaasvm-rg;iaasvm-1"), + // LastRecoveryPoint: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-22T12:25:32.048723Z"); return t}()), + // PolicyID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), + // ProtectedItemType: to.Ptr("Microsoft.ClassicCompute/virtualMachines"), + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), + // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), + // FriendlyName: to.Ptr("iaasvm-1"), + // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), + // LastBackupStatus: to.Ptr("Completed"), + // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048723Z"); return t}()), + // ProtectedItemDataID: to.Ptr("636482643132986882"), + // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), + // ProtectionStatus: to.Ptr("Healthy"), + // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client.go similarity index 88% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectioncontainers_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client.go index a9a7079bbac7..f8dd5bebcb73 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectioncontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupProtectionContainersClient struct { } // NewBackupProtectionContainersClient creates a new instance of BackupProtectionContainersClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupProtectionContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupProtectionContainersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,12 +56,12 @@ func NewBackupProtectionContainersClient(subscriptionID string, credential azcor } // NewListPager - Lists the containers registered to Recovery Services Vault. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - BackupProtectionContainersClientListOptions contains the optional parameters for the BackupProtectionContainersClient.List -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - BackupProtectionContainersClientListOptions contains the optional parameters for the BackupProtectionContainersClient.NewListPager +// method. func (client *BackupProtectionContainersClient) NewListPager(vaultName string, resourceGroupName string, options *BackupProtectionContainersClientListOptions) *runtime.Pager[BackupProtectionContainersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BackupProtectionContainersClientListResponse]{ More: func(page BackupProtectionContainersClientListResponse) bool { @@ -109,7 +110,7 @@ func (client *BackupProtectionContainersClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client_example_test.go new file mode 100644 index 000000000000..a14cb5bf518b --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client_example_test.go @@ -0,0 +1,61 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureStorage/ProtectionContainers_List.json +func ExampleBackupProtectionContainersClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("testVault", "testRg", &armrecoveryservicesbackup.BackupProtectionContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'")}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ProtectionContainerResourceList = armrecoveryservicesbackup.ProtectionContainerResourceList{ + // Value: []*armrecoveryservicesbackup.ProtectionContainerResource{ + // { + // Name: to.Ptr("StorageContainer;Storage;testrg;suchandrtestsa125"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers"), + // ID: to.Ptr("/subscriptions/172424a4-d65f-421e-a8de-197d98aabeba/resourcegroups/testrg/providers/microsoft.recoveryservices/vaults/suchandr-test-vault-wcus/backupFabrics/Azure/protectionContainers/StorageContainer;Storage;testrg;suchandrtestsa125"), + // Properties: &armrecoveryservicesbackup.AzureStorageContainer{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), + // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), + // FriendlyName: to.Ptr("suchandrtestsa125"), + // HealthStatus: to.Ptr("Healthy"), + // RegistrationStatus: to.Ptr("Registered"), + // ProtectedItemCount: to.Ptr[int64](2), + // SourceResourceID: to.Ptr("/subscriptions/172424a4-d65f-421e-a8de-197d98aabeba/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/suchandrtestsa125"), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectionintent_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client.go similarity index 89% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectionintent_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client.go index 582e6bafcfe4..8dda06bcecb3 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupprotectionintent_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupProtectionIntentClient struct { } // NewBackupProtectionIntentClient creates a new instance of BackupProtectionIntentClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupProtectionIntentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupProtectionIntentClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,12 +56,12 @@ func NewBackupProtectionIntentClient(subscriptionID string, credential azcore.To } // NewListPager - Provides a pageable list of all intents that are present within a vault. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - BackupProtectionIntentClientListOptions contains the optional parameters for the BackupProtectionIntentClient.List -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - BackupProtectionIntentClientListOptions contains the optional parameters for the BackupProtectionIntentClient.NewListPager +// method. func (client *BackupProtectionIntentClient) NewListPager(vaultName string, resourceGroupName string, options *BackupProtectionIntentClientListOptions) *runtime.Pager[BackupProtectionIntentClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BackupProtectionIntentClientListResponse]{ More: func(page BackupProtectionIntentClientListResponse) bool { @@ -109,7 +110,7 @@ func (client *BackupProtectionIntentClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client_example_test.go new file mode 100644 index 000000000000..bb87fca200bf --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client_example_test.go @@ -0,0 +1,59 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureWorkload/BackupProtectionIntent_List.json +func ExampleBackupProtectionIntentClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("myVault", "myRG", &armrecoveryservicesbackup.BackupProtectionIntentClientListOptions{Filter: nil, + SkipToken: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ProtectionIntentResourceList = armrecoveryservicesbackup.ProtectionIntentResourceList{ + // Value: []*armrecoveryservicesbackup.ProtectionIntentResource{ + // { + // Name: to.Ptr("249D9B07-D2EF-4202-AA64-65F35418564E"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupProtectionIntent"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupFabrics/Azure/backupProtectionIntent/249D9B07-D2EF-4202-AA64-65F35418564E"), + // Properties: &armrecoveryservicesbackup.AzureWorkloadContainerAutoProtectionIntent{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureWorkload), + // ItemID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupProtectionContainer/VMAppContainer;Compute;testVmName/backupProtectableItems/SQLInstance;MSSQLSERVER"), + // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), + // ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourceencryptionconfigs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourceencryptionconfigs_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client.go index 0ae6a75073e0..de9fcd4407bf 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourceencryptionconfigs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupResourceEncryptionConfigsClient struct { } // NewBackupResourceEncryptionConfigsClient creates a new instance of BackupResourceEncryptionConfigsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupResourceEncryptionConfigsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupResourceEncryptionConfigsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewBackupResourceEncryptionConfigsClient(subscriptionID string, credential // Get - Fetches Vault Encryption config. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - BackupResourceEncryptionConfigsClientGetOptions contains the optional parameters for the BackupResourceEncryptionConfigsClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - BackupResourceEncryptionConfigsClientGetOptions contains the optional parameters for the BackupResourceEncryptionConfigsClient.Get +// method. func (client *BackupResourceEncryptionConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, options *BackupResourceEncryptionConfigsClientGetOptions) (BackupResourceEncryptionConfigsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, options) if err != nil { @@ -96,7 +98,7 @@ func (client *BackupResourceEncryptionConfigsClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,12 +115,13 @@ func (client *BackupResourceEncryptionConfigsClient) getHandleResponse(resp *htt // Update - Updates Vault encryption config. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - Vault encryption input config request -// options - BackupResourceEncryptionConfigsClientUpdateOptions contains the optional parameters for the BackupResourceEncryptionConfigsClient.Update -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - Vault encryption input config request +// - options - BackupResourceEncryptionConfigsClientUpdateOptions contains the optional parameters for the BackupResourceEncryptionConfigsClient.Update +// method. func (client *BackupResourceEncryptionConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters BackupResourceEncryptionConfigResource, options *BackupResourceEncryptionConfigsClientUpdateOptions) (BackupResourceEncryptionConfigsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { @@ -154,7 +157,7 @@ func (client *BackupResourceEncryptionConfigsClient) updateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client_example_test.go new file mode 100644 index 000000000000..6e75e2700da0 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client_example_test.go @@ -0,0 +1,77 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/BackupResourceEncryptionConfig_Get.json +func ExampleBackupResourceEncryptionConfigsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupResourceEncryptionConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "rishTestVault", "rishgrp", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.BackupResourceEncryptionConfigExtendedResource = armrecoveryservicesbackup.BackupResourceEncryptionConfigExtendedResource{ + // Name: to.Ptr("backupResourceEncryptionConfig"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupEncryptionConfigs"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rishgrp/providers/Microsoft.RecoveryServicesBVTD2/vaults/rishTestVault/backupEncryptionConfigs/backupResourceEncryptionConfig"), + // Properties: &armrecoveryservicesbackup.BackupResourceEncryptionConfigExtended{ + // EncryptionAtRestType: to.Ptr(armrecoveryservicesbackup.EncryptionAtRestTypeCustomerManaged), + // InfrastructureEncryptionState: to.Ptr(armrecoveryservicesbackup.InfrastructureEncryptionStateDisabled), + // KeyURI: to.Ptr("https://gktestkv1.vault.azure.net/keys/Test1/ed2e8cdc7f86477ebf0c6462b504a9ed"), + // LastUpdateStatus: to.Ptr(armrecoveryservicesbackup.LastUpdateStatusSucceeded), + // SubscriptionID: to.Ptr("1a2311d9-66f5-47d3-a9fb-7a37da63934b"), + // UseSystemAssignedIdentity: to.Ptr(false), + // UserAssignedIdentity: to.Ptr("/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/BackupResourceEncryptionConfig_Put.json +func ExampleBackupResourceEncryptionConfigsClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupResourceEncryptionConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Update(ctx, "source-rsv", "test-rg", armrecoveryservicesbackup.BackupResourceEncryptionConfigResource{ + Properties: &armrecoveryservicesbackup.BackupResourceEncryptionConfig{ + EncryptionAtRestType: to.Ptr(armrecoveryservicesbackup.EncryptionAtRestTypeCustomerManaged), + InfrastructureEncryptionState: to.Ptr(armrecoveryservicesbackup.InfrastructureEncryptionState("true")), + KeyURI: to.Ptr("https://gktestkv1.vault.azure.net/keys/Test1/ed2e8cdc7f86477ebf0c6462b504a9ed"), + SubscriptionID: to.Ptr("1a2311d9-66f5-47d3-a9fb-7a37da63934b"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourcestorageconfigsnoncrr_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourcestorageconfigsnoncrr_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client.go index b6d27619e46c..c240e2e3d321 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourcestorageconfigsnoncrr_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupResourceStorageConfigsNonCRRClient struct { } // NewBackupResourceStorageConfigsNonCRRClient creates a new instance of BackupResourceStorageConfigsNonCRRClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupResourceStorageConfigsNonCRRClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupResourceStorageConfigsNonCRRClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewBackupResourceStorageConfigsNonCRRClient(subscriptionID string, credenti // Get - Fetches resource storage config. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - BackupResourceStorageConfigsNonCRRClientGetOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - BackupResourceStorageConfigsNonCRRClientGetOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Get +// method. func (client *BackupResourceStorageConfigsNonCRRClient) Get(ctx context.Context, vaultName string, resourceGroupName string, options *BackupResourceStorageConfigsNonCRRClientGetOptions) (BackupResourceStorageConfigsNonCRRClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, options) if err != nil { @@ -96,7 +98,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,12 +115,13 @@ func (client *BackupResourceStorageConfigsNonCRRClient) getHandleResponse(resp * // Patch - Updates vault storage model type. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - Vault storage config request -// options - BackupResourceStorageConfigsNonCRRClientPatchOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Patch -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - Vault storage config request +// - options - BackupResourceStorageConfigsNonCRRClientPatchOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Patch +// method. func (client *BackupResourceStorageConfigsNonCRRClient) Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters BackupResourceConfigResource, options *BackupResourceStorageConfigsNonCRRClientPatchOptions) (BackupResourceStorageConfigsNonCRRClientPatchResponse, error) { req, err := client.patchCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { @@ -154,7 +157,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) patchCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -162,12 +165,13 @@ func (client *BackupResourceStorageConfigsNonCRRClient) patchCreateRequest(ctx c // Update - Updates vault storage model type. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - Vault storage config request -// options - BackupResourceStorageConfigsNonCRRClientUpdateOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Update -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - Vault storage config request +// - options - BackupResourceStorageConfigsNonCRRClientUpdateOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Update +// method. func (client *BackupResourceStorageConfigsNonCRRClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters BackupResourceConfigResource, options *BackupResourceStorageConfigsNonCRRClientUpdateOptions) (BackupResourceStorageConfigsNonCRRClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { @@ -203,7 +207,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) updateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client_example_test.go new file mode 100644 index 000000000000..19aeb2452310 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client_example_test.go @@ -0,0 +1,106 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/BackupStorageConfig_Get.json +func ExampleBackupResourceStorageConfigsNonCRRClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupResourceStorageConfigsNonCRRClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.BackupResourceConfigResource = armrecoveryservicesbackup.BackupResourceConfigResource{ + // Name: to.Ptr("vaultstorageconfig"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupstorageconfig"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupstorageconfig/vaultstorageconfig"), + // Properties: &armrecoveryservicesbackup.BackupResourceConfig{ + // StorageModelType: to.Ptr(armrecoveryservicesbackup.StorageTypeGeoRedundant), + // StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeGeoRedundant), + // StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateLocked), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/BackupStorageConfig_Put.json +func ExampleBackupResourceStorageConfigsNonCRRClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupResourceStorageConfigsNonCRRClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Update(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", armrecoveryservicesbackup.BackupResourceConfigResource{ + Properties: &armrecoveryservicesbackup.BackupResourceConfig{ + StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), + StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateUnlocked), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.BackupResourceConfigResource = armrecoveryservicesbackup.BackupResourceConfigResource{ + // Name: to.Ptr("vaultstorageconfig"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupstorageconfig"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupstorageconfig/vaultstorageconfig"), + // Properties: &armrecoveryservicesbackup.BackupResourceConfig{ + // StorageModelType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), + // StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), + // StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateUnlocked), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/BackupStorageConfig_Patch.json +func ExampleBackupResourceStorageConfigsNonCRRClient_Patch() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupResourceStorageConfigsNonCRRClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Patch(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", armrecoveryservicesbackup.BackupResourceConfigResource{ + Properties: &armrecoveryservicesbackup.BackupResourceConfig{ + StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), + StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateUnlocked), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourcevaultconfigs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourcevaultconfigs_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client.go index 4f64a75430c8..97268559533f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupresourcevaultconfigs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupResourceVaultConfigsClient struct { } // NewBackupResourceVaultConfigsClient creates a new instance of BackupResourceVaultConfigsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupResourceVaultConfigsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupResourceVaultConfigsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewBackupResourceVaultConfigsClient(subscriptionID string, credential azcor // Get - Fetches resource vault config. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - BackupResourceVaultConfigsClientGetOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - BackupResourceVaultConfigsClientGetOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Get +// method. func (client *BackupResourceVaultConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, options *BackupResourceVaultConfigsClientGetOptions) (BackupResourceVaultConfigsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, options) if err != nil { @@ -96,7 +98,7 @@ func (client *BackupResourceVaultConfigsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,12 +115,13 @@ func (client *BackupResourceVaultConfigsClient) getHandleResponse(resp *http.Res // Put - Updates vault security config. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - resource config request -// options - BackupResourceVaultConfigsClientPutOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Put -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - resource config request +// - options - BackupResourceVaultConfigsClientPutOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Put +// method. func (client *BackupResourceVaultConfigsClient) Put(ctx context.Context, vaultName string, resourceGroupName string, parameters BackupResourceVaultConfigResource, options *BackupResourceVaultConfigsClientPutOptions) (BackupResourceVaultConfigsClientPutResponse, error) { req, err := client.putCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { @@ -154,7 +157,7 @@ func (client *BackupResourceVaultConfigsClient) putCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -171,12 +174,13 @@ func (client *BackupResourceVaultConfigsClient) putHandleResponse(resp *http.Res // Update - Updates vault security config. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - resource config request -// options - BackupResourceVaultConfigsClientUpdateOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Update -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - resource config request +// - options - BackupResourceVaultConfigsClientUpdateOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Update +// method. func (client *BackupResourceVaultConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters BackupResourceVaultConfigResource, options *BackupResourceVaultConfigsClientUpdateOptions) (BackupResourceVaultConfigsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { @@ -212,7 +216,7 @@ func (client *BackupResourceVaultConfigsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client_example_test.go new file mode 100644 index 000000000000..82d65b07ff22 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client_example_test.go @@ -0,0 +1,113 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/BackupResourceVaultConfigs_Get.json +func ExampleBackupResourceVaultConfigsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupResourceVaultConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "SwaggerTest", "SwaggerTestRg", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.BackupResourceVaultConfigResource = armrecoveryservicesbackup.BackupResourceVaultConfigResource{ + // Name: to.Ptr("vaultconfig"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/SwaggerTest/backupconfig/vaultconfig"), + // Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ + // EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/BackupResourceVaultConfigs_Patch.json +func ExampleBackupResourceVaultConfigsClient_Update() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupResourceVaultConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Update(ctx, "SwaggerTest", "SwaggerTestRg", armrecoveryservicesbackup.BackupResourceVaultConfigResource{ + Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ + EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.BackupResourceVaultConfigResource = armrecoveryservicesbackup.BackupResourceVaultConfigResource{ + // Name: to.Ptr("vaultconfig"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/SwaggerTest/backupconfig/vaultconfig"), + // Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ + // EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/BackupResourceVaultConfigs_Put.json +func ExampleBackupResourceVaultConfigsClient_Put() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupResourceVaultConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Put(ctx, "SwaggerTest", "SwaggerTestRg", armrecoveryservicesbackup.BackupResourceVaultConfigResource{ + Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ + EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), + SoftDeleteFeatureState: to.Ptr(armrecoveryservicesbackup.SoftDeleteFeatureStateEnabled), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.BackupResourceVaultConfigResource = armrecoveryservicesbackup.BackupResourceVaultConfigResource{ + // Name: to.Ptr("vaultconfig"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/SwaggerTest/backupconfig/vaultconfig"), + // Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ + // EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), + // SoftDeleteFeatureState: to.Ptr(armrecoveryservicesbackup.SoftDeleteFeatureStateEnabled), + // }, + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backups_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client.go similarity index 85% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backups_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client.go index 194221a6dfca..d1b0c1a02630 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backups_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupsClient struct { } // NewBackupsClient creates a new instance of BackupsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +58,15 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, // Trigger - Triggers backup for specified backed up item. This is an asynchronous operation. To know the status of the operation, // call GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the backup item. -// containerName - Container name associated with the backup item. -// protectedItemName - Backup item for which backup needs to be triggered. -// parameters - resource backup request -// options - BackupsClientTriggerOptions contains the optional parameters for the BackupsClient.Trigger method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the backup item. +// - containerName - Container name associated with the backup item. +// - protectedItemName - Backup item for which backup needs to be triggered. +// - parameters - resource backup request +// - options - BackupsClientTriggerOptions contains the optional parameters for the BackupsClient.Trigger method. func (client *BackupsClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters BackupRequestResource, options *BackupsClientTriggerOptions) (BackupsClientTriggerResponse, error) { req, err := client.triggerCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, options) if err != nil { @@ -112,7 +114,7 @@ func (client *BackupsClient) triggerCreateRequest(ctx context.Context, vaultName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backups_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client_example_test.go similarity index 64% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backups_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client_example_test.go index d067bf427337..fbb37505f9c6 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backups_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client_example_test.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 armrecoveryservicesbackup_test @@ -14,10 +15,10 @@ import ( "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/recoveryservices/armrecoveryservicesbackup" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/TriggerBackup_Post.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/TriggerBackup_Post.json func ExampleBackupsClient_Trigger() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -28,18 +29,11 @@ func ExampleBackupsClient_Trigger() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Trigger(ctx, - "linuxRsVault", - "linuxRsVaultRG", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;testrg;v1win2012r", - "VM;iaasvmcontainerv2;testrg;v1win2012r", - armrecoveryservicesbackup.BackupRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMBackupRequest{ - ObjectType: to.Ptr("IaasVMBackupRequest"), - }, + _, err = client.Trigger(ctx, "linuxRsVault", "linuxRsVaultRG", "Azure", "IaasVMContainer;iaasvmcontainerv2;testrg;v1win2012r", "VM;iaasvmcontainerv2;testrg;v1win2012r", armrecoveryservicesbackup.BackupRequestResource{ + Properties: &armrecoveryservicesbackup.IaasVMBackupRequest{ + ObjectType: to.Ptr("IaasVMBackupRequest"), }, - nil) + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupstatus_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client.go similarity index 88% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupstatus_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client.go index d786048de08b..1ae244d576d7 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupstatus_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupStatusClient struct { } // NewBackupStatusClient creates a new instance of BackupStatusClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupStatusClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,10 +57,11 @@ func NewBackupStatusClient(subscriptionID string, credential azcore.TokenCredent // Get - Get the container backup status // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// azureRegion - Azure region to hit Api -// parameters - Container Backup Status Request -// options - BackupStatusClientGetOptions contains the optional parameters for the BackupStatusClient.Get method. +// +// Generated from API version 2023-01-01 +// - azureRegion - Azure region to hit Api +// - parameters - Container Backup Status Request +// - options - BackupStatusClientGetOptions contains the optional parameters for the BackupStatusClient.Get method. func (client *BackupStatusClient) Get(ctx context.Context, azureRegion string, parameters BackupStatusRequest, options *BackupStatusClientGetOptions) (BackupStatusClientGetResponse, error) { req, err := client.getCreateRequest(ctx, azureRegion, parameters, options) if err != nil { @@ -91,7 +93,7 @@ func (client *BackupStatusClient) getCreateRequest(ctx context.Context, azureReg return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client_example_test.go new file mode 100644 index 000000000000..9e5baf4ec751 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client_example_test.go @@ -0,0 +1,52 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/GetBackupStatus.json +func ExampleBackupStatusClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupStatusClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "southeastasia", armrecoveryservicesbackup.BackupStatusRequest{ + ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Compute/VirtualMachines/testVm"), + ResourceType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.BackupStatusResponse = armrecoveryservicesbackup.BackupStatusResponse{ + // ContainerName: to.Ptr("iaasvmcontainer;iaasvmcontainerv2;testRg;testVm"), + // ErrorCode: to.Ptr("Success"), + // ErrorMessage: to.Ptr("ErrorMessage"), + // FabricName: to.Ptr(armrecoveryservicesbackup.FabricNameAzure), + // PolicyName: to.Ptr("myPolicy"), + // ProtectedItemName: to.Ptr("vm;iaasvmcontainerv2;testRg;testVm"), + // ProtectionStatus: to.Ptr(armrecoveryservicesbackup.ProtectionStatusProtected), + // VaultID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.RecoveryServices/Vaults/testVault"), + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupusagesummaries_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client.go similarity index 88% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupusagesummaries_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client.go index 9f3539ae5717..1ee77c4ff642 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupusagesummaries_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupUsageSummariesClient struct { } // NewBackupUsageSummariesClient creates a new instance of BackupUsageSummariesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupUsageSummariesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupUsageSummariesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,12 +56,12 @@ func NewBackupUsageSummariesClient(subscriptionID string, credential azcore.Toke } // NewListPager - Fetches the backup management usage summaries of the vault. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - BackupUsageSummariesClientListOptions contains the optional parameters for the BackupUsageSummariesClient.List -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - BackupUsageSummariesClientListOptions contains the optional parameters for the BackupUsageSummariesClient.NewListPager +// method. func (client *BackupUsageSummariesClient) NewListPager(vaultName string, resourceGroupName string, options *BackupUsageSummariesClientListOptions) *runtime.Pager[BackupUsageSummariesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BackupUsageSummariesClientListResponse]{ More: func(page BackupUsageSummariesClientListResponse) bool { @@ -103,7 +104,7 @@ func (client *BackupUsageSummariesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client_example_test.go new file mode 100644 index 000000000000..daec36ac3da5 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client_example_test.go @@ -0,0 +1,151 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/BackupProtectionContainers_UsageSummary_Get.json +func ExampleBackupUsageSummariesClient_NewListPager_getProtectedContainersUsagesSummary() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupUsageSummariesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("testVault", "testRG", &armrecoveryservicesbackup.BackupUsageSummariesClientListOptions{Filter: to.Ptr("type eq 'BackupProtectionContainerCountSummary'"), + SkipToken: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.BackupManagementUsageList = armrecoveryservicesbackup.BackupManagementUsageList{ + // Value: []*armrecoveryservicesbackup.BackupManagementUsage{ + // { + // Name: &armrecoveryservicesbackup.NameInfo{ + // LocalizedValue: to.Ptr("Azure Backup Server"), + // Value: to.Ptr("AzureBackupServer"), + // }, + // CurrentValue: to.Ptr[int64](2), + // Limit: to.Ptr[int64](-1), + // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), + // }, + // { + // Name: &armrecoveryservicesbackup.NameInfo{ + // LocalizedValue: to.Ptr("Azure Backup Agent"), + // Value: to.Ptr("MAB"), + // }, + // CurrentValue: to.Ptr[int64](3), + // Limit: to.Ptr[int64](-1), + // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), + // }, + // { + // Name: &armrecoveryservicesbackup.NameInfo{ + // LocalizedValue: to.Ptr("SQL in Azure VM"), + // Value: to.Ptr("AzureWorkload"), + // }, + // CurrentValue: to.Ptr[int64](1), + // Limit: to.Ptr[int64](-1), + // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/BackupProtectedItem_UsageSummary_Get.json +func ExampleBackupUsageSummariesClient_NewListPager_getProtectedItemsUsagesSummary() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupUsageSummariesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("testVault", "testRG", &armrecoveryservicesbackup.BackupUsageSummariesClientListOptions{Filter: to.Ptr("type eq 'BackupProtectedItemCountSummary'"), + SkipToken: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.BackupManagementUsageList = armrecoveryservicesbackup.BackupManagementUsageList{ + // Value: []*armrecoveryservicesbackup.BackupManagementUsage{ + // { + // Name: &armrecoveryservicesbackup.NameInfo{ + // LocalizedValue: to.Ptr("Azure Virtual Machine"), + // Value: to.Ptr("AzureIaasVM"), + // }, + // CurrentValue: to.Ptr[int64](7), + // Limit: to.Ptr[int64](-1), + // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), + // }, + // { + // Name: &armrecoveryservicesbackup.NameInfo{ + // LocalizedValue: to.Ptr("Azure Backup Agent"), + // Value: to.Ptr("MAB"), + // }, + // CurrentValue: to.Ptr[int64](3), + // Limit: to.Ptr[int64](-1), + // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), + // }, + // { + // Name: &armrecoveryservicesbackup.NameInfo{ + // LocalizedValue: to.Ptr("Azure Backup Server"), + // Value: to.Ptr("AzureBackupServer"), + // }, + // CurrentValue: to.Ptr[int64](1), + // Limit: to.Ptr[int64](-1), + // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), + // }, + // { + // Name: &armrecoveryservicesbackup.NameInfo{ + // LocalizedValue: to.Ptr("Azure Storage (Azure Files)"), + // Value: to.Ptr("AzureStorage"), + // }, + // CurrentValue: to.Ptr[int64](2), + // Limit: to.Ptr[int64](-1), + // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), + // }, + // { + // Name: &armrecoveryservicesbackup.NameInfo{ + // LocalizedValue: to.Ptr("SQL in Azure VM"), + // Value: to.Ptr("AzureWorkload"), + // }, + // CurrentValue: to.Ptr[int64](2), + // Limit: to.Ptr[int64](-1), + // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupworkloaditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client.go similarity index 88% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupworkloaditems_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client.go index a2b087c390a7..25a7ffc7f8b7 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_backupworkloaditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BackupWorkloadItemsClient struct { } // NewBackupWorkloadItemsClient creates a new instance of BackupWorkloadItemsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackupWorkloadItemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackupWorkloadItemsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,14 @@ func NewBackupWorkloadItemsClient(subscriptionID string, credential azcore.Token // NewListPager - Provides a pageable list of workload item of a specific container according to the query filter and the // pagination parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the container. -// containerName - Name of the container. -// options - BackupWorkloadItemsClientListOptions contains the optional parameters for the BackupWorkloadItemsClient.List -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the container. +// - containerName - Name of the container. +// - options - BackupWorkloadItemsClientListOptions contains the optional parameters for the BackupWorkloadItemsClient.NewListPager +// method. func (client *BackupWorkloadItemsClient) NewListPager(vaultName string, resourceGroupName string, fabricName string, containerName string, options *BackupWorkloadItemsClientListOptions) *runtime.Pager[BackupWorkloadItemsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[BackupWorkloadItemsClientListResponse]{ More: func(page BackupWorkloadItemsClientListResponse) bool { @@ -120,7 +121,7 @@ func (client *BackupWorkloadItemsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client_example_test.go new file mode 100644 index 000000000000..184a9525942d --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client_example_test.go @@ -0,0 +1,75 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureWorkload/BackupWorkloadItems_List.json +func ExampleBackupWorkloadItemsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewBackupWorkloadItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("suchandr-seacan-rsv", "testRg", "Azure", "VMAppContainer;Compute;bvtdtestag;sqlserver-1", &armrecoveryservicesbackup.BackupWorkloadItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'"), + SkipToken: nil, + }) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.WorkloadItemResourceList = armrecoveryservicesbackup.WorkloadItemResourceList{ + // Value: []*armrecoveryservicesbackup.WorkloadItemResource{ + // { + // Name: to.Ptr("SQLInstance;MSSQLSERVER"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/items"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/testRg/providers/Microsoft.RecoveryServices/vaults/suchandr-seacan-rsv/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;bvtdtestag;sqlserver-1/protectableItems/SQLInstance;MSSQLSERVER"), + // Properties: &armrecoveryservicesbackup.AzureVMWorkloadSQLInstanceWorkloadItem{ + // BackupManagementType: to.Ptr("AzureWorkload"), + // FriendlyName: to.Ptr("MSSQLSERVER"), + // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStatusNotProtected), + // WorkloadItemType: to.Ptr("SQLInstance"), + // WorkloadType: to.Ptr("SQL"), + // IsAutoProtectable: to.Ptr(true), + // ParentName: to.Ptr("MSSQLSERVER"), + // ServerName: to.Ptr("sqlserver-1.contoso.com"), + // SubWorkloadItemCount: to.Ptr[int32](3), + // Subinquireditemcount: to.Ptr[int32](0), + // DataDirectoryPaths: []*armrecoveryservicesbackup.SQLDataDirectory{ + // { + // Type: to.Ptr(armrecoveryservicesbackup.SQLDataDirectoryTypeData), + // Path: to.Ptr("F:\\DATA\\"), + // }, + // { + // Type: to.Ptr(armrecoveryservicesbackup.SQLDataDirectoryTypeLog), + // Path: to.Ptr("F:\\LOG\\"), + // }}, + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_bmspreparedatamoveoperationresult_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client.go similarity index 88% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_bmspreparedatamoveoperationresult_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client.go index b1a99b477873..231f0ad4d844 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_bmspreparedatamoveoperationresult_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type BMSPrepareDataMoveOperationResultClient struct { } // NewBMSPrepareDataMoveOperationResultClient creates a new instance of BMSPrepareDataMoveOperationResultClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBMSPrepareDataMoveOperationResultClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BMSPrepareDataMoveOperationResultClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewBMSPrepareDataMoveOperationResultClient(subscriptionID string, credentia // Get - Fetches Operation Result for Prepare Data Move // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - BMSPrepareDataMoveOperationResultClientGetOptions contains the optional parameters for the BMSPrepareDataMoveOperationResultClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - BMSPrepareDataMoveOperationResultClientGetOptions contains the optional parameters for the BMSPrepareDataMoveOperationResultClient.Get +// method. func (client *BMSPrepareDataMoveOperationResultClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *BMSPrepareDataMoveOperationResultClientGetOptions) (BMSPrepareDataMoveOperationResultClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { @@ -100,7 +102,7 @@ func (client *BMSPrepareDataMoveOperationResultClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_bmspreparedatamoveoperationresult_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client_example_test.go similarity index 52% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_bmspreparedatamoveoperationresult_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client_example_test.go index c8b4aaac4770..4135a0f64931 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_bmspreparedatamoveoperationresult_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client_example_test.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 armrecoveryservicesbackup_test @@ -13,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/BackupDataMove/PrepareDataMoveOperationResult_Get.json func ExampleBMSPrepareDataMoveOperationResultClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -27,14 +28,16 @@ func ExampleBMSPrepareDataMoveOperationResultClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "source-rsv", - "sourceRG", - "00000000-0000-0000-0000-000000000000", - nil) + res, err := client.Get(ctx, "source-rsv", "sourceRG", "00000000-0000-0000-0000-000000000000", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // You could use response here. We use blank identifier for just demo purposes. _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res = armrecoveryservicesbackup.BMSPrepareDataMoveOperationResultClientGetResponse{ + // VaultStorageConfigOperationResultResponseClassification: &armrecoveryservicesbackup.PrepareDataMoveResponse{ + // ObjectType: to.Ptr("PrepareDataMoveResponse"), + // }, + // } } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client.go similarity index 87% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client.go index 23c8b035e74e..b2878d6193ac 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // BeginBMSPrepareDataMove - Prepares source vault for Data Move operation // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - Prepare data move request -// options - ClientBeginBMSPrepareDataMoveOptions contains the optional parameters for the Client.BeginBMSPrepareDataMove -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - Prepare data move request +// - options - ClientBeginBMSPrepareDataMoveOptions contains the optional parameters for the Client.BeginBMSPrepareDataMove +// method. func (client *Client) BeginBMSPrepareDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters PrepareDataMoveRequest, options *ClientBeginBMSPrepareDataMoveOptions) (*runtime.Poller[ClientBMSPrepareDataMoveResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.bMSPrepareDataMove(ctx, vaultName, resourceGroupName, parameters, options) @@ -76,7 +78,8 @@ func (client *Client) BeginBMSPrepareDataMove(ctx context.Context, vaultName str // BMSPrepareDataMove - Prepares source vault for Data Move operation // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// +// Generated from API version 2023-01-01 func (client *Client) bMSPrepareDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters PrepareDataMoveRequest, options *ClientBeginBMSPrepareDataMoveOptions) (*http.Response, error) { req, err := client.bmsPrepareDataMoveCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { @@ -112,7 +115,7 @@ func (client *Client) bmsPrepareDataMoveCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -120,12 +123,13 @@ func (client *Client) bmsPrepareDataMoveCreateRequest(ctx context.Context, vault // BeginBMSTriggerDataMove - Triggers Data Move Operation on target vault // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - Trigger data move request -// options - ClientBeginBMSTriggerDataMoveOptions contains the optional parameters for the Client.BeginBMSTriggerDataMove -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - Trigger data move request +// - options - ClientBeginBMSTriggerDataMoveOptions contains the optional parameters for the Client.BeginBMSTriggerDataMove +// method. func (client *Client) BeginBMSTriggerDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters TriggerDataMoveRequest, options *ClientBeginBMSTriggerDataMoveOptions) (*runtime.Poller[ClientBMSTriggerDataMoveResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.bMSTriggerDataMove(ctx, vaultName, resourceGroupName, parameters, options) @@ -140,7 +144,8 @@ func (client *Client) BeginBMSTriggerDataMove(ctx context.Context, vaultName str // BMSTriggerDataMove - Triggers Data Move Operation on target vault // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// +// Generated from API version 2023-01-01 func (client *Client) bMSTriggerDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters TriggerDataMoveRequest, options *ClientBeginBMSTriggerDataMoveOptions) (*http.Response, error) { req, err := client.bmsTriggerDataMoveCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { @@ -176,7 +181,7 @@ func (client *Client) bmsTriggerDataMoveCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -184,10 +189,11 @@ func (client *Client) bmsTriggerDataMoveCreateRequest(ctx context.Context, vault // GetOperationStatus - Fetches operation status for data move operation on vault // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - ClientGetOperationStatusOptions contains the optional parameters for the Client.GetOperationStatus method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - ClientGetOperationStatusOptions contains the optional parameters for the Client.GetOperationStatus method. func (client *Client) GetOperationStatus(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *ClientGetOperationStatusOptions) (ClientGetOperationStatusResponse, error) { req, err := client.getOperationStatusCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { @@ -227,7 +233,7 @@ func (client *Client) getOperationStatusCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,11 +250,12 @@ func (client *Client) getOperationStatusHandleResponse(resp *http.Response) (Cli // BeginMoveRecoveryPoint - Move recovery point from one datastore to another store. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - Move Resource Across Tiers Request -// options - ClientBeginMoveRecoveryPointOptions contains the optional parameters for the Client.BeginMoveRecoveryPoint method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - Move Resource Across Tiers Request +// - options - ClientBeginMoveRecoveryPointOptions contains the optional parameters for the Client.BeginMoveRecoveryPoint method. func (client *Client) BeginMoveRecoveryPoint(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters MoveRPAcrossTiersRequest, options *ClientBeginMoveRecoveryPointOptions) (*runtime.Poller[ClientMoveRecoveryPointResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.moveRecoveryPoint(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters, options) @@ -263,7 +270,8 @@ func (client *Client) BeginMoveRecoveryPoint(ctx context.Context, vaultName stri // MoveRecoveryPoint - Move recovery point from one datastore to another store. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// +// Generated from API version 2023-01-01 func (client *Client) moveRecoveryPoint(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters MoveRPAcrossTiersRequest, options *ClientBeginMoveRecoveryPointOptions) (*http.Response, error) { req, err := client.moveRecoveryPointCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters, options) if err != nil { @@ -315,7 +323,7 @@ func (client *Client) moveRecoveryPointCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_example_test.go new file mode 100644 index 000000000000..c674ecfcc6b7 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_example_test.go @@ -0,0 +1,122 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json +func ExampleClient_GetOperationStatus() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetOperationStatus(ctx, "source-rsv", "sourceRG", "00000000-0000-0000-0000-000000000000", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.OperationStatus = armrecoveryservicesbackup.OperationStatus{ + // Name: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.5901592Z"); return t}()), + // ID: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.5901592Z"); return t}()), + // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/BackupDataMove/PrepareDataMove_Post.json +func ExampleClient_BeginBMSPrepareDataMove() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginBMSPrepareDataMove(ctx, "source-rsv", "sourceRG", armrecoveryservicesbackup.PrepareDataMoveRequest{ + DataMoveLevel: to.Ptr(armrecoveryservicesbackup.DataMoveLevelVault), + TargetRegion: to.Ptr("USGov Virginia"), + TargetResourceID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/targetRG/providers/Microsoft.RecoveryServices/vaults/target-rsv"), + }, 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/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/BackupDataMove/TriggerDataMove_Post.json +func ExampleClient_BeginBMSTriggerDataMove() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginBMSTriggerDataMove(ctx, "target-rsv", "targetRG", armrecoveryservicesbackup.TriggerDataMoveRequest{ + CorrelationID: to.Ptr("MTg2OTcyMzM4NzYyMjc1NDY3Nzs1YmUzYmVmNi04YjJiLTRhOTItOTllYi01NTM0MDllYjk2NjE="), + DataMoveLevel: to.Ptr(armrecoveryservicesbackup.DataMoveLevelVault), + SourceRegion: to.Ptr("USGov Iowa"), + SourceResourceID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/sourceRG/providers/Microsoft.RecoveryServices/vaults/source-rsv"), + }, 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/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/TriggerRecoveryPointMove_Post.json +func ExampleClient_BeginMoveRecoveryPoint() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginMoveRecoveryPoint(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.MoveRPAcrossTiersRequest{ + ObjectType: to.Ptr("MoveRPAcrossTiersRequest"), + SourceTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), + TargetTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), + }, 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/recoveryservices/armrecoveryservicesbackup/zz_generated_constants.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/constants.go similarity index 85% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_constants.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/constants.go index afb26f630bfb..adc8a03d022b 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_constants.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup const ( moduleName = "armrecoveryservicesbackup" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) // AcquireStorageAccountLock - Whether storage account lock is to be acquired for this container or not. @@ -77,6 +78,7 @@ const ( BackupItemTypeGenericDataSource BackupItemType = "GenericDataSource" BackupItemTypeInvalid BackupItemType = "Invalid" BackupItemTypeSAPAseDatabase BackupItemType = "SAPAseDatabase" + BackupItemTypeSAPHanaDBInstance BackupItemType = "SAPHanaDBInstance" BackupItemTypeSAPHanaDatabase BackupItemType = "SAPHanaDatabase" BackupItemTypeSQLDB BackupItemType = "SQLDB" BackupItemTypeSQLDataBase BackupItemType = "SQLDataBase" @@ -97,6 +99,7 @@ func PossibleBackupItemTypeValues() []BackupItemType { BackupItemTypeGenericDataSource, BackupItemTypeInvalid, BackupItemTypeSAPAseDatabase, + BackupItemTypeSAPHanaDBInstance, BackupItemTypeSAPHanaDatabase, BackupItemTypeSQLDB, BackupItemTypeSQLDataBase, @@ -141,12 +144,14 @@ func PossibleBackupManagementTypeValues() []BackupManagementType { type BackupType string const ( - BackupTypeCopyOnlyFull BackupType = "CopyOnlyFull" - BackupTypeDifferential BackupType = "Differential" - BackupTypeFull BackupType = "Full" - BackupTypeIncremental BackupType = "Incremental" - BackupTypeInvalid BackupType = "Invalid" - BackupTypeLog BackupType = "Log" + BackupTypeCopyOnlyFull BackupType = "CopyOnlyFull" + BackupTypeDifferential BackupType = "Differential" + BackupTypeFull BackupType = "Full" + BackupTypeIncremental BackupType = "Incremental" + BackupTypeInvalid BackupType = "Invalid" + BackupTypeLog BackupType = "Log" + BackupTypeSnapshotCopyOnlyFull BackupType = "SnapshotCopyOnlyFull" + BackupTypeSnapshotFull BackupType = "SnapshotFull" ) // PossibleBackupTypeValues returns the possible values for the BackupType const type. @@ -158,6 +163,8 @@ func PossibleBackupTypeValues() []BackupType { BackupTypeIncremental, BackupTypeInvalid, BackupTypeLog, + BackupTypeSnapshotCopyOnlyFull, + BackupTypeSnapshotFull, } } @@ -165,24 +172,22 @@ func PossibleBackupTypeValues() []BackupType { type ContainerType string const ( - ContainerTypeAzureBackupServerContainer ContainerType = "AzureBackupServerContainer" - ContainerTypeAzureSQLContainer ContainerType = "AzureSqlContainer" - ContainerTypeAzureWorkloadContainer ContainerType = "AzureWorkloadContainer" - ContainerTypeCluster ContainerType = "Cluster" - ContainerTypeDPMContainer ContainerType = "DPMContainer" - ContainerTypeGenericContainer ContainerType = "GenericContainer" - ContainerTypeIaasVMContainer ContainerType = "IaasVMContainer" - ContainerTypeIaasVMServiceContainer ContainerType = "IaasVMServiceContainer" - ContainerTypeInvalid ContainerType = "Invalid" - ContainerTypeMABContainer ContainerType = "MABContainer" - ContainerTypeMicrosoftClassicComputeVirtualMachines ContainerType = "Microsoft.ClassicCompute/virtualMachines" - ContainerTypeMicrosoftComputeVirtualMachines ContainerType = "Microsoft.Compute/virtualMachines" - ContainerTypeSQLAGWorkLoadContainer ContainerType = "SQLAGWorkLoadContainer" - ContainerTypeStorageContainer ContainerType = "StorageContainer" - ContainerTypeUnknown ContainerType = "Unknown" - ContainerTypeVCenter ContainerType = "VCenter" - ContainerTypeVMAppContainer ContainerType = "VMAppContainer" - ContainerTypeWindows ContainerType = "Windows" + ContainerTypeAzureBackupServerContainer ContainerType = "AzureBackupServerContainer" + ContainerTypeAzureSQLContainer ContainerType = "AzureSqlContainer" + ContainerTypeCluster ContainerType = "Cluster" + ContainerTypeDPMContainer ContainerType = "DPMContainer" + ContainerTypeGenericContainer ContainerType = "GenericContainer" + ContainerTypeHanaHSRContainer ContainerType = "HanaHSRContainer" + ContainerTypeIaasVMContainer ContainerType = "IaasVMContainer" + ContainerTypeIaasVMServiceContainer ContainerType = "IaasVMServiceContainer" + ContainerTypeInvalid ContainerType = "Invalid" + ContainerTypeMABContainer ContainerType = "MABContainer" + ContainerTypeSQLAGWorkLoadContainer ContainerType = "SQLAGWorkLoadContainer" + ContainerTypeStorageContainer ContainerType = "StorageContainer" + ContainerTypeUnknown ContainerType = "Unknown" + ContainerTypeVCenter ContainerType = "VCenter" + ContainerTypeVMAppContainer ContainerType = "VMAppContainer" + ContainerTypeWindows ContainerType = "Windows" ) // PossibleContainerTypeValues returns the possible values for the ContainerType const type. @@ -190,16 +195,14 @@ func PossibleContainerTypeValues() []ContainerType { return []ContainerType{ ContainerTypeAzureBackupServerContainer, ContainerTypeAzureSQLContainer, - ContainerTypeAzureWorkloadContainer, ContainerTypeCluster, ContainerTypeDPMContainer, ContainerTypeGenericContainer, + ContainerTypeHanaHSRContainer, ContainerTypeIaasVMContainer, ContainerTypeIaasVMServiceContainer, ContainerTypeInvalid, ContainerTypeMABContainer, - ContainerTypeMicrosoftClassicComputeVirtualMachines, - ContainerTypeMicrosoftComputeVirtualMachines, ContainerTypeSQLAGWorkLoadContainer, ContainerTypeStorageContainer, ContainerTypeUnknown, @@ -279,6 +282,7 @@ const ( DataSourceTypeGenericDataSource DataSourceType = "GenericDataSource" DataSourceTypeInvalid DataSourceType = "Invalid" DataSourceTypeSAPAseDatabase DataSourceType = "SAPAseDatabase" + DataSourceTypeSAPHanaDBInstance DataSourceType = "SAPHanaDBInstance" DataSourceTypeSAPHanaDatabase DataSourceType = "SAPHanaDatabase" DataSourceTypeSQLDB DataSourceType = "SQLDB" DataSourceTypeSQLDataBase DataSourceType = "SQLDataBase" @@ -299,6 +303,7 @@ func PossibleDataSourceTypeValues() []DataSourceType { DataSourceTypeGenericDataSource, DataSourceTypeInvalid, DataSourceTypeSAPAseDatabase, + DataSourceTypeSAPHanaDBInstance, DataSourceTypeSAPHanaDatabase, DataSourceTypeSQLDB, DataSourceTypeSQLDataBase, @@ -885,12 +890,14 @@ func PossibleOverwriteOptionsValues() []OverwriteOptions { type PolicyType string const ( - PolicyTypeCopyOnlyFull PolicyType = "CopyOnlyFull" - PolicyTypeDifferential PolicyType = "Differential" - PolicyTypeFull PolicyType = "Full" - PolicyTypeIncremental PolicyType = "Incremental" - PolicyTypeInvalid PolicyType = "Invalid" - PolicyTypeLog PolicyType = "Log" + PolicyTypeCopyOnlyFull PolicyType = "CopyOnlyFull" + PolicyTypeDifferential PolicyType = "Differential" + PolicyTypeFull PolicyType = "Full" + PolicyTypeIncremental PolicyType = "Incremental" + PolicyTypeInvalid PolicyType = "Invalid" + PolicyTypeLog PolicyType = "Log" + PolicyTypeSnapshotCopyOnlyFull PolicyType = "SnapshotCopyOnlyFull" + PolicyTypeSnapshotFull PolicyType = "SnapshotFull" ) // PossiblePolicyTypeValues returns the possible values for the PolicyType const type. @@ -902,6 +909,8 @@ func PossiblePolicyTypeValues() []PolicyType { PolicyTypeIncremental, PolicyTypeInvalid, PolicyTypeLog, + PolicyTypeSnapshotCopyOnlyFull, + PolicyTypeSnapshotFull, } } @@ -925,6 +934,56 @@ func PossiblePrivateEndpointConnectionStatusValues() []PrivateEndpointConnection } } +// ProtectableContainerType - Type of the container. The value of this property for +// 1. Compute Azure VM is Microsoft.Compute/virtualMachines +// 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines +type ProtectableContainerType string + +const ( + ProtectableContainerTypeInvalid ProtectableContainerType = "Invalid" + ProtectableContainerTypeUnknown ProtectableContainerType = "Unknown" + ProtectableContainerTypeIaasVMContainer ProtectableContainerType = "IaasVMContainer" + ProtectableContainerTypeIaasVMServiceContainer ProtectableContainerType = "IaasVMServiceContainer" + ProtectableContainerTypeDPMContainer ProtectableContainerType = "DPMContainer" + ProtectableContainerTypeAzureBackupServerContainer ProtectableContainerType = "AzureBackupServerContainer" + ProtectableContainerTypeMABContainer ProtectableContainerType = "MABContainer" + ProtectableContainerTypeCluster ProtectableContainerType = "Cluster" + ProtectableContainerTypeAzureSQLContainer ProtectableContainerType = "AzureSqlContainer" + ProtectableContainerTypeWindows ProtectableContainerType = "Windows" + ProtectableContainerTypeVCenter ProtectableContainerType = "VCenter" + ProtectableContainerTypeVMAppContainer ProtectableContainerType = "VMAppContainer" + ProtectableContainerTypeSQLAGWorkLoadContainer ProtectableContainerType = "SQLAGWorkLoadContainer" + ProtectableContainerTypeStorageContainer ProtectableContainerType = "StorageContainer" + ProtectableContainerTypeGenericContainer ProtectableContainerType = "GenericContainer" + ProtectableContainerTypeMicrosoftClassicComputeVirtualMachines ProtectableContainerType = "Microsoft.ClassicCompute/virtualMachines" + ProtectableContainerTypeMicrosoftComputeVirtualMachines ProtectableContainerType = "Microsoft.Compute/virtualMachines" + ProtectableContainerTypeAzureWorkloadContainer ProtectableContainerType = "AzureWorkloadContainer" +) + +// PossibleProtectableContainerTypeValues returns the possible values for the ProtectableContainerType const type. +func PossibleProtectableContainerTypeValues() []ProtectableContainerType { + return []ProtectableContainerType{ + ProtectableContainerTypeInvalid, + ProtectableContainerTypeUnknown, + ProtectableContainerTypeIaasVMContainer, + ProtectableContainerTypeIaasVMServiceContainer, + ProtectableContainerTypeDPMContainer, + ProtectableContainerTypeAzureBackupServerContainer, + ProtectableContainerTypeMABContainer, + ProtectableContainerTypeCluster, + ProtectableContainerTypeAzureSQLContainer, + ProtectableContainerTypeWindows, + ProtectableContainerTypeVCenter, + ProtectableContainerTypeVMAppContainer, + ProtectableContainerTypeSQLAGWorkLoadContainer, + ProtectableContainerTypeStorageContainer, + ProtectableContainerTypeGenericContainer, + ProtectableContainerTypeMicrosoftClassicComputeVirtualMachines, + ProtectableContainerTypeMicrosoftComputeVirtualMachines, + ProtectableContainerTypeAzureWorkloadContainer, + } +} + // ProtectedItemHealthStatus - Health status of the backup item, evaluated based on last heartbeat received type ProtectedItemHealthStatus string @@ -951,6 +1010,7 @@ func PossibleProtectedItemHealthStatusValues() []ProtectedItemHealthStatus { type ProtectedItemState string const ( + ProtectedItemStateBackupsSuspended ProtectedItemState = "BackupsSuspended" ProtectedItemStateIRPending ProtectedItemState = "IRPending" ProtectedItemStateInvalid ProtectedItemState = "Invalid" ProtectedItemStateProtected ProtectedItemState = "Protected" @@ -962,6 +1022,7 @@ const ( // PossibleProtectedItemStateValues returns the possible values for the ProtectedItemState const type. func PossibleProtectedItemStateValues() []ProtectedItemState { return []ProtectedItemState{ + ProtectedItemStateBackupsSuspended, ProtectedItemStateIRPending, ProtectedItemStateInvalid, ProtectedItemStateProtected, @@ -999,6 +1060,7 @@ func PossibleProtectionIntentItemTypeValues() []ProtectionIntentItemType { type ProtectionState string const ( + ProtectionStateBackupsSuspended ProtectionState = "BackupsSuspended" ProtectionStateIRPending ProtectionState = "IRPending" ProtectionStateInvalid ProtectionState = "Invalid" ProtectionStateProtected ProtectionState = "Protected" @@ -1010,6 +1072,7 @@ const ( // PossibleProtectionStateValues returns the possible values for the ProtectionState const type. func PossibleProtectionStateValues() []ProtectionState { return []ProtectionState{ + ProtectionStateBackupsSuspended, ProtectionStateIRPending, ProtectionStateInvalid, ProtectionStateProtected, @@ -1187,13 +1250,15 @@ func PossibleResourceHealthStatusValues() []ResourceHealthStatus { type RestorePointQueryType string const ( - RestorePointQueryTypeAll RestorePointQueryType = "All" - RestorePointQueryTypeDifferential RestorePointQueryType = "Differential" - RestorePointQueryTypeFull RestorePointQueryType = "Full" - RestorePointQueryTypeFullAndDifferential RestorePointQueryType = "FullAndDifferential" - RestorePointQueryTypeIncremental RestorePointQueryType = "Incremental" - RestorePointQueryTypeInvalid RestorePointQueryType = "Invalid" - RestorePointQueryTypeLog RestorePointQueryType = "Log" + RestorePointQueryTypeAll RestorePointQueryType = "All" + RestorePointQueryTypeDifferential RestorePointQueryType = "Differential" + RestorePointQueryTypeFull RestorePointQueryType = "Full" + RestorePointQueryTypeFullAndDifferential RestorePointQueryType = "FullAndDifferential" + RestorePointQueryTypeIncremental RestorePointQueryType = "Incremental" + RestorePointQueryTypeInvalid RestorePointQueryType = "Invalid" + RestorePointQueryTypeLog RestorePointQueryType = "Log" + RestorePointQueryTypeSnapshotCopyOnlyFull RestorePointQueryType = "SnapshotCopyOnlyFull" + RestorePointQueryTypeSnapshotFull RestorePointQueryType = "SnapshotFull" ) // PossibleRestorePointQueryTypeValues returns the possible values for the RestorePointQueryType const type. @@ -1206,6 +1271,8 @@ func PossibleRestorePointQueryTypeValues() []RestorePointQueryType { RestorePointQueryTypeIncremental, RestorePointQueryTypeInvalid, RestorePointQueryTypeLog, + RestorePointQueryTypeSnapshotCopyOnlyFull, + RestorePointQueryTypeSnapshotFull, } } @@ -1213,11 +1280,13 @@ func PossibleRestorePointQueryTypeValues() []RestorePointQueryType { type RestorePointType string const ( - RestorePointTypeDifferential RestorePointType = "Differential" - RestorePointTypeFull RestorePointType = "Full" - RestorePointTypeIncremental RestorePointType = "Incremental" - RestorePointTypeInvalid RestorePointType = "Invalid" - RestorePointTypeLog RestorePointType = "Log" + RestorePointTypeDifferential RestorePointType = "Differential" + RestorePointTypeFull RestorePointType = "Full" + RestorePointTypeIncremental RestorePointType = "Incremental" + RestorePointTypeInvalid RestorePointType = "Invalid" + RestorePointTypeLog RestorePointType = "Log" + RestorePointTypeSnapshotCopyOnlyFull RestorePointType = "SnapshotCopyOnlyFull" + RestorePointTypeSnapshotFull RestorePointType = "SnapshotFull" ) // PossibleRestorePointTypeValues returns the possible values for the RestorePointType const type. @@ -1228,6 +1297,8 @@ func PossibleRestorePointTypeValues() []RestorePointType { RestorePointTypeIncremental, RestorePointTypeInvalid, RestorePointTypeLog, + RestorePointTypeSnapshotCopyOnlyFull, + RestorePointTypeSnapshotFull, } } @@ -1408,6 +1479,29 @@ func PossibleSupportStatusValues() []SupportStatus { } } +// TieringMode - Tiering Mode to control automatic tiering of recovery points. Supported values are: +// 1. TierRecommended: Tier all recovery points recommended to be tiered +// 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. +// 3. DoNotTier: Do not tier any recovery points +type TieringMode string + +const ( + TieringModeDoNotTier TieringMode = "DoNotTier" + TieringModeInvalid TieringMode = "Invalid" + TieringModeTierAfter TieringMode = "TierAfter" + TieringModeTierRecommended TieringMode = "TierRecommended" +) + +// PossibleTieringModeValues returns the possible values for the TieringMode const type. +func PossibleTieringModeValues() []TieringMode { + return []TieringMode{ + TieringModeDoNotTier, + TieringModeInvalid, + TieringModeTierAfter, + TieringModeTierRecommended, + } +} + // Type - Backup management type for this container. type Type string @@ -1495,13 +1589,14 @@ func PossibleWeekOfMonthValues() []WeekOfMonth { type WorkloadItemType string const ( - WorkloadItemTypeInvalid WorkloadItemType = "Invalid" - WorkloadItemTypeSAPAseDatabase WorkloadItemType = "SAPAseDatabase" - WorkloadItemTypeSAPAseSystem WorkloadItemType = "SAPAseSystem" - WorkloadItemTypeSAPHanaDatabase WorkloadItemType = "SAPHanaDatabase" - WorkloadItemTypeSAPHanaSystem WorkloadItemType = "SAPHanaSystem" - WorkloadItemTypeSQLDataBase WorkloadItemType = "SQLDataBase" - WorkloadItemTypeSQLInstance WorkloadItemType = "SQLInstance" + WorkloadItemTypeInvalid WorkloadItemType = "Invalid" + WorkloadItemTypeSAPAseDatabase WorkloadItemType = "SAPAseDatabase" + WorkloadItemTypeSAPAseSystem WorkloadItemType = "SAPAseSystem" + WorkloadItemTypeSAPHanaDBInstance WorkloadItemType = "SAPHanaDBInstance" + WorkloadItemTypeSAPHanaDatabase WorkloadItemType = "SAPHanaDatabase" + WorkloadItemTypeSAPHanaSystem WorkloadItemType = "SAPHanaSystem" + WorkloadItemTypeSQLDataBase WorkloadItemType = "SQLDataBase" + WorkloadItemTypeSQLInstance WorkloadItemType = "SQLInstance" ) // PossibleWorkloadItemTypeValues returns the possible values for the WorkloadItemType const type. @@ -1510,6 +1605,7 @@ func PossibleWorkloadItemTypeValues() []WorkloadItemType { WorkloadItemTypeInvalid, WorkloadItemTypeSAPAseDatabase, WorkloadItemTypeSAPAseSystem, + WorkloadItemTypeSAPHanaDBInstance, WorkloadItemTypeSAPHanaDatabase, WorkloadItemTypeSAPHanaSystem, WorkloadItemTypeSQLDataBase, @@ -1529,6 +1625,7 @@ const ( WorkloadTypeGenericDataSource WorkloadType = "GenericDataSource" WorkloadTypeInvalid WorkloadType = "Invalid" WorkloadTypeSAPAseDatabase WorkloadType = "SAPAseDatabase" + WorkloadTypeSAPHanaDBInstance WorkloadType = "SAPHanaDBInstance" WorkloadTypeSAPHanaDatabase WorkloadType = "SAPHanaDatabase" WorkloadTypeSQLDB WorkloadType = "SQLDB" WorkloadTypeSQLDataBase WorkloadType = "SQLDataBase" @@ -1549,6 +1646,7 @@ func PossibleWorkloadTypeValues() []WorkloadType { WorkloadTypeGenericDataSource, WorkloadTypeInvalid, WorkloadTypeSAPAseDatabase, + WorkloadTypeSAPHanaDBInstance, WorkloadTypeSAPHanaDatabase, WorkloadTypeSQLDB, WorkloadTypeSQLDataBase, diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go new file mode 100644 index 000000000000..2bc7ec2f4546 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go @@ -0,0 +1,129 @@ +//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 armrecoveryservicesbackup + +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" +) + +// DeletedProtectionContainersClient contains the methods for the DeletedProtectionContainers group. +// Don't use this type directly, use NewDeletedProtectionContainersClient() instead. +type DeletedProtectionContainersClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDeletedProtectionContainersClient creates a new instance of DeletedProtectionContainersClient with the specified values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDeletedProtectionContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeletedProtectionContainersClient, 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 := &DeletedProtectionContainersClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Lists the soft deleted containers registered to Recovery Services Vault. +// +// Generated from API version 2023-01-01 +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - vaultName - The name of the recovery services vault. +// - options - DeletedProtectionContainersClientListOptions contains the optional parameters for the DeletedProtectionContainersClient.NewListPager +// method. +func (client *DeletedProtectionContainersClient) NewListPager(resourceGroupName string, vaultName string, options *DeletedProtectionContainersClientListOptions) *runtime.Pager[DeletedProtectionContainersClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[DeletedProtectionContainersClientListResponse]{ + More: func(page DeletedProtectionContainersClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DeletedProtectionContainersClientListResponse) (DeletedProtectionContainersClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, vaultName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DeletedProtectionContainersClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DeletedProtectionContainersClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DeletedProtectionContainersClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *DeletedProtectionContainersClient) listCreateRequest(ctx context.Context, resourceGroupName string, vaultName string, options *DeletedProtectionContainersClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupDeletedProtectionContainers" + 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 vaultName == "" { + return nil, errors.New("parameter vaultName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{vaultName}", url.PathEscape(vaultName)) + 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", "2023-01-01") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *DeletedProtectionContainersClient) listHandleResponse(resp *http.Response) (DeletedProtectionContainersClientListResponse, error) { + result := DeletedProtectionContainersClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ProtectionContainerResourceList); err != nil { + return DeletedProtectionContainersClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client_example_test.go new file mode 100644 index 000000000000..4be754d57c15 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client_example_test.go @@ -0,0 +1,61 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureStorage/SoftDeletedContainers_List.json +func ExampleDeletedProtectionContainersClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewDeletedProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("testRg", "testVault", &armrecoveryservicesbackup.DeletedProtectionContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'")}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ProtectionContainerResourceList = armrecoveryservicesbackup.ProtectionContainerResourceList{ + // Value: []*armrecoveryservicesbackup.ProtectionContainerResource{ + // { + // Name: to.Ptr("StorageContainer;Storage;testrg;suchandrtestsa125"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers"), + // ID: to.Ptr("/subscriptions/172424a4-d65f-421e-a8de-197d98aabeba/resourcegroups/testrg/providers/microsoft.recoveryservices/vaults/suchandr-test-vault-wcus/backupFabrics/Azure/protectionContainers/StorageContainer;Storage;testrg;suchandrtestsa125"), + // Properties: &armrecoveryservicesbackup.AzureStorageContainer{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), + // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), + // FriendlyName: to.Ptr("suchandrtestsa125"), + // HealthStatus: to.Ptr("Healthy"), + // RegistrationStatus: to.Ptr("SoftDeleted"), + // ProtectedItemCount: to.Ptr[int64](2), + // SourceResourceID: to.Ptr("/subscriptions/172424a4-d65f-421e-a8de-197d98aabeba/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/suchandrtestsa125"), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_exportjobsoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client.go similarity index 87% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_exportjobsoperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client.go index dad3d239f841..7314bb0c7f3b 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_exportjobsoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ExportJobsOperationResultsClient struct { } // NewExportJobsOperationResultsClient creates a new instance of ExportJobsOperationResultsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewExportJobsOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ExportJobsOperationResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +59,13 @@ func NewExportJobsOperationResultsClient(subscriptionID string, credential azcor // contains URL of a Blob and a SAS key to access the same. The blob contains exported // jobs in JSON serialized format. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// operationID - OperationID which represents the export job. -// options - ExportJobsOperationResultsClientGetOptions contains the optional parameters for the ExportJobsOperationResultsClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - operationID - OperationID which represents the export job. +// - options - ExportJobsOperationResultsClientGetOptions contains the optional parameters for the ExportJobsOperationResultsClient.Get +// method. func (client *ExportJobsOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *ExportJobsOperationResultsClientGetOptions) (ExportJobsOperationResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { @@ -103,7 +105,7 @@ func (client *ExportJobsOperationResultsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client_example_test.go new file mode 100644 index 000000000000..38267127eda5 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client_example_test.go @@ -0,0 +1,47 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/ExportJobsOperationResult.json +func ExampleExportJobsOperationResultsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewExportJobsOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.OperationResultInfoBaseResource = armrecoveryservicesbackup.OperationResultInfoBaseResource{ + // Headers: map[string][]*string{ + // }, + // Operation: &armrecoveryservicesbackup.ExportJobsOperationResultInfo{ + // ObjectType: to.Ptr("ExportJobsOperationResultInfo"), + // BlobSasKey: to.Ptr("?sv=2014-02-14&sr=b&sig=&st=2017-11-29T07%3A53%3A34Z&se=2017-11-29T08%3A03%3A34Z&sp=r"), + // BlobURL: to.Ptr("https://azureblob.blob.core.windows.net/reportcontainer/exportjobsreportc00000000-0000-0000-0000-000000000000"), + // }, + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_featuresupport_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client.go similarity index 88% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_featuresupport_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client.go index e7b202131590..f3c50914b776 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_featuresupport_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type FeatureSupportClient struct { } // NewFeatureSupportClient creates a new instance of FeatureSupportClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewFeatureSupportClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FeatureSupportClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,10 +57,11 @@ func NewFeatureSupportClient(subscriptionID string, credential azcore.TokenCrede // Validate - It will validate if given feature with resource properties is supported in service // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// azureRegion - Azure region to hit Api -// parameters - Feature support request object -// options - FeatureSupportClientValidateOptions contains the optional parameters for the FeatureSupportClient.Validate method. +// +// Generated from API version 2023-01-01 +// - azureRegion - Azure region to hit Api +// - parameters - Feature support request object +// - options - FeatureSupportClientValidateOptions contains the optional parameters for the FeatureSupportClient.Validate method. func (client *FeatureSupportClient) Validate(ctx context.Context, azureRegion string, parameters FeatureSupportRequestClassification, options *FeatureSupportClientValidateOptions) (FeatureSupportClientValidateResponse, error) { req, err := client.validateCreateRequest(ctx, azureRegion, parameters, options) if err != nil { @@ -91,7 +93,7 @@ func (client *FeatureSupportClient) validateCreateRequest(ctx context.Context, a return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_featuresupport_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client_example_test.go similarity index 52% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_featuresupport_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client_example_test.go index 2e1cfa7f5a30..fac0df1d2c4e 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_featuresupport_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client_example_test.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 armrecoveryservicesbackup_test @@ -14,10 +15,10 @@ import ( "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/recoveryservices/armrecoveryservicesbackup" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/BackupFeature_Validate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/BackupFeature_Validate.json func ExampleFeatureSupportClient_Validate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -28,17 +29,18 @@ func ExampleFeatureSupportClient_Validate() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Validate(ctx, - "southeastasia", - &armrecoveryservicesbackup.AzureVMResourceFeatureSupportRequest{ - FeatureType: to.Ptr("AzureVMResourceBackup"), - VMSize: to.Ptr("Basic_A0"), - VMSKU: to.Ptr("Premium"), - }, - nil) + res, err := client.Validate(ctx, "southeastasia", &armrecoveryservicesbackup.AzureVMResourceFeatureSupportRequest{ + FeatureType: to.Ptr("AzureVMResourceBackup"), + VMSize: to.Ptr("Basic_A0"), + VMSKU: to.Ptr("Premium"), + }, nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // You could use response here. We use blank identifier for just demo purposes. _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.AzureVMResourceFeatureSupportResponse = armrecoveryservicesbackup.AzureVMResourceFeatureSupportResponse{ + // SupportStatus: to.Ptr(armrecoveryservicesbackup.SupportStatusDefaultOFF), + // } } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod index d64f1aff68f5..4e50fea9a3f1 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod @@ -1,16 +1,16 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.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/AzureAD/microsoft-authentication-library-for-go v0.7.0 // indirect + github.com/golang-jwt/jwt/v4 v4.4.2 // 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 diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.sum b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.sum index ed5b814680ee..8c0539b73123 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.sum +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.sum @@ -1,21 +1,19 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0 h1:sVPhtT2qjO86rTUaWMr4WoES4TkjGnzcioXcnHV9s5k= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.0.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0 h1:t/W5MYAuQy81cvM8VUNfRLzhtKpXhVUAN7Cd7KVbTyc= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.0/go.mod h1:NBanQUfSWiWn3QEpWDTCU0IjBECKOYvl2R8xdRtMtiM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= +github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0 h1:VgSJlZH5u0k2qxSpqyghcFQKmvYckj46uymKK5XzkBM= +github.com/AzureAD/microsoft-authentication-library-for-go v0.7.0/go.mod h1:BDJ5qMFKx9DugEg3+uQSDCdbYPr5s9vBTrL9P8TpqOU= 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/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= +github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= 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/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= @@ -24,7 +22,6 @@ golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4Wwu 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= diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_itemlevelrecoveryconnections_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client.go similarity index 83% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_itemlevelrecoveryconnections_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client.go index 5690970608c0..f1c83b2d7d68 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_itemlevelrecoveryconnections_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ItemLevelRecoveryConnectionsClient struct { } // NewItemLevelRecoveryConnectionsClient creates a new instance of ItemLevelRecoveryConnectionsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewItemLevelRecoveryConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ItemLevelRecoveryConnectionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,17 +59,18 @@ func NewItemLevelRecoveryConnectionsClient(subscriptionID string, credential azc // explorer displaying all the recoverable files and folders. This is an asynchronous // operation. To know the status of provisioning, call GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the backed up items. -// containerName - Container name associated with the backed up items. -// protectedItemName - Backed up item name whose files/folders are to be restored. -// recoveryPointID - Recovery point ID which represents backed up data. iSCSI connection will be provisioned for this backed -// up data. -// parameters - resource ILR request -// options - ItemLevelRecoveryConnectionsClientProvisionOptions contains the optional parameters for the ItemLevelRecoveryConnectionsClient.Provision -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the backed up items. +// - containerName - Container name associated with the backed up items. +// - protectedItemName - Backed up item name whose files/folders are to be restored. +// - recoveryPointID - Recovery point ID which represents backed up data. iSCSI connection will be provisioned for this backed +// up data. +// - parameters - resource ILR request +// - options - ItemLevelRecoveryConnectionsClientProvisionOptions contains the optional parameters for the ItemLevelRecoveryConnectionsClient.Provision +// method. func (client *ItemLevelRecoveryConnectionsClient) Provision(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters ILRRequestResource, options *ItemLevelRecoveryConnectionsClientProvisionOptions) (ItemLevelRecoveryConnectionsClientProvisionResponse, error) { req, err := client.provisionCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters, options) if err != nil { @@ -120,7 +122,7 @@ func (client *ItemLevelRecoveryConnectionsClient) provisionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -129,16 +131,17 @@ func (client *ItemLevelRecoveryConnectionsClient) provisionCreateRequest(ctx con // Revoke - Revokes an iSCSI connection which can be used to download a script. Executing this script opens a file explorer // displaying all recoverable files and folders. This is an asynchronous operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the backed up items. -// containerName - Container name associated with the backed up items. -// protectedItemName - Backed up item name whose files/folders are to be restored. -// recoveryPointID - Recovery point ID which represents backed up data. iSCSI connection will be revoked for this backed up -// data. -// options - ItemLevelRecoveryConnectionsClientRevokeOptions contains the optional parameters for the ItemLevelRecoveryConnectionsClient.Revoke -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the backed up items. +// - containerName - Container name associated with the backed up items. +// - protectedItemName - Backed up item name whose files/folders are to be restored. +// - recoveryPointID - Recovery point ID which represents backed up data. iSCSI connection will be revoked for this backed up +// data. +// - options - ItemLevelRecoveryConnectionsClientRevokeOptions contains the optional parameters for the ItemLevelRecoveryConnectionsClient.Revoke +// method. func (client *ItemLevelRecoveryConnectionsClient) Revoke(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, options *ItemLevelRecoveryConnectionsClientRevokeOptions) (ItemLevelRecoveryConnectionsClientRevokeResponse, error) { req, err := client.revokeCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, options) if err != nil { @@ -190,7 +193,7 @@ func (client *ItemLevelRecoveryConnectionsClient) revokeCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_itemlevelrecoveryconnections_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client_example_test.go similarity index 54% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_itemlevelrecoveryconnections_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client_example_test.go index 4fb7dad09dd3..fd6721db9e10 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_itemlevelrecoveryconnections_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client_example_test.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 armrecoveryservicesbackup_test @@ -14,10 +15,10 @@ import ( "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/recoveryservices/armrecoveryservicesbackup" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/Provision_Ilr.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/Provision_Ilr.json func ExampleItemLevelRecoveryConnectionsClient_Provision() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -28,29 +29,21 @@ func ExampleItemLevelRecoveryConnectionsClient_Provision() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Provision(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - "Azure", - "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", - "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", - "1", - armrecoveryservicesbackup.ILRRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMILRRegistrationRequest{ - ObjectType: to.Ptr("IaasVMILRRegistrationRequest"), - InitiatorName: to.Ptr("Hello World"), - RecoveryPointID: to.Ptr("38823086363464"), - RenewExistingRegistration: to.Ptr(true), - VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/pysdktestrg/providers/Microsoft.Compute/virtualMachines/pysdktestv2vm1"), - }, + _, err = client.Provision(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "Azure", "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", "1", armrecoveryservicesbackup.ILRRequestResource{ + Properties: &armrecoveryservicesbackup.IaasVMILRRegistrationRequest{ + ObjectType: to.Ptr("IaasVMILRRegistrationRequest"), + InitiatorName: to.Ptr("Hello World"), + RecoveryPointID: to.Ptr("38823086363464"), + RenewExistingRegistration: to.Ptr(true), + VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/pysdktestrg/providers/Microsoft.Compute/virtualMachines/pysdktestv2vm1"), }, - nil) + }, 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/Revoke_Ilr.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/Revoke_Ilr.json func ExampleItemLevelRecoveryConnectionsClient_Revoke() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -61,14 +54,7 @@ func ExampleItemLevelRecoveryConnectionsClient_Revoke() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Revoke(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - "Azure", - "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", - "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", - "1", - nil) + _, err = client.Revoke(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "Azure", "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", "1", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobcancellations_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobcancellations_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client.go index e36715be4f82..93fee9cd44c4 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobcancellations_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type JobCancellationsClient struct { } // NewJobCancellationsClient creates a new instance of JobCancellationsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobCancellationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobCancellationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +58,13 @@ func NewJobCancellationsClient(subscriptionID string, credential azcore.TokenCre // Trigger - Cancels a job. This is an asynchronous operation. To know the status of the cancellation, call GetCancelOperationResult // API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// jobName - Name of the job to cancel. -// options - JobCancellationsClientTriggerOptions contains the optional parameters for the JobCancellationsClient.Trigger -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - jobName - Name of the job to cancel. +// - options - JobCancellationsClientTriggerOptions contains the optional parameters for the JobCancellationsClient.Trigger +// method. func (client *JobCancellationsClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, jobName string, options *JobCancellationsClientTriggerOptions) (JobCancellationsClientTriggerResponse, error) { req, err := client.triggerCreateRequest(ctx, vaultName, resourceGroupName, jobName, options) if err != nil { @@ -102,7 +104,7 @@ func (client *JobCancellationsClient) triggerCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobcancellations_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client_example_test.go similarity index 74% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobcancellations_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client_example_test.go index bd364ae498d0..b44e9745b884 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobcancellations_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client_example_test.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 armrecoveryservicesbackup_test @@ -13,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/TriggerCancelJob.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/TriggerCancelJob.json func ExampleJobCancellationsClient_Trigger() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -27,11 +28,7 @@ func ExampleJobCancellationsClient_Trigger() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Trigger(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "00000000-0000-0000-0000-000000000000", - nil) + _, err = client.Trigger(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobdetails_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client.go similarity index 87% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobdetails_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client.go index fca7ee5f3cf2..f77bca225886 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobdetails_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type JobDetailsClient struct { } // NewJobDetailsClient creates a new instance of JobDetailsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobDetailsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobDetailsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewJobDetailsClient(subscriptionID string, credential azcore.TokenCredentia // Get - Gets extended information associated with the job. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// jobName - Name of the job whose details are to be fetched. -// options - JobDetailsClientGetOptions contains the optional parameters for the JobDetailsClient.Get method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - jobName - Name of the job whose details are to be fetched. +// - options - JobDetailsClientGetOptions contains the optional parameters for the JobDetailsClient.Get method. func (client *JobDetailsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, options *JobDetailsClientGetOptions) (JobDetailsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, jobName, options) if err != nil { @@ -100,7 +102,7 @@ func (client *JobDetailsClient) getCreateRequest(ctx context.Context, vaultName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client_example_test.go new file mode 100644 index 000000000000..ece593efbf39 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client_example_test.go @@ -0,0 +1,70 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/GetJobDetails.json +func ExampleJobDetailsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewJobDetailsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.JobResource = armrecoveryservicesbackup.JobResource{ + // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ + // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // EntityFriendlyName: to.Ptr("testvm"), + // JobType: to.Ptr("AzureIaaSVMJob"), + // Operation: to.Ptr("Backup"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:07.014604Z"); return t}()), + // Status: to.Ptr("InProgress"), + // Duration: to.Ptr("PT9.8782791S"), + // ExtendedInfo: &armrecoveryservicesbackup.AzureIaaSVMJobExtendedInfo{ + // PropertyBag: map[string]*string{ + // "VM Name": to.Ptr("testvm"), + // }, + // TasksList: []*armrecoveryservicesbackup.AzureIaaSVMJobTaskDetails{ + // { + // Duration: to.Ptr("PT0S"), + // Status: to.Ptr("InProgress"), + // TaskID: to.Ptr("Take Snapshot"), + // }, + // { + // Duration: to.Ptr("PT0S"), + // Status: to.Ptr("NotStarted"), + // TaskID: to.Ptr("Transfer data to vault"), + // }}, + // }, + // VirtualMachineVersion: to.Ptr("Compute"), + // }, + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_joboperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client.go similarity index 85% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_joboperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client.go index f800d79f5322..afa2390c47f3 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_joboperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type JobOperationResultsClient struct { } // NewJobOperationResultsClient creates a new instance of JobOperationResultsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobOperationResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewJobOperationResultsClient(subscriptionID string, credential azcore.Token // Get - Fetches the result of any operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// jobName - Job name whose operation result has to be fetched. -// operationID - OperationID which represents the operation whose result has to be fetched. -// options - JobOperationResultsClientGetOptions contains the optional parameters for the JobOperationResultsClient.Get method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - jobName - Job name whose operation result has to be fetched. +// - operationID - OperationID which represents the operation whose result has to be fetched. +// - options - JobOperationResultsClientGetOptions contains the optional parameters for the JobOperationResultsClient.Get method. func (client *JobOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string, options *JobOperationResultsClientGetOptions) (JobOperationResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, jobName, operationID, options) if err != nil { @@ -105,7 +107,7 @@ func (client *JobOperationResultsClient) getCreateRequest(ctx context.Context, v return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_joboperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client_example_test.go similarity index 71% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_joboperationresults_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client_example_test.go index de97051fca05..56fbc6cf2256 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_joboperationresults_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client_example_test.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 armrecoveryservicesbackup_test @@ -13,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/CancelJobOperationResult.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/CancelJobOperationResult.json func ExampleJobOperationResultsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -27,12 +28,7 @@ func ExampleJobOperationResultsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "00000000-0000-0000-0000-000000000000", - "00000000-0000-0000-0000-000000000000", - nil) + _, err = client.Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", "00000000-0000-0000-0000-000000000000", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client.go similarity index 87% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobs_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client.go index 308a1fd58261..0fa1f9c2b543 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_jobs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type JobsClient struct { } // NewJobsClient creates a new instance of JobsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*JobsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,10 +57,11 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // Export - Triggers export of jobs specified by filters and returns an OperationID to track. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - JobsClientExportOptions contains the optional parameters for the JobsClient.Export method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - JobsClientExportOptions contains the optional parameters for the JobsClient.Export method. func (client *JobsClient) Export(ctx context.Context, vaultName string, resourceGroupName string, options *JobsClientExportOptions) (JobsClientExportResponse, error) { req, err := client.exportCreateRequest(ctx, vaultName, resourceGroupName, options) if err != nil { @@ -95,7 +97,7 @@ func (client *JobsClient) exportCreateRequest(ctx context.Context, vaultName str return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobs_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client_example_test.go similarity index 72% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobs_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client_example_test.go index 50c7f707a0ff..8709169cbbcd 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobs_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client_example_test.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 armrecoveryservicesbackup_test @@ -13,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/TriggerExportJobs.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/TriggerExportJobs.json func ExampleJobsClient_Export() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -27,10 +28,7 @@ func ExampleJobsClient_Export() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Export(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - &armrecoveryservicesbackup.JobsClientExportOptions{Filter: nil}) + _, err = client.Export(ctx, "NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.JobsClientExportOptions{Filter: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_models.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models.go similarity index 92% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_models.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models.go index da7362144e9f..349f5a1addca 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_models.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup @@ -29,7 +30,7 @@ type AzureBackupServerContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -278,6 +279,9 @@ type AzureFileShareRecoveryPoint struct { // Contains Url to the snapshot of fileshare, if applicable FileShareSnapshotURI *string `json:"fileShareSnapshotUri,omitempty"` + // Properties of Recovery Point + RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` + // Contains recovery point size RecoveryPointSizeInGB *int32 `json:"recoveryPointSizeInGB,omitempty"` @@ -331,9 +335,6 @@ type AzureFileshareProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -394,11 +395,17 @@ type AzureFileshareProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetProtectedItem implements the ProtectedItemClassification interface for type AzureFileshareProtectedItem. @@ -421,6 +428,7 @@ func (a *AzureFileshareProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -449,7 +457,7 @@ type AzureIaaSClassicComputeVMContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -560,9 +568,6 @@ type AzureIaaSClassicComputeVMProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -584,15 +589,9 @@ type AzureIaaSClassicComputeVMProtectedItem struct { // Extended Properties for Azure IaasVM Backup. ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Health details on this backup item. HealthDetails []*AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // Health status of protected item. - HealthStatus *HealthStatus `json:"healthStatus,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -611,9 +610,6 @@ type AzureIaaSClassicComputeVMProtectedItem struct { // Last backup operation status. LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // Timestamp of the last backup operation on this backup item. - LastBackupTime *time.Time `json:"lastBackupTime,omitempty"` - // Timestamp when the last (latest) backup copy was created for this backup item. LastRecoveryPoint *time.Time `json:"lastRecoveryPoint,omitempty"` @@ -623,9 +619,6 @@ type AzureIaaSClassicComputeVMProtectedItem struct { // Name of the policy used for protection PolicyName *string `json:"policyName,omitempty"` - // Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` @@ -635,14 +628,32 @@ type AzureIaaSClassicComputeVMProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Health status of protected item. + HealthStatus *HealthStatus `json:"healthStatus,omitempty" azure:"ro"` + + // READ-ONLY; Timestamp of the last backup operation on this backup item. + LastBackupTime *time.Time `json:"lastBackupTime,omitempty" azure:"ro"` + + // READ-ONLY; Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty" azure:"ro"` + + // READ-ONLY; Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureIaaSVMProtectedItem implements the AzureIaaSVMProtectedItemClassification interface for type AzureIaaSClassicComputeVMProtectedItem. @@ -677,6 +688,7 @@ func (a *AzureIaaSClassicComputeVMProtectedItem) GetAzureIaaSVMProtectedItem() * ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -700,6 +712,7 @@ func (a *AzureIaaSClassicComputeVMProtectedItem) GetProtectedItem() *ProtectedIt ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -709,7 +722,7 @@ type AzureIaaSComputeVMContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -820,9 +833,6 @@ type AzureIaaSComputeVMProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -844,15 +854,9 @@ type AzureIaaSComputeVMProtectedItem struct { // Extended Properties for Azure IaasVM Backup. ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Health details on this backup item. HealthDetails []*AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // Health status of protected item. - HealthStatus *HealthStatus `json:"healthStatus,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -871,9 +875,6 @@ type AzureIaaSComputeVMProtectedItem struct { // Last backup operation status. LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // Timestamp of the last backup operation on this backup item. - LastBackupTime *time.Time `json:"lastBackupTime,omitempty"` - // Timestamp when the last (latest) backup copy was created for this backup item. LastRecoveryPoint *time.Time `json:"lastRecoveryPoint,omitempty"` @@ -883,9 +884,6 @@ type AzureIaaSComputeVMProtectedItem struct { // Name of the policy used for protection PolicyName *string `json:"policyName,omitempty"` - // Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` @@ -895,14 +893,32 @@ type AzureIaaSComputeVMProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Health status of protected item. + HealthStatus *HealthStatus `json:"healthStatus,omitempty" azure:"ro"` + + // READ-ONLY; Timestamp of the last backup operation on this backup item. + LastBackupTime *time.Time `json:"lastBackupTime,omitempty" azure:"ro"` + + // READ-ONLY; Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty" azure:"ro"` + + // READ-ONLY; Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureIaaSVMProtectedItem implements the AzureIaaSVMProtectedItemClassification interface for type AzureIaaSComputeVMProtectedItem. @@ -937,6 +953,7 @@ func (a *AzureIaaSComputeVMProtectedItem) GetAzureIaaSVMProtectedItem() *AzureIa ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -960,6 +977,7 @@ func (a *AzureIaaSComputeVMProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -1177,9 +1195,6 @@ type AzureIaaSVMProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -1201,15 +1216,9 @@ type AzureIaaSVMProtectedItem struct { // Extended Properties for Azure IaasVM Backup. ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - // Friendly name of the VM represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Health details on this backup item. HealthDetails []*AzureIaaSVMHealthDetails `json:"healthDetails,omitempty"` - // Health status of protected item. - HealthStatus *HealthStatus `json:"healthStatus,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -1228,9 +1237,6 @@ type AzureIaaSVMProtectedItem struct { // Last backup operation status. LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - // Timestamp of the last backup operation on this backup item. - LastBackupTime *time.Time `json:"lastBackupTime,omitempty"` - // Timestamp when the last (latest) backup copy was created for this backup item. LastRecoveryPoint *time.Time `json:"lastRecoveryPoint,omitempty"` @@ -1240,9 +1246,6 @@ type AzureIaaSVMProtectedItem struct { // Name of the policy used for protection PolicyName *string `json:"policyName,omitempty"` - // Data ID of the protected item. - ProtectedItemDataID *string `json:"protectedItemDataId,omitempty"` - // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` @@ -1252,14 +1255,32 @@ type AzureIaaSVMProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Fully qualified ARM ID of the virtual machine represented by this item. - VirtualMachineID *string `json:"virtualMachineId,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Friendly name of the VM represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Health status of protected item. + HealthStatus *HealthStatus `json:"healthStatus,omitempty" azure:"ro"` + + // READ-ONLY; Timestamp of the last backup operation on this backup item. + LastBackupTime *time.Time `json:"lastBackupTime,omitempty" azure:"ro"` + + // READ-ONLY; Data ID of the protected item. + ProtectedItemDataID *string `json:"protectedItemDataId,omitempty" azure:"ro"` + + // READ-ONLY; Fully qualified ARM ID of the virtual machine represented by this item. + VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureIaaSVMProtectedItem implements the AzureIaaSVMProtectedItemClassification interface for type AzureIaaSVMProtectedItem. @@ -1285,14 +1306,24 @@ func (a *AzureIaaSVMProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } // AzureIaaSVMProtectedItemExtendedInfo - Additional information on Azure IaaS VM specific backup item. type AzureIaaSVMProtectedItemExtendedInfo struct { - // The oldest backup copy available for this backup item. + // The latest backup copy available for this backup item in archive tier + NewestRecoveryPointInArchive *time.Time `json:"newestRecoveryPointInArchive,omitempty"` + + // The oldest backup copy available for this backup item across all tiers. OldestRecoveryPoint *time.Time `json:"oldestRecoveryPoint,omitempty"` + // The oldest backup copy available for this backup item in archive tier + OldestRecoveryPointInArchive *time.Time `json:"oldestRecoveryPointInArchive,omitempty"` + + // The oldest backup copy available for this backup item in vault tier + OldestRecoveryPointInVault *time.Time `json:"oldestRecoveryPointInVault,omitempty"` + // Specifies if backup policy associated with the backup item is inconsistent. PolicyInconsistent *bool `json:"policyInconsistent,omitempty"` @@ -1322,6 +1353,10 @@ type AzureIaaSVMProtectionPolicy struct { // Backup schedule specified as part of backup policy. SchedulePolicy SchedulePolicyClassification `json:"schedulePolicy,omitempty"` + // Tiering policy to automatically move RPs to another tier Key is Target Tier, defined in RecoveryPointTierType enum. Tiering + // policy specifies the criteria to move RP to the target tier. + TieringPolicy map[string]*TieringPolicy `json:"tieringPolicy,omitempty"` + // TimeZone optional input as string. For example: TimeZone = "Pacific Standard Time". TimeZone *string `json:"timeZone,omitempty"` } @@ -1426,7 +1461,7 @@ type AzureSQLAGWorkloadContainerProtectionContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -1494,7 +1529,7 @@ type AzureSQLContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -1529,9 +1564,6 @@ type AzureSQLProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -1580,11 +1612,17 @@ type AzureSQLProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetProtectedItem implements the ProtectedItemClassification interface for type AzureSQLProtectedItem. @@ -1607,6 +1645,7 @@ func (a *AzureSQLProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -1652,7 +1691,7 @@ type AzureStorageContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Whether storage account lock is to be acquired for this container or not. AcquireStorageAccountLock *AcquireStorageAccountLock `json:"acquireStorageAccountLock,omitempty"` @@ -1797,7 +1836,7 @@ type AzureStorageProtectableContainer struct { // REQUIRED; Type of the container. The value of this property for // 1. Compute Azure VM is Microsoft.Compute/virtualMachines // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines - ProtectableContainerType *ContainerType `json:"protectableContainerType,omitempty"` + ProtectableContainerType *ProtectableContainerType `json:"protectableContainerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -1828,7 +1867,7 @@ type AzureVMAppContainerProtectableContainer struct { // REQUIRED; Type of the container. The value of this property for // 1. Compute Azure VM is Microsoft.Compute/virtualMachines // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines - ProtectableContainerType *ContainerType `json:"protectableContainerType,omitempty"` + ProtectableContainerType *ProtectableContainerType `json:"protectableContainerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -1860,7 +1899,7 @@ type AzureVMAppContainerProtectionContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -2008,9 +2047,9 @@ func (a *AzureVMWorkloadItem) GetWorkloadItem() *WorkloadItem { // AzureVMWorkloadProtectableItemClassification provides polymorphic access to related types. // Call the interface's GetAzureVMWorkloadProtectableItem() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AzureVMWorkloadProtectableItem, *AzureVMWorkloadSAPAseSystemProtectableItem, *AzureVMWorkloadSAPHanaDatabaseProtectableItem, -// - *AzureVMWorkloadSAPHanaSystemProtectableItem, *AzureVMWorkloadSQLAvailabilityGroupProtectableItem, *AzureVMWorkloadSQLDatabaseProtectableItem, -// - *AzureVMWorkloadSQLInstanceProtectableItem +// - *AzureVMWorkloadProtectableItem, *AzureVMWorkloadSAPAseSystemProtectableItem, *AzureVMWorkloadSAPHanaDBInstance, *AzureVMWorkloadSAPHanaDatabaseProtectableItem, +// - *AzureVMWorkloadSAPHanaHSR, *AzureVMWorkloadSAPHanaSystemProtectableItem, *AzureVMWorkloadSQLAvailabilityGroupProtectableItem, +// - *AzureVMWorkloadSQLDatabaseProtectableItem, *AzureVMWorkloadSQLInstanceProtectableItem type AzureVMWorkloadProtectableItemClassification interface { WorkloadProtectableItemClassification // GetAzureVMWorkloadProtectableItem returns the AzureVMWorkloadProtectableItem content of the underlying type. @@ -2079,8 +2118,8 @@ func (a *AzureVMWorkloadProtectableItem) GetWorkloadProtectableItem() *WorkloadP // AzureVMWorkloadProtectedItemClassification provides polymorphic access to related types. // Call the interface's GetAzureVMWorkloadProtectedItem() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *AzureVMWorkloadProtectedItem, *AzureVMWorkloadSAPAseDatabaseProtectedItem, *AzureVMWorkloadSAPHanaDatabaseProtectedItem, -// - *AzureVMWorkloadSQLDatabaseProtectedItem +// - *AzureVMWorkloadProtectedItem, *AzureVMWorkloadSAPAseDatabaseProtectedItem, *AzureVMWorkloadSAPHanaDBInstanceProtectedItem, +// - *AzureVMWorkloadSAPHanaDatabaseProtectedItem, *AzureVMWorkloadSQLDatabaseProtectedItem type AzureVMWorkloadProtectedItemClassification interface { ProtectedItemClassification // GetAzureVMWorkloadProtectedItem returns the AzureVMWorkloadProtectedItem content of the underlying type. @@ -2092,9 +2131,6 @@ type AzureVMWorkloadProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -2113,9 +2149,6 @@ type AzureVMWorkloadProtectedItem struct { // Additional information for this backup item. ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -2164,20 +2197,29 @@ type AzureVMWorkloadProtectedItem struct { // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` - // Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` // Host/Cluster Name for instance or AG ServerName *string `json:"serverName,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadProtectedItem. @@ -2205,14 +2247,24 @@ func (a *AzureVMWorkloadProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } // AzureVMWorkloadProtectedItemExtendedInfo - Additional information on Azure Workload for SQL specific backup item. type AzureVMWorkloadProtectedItemExtendedInfo struct { - // The oldest backup copy available for this backup item. + // The latest backup copy available for this backup item in archive tier + NewestRecoveryPointInArchive *time.Time `json:"newestRecoveryPointInArchive,omitempty"` + + // The oldest backup copy available for this backup item across all tiers. OldestRecoveryPoint *time.Time `json:"oldestRecoveryPoint,omitempty"` + // The oldest backup copy available for this backup item in archive tier + OldestRecoveryPointInArchive *time.Time `json:"oldestRecoveryPointInArchive,omitempty"` + + // The oldest backup copy available for this backup item in vault tier + OldestRecoveryPointInVault *time.Time `json:"oldestRecoveryPointInVault,omitempty"` + // Indicates consistency of policy object and policy applied to this backup item. PolicyState *string `json:"policyState,omitempty"` @@ -2261,9 +2313,6 @@ type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -2282,9 +2331,6 @@ type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { // Additional information for this backup item. ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -2333,20 +2379,29 @@ type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` - // Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` // Host/Cluster Name for instance or AG ServerName *string `json:"serverName,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadSAPAseDatabaseProtectedItem. @@ -2382,6 +2437,7 @@ func (a *AzureVMWorkloadSAPAseDatabaseProtectedItem) GetAzureVMWorkloadProtected ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -2405,6 +2461,7 @@ func (a *AzureVMWorkloadSAPAseDatabaseProtectedItem) GetProtectedItem() *Protect ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -2601,6 +2658,236 @@ func (a *AzureVMWorkloadSAPAseSystemWorkloadItem) GetWorkloadItem() *WorkloadIte } } +// AzureVMWorkloadSAPHanaDBInstance - Azure VM workload-specific protectable item representing SAP HANA Dbinstance. +type AzureVMWorkloadSAPHanaDBInstance struct { + // REQUIRED; Type of the backup item. + ProtectableItemType *string `json:"protectableItemType,omitempty"` + + // Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + + // Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + + // Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + + // Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` + + // Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + + // Parent Unique Name is added to provide the service formatted URI Name of the Parent Only Applicable for data bases where + // the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + + // Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + + // State of the back up item. + ProtectionState *ProtectionStatus `json:"protectionState,omitempty"` + + // Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + + // For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + + // For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + + // Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` +} + +// GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaDBInstance. +func (a *AzureVMWorkloadSAPHanaDBInstance) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { + return &AzureVMWorkloadProtectableItem{ + ParentName: a.ParentName, + ParentUniqueName: a.ParentUniqueName, + ServerName: a.ServerName, + IsAutoProtectable: a.IsAutoProtectable, + IsAutoProtected: a.IsAutoProtected, + Subinquireditemcount: a.Subinquireditemcount, + Subprotectableitemcount: a.Subprotectableitemcount, + Prebackupvalidation: a.Prebackupvalidation, + BackupManagementType: a.BackupManagementType, + WorkloadType: a.WorkloadType, + ProtectableItemType: a.ProtectableItemType, + FriendlyName: a.FriendlyName, + ProtectionState: a.ProtectionState, + } +} + +// GetWorkloadProtectableItem implements the WorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaDBInstance. +func (a *AzureVMWorkloadSAPHanaDBInstance) GetWorkloadProtectableItem() *WorkloadProtectableItem { + return &WorkloadProtectableItem{ + BackupManagementType: a.BackupManagementType, + WorkloadType: a.WorkloadType, + ProtectableItemType: a.ProtectableItemType, + FriendlyName: a.FriendlyName, + ProtectionState: a.ProtectionState, + } +} + +// AzureVMWorkloadSAPHanaDBInstanceProtectedItem - Azure VM workload-specific protected item representing SAP HANA DBInstance. +type AzureVMWorkloadSAPHanaDBInstanceProtectedItem struct { + // REQUIRED; backup item type. + ProtectedItemType *string `json:"protectedItemType,omitempty"` + + // Name of the backup set the backup item belongs to + BackupSetName *string `json:"backupSetName,omitempty"` + + // Unique name of container + ContainerName *string `json:"containerName,omitempty"` + + // Create mode to indicate recovery of existing soft deleted data source or creation of new data source. + CreateMode *CreateMode `json:"createMode,omitempty"` + + // Time for deferred deletion in UTC + DeferredDeleteTimeInUTC *time.Time `json:"deferredDeleteTimeInUTC,omitempty"` + + // Time remaining before the DS marked for deferred delete is permanently deleted + DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` + + // Additional information for this backup item. + ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` + + // Flag to identify whether datasource is protected in archive + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + + // Flag to identify whether the deferred deleted DS is to be purged soon + IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` + + // Flag to identify that deferred deleted DS is to be moved into Pause state + IsRehydrate *bool `json:"isRehydrate,omitempty"` + + // Flag to identify whether the DS is scheduled for deferred delete + IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` + + // Health details of different KPIs + KpisHealths map[string]*KPIResourceHealthDetails `json:"kpisHealths,omitempty"` + + // Error details in last backup + LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` + + // Last backup operation status. Possible values: Healthy, Unhealthy. + LastBackupStatus *LastBackupStatus `json:"lastBackupStatus,omitempty"` + + // Timestamp of the last backup operation on this backup item. + LastBackupTime *time.Time `json:"lastBackupTime,omitempty"` + + // Timestamp when the last (latest) backup copy was created for this backup item. + LastRecoveryPoint *time.Time `json:"lastRecoveryPoint,omitempty"` + + // Parent name of the DB such as Instance or Availability Group. + ParentName *string `json:"parentName,omitempty"` + + // Parent type of protected item, example: for a DB, standalone server or distributed + ParentType *string `json:"parentType,omitempty"` + + // ID of the backup policy with which this item is backed up. + PolicyID *string `json:"policyId,omitempty"` + + // Name of the policy used for protection + PolicyName *string `json:"policyName,omitempty"` + + // Data ID of the protected item. + ProtectedItemDataSourceID *string `json:"protectedItemDataSourceId,omitempty"` + + // Health status of the backup item, evaluated based on last heartbeat received + ProtectedItemHealthStatus *ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` + + // Backup state of this backup item. + ProtectionState *ProtectionState `json:"protectionState,omitempty"` + + // ResourceGuardOperationRequests on which LAC check will be performed + ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + + // Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + + // ARM ID of the resource to be backed up. + SourceResourceID *string `json:"sourceResourceId,omitempty"` + + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` +} + +// GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadSAPHanaDBInstanceProtectedItem. +func (a *AzureVMWorkloadSAPHanaDBInstanceProtectedItem) GetAzureVMWorkloadProtectedItem() *AzureVMWorkloadProtectedItem { + return &AzureVMWorkloadProtectedItem{ + FriendlyName: a.FriendlyName, + ServerName: a.ServerName, + ParentName: a.ParentName, + ParentType: a.ParentType, + ProtectionStatus: a.ProtectionStatus, + ProtectionState: a.ProtectionState, + LastBackupStatus: a.LastBackupStatus, + LastBackupTime: a.LastBackupTime, + LastBackupErrorDetail: a.LastBackupErrorDetail, + ProtectedItemDataSourceID: a.ProtectedItemDataSourceID, + ProtectedItemHealthStatus: a.ProtectedItemHealthStatus, + ExtendedInfo: a.ExtendedInfo, + KpisHealths: a.KpisHealths, + ProtectedItemType: a.ProtectedItemType, + BackupManagementType: a.BackupManagementType, + WorkloadType: a.WorkloadType, + ContainerName: a.ContainerName, + SourceResourceID: a.SourceResourceID, + PolicyID: a.PolicyID, + LastRecoveryPoint: a.LastRecoveryPoint, + BackupSetName: a.BackupSetName, + CreateMode: a.CreateMode, + DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, + IsRehydrate: a.IsRehydrate, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + IsArchiveEnabled: a.IsArchiveEnabled, + PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + } +} + +// GetProtectedItem implements the ProtectedItemClassification interface for type AzureVMWorkloadSAPHanaDBInstanceProtectedItem. +func (a *AzureVMWorkloadSAPHanaDBInstanceProtectedItem) GetProtectedItem() *ProtectedItem { + return &ProtectedItem{ + ProtectedItemType: a.ProtectedItemType, + BackupManagementType: a.BackupManagementType, + WorkloadType: a.WorkloadType, + ContainerName: a.ContainerName, + SourceResourceID: a.SourceResourceID, + PolicyID: a.PolicyID, + LastRecoveryPoint: a.LastRecoveryPoint, + BackupSetName: a.BackupSetName, + CreateMode: a.CreateMode, + DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, + IsRehydrate: a.IsRehydrate, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + IsArchiveEnabled: a.IsArchiveEnabled, + PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + } +} + // AzureVMWorkloadSAPHanaDatabaseProtectableItem - Azure VM workload-specific protectable item representing SAP HANA Database. type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { // REQUIRED; Type of the backup item. @@ -2679,9 +2966,6 @@ type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -2700,9 +2984,6 @@ type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { // Additional information for this backup item. ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -2751,20 +3032,29 @@ type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` - // Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` // Host/Cluster Name for instance or AG ServerName *string `json:"serverName,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadSAPHanaDatabaseProtectedItem. @@ -2800,6 +3090,7 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) GetAzureVMWorkloadProtecte ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -2823,6 +3114,7 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) GetProtectedItem() *Protec ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -2886,6 +3178,79 @@ func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) GetWorkloadItem() *Workload } } +// AzureVMWorkloadSAPHanaHSR - Azure VM workload-specific protectable item representing SAP HANA Dbinstance. +type AzureVMWorkloadSAPHanaHSR struct { + // REQUIRED; Type of the backup item. + ProtectableItemType *string `json:"protectableItemType,omitempty"` + + // Type of backup management to backup an item. + BackupManagementType *string `json:"backupManagementType,omitempty"` + + // Friendly name of the backup item. + FriendlyName *string `json:"friendlyName,omitempty"` + + // Indicates if protectable item is auto-protectable + IsAutoProtectable *bool `json:"isAutoProtectable,omitempty"` + + // Indicates if protectable item is auto-protected + IsAutoProtected *bool `json:"isAutoProtected,omitempty"` + + // Name for instance or AG + ParentName *string `json:"parentName,omitempty"` + + // Parent Unique Name is added to provide the service formatted URI Name of the Parent Only Applicable for data bases where + // the parent would be either Instance or a SQL AG. + ParentUniqueName *string `json:"parentUniqueName,omitempty"` + + // Pre-backup validation for protectable objects + Prebackupvalidation *PreBackupValidation `json:"prebackupvalidation,omitempty"` + + // State of the back up item. + ProtectionState *ProtectionStatus `json:"protectionState,omitempty"` + + // Host/Cluster Name for instance or AG + ServerName *string `json:"serverName,omitempty"` + + // For instance or AG, indicates number of DB's present + Subinquireditemcount *int32 `json:"subinquireditemcount,omitempty"` + + // For instance or AG, indicates number of DB's to be protected + Subprotectableitemcount *int32 `json:"subprotectableitemcount,omitempty"` + + // Type of workload for the backup management + WorkloadType *string `json:"workloadType,omitempty"` +} + +// GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaHSR. +func (a *AzureVMWorkloadSAPHanaHSR) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { + return &AzureVMWorkloadProtectableItem{ + ParentName: a.ParentName, + ParentUniqueName: a.ParentUniqueName, + ServerName: a.ServerName, + IsAutoProtectable: a.IsAutoProtectable, + IsAutoProtected: a.IsAutoProtected, + Subinquireditemcount: a.Subinquireditemcount, + Subprotectableitemcount: a.Subprotectableitemcount, + Prebackupvalidation: a.Prebackupvalidation, + BackupManagementType: a.BackupManagementType, + WorkloadType: a.WorkloadType, + ProtectableItemType: a.ProtectableItemType, + FriendlyName: a.FriendlyName, + ProtectionState: a.ProtectionState, + } +} + +// GetWorkloadProtectableItem implements the WorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaHSR. +func (a *AzureVMWorkloadSAPHanaHSR) GetWorkloadProtectableItem() *WorkloadProtectableItem { + return &WorkloadProtectableItem{ + BackupManagementType: a.BackupManagementType, + WorkloadType: a.WorkloadType, + ProtectableItemType: a.ProtectableItemType, + FriendlyName: a.FriendlyName, + ProtectionState: a.ProtectionState, + } +} + // AzureVMWorkloadSAPHanaSystemProtectableItem - Azure VM workload-specific protectable item representing SAP HANA System. type AzureVMWorkloadSAPHanaSystemProtectableItem struct { // REQUIRED; Type of the backup item. @@ -3171,9 +3536,6 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -3192,9 +3554,6 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { // Additional information for this backup item. ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - // Friendly name of the DB represented by this backup item. - FriendlyName *string `json:"friendlyName,omitempty"` - // Flag to identify whether datasource is protected in archive IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` @@ -3243,20 +3602,29 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { // Backup state of this backup item. ProtectionState *ProtectionState `json:"protectionState,omitempty"` - // Backup status of this backup item. - ProtectionStatus *string `json:"protectionStatus,omitempty"` - // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` // Host/Cluster Name for instance or AG ServerName *string `json:"serverName,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Friendly name of the DB represented by this backup item. + FriendlyName *string `json:"friendlyName,omitempty" azure:"ro"` + + // READ-ONLY; Backup status of this backup item. + ProtectionStatus *string `json:"protectionStatus,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadSQLDatabaseProtectedItem. @@ -3292,6 +3660,7 @@ func (a *AzureVMWorkloadSQLDatabaseProtectedItem) GetAzureVMWorkloadProtectedIte ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -3315,6 +3684,7 @@ func (a *AzureVMWorkloadSQLDatabaseProtectedItem) GetProtectedItem() *ProtectedI ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, IsArchiveEnabled: a.IsArchiveEnabled, PolicyName: a.PolicyName, + SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, } } @@ -3614,7 +3984,7 @@ type AzureWorkloadContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -3820,6 +4190,9 @@ type AzureWorkloadPointInTimeRecoveryPoint struct { // Eligibility of RP to be moved to another tier RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` + // Properties of Recovery Point + RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` + // Recovery point tier information. RecoveryPointTierDetails []*RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` @@ -3846,6 +4219,7 @@ func (a *AzureWorkloadPointInTimeRecoveryPoint) GetAzureWorkloadRecoveryPoint() Type: a.Type, RecoveryPointTierDetails: a.RecoveryPointTierDetails, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, + RecoveryPointProperties: a.RecoveryPointProperties, ObjectType: a.ObjectType, } } @@ -3923,6 +4297,9 @@ type AzureWorkloadRecoveryPoint struct { // Eligibility of RP to be moved to another tier RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` + // Properties of Recovery Point + RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` + // Recovery point tier information. RecoveryPointTierDetails []*RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` @@ -4002,6 +4379,9 @@ type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { // Eligibility of RP to be moved to another tier RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` + // Properties of Recovery Point + RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` + // Recovery point tier information. RecoveryPointTierDetails []*RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` @@ -4024,6 +4404,7 @@ func (a *AzureWorkloadSAPHanaPointInTimeRecoveryPoint) GetAzureWorkloadPointInTi Type: a.Type, RecoveryPointTierDetails: a.RecoveryPointTierDetails, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, + RecoveryPointProperties: a.RecoveryPointProperties, ObjectType: a.ObjectType, } } @@ -4035,6 +4416,7 @@ func (a *AzureWorkloadSAPHanaPointInTimeRecoveryPoint) GetAzureWorkloadRecoveryP Type: a.Type, RecoveryPointTierDetails: a.RecoveryPointTierDetails, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, + RecoveryPointProperties: a.RecoveryPointProperties, ObjectType: a.ObjectType, } } @@ -4212,6 +4594,9 @@ type AzureWorkloadSAPHanaRecoveryPoint struct { // Eligibility of RP to be moved to another tier RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` + // Properties of Recovery Point + RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` + // Recovery point tier information. RecoveryPointTierDetails []*RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` @@ -4229,6 +4614,7 @@ func (a *AzureWorkloadSAPHanaRecoveryPoint) GetAzureWorkloadRecoveryPoint() *Azu Type: a.Type, RecoveryPointTierDetails: a.RecoveryPointTierDetails, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, + RecoveryPointProperties: a.RecoveryPointProperties, ObjectType: a.ObjectType, } } @@ -4438,6 +4824,9 @@ type AzureWorkloadSQLPointInTimeRecoveryPoint struct { // Eligibility of RP to be moved to another tier RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` + // Properties of Recovery Point + RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` + // Recovery point tier information. RecoveryPointTierDetails []*RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` @@ -4458,6 +4847,7 @@ func (a *AzureWorkloadSQLPointInTimeRecoveryPoint) GetAzureWorkloadRecoveryPoint Type: a.Type, RecoveryPointTierDetails: a.RecoveryPointTierDetails, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, + RecoveryPointProperties: a.RecoveryPointProperties, ObjectType: a.ObjectType, } } @@ -4470,6 +4860,7 @@ func (a *AzureWorkloadSQLPointInTimeRecoveryPoint) GetAzureWorkloadSQLRecoveryPo Type: a.Type, RecoveryPointTierDetails: a.RecoveryPointTierDetails, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, + RecoveryPointProperties: a.RecoveryPointProperties, ObjectType: a.ObjectType, } } @@ -4687,6 +5078,9 @@ type AzureWorkloadSQLRecoveryPoint struct { // Eligibility of RP to be moved to another tier RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` + // Properties of Recovery Point + RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` + // Recovery point tier information. RecoveryPointTierDetails []*RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` @@ -4704,6 +5098,7 @@ func (a *AzureWorkloadSQLRecoveryPoint) GetAzureWorkloadRecoveryPoint() *AzureWo Type: a.Type, RecoveryPointTierDetails: a.RecoveryPointTierDetails, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, + RecoveryPointProperties: a.RecoveryPointProperties, ObjectType: a.ObjectType, } } @@ -5122,7 +5517,7 @@ type BackupEnginesClientGetOptions struct { SkipToken *string } -// BackupEnginesClientListOptions contains the optional parameters for the BackupEnginesClient.List method. +// BackupEnginesClientListOptions contains the optional parameters for the BackupEnginesClient.NewListPager method. type BackupEnginesClientListOptions struct { // OData filter options. Filter *string @@ -5130,7 +5525,7 @@ type BackupEnginesClientListOptions struct { SkipToken *string } -// BackupJobsClientListOptions contains the optional parameters for the BackupJobsClient.List method. +// BackupJobsClientListOptions contains the optional parameters for the BackupJobsClient.NewListPager method. type BackupJobsClientListOptions struct { // OData filter options. Filter *string @@ -5175,13 +5570,14 @@ type BackupOperationStatusesClientGetOptions struct { // placeholder for future optional parameters } -// BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.List method. +// BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.NewListPager method. type BackupPoliciesClientListOptions struct { // OData filter options. Filter *string } -// BackupProtectableItemsClientListOptions contains the optional parameters for the BackupProtectableItemsClient.List method. +// BackupProtectableItemsClientListOptions contains the optional parameters for the BackupProtectableItemsClient.NewListPager +// method. type BackupProtectableItemsClientListOptions struct { // OData filter options. Filter *string @@ -5189,7 +5585,8 @@ type BackupProtectableItemsClientListOptions struct { SkipToken *string } -// BackupProtectedItemsClientListOptions contains the optional parameters for the BackupProtectedItemsClient.List method. +// BackupProtectedItemsClientListOptions contains the optional parameters for the BackupProtectedItemsClient.NewListPager +// method. type BackupProtectedItemsClientListOptions struct { // OData filter options. Filter *string @@ -5197,14 +5594,15 @@ type BackupProtectedItemsClientListOptions struct { SkipToken *string } -// BackupProtectionContainersClientListOptions contains the optional parameters for the BackupProtectionContainersClient.List +// BackupProtectionContainersClientListOptions contains the optional parameters for the BackupProtectionContainersClient.NewListPager // method. type BackupProtectionContainersClientListOptions struct { // OData filter options. Filter *string } -// BackupProtectionIntentClientListOptions contains the optional parameters for the BackupProtectionIntentClient.List method. +// BackupProtectionIntentClientListOptions contains the optional parameters for the BackupProtectionIntentClient.NewListPager +// method. type BackupProtectionIntentClientListOptions struct { // OData filter options. Filter *string @@ -5520,7 +5918,8 @@ type BackupStatusResponse struct { VaultID *string `json:"vaultId,omitempty"` } -// BackupUsageSummariesClientListOptions contains the optional parameters for the BackupUsageSummariesClient.List method. +// BackupUsageSummariesClientListOptions contains the optional parameters for the BackupUsageSummariesClient.NewListPager +// method. type BackupUsageSummariesClientListOptions struct { // OData filter options. Filter *string @@ -5528,7 +5927,7 @@ type BackupUsageSummariesClientListOptions struct { SkipToken *string } -// BackupWorkloadItemsClientListOptions contains the optional parameters for the BackupWorkloadItemsClient.List method. +// BackupWorkloadItemsClientListOptions contains the optional parameters for the BackupWorkloadItemsClient.NewListPager method. type BackupWorkloadItemsClientListOptions struct { // OData filter options. Filter *string @@ -5646,30 +6045,6 @@ type ClientScriptForConnect struct { URL *string `json:"url,omitempty"` } -// CloudError - An error response from the Container Instance service. -type CloudError struct { - // The error object. - Error *CloudErrorBody `json:"error,omitempty"` -} - -// CloudErrorBody - An error response from the Container Instance service. -type CloudErrorBody struct { - // READ-ONLY; The error additional info. - AdditionalInfo []*ErrorAdditionalInfo `json:"additionalInfo,omitempty" azure:"ro"` - - // READ-ONLY; An identifier for the error. Codes are invariant and are intended to be consumed programmatically. - Code *string `json:"code,omitempty" azure:"ro"` - - // READ-ONLY; A list of additional details about the error. - Details []*CloudErrorBody `json:"details,omitempty" azure:"ro"` - - // READ-ONLY; A message describing the error, intended to be suitable for display in a user interface. - Message *string `json:"message,omitempty" azure:"ro"` - - // READ-ONLY; The target of the particular error. For example, the name of the property in error. - Target *string `json:"target,omitempty" azure:"ro"` -} - // ContainerIdentityInfo - Container identity information type ContainerIdentityInfo struct { // Protection container identity - AAD Tenant @@ -5699,9 +6074,6 @@ type DPMProtectedItem struct { // Backup Management server protecting this backup item BackupEngineName *string `json:"backupEngineName,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -5750,11 +6122,17 @@ type DPMProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetProtectedItem implements the ProtectedItemClassification interface for type DPMProtectedItem. @@ -5777,6 +6155,7 @@ func (d *DPMProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: d.ResourceGuardOperationRequests, IsArchiveEnabled: d.IsArchiveEnabled, PolicyName: d.PolicyName, + SoftDeleteRetentionPeriod: d.SoftDeleteRetentionPeriod, } } @@ -5854,6 +6233,13 @@ type Day struct { IsLast *bool `json:"isLast,omitempty"` } +// DeletedProtectionContainersClientListOptions contains the optional parameters for the DeletedProtectionContainersClient.NewListPager +// method. +type DeletedProtectionContainersClientListOptions struct { + // OData filter options. + Filter *string +} + type DiskExclusionProperties struct { // List of Disks' Logical Unit Numbers (LUN) to be used for VM Protection. DiskLunList []*int32 `json:"diskLunList,omitempty"` @@ -5957,7 +6343,7 @@ type DpmContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -6139,7 +6525,7 @@ type EncryptionDetails struct { // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info interface{} `json:"info,omitempty" azure:"ro"` + Info any `json:"info,omitempty" azure:"ro"` // READ-ONLY; The additional info type. Type *string `json:"type,omitempty" azure:"ro"` @@ -6226,7 +6612,7 @@ type GenericContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -6279,9 +6665,6 @@ type GenericProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -6336,14 +6719,20 @@ type GenericProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // Loosely coupled (type, value) associations (example - parent of a protected item) SourceAssociations map[string]*string `json:"sourceAssociations,omitempty"` // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetProtectedItem implements the ProtectedItemClassification interface for type GenericProtectedItem. @@ -6366,6 +6755,7 @@ func (g *GenericProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: g.ResourceGuardOperationRequests, IsArchiveEnabled: g.IsArchiveEnabled, PolicyName: g.PolicyName, + SoftDeleteRetentionPeriod: g.SoftDeleteRetentionPeriod, } } @@ -6410,6 +6800,9 @@ type GenericRecoveryPoint struct { // Additional information associated with this backup copy. RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` + // Properties of Recovery Point + RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` + // Time at which this backup copy was created. RecoveryPointTime *time.Time `json:"recoveryPointTime,omitempty"` @@ -6499,7 +6892,7 @@ type IaaSVMContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -6665,6 +7058,9 @@ type IaasVMRecoveryPoint struct { // Eligibility of RP to be moved to another tier RecoveryPointMoveReadinessInfo map[string]*RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` + // Properties of Recovery Point + RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` + // Recovery point tier information. RecoveryPointTierDetails []*RecoveryPointTierInformationV2 `json:"recoveryPointTierDetails,omitempty"` @@ -7192,7 +7588,7 @@ type MabContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Agent version of this container. AgentVersion *string `json:"agentVersion,omitempty"` @@ -7275,9 +7671,6 @@ type MabFileFolderProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -7338,11 +7731,17 @@ type MabFileFolderProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetProtectedItem implements the ProtectedItemClassification interface for type MabFileFolderProtectedItem. @@ -7365,6 +7764,7 @@ func (m *MabFileFolderProtectedItem) GetProtectedItem() *ProtectedItem { ResourceGuardOperationRequests: m.ResourceGuardOperationRequests, IsArchiveEnabled: m.IsArchiveEnabled, PolicyName: m.PolicyName, + SoftDeleteRetentionPeriod: m.SoftDeleteRetentionPeriod, } } @@ -7742,7 +8142,7 @@ type OperationWorkerResponse struct { StatusCode *HTTPStatusCode `json:"statusCode,omitempty"` } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. type OperationsClientListOptions struct { // placeholder for future optional parameters } @@ -7941,7 +8341,7 @@ type ProtectableContainer struct { // REQUIRED; Type of the container. The value of this property for // 1. Compute Azure VM is Microsoft.Compute/virtualMachines // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines - ProtectableContainerType *ContainerType `json:"protectableContainerType,omitempty"` + ProtectableContainerType *ProtectableContainerType `json:"protectableContainerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -7992,7 +8392,8 @@ type ProtectableContainerResourceList struct { Value []*ProtectableContainerResource `json:"value,omitempty"` } -// ProtectableContainersClientListOptions contains the optional parameters for the ProtectableContainersClient.List method. +// ProtectableContainersClientListOptions contains the optional parameters for the ProtectableContainersClient.NewListPager +// method. type ProtectableContainersClientListOptions struct { // OData filter options. Filter *string @@ -8002,8 +8403,9 @@ type ProtectableContainersClientListOptions struct { // Call the interface's GetProtectedItem() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: // - *AzureFileshareProtectedItem, *AzureIaaSClassicComputeVMProtectedItem, *AzureIaaSComputeVMProtectedItem, *AzureIaaSVMProtectedItem, -// - *AzureSQLProtectedItem, *AzureVMWorkloadProtectedItem, *AzureVMWorkloadSAPAseDatabaseProtectedItem, *AzureVMWorkloadSAPHanaDatabaseProtectedItem, -// - *AzureVMWorkloadSQLDatabaseProtectedItem, *DPMProtectedItem, *GenericProtectedItem, *MabFileFolderProtectedItem, *ProtectedItem +// - *AzureSQLProtectedItem, *AzureVMWorkloadProtectedItem, *AzureVMWorkloadSAPAseDatabaseProtectedItem, *AzureVMWorkloadSAPHanaDBInstanceProtectedItem, +// - *AzureVMWorkloadSAPHanaDatabaseProtectedItem, *AzureVMWorkloadSQLDatabaseProtectedItem, *DPMProtectedItem, *GenericProtectedItem, +// - *MabFileFolderProtectedItem, *ProtectedItem type ProtectedItemClassification interface { // GetProtectedItem returns the ProtectedItem content of the underlying type. GetProtectedItem() *ProtectedItem @@ -8014,9 +8416,6 @@ type ProtectedItem struct { // REQUIRED; backup item type. ProtectedItemType *string `json:"protectedItemType,omitempty"` - // Type of backup management for the backed up item. - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - // Name of the backup set the backup item belongs to BackupSetName *string `json:"backupSetName,omitempty"` @@ -8056,11 +8455,17 @@ type ProtectedItem struct { // ResourceGuardOperationRequests on which LAC check will be performed ResourceGuardOperationRequests []*string `json:"resourceGuardOperationRequests,omitempty"` + // Soft delete retention period in days + SoftDeleteRetentionPeriod *int32 `json:"softDeleteRetentionPeriod,omitempty"` + // ARM ID of the resource to be backed up. SourceResourceID *string `json:"sourceResourceId,omitempty"` - // Type of workload this item represents. - WorkloadType *DataSourceType `json:"workloadType,omitempty"` + // READ-ONLY; Type of backup management for the backed up item. + BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty" azure:"ro"` + + // READ-ONLY; Type of workload this item represents. + WorkloadType *DataSourceType `json:"workloadType,omitempty" azure:"ro"` } // GetProtectedItem implements the ProtectedItemClassification interface for type ProtectedItem. @@ -8176,7 +8581,7 @@ type ProtectionContainer struct { // 2. Classic Compute Azure VM is Microsoft.ClassicCompute/virtualMachines 3. Windows // machines (like MAB, DPM etc) is Windows 4. Azure SQL instance is AzureSqlContainer. 5. Storage containers is StorageContainer. // 6. Azure workload Backup is VMAppContainer - ContainerType *ContainerType `json:"containerType,omitempty"` + ContainerType *ProtectableContainerType `json:"containerType,omitempty"` // Type of backup management for the container. BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` @@ -8515,6 +8920,15 @@ type RecoveryPointMoveReadinessInfo struct { IsReadyForMove *bool `json:"isReadyForMove,omitempty"` } +// RecoveryPointProperties - Properties of Recovery Point +type RecoveryPointProperties struct { + // Expiry time of Recovery Point in UTC. + ExpiryTime *string `json:"expiryTime,omitempty"` + + // Rule name tagged on Recovery Point that governs life cycle + RuleName *string `json:"ruleName,omitempty"` +} + // RecoveryPointRehydrationInfo - RP Rehydration Info type RecoveryPointRehydrationInfo struct { // Rehydration Priority @@ -8586,13 +9000,13 @@ type RecoveryPointsClientGetOptions struct { // placeholder for future optional parameters } -// RecoveryPointsClientListOptions contains the optional parameters for the RecoveryPointsClient.List method. +// RecoveryPointsClientListOptions contains the optional parameters for the RecoveryPointsClient.NewListPager method. type RecoveryPointsClientListOptions struct { // OData filter options. Filter *string } -// RecoveryPointsRecommendedForMoveClientListOptions contains the optional parameters for the RecoveryPointsRecommendedForMoveClient.List +// RecoveryPointsRecommendedForMoveClientListOptions contains the optional parameters for the RecoveryPointsRecommendedForMoveClient.NewListPager // method. type RecoveryPointsRecommendedForMoveClientListOptions struct { // placeholder for future optional parameters @@ -8624,7 +9038,7 @@ type ResourceGuardOperationDetail struct { VaultCriticalOperation *string `json:"vaultCriticalOperation,omitempty"` } -// ResourceGuardProxiesClientGetOptions contains the optional parameters for the ResourceGuardProxiesClient.Get method. +// ResourceGuardProxiesClientGetOptions contains the optional parameters for the ResourceGuardProxiesClient.NewGetPager method. type ResourceGuardProxiesClientGetOptions struct { // placeholder for future optional parameters } @@ -8950,6 +9364,10 @@ type SubProtectionPolicy struct { // Backup schedule specified as part of backup policy. SchedulePolicy SchedulePolicyClassification `json:"schedulePolicy,omitempty"` + + // Tiering policy to automatically move RPs to another tier. Key is Target Tier, defined in RecoveryPointTierType enum. Tiering + // policy specifies the criteria to move RP to the target tier. + TieringPolicy map[string]*TieringPolicy `json:"tieringPolicy,omitempty"` } // TargetAFSRestoreInfo - Target Azure File Share Info. @@ -8976,6 +9394,23 @@ type TargetRestoreInfo struct { TargetDirectoryForFileRestore *string `json:"targetDirectoryForFileRestore,omitempty"` } +// TieringPolicy - Tiering Policy for a target tier. If the policy is not specified for a given target tier, service retains +// the existing configured tiering policy for that tier +type TieringPolicy struct { + // Number of days/weeks/months/years to retain backups in current tier before tiering. Used only if TieringMode is set to + // TierAfter + Duration *int32 `json:"duration,omitempty"` + + // Retention duration type: days/weeks/months/years Used only if TieringMode is set to TierAfter + DurationType *RetentionDurationType `json:"durationType,omitempty"` + + // Tiering Mode to control automatic tiering of recovery points. Supported values are: + // 1. TierRecommended: Tier all recovery points recommended to be tiered + // 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below. + // 3. DoNotTier: Do not tier any recovery points + TieringMode *TieringMode `json:"tieringMode,omitempty"` +} + // TokenInformation - The token information details. type TokenInformation struct { // Expiry time of token. @@ -9324,9 +9759,9 @@ type WorkloadItemResourceList struct { // Call the interface's GetWorkloadProtectableItem() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: // - *AzureFileShareProtectableItem, *AzureIaaSClassicComputeVMProtectableItem, *AzureIaaSComputeVMProtectableItem, *AzureVMWorkloadProtectableItem, -// - *AzureVMWorkloadSAPAseSystemProtectableItem, *AzureVMWorkloadSAPHanaDatabaseProtectableItem, *AzureVMWorkloadSAPHanaSystemProtectableItem, -// - *AzureVMWorkloadSQLAvailabilityGroupProtectableItem, *AzureVMWorkloadSQLDatabaseProtectableItem, *AzureVMWorkloadSQLInstanceProtectableItem, -// - *IaaSVMProtectableItem, *WorkloadProtectableItem +// - *AzureVMWorkloadSAPAseSystemProtectableItem, *AzureVMWorkloadSAPHanaDBInstance, *AzureVMWorkloadSAPHanaDatabaseProtectableItem, +// - *AzureVMWorkloadSAPHanaHSR, *AzureVMWorkloadSAPHanaSystemProtectableItem, *AzureVMWorkloadSQLAvailabilityGroupProtectableItem, +// - *AzureVMWorkloadSQLDatabaseProtectableItem, *AzureVMWorkloadSQLInstanceProtectableItem, *IaaSVMProtectableItem, *WorkloadProtectableItem type WorkloadProtectableItemClassification interface { // GetWorkloadProtectableItem returns the WorkloadProtectableItem content of the underlying type. GetWorkloadProtectableItem() *WorkloadProtectableItem diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_models_serde.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.go similarity index 64% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_models_serde.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.go index 316f968984d1..de5a4e06ac31 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_models_serde.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.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 armrecoveryservicesbackup @@ -18,7 +19,7 @@ import ( // MarshalJSON implements the json.Marshaller interface for type AzureBackupGoalFeatureSupportRequest. func (a AzureBackupGoalFeatureSupportRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["featureType"] = "AzureBackupGoals" return json.Marshal(objectMap) } @@ -45,11 +46,11 @@ func (a *AzureBackupGoalFeatureSupportRequest) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type AzureBackupServerContainer. func (a AzureBackupServerContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "canReRegister", a.CanReRegister) populate(objectMap, "containerId", a.ContainerID) - objectMap["containerType"] = ContainerTypeAzureBackupServerContainer + objectMap["containerType"] = ProtectableContainerTypeAzureBackupServerContainer populate(objectMap, "dpmAgentVersion", a.DpmAgentVersion) populate(objectMap, "dpmServers", a.DpmServers) populate(objectMap, "extendedInfo", a.ExtendedInfo) @@ -124,7 +125,7 @@ func (a *AzureBackupServerContainer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureBackupServerEngine. func (a AzureBackupServerEngine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "azureBackupAgentVersion", a.AzureBackupAgentVersion) populate(objectMap, "backupEngineId", a.BackupEngineID) populate(objectMap, "backupEngineState", a.BackupEngineState) @@ -199,7 +200,7 @@ func (a *AzureBackupServerEngine) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureFileShareBackupRequest. func (a AzureFileShareBackupRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["objectType"] = "AzureFileShareBackupRequest" populateTimeRFC3339(objectMap, "recoveryPointExpiryTimeInUTC", a.RecoveryPointExpiryTimeInUTC) return json.Marshal(objectMap) @@ -230,7 +231,7 @@ func (a *AzureFileShareBackupRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureFileShareProtectableItem. func (a AzureFileShareProtectableItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "azureFileShareType", a.AzureFileShareType) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) @@ -285,7 +286,7 @@ func (a *AzureFileShareProtectableItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureFileShareProtectionPolicy. func (a AzureFileShareProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["backupManagementType"] = "AzureStorage" populate(objectMap, "protectedItemsCount", a.ProtectedItemsCount) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) @@ -336,7 +337,7 @@ func (a *AzureFileShareProtectionPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureFileShareProvisionILRRequest. func (a AzureFileShareProvisionILRRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["objectType"] = "AzureFileShareProvisionILRRequest" populate(objectMap, "recoveryPointId", a.RecoveryPointID) populate(objectMap, "sourceResourceId", a.SourceResourceID) @@ -371,9 +372,10 @@ func (a *AzureFileShareProvisionILRRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureFileShareRecoveryPoint. func (a AzureFileShareRecoveryPoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "fileShareSnapshotUri", a.FileShareSnapshotURI) objectMap["objectType"] = "AzureFileShareRecoveryPoint" + populate(objectMap, "recoveryPointProperties", a.RecoveryPointProperties) populate(objectMap, "recoveryPointSizeInGB", a.RecoveryPointSizeInGB) populateTimeRFC3339(objectMap, "recoveryPointTime", a.RecoveryPointTime) populate(objectMap, "recoveryPointType", a.RecoveryPointType) @@ -395,6 +397,9 @@ func (a *AzureFileShareRecoveryPoint) UnmarshalJSON(data []byte) error { case "objectType": err = unpopulate(val, "ObjectType", &a.ObjectType) delete(rawMsg, key) + case "recoveryPointProperties": + err = unpopulate(val, "RecoveryPointProperties", &a.RecoveryPointProperties) + delete(rawMsg, key) case "recoveryPointSizeInGB": err = unpopulate(val, "RecoveryPointSizeInGB", &a.RecoveryPointSizeInGB) delete(rawMsg, key) @@ -414,7 +419,7 @@ func (a *AzureFileShareRecoveryPoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureFileShareRestoreRequest. func (a AzureFileShareRestoreRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "copyOptions", a.CopyOptions) objectMap["objectType"] = "AzureFileShareRestoreRequest" populate(objectMap, "recoveryType", a.RecoveryType) @@ -465,7 +470,7 @@ func (a *AzureFileShareRestoreRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureFileshareProtectedItem. func (a AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "backupSetName", a.BackupSetName) populate(objectMap, "containerName", a.ContainerName) @@ -488,6 +493,7 @@ func (a AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -568,6 +574,9 @@ func (a *AzureFileshareProtectedItem) UnmarshalJSON(data []byte) error { case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -584,7 +593,7 @@ func (a *AzureFileshareProtectedItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureFileshareProtectedItemExtendedInfo. func (a AzureFileshareProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "oldestRecoveryPoint", a.OldestRecoveryPoint) populate(objectMap, "policyState", a.PolicyState) populate(objectMap, "recoveryPointCount", a.RecoveryPointCount) @@ -627,9 +636,9 @@ func (a *AzureFileshareProtectedItemExtendedInfo) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type AzureIaaSClassicComputeVMContainer. func (a AzureIaaSClassicComputeVMContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeMicrosoftClassicComputeVirtualMachines + objectMap["containerType"] = ProtectableContainerTypeMicrosoftClassicComputeVirtualMachines populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) populate(objectMap, "protectableObjectType", a.ProtectableObjectType) @@ -686,7 +695,7 @@ func (a *AzureIaaSClassicComputeVMContainer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureIaaSClassicComputeVMProtectableItem. func (a AzureIaaSClassicComputeVMProtectableItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) objectMap["protectableItemType"] = "Microsoft.ClassicCompute/virtualMachines" @@ -741,7 +750,7 @@ func (a *AzureIaaSClassicComputeVMProtectableItem) UnmarshalJSON(data []byte) er // MarshalJSON implements the json.Marshaller interface for type AzureIaaSClassicComputeVMProtectedItem. func (a AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "backupSetName", a.BackupSetName) populate(objectMap, "containerName", a.ContainerName) @@ -768,6 +777,7 @@ func (a AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "virtualMachineId", a.VirtualMachineID) populate(objectMap, "workloadType", a.WorkloadType) @@ -861,6 +871,9 @@ func (a *AzureIaaSClassicComputeVMProtectedItem) UnmarshalJSON(data []byte) erro case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -880,9 +893,9 @@ func (a *AzureIaaSClassicComputeVMProtectedItem) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type AzureIaaSComputeVMContainer. func (a AzureIaaSComputeVMContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeMicrosoftComputeVirtualMachines + objectMap["containerType"] = ProtectableContainerTypeMicrosoftComputeVirtualMachines populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) populate(objectMap, "protectableObjectType", a.ProtectableObjectType) @@ -939,7 +952,7 @@ func (a *AzureIaaSComputeVMContainer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureIaaSComputeVMProtectableItem. func (a AzureIaaSComputeVMProtectableItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) objectMap["protectableItemType"] = "Microsoft.Compute/virtualMachines" @@ -994,7 +1007,7 @@ func (a *AzureIaaSComputeVMProtectableItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureIaaSComputeVMProtectedItem. func (a AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "backupSetName", a.BackupSetName) populate(objectMap, "containerName", a.ContainerName) @@ -1021,6 +1034,7 @@ func (a AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "virtualMachineId", a.VirtualMachineID) populate(objectMap, "workloadType", a.WorkloadType) @@ -1114,6 +1128,9 @@ func (a *AzureIaaSComputeVMProtectedItem) UnmarshalJSON(data []byte) error { case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -1133,7 +1150,7 @@ func (a *AzureIaaSComputeVMProtectedItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureIaaSVMErrorInfo. func (a AzureIaaSVMErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "errorCode", a.ErrorCode) populate(objectMap, "errorString", a.ErrorString) populate(objectMap, "errorTitle", a.ErrorTitle) @@ -1141,9 +1158,38 @@ func (a AzureIaaSVMErrorInfo) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureIaaSVMErrorInfo. +func (a *AzureIaaSVMErrorInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorCode": + err = unpopulate(val, "ErrorCode", &a.ErrorCode) + delete(rawMsg, key) + case "errorString": + err = unpopulate(val, "ErrorString", &a.ErrorString) + delete(rawMsg, key) + case "errorTitle": + err = unpopulate(val, "ErrorTitle", &a.ErrorTitle) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &a.Recommendations) + 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 AzureIaaSVMHealthDetails. func (a AzureIaaSVMHealthDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "code", a.Code) populate(objectMap, "message", a.Message) populate(objectMap, "recommendations", a.Recommendations) @@ -1151,9 +1197,38 @@ func (a AzureIaaSVMHealthDetails) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureIaaSVMHealthDetails. +func (a *AzureIaaSVMHealthDetails) UnmarshalJSON(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 "code": + err = unpopulate(val, "Code", &a.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &a.Message) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &a.Recommendations) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &a.Title) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type AzureIaaSVMJob. func (a AzureIaaSVMJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionsInfo", a.ActionsInfo) populate(objectMap, "activityId", a.ActivityID) populate(objectMap, "backupManagementType", a.BackupManagementType) @@ -1236,7 +1311,7 @@ func (a *AzureIaaSVMJob) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureIaaSVMJobExtendedInfo. func (a AzureIaaSVMJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dynamicErrorMessage", a.DynamicErrorMessage) populate(objectMap, "estimatedRemainingDuration", a.EstimatedRemainingDuration) populate(objectMap, "internalPropertyBag", a.InternalPropertyBag) @@ -1246,9 +1321,44 @@ func (a AzureIaaSVMJobExtendedInfo) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureIaaSVMJobExtendedInfo. +func (a *AzureIaaSVMJobExtendedInfo) UnmarshalJSON(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 "dynamicErrorMessage": + err = unpopulate(val, "DynamicErrorMessage", &a.DynamicErrorMessage) + delete(rawMsg, key) + case "estimatedRemainingDuration": + err = unpopulate(val, "EstimatedRemainingDuration", &a.EstimatedRemainingDuration) + delete(rawMsg, key) + case "internalPropertyBag": + err = unpopulate(val, "InternalPropertyBag", &a.InternalPropertyBag) + delete(rawMsg, key) + case "progressPercentage": + err = unpopulate(val, "ProgressPercentage", &a.ProgressPercentage) + delete(rawMsg, key) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &a.PropertyBag) + delete(rawMsg, key) + case "tasksList": + err = unpopulate(val, "TasksList", &a.TasksList) + 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 AzureIaaSVMJobTaskDetails. func (a AzureIaaSVMJobTaskDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "duration", a.Duration) populateTimeRFC3339(objectMap, "endTime", a.EndTime) populate(objectMap, "instanceId", a.InstanceID) @@ -1303,7 +1413,7 @@ func (a *AzureIaaSVMJobTaskDetails) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureIaaSVMJobV2. func (a AzureIaaSVMJobV2) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionsInfo", a.ActionsInfo) populate(objectMap, "activityId", a.ActivityID) populate(objectMap, "backupManagementType", a.BackupManagementType) @@ -1382,7 +1492,7 @@ func (a *AzureIaaSVMJobV2) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureIaaSVMProtectedItem. func (a AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "backupSetName", a.BackupSetName) populate(objectMap, "containerName", a.ContainerName) @@ -1409,6 +1519,7 @@ func (a AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "virtualMachineId", a.VirtualMachineID) populate(objectMap, "workloadType", a.WorkloadType) @@ -1502,6 +1613,9 @@ func (a *AzureIaaSVMProtectedItem) UnmarshalJSON(data []byte) error { case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -1521,8 +1635,11 @@ func (a *AzureIaaSVMProtectedItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureIaaSVMProtectedItemExtendedInfo. func (a AzureIaaSVMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "newestRecoveryPointInArchive", a.NewestRecoveryPointInArchive) populateTimeRFC3339(objectMap, "oldestRecoveryPoint", a.OldestRecoveryPoint) + populateTimeRFC3339(objectMap, "oldestRecoveryPointInArchive", a.OldestRecoveryPointInArchive) + populateTimeRFC3339(objectMap, "oldestRecoveryPointInVault", a.OldestRecoveryPointInVault) populate(objectMap, "policyInconsistent", a.PolicyInconsistent) populate(objectMap, "recoveryPointCount", a.RecoveryPointCount) return json.Marshal(objectMap) @@ -1537,9 +1654,18 @@ func (a *AzureIaaSVMProtectedItemExtendedInfo) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { + case "newestRecoveryPointInArchive": + err = unpopulateTimeRFC3339(val, "NewestRecoveryPointInArchive", &a.NewestRecoveryPointInArchive) + delete(rawMsg, key) case "oldestRecoveryPoint": err = unpopulateTimeRFC3339(val, "OldestRecoveryPoint", &a.OldestRecoveryPoint) delete(rawMsg, key) + case "oldestRecoveryPointInArchive": + err = unpopulateTimeRFC3339(val, "OldestRecoveryPointInArchive", &a.OldestRecoveryPointInArchive) + delete(rawMsg, key) + case "oldestRecoveryPointInVault": + err = unpopulateTimeRFC3339(val, "OldestRecoveryPointInVault", &a.OldestRecoveryPointInVault) + delete(rawMsg, key) case "policyInconsistent": err = unpopulate(val, "PolicyInconsistent", &a.PolicyInconsistent) delete(rawMsg, key) @@ -1556,7 +1682,7 @@ func (a *AzureIaaSVMProtectedItemExtendedInfo) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type AzureIaaSVMProtectionPolicy. func (a AzureIaaSVMProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["backupManagementType"] = "AzureIaasVM" populate(objectMap, "instantRPDetails", a.InstantRPDetails) populate(objectMap, "instantRpRetentionRangeInDays", a.InstantRpRetentionRangeInDays) @@ -1565,6 +1691,7 @@ func (a AzureIaaSVMProtectionPolicy) MarshalJSON() ([]byte, error) { populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "retentionPolicy", a.RetentionPolicy) populate(objectMap, "schedulePolicy", a.SchedulePolicy) + populate(objectMap, "tieringPolicy", a.TieringPolicy) populate(objectMap, "timeZone", a.TimeZone) return json.Marshal(objectMap) } @@ -1602,6 +1729,9 @@ func (a *AzureIaaSVMProtectionPolicy) UnmarshalJSON(data []byte) error { case "schedulePolicy": a.SchedulePolicy, err = unmarshalSchedulePolicyClassification(val) delete(rawMsg, key) + case "tieringPolicy": + err = unpopulate(val, "TieringPolicy", &a.TieringPolicy) + delete(rawMsg, key) case "timeZone": err = unpopulate(val, "TimeZone", &a.TimeZone) delete(rawMsg, key) @@ -1615,7 +1745,7 @@ func (a *AzureIaaSVMProtectionPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureRecoveryServiceVaultProtectionIntent. func (a AzureRecoveryServiceVaultProtectionIntent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "itemId", a.ItemID) populate(objectMap, "policyId", a.PolicyID) @@ -1662,7 +1792,7 @@ func (a *AzureRecoveryServiceVaultProtectionIntent) UnmarshalJSON(data []byte) e // MarshalJSON implements the json.Marshaller interface for type AzureResourceProtectionIntent. func (a AzureResourceProtectionIntent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "itemId", a.ItemID) @@ -1713,9 +1843,9 @@ func (a *AzureResourceProtectionIntent) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureSQLAGWorkloadContainerProtectionContainer. func (a AzureSQLAGWorkloadContainerProtectionContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeSQLAGWorkLoadContainer + objectMap["containerType"] = ProtectableContainerTypeSQLAGWorkLoadContainer populate(objectMap, "extendedInfo", a.ExtendedInfo) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) @@ -1780,9 +1910,9 @@ func (a *AzureSQLAGWorkloadContainerProtectionContainer) UnmarshalJSON(data []by // MarshalJSON implements the json.Marshaller interface for type AzureSQLContainer. func (a AzureSQLContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeAzureSQLContainer + objectMap["containerType"] = ProtectableContainerTypeAzureSQLContainer populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) populate(objectMap, "protectableObjectType", a.ProtectableObjectType) @@ -1827,7 +1957,7 @@ func (a *AzureSQLContainer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureSQLProtectedItem. func (a AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "backupSetName", a.BackupSetName) populate(objectMap, "containerName", a.ContainerName) @@ -1846,6 +1976,7 @@ func (a AzureSQLProtectedItem) MarshalJSON() ([]byte, error) { objectMap["protectedItemType"] = "Microsoft.Sql/servers/databases" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -1914,6 +2045,9 @@ func (a *AzureSQLProtectedItem) UnmarshalJSON(data []byte) error { case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -1930,7 +2064,7 @@ func (a *AzureSQLProtectedItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureSQLProtectedItemExtendedInfo. func (a AzureSQLProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populateTimeRFC3339(objectMap, "oldestRecoveryPoint", a.OldestRecoveryPoint) populate(objectMap, "policyState", a.PolicyState) populate(objectMap, "recoveryPointCount", a.RecoveryPointCount) @@ -1965,7 +2099,7 @@ func (a *AzureSQLProtectedItemExtendedInfo) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureSQLProtectionPolicy. func (a AzureSQLProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["backupManagementType"] = "AzureSql" populate(objectMap, "protectedItemsCount", a.ProtectedItemsCount) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) @@ -2004,10 +2138,10 @@ func (a *AzureSQLProtectionPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureStorageContainer. func (a AzureStorageContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "acquireStorageAccountLock", a.AcquireStorageAccountLock) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeStorageContainer + objectMap["containerType"] = ProtectableContainerTypeStorageContainer populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) populate(objectMap, "protectableObjectType", a.ProtectableObjectType) @@ -2071,16 +2205,42 @@ func (a *AzureStorageContainer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureStorageErrorInfo. func (a AzureStorageErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "errorCode", a.ErrorCode) populate(objectMap, "errorString", a.ErrorString) populate(objectMap, "recommendations", a.Recommendations) return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureStorageErrorInfo. +func (a *AzureStorageErrorInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "errorCode": + err = unpopulate(val, "ErrorCode", &a.ErrorCode) + delete(rawMsg, key) + case "errorString": + err = unpopulate(val, "ErrorString", &a.ErrorString) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &a.Recommendations) + 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 AzureStorageJob. func (a AzureStorageJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "actionsInfo", a.ActionsInfo) populate(objectMap, "activityId", a.ActivityID) populate(objectMap, "backupManagementType", a.BackupManagementType) @@ -2163,21 +2323,78 @@ func (a *AzureStorageJob) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureStorageJobExtendedInfo. func (a AzureStorageJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dynamicErrorMessage", a.DynamicErrorMessage) populate(objectMap, "propertyBag", a.PropertyBag) populate(objectMap, "tasksList", a.TasksList) return json.Marshal(objectMap) } +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureStorageJobExtendedInfo. +func (a *AzureStorageJobExtendedInfo) UnmarshalJSON(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 "dynamicErrorMessage": + err = unpopulate(val, "DynamicErrorMessage", &a.DynamicErrorMessage) + delete(rawMsg, key) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &a.PropertyBag) + delete(rawMsg, key) + case "tasksList": + err = unpopulate(val, "TasksList", &a.TasksList) + 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 AzureStorageJobTaskDetails. +func (a AzureStorageJobTaskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "status", a.Status) + populate(objectMap, "taskId", a.TaskID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureStorageJobTaskDetails. +func (a *AzureStorageJobTaskDetails) UnmarshalJSON(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 "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "taskId": + err = unpopulate(val, "TaskID", &a.TaskID) + 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 AzureStorageProtectableContainer. func (a AzureStorageProtectableContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "containerId", a.ContainerID) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) - objectMap["protectableContainerType"] = ContainerTypeStorageContainer + objectMap["protectableContainerType"] = ProtectableContainerTypeStorageContainer return json.Marshal(objectMap) } @@ -2215,12 +2432,12 @@ func (a *AzureStorageProtectableContainer) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureVMAppContainerProtectableContainer. func (a AzureVMAppContainerProtectableContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "containerId", a.ContainerID) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) - objectMap["protectableContainerType"] = ContainerTypeVMAppContainer + objectMap["protectableContainerType"] = ProtectableContainerTypeVMAppContainer return json.Marshal(objectMap) } @@ -2258,9 +2475,9 @@ func (a *AzureVMAppContainerProtectableContainer) UnmarshalJSON(data []byte) err // MarshalJSON implements the json.Marshaller interface for type AzureVMAppContainerProtectionContainer. func (a AzureVMAppContainerProtectionContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeVMAppContainer + objectMap["containerType"] = ProtectableContainerTypeVMAppContainer populate(objectMap, "extendedInfo", a.ExtendedInfo) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "healthStatus", a.HealthStatus) @@ -2325,7 +2542,7 @@ func (a *AzureVMAppContainerProtectionContainer) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type AzureVMResourceFeatureSupportRequest. func (a AzureVMResourceFeatureSupportRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["featureType"] = "AzureVMResourceBackup" populate(objectMap, "vmSku", a.VMSKU) populate(objectMap, "vmSize", a.VMSize) @@ -2358,9 +2575,36 @@ func (a *AzureVMResourceFeatureSupportRequest) UnmarshalJSON(data []byte) error return nil } +// MarshalJSON implements the json.Marshaller interface for type AzureVMResourceFeatureSupportResponse. +func (a AzureVMResourceFeatureSupportResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "supportStatus", a.SupportStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMResourceFeatureSupportResponse. +func (a *AzureVMResourceFeatureSupportResponse) UnmarshalJSON(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 "supportStatus": + err = unpopulate(val, "SupportStatus", &a.SupportStatus) + 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 AzureVMWorkloadItem. func (a AzureVMWorkloadItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) @@ -2423,7 +2667,7 @@ func (a *AzureVMWorkloadItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadProtectableItem. func (a AzureVMWorkloadProtectableItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) @@ -2498,7 +2742,7 @@ func (a *AzureVMWorkloadProtectableItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadProtectedItem. func (a AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "backupSetName", a.BackupSetName) populate(objectMap, "containerName", a.ContainerName) @@ -2527,6 +2771,7 @@ func (a AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -2625,6 +2870,9 @@ func (a *AzureVMWorkloadProtectedItem) UnmarshalJSON(data []byte) error { case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -2641,8 +2889,11 @@ func (a *AzureVMWorkloadProtectedItem) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadProtectedItemExtendedInfo. func (a AzureVMWorkloadProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "newestRecoveryPointInArchive", a.NewestRecoveryPointInArchive) populateTimeRFC3339(objectMap, "oldestRecoveryPoint", a.OldestRecoveryPoint) + populateTimeRFC3339(objectMap, "oldestRecoveryPointInArchive", a.OldestRecoveryPointInArchive) + populateTimeRFC3339(objectMap, "oldestRecoveryPointInVault", a.OldestRecoveryPointInVault) populate(objectMap, "policyState", a.PolicyState) populate(objectMap, "recoveryModel", a.RecoveryModel) populate(objectMap, "recoveryPointCount", a.RecoveryPointCount) @@ -2658,9 +2909,18 @@ func (a *AzureVMWorkloadProtectedItemExtendedInfo) UnmarshalJSON(data []byte) er for key, val := range rawMsg { var err error switch key { + case "newestRecoveryPointInArchive": + err = unpopulateTimeRFC3339(val, "NewestRecoveryPointInArchive", &a.NewestRecoveryPointInArchive) + delete(rawMsg, key) case "oldestRecoveryPoint": err = unpopulateTimeRFC3339(val, "OldestRecoveryPoint", &a.OldestRecoveryPoint) delete(rawMsg, key) + case "oldestRecoveryPointInArchive": + err = unpopulateTimeRFC3339(val, "OldestRecoveryPointInArchive", &a.OldestRecoveryPointInArchive) + delete(rawMsg, key) + case "oldestRecoveryPointInVault": + err = unpopulateTimeRFC3339(val, "OldestRecoveryPointInVault", &a.OldestRecoveryPointInVault) + delete(rawMsg, key) case "policyState": err = unpopulate(val, "PolicyState", &a.PolicyState) delete(rawMsg, key) @@ -2680,7 +2940,7 @@ func (a *AzureVMWorkloadProtectedItemExtendedInfo) UnmarshalJSON(data []byte) er // MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadProtectionPolicy. func (a AzureVMWorkloadProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["backupManagementType"] = "AzureWorkload" populate(objectMap, "makePolicyConsistent", a.MakePolicyConsistent) populate(objectMap, "protectedItemsCount", a.ProtectedItemsCount) @@ -2731,7 +2991,7 @@ func (a *AzureVMWorkloadProtectionPolicy) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPAseDatabaseProtectedItem. func (a AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "backupSetName", a.BackupSetName) populate(objectMap, "containerName", a.ContainerName) @@ -2760,6 +3020,7 @@ func (a AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -2858,6 +3119,9 @@ func (a *AzureVMWorkloadSAPAseDatabaseProtectedItem) UnmarshalJSON(data []byte) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -2874,7 +3138,7 @@ func (a *AzureVMWorkloadSAPAseDatabaseProtectedItem) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPAseDatabaseWorkloadItem. func (a AzureVMWorkloadSAPAseDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) @@ -2937,7 +3201,7 @@ func (a *AzureVMWorkloadSAPAseDatabaseWorkloadItem) UnmarshalJSON(data []byte) e // MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPAseSystemProtectableItem. func (a AzureVMWorkloadSAPAseSystemProtectableItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) @@ -3012,7 +3276,7 @@ func (a *AzureVMWorkloadSAPAseSystemProtectableItem) UnmarshalJSON(data []byte) // MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPAseSystemWorkloadItem. func (a AzureVMWorkloadSAPAseSystemWorkloadItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) @@ -3073,9 +3337,9 @@ func (a *AzureVMWorkloadSAPAseSystemWorkloadItem) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (a AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDBInstance. +func (a AzureVMWorkloadSAPHanaDBInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) @@ -3083,7 +3347,7 @@ func (a AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, er populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) - objectMap["protectableItemType"] = "SAPHanaDatabase" + objectMap["protectableItemType"] = "SAPHanaDBInstance" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) @@ -3092,8 +3356,8 @@ func (a AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, er return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectableItem. -func (a *AzureVMWorkloadSAPHanaDatabaseProtectableItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDBInstance. +func (a *AzureVMWorkloadSAPHanaDBInstance) UnmarshalJSON(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) @@ -3148,9 +3412,9 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectableItem) UnmarshalJSON(data []byt return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (a AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDBInstanceProtectedItem. +func (a AzureVMWorkloadSAPHanaDBInstanceProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "backupSetName", a.BackupSetName) populate(objectMap, "containerName", a.ContainerName) @@ -3174,18 +3438,19 @@ func (a AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, erro populate(objectMap, "policyName", a.PolicyName) populate(objectMap, "protectedItemDataSourceId", a.ProtectedItemDataSourceID) populate(objectMap, "protectedItemHealthStatus", a.ProtectedItemHealthStatus) - objectMap["protectedItemType"] = "AzureVmWorkloadSAPHanaDatabase" + objectMap["protectedItemType"] = "AzureVmWorkloadSAPHanaDBInstance" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectedItem. -func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDBInstanceProtectedItem. +func (a *AzureVMWorkloadSAPHanaDBInstanceProtectedItem) UnmarshalJSON(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) @@ -3277,6 +3542,9 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) UnmarshalJSON(data []byte) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) @@ -3291,24 +3559,27 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (a AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (a AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) + populate(objectMap, "isAutoProtected", a.IsAutoProtected) populate(objectMap, "parentName", a.ParentName) + populate(objectMap, "parentUniqueName", a.ParentUniqueName) + populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) + objectMap["protectableItemType"] = "SAPHanaDatabase" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) - populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) - objectMap["workloadItemType"] = "SAPHanaDatabase" + populate(objectMap, "subprotectableitemcount", a.Subprotectableitemcount) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDatabaseWorkloadItem. -func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectableItem. +func (a *AzureVMWorkloadSAPHanaDatabaseProtectableItem) UnmarshalJSON(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) @@ -3325,23 +3596,32 @@ func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) UnmarshalJSON(data []byte) case "isAutoProtectable": err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) delete(rawMsg, key) + case "isAutoProtected": + err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) + case "parentUniqueName": + err = unpopulate(val, "ParentUniqueName", &a.ParentUniqueName) + delete(rawMsg, key) + case "prebackupvalidation": + err = unpopulate(val, "Prebackupvalidation", &a.Prebackupvalidation) + delete(rawMsg, key) + case "protectableItemType": + err = unpopulate(val, "ProtectableItemType", &a.ProtectableItemType) + delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) - case "subWorkloadItemCount": - err = unpopulate(val, "SubWorkloadItemCount", &a.SubWorkloadItemCount) - delete(rawMsg, key) case "subinquireditemcount": err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) delete(rawMsg, key) - case "workloadItemType": - err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) + case "subprotectableitemcount": + err = unpopulate(val, "Subprotectableitemcount", &a.Subprotectableitemcount) delete(rawMsg, key) case "workloadType": err = unpopulate(val, "WorkloadType", &a.WorkloadType) @@ -3354,27 +3634,45 @@ func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaSystemProtectableItem. -func (a AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (a AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) + populate(objectMap, "backupSetName", a.BackupSetName) + populate(objectMap, "containerName", a.ContainerName) + populate(objectMap, "createMode", a.CreateMode) + populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", a.DeferredDeleteTimeInUTC) + populate(objectMap, "deferredDeleteTimeRemaining", a.DeferredDeleteTimeRemaining) + populate(objectMap, "extendedInfo", a.ExtendedInfo) populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) - populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "isArchiveEnabled", a.IsArchiveEnabled) + populate(objectMap, "isDeferredDeleteScheduleUpcoming", a.IsDeferredDeleteScheduleUpcoming) + populate(objectMap, "isRehydrate", a.IsRehydrate) + populate(objectMap, "isScheduledForDeferredDelete", a.IsScheduledForDeferredDelete) + populate(objectMap, "kpisHealths", a.KpisHealths) + populate(objectMap, "lastBackupErrorDetail", a.LastBackupErrorDetail) + populate(objectMap, "lastBackupStatus", a.LastBackupStatus) + populateTimeRFC3339(objectMap, "lastBackupTime", a.LastBackupTime) + populateTimeRFC3339(objectMap, "lastRecoveryPoint", a.LastRecoveryPoint) populate(objectMap, "parentName", a.ParentName) - populate(objectMap, "parentUniqueName", a.ParentUniqueName) - populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) - objectMap["protectableItemType"] = "SAPHanaSystem" + populate(objectMap, "parentType", a.ParentType) + populate(objectMap, "policyId", a.PolicyID) + populate(objectMap, "policyName", a.PolicyName) + populate(objectMap, "protectedItemDataSourceId", a.ProtectedItemDataSourceID) + populate(objectMap, "protectedItemHealthStatus", a.ProtectedItemHealthStatus) + objectMap["protectedItemType"] = "AzureVmWorkloadSAPHanaDatabase" populate(objectMap, "protectionState", a.ProtectionState) + populate(objectMap, "protectionStatus", a.ProtectionStatus) + populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) - populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) - populate(objectMap, "subprotectableitemcount", a.Subprotectableitemcount) + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) + populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaSystemProtectableItem. -func (a *AzureVMWorkloadSAPHanaSystemProtectableItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDatabaseProtectedItem. +func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) UnmarshalJSON(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) @@ -3385,38 +3683,92 @@ func (a *AzureVMWorkloadSAPHanaSystemProtectableItem) UnmarshalJSON(data []byte) case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &a.FriendlyName) - delete(rawMsg, key) - case "isAutoProtectable": - err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &a.BackupSetName) delete(rawMsg, key) - case "isAutoProtected": - err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) + case "containerName": + err = unpopulate(val, "ContainerName", &a.ContainerName) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &a.CreateMode) + delete(rawMsg, key) + case "deferredDeleteTimeInUTC": + err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &a.DeferredDeleteTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeRemaining": + err = unpopulate(val, "DeferredDeleteTimeRemaining", &a.DeferredDeleteTimeRemaining) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) + delete(rawMsg, key) + case "isArchiveEnabled": + err = unpopulate(val, "IsArchiveEnabled", &a.IsArchiveEnabled) + delete(rawMsg, key) + case "isDeferredDeleteScheduleUpcoming": + err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &a.IsDeferredDeleteScheduleUpcoming) + delete(rawMsg, key) + case "isRehydrate": + err = unpopulate(val, "IsRehydrate", &a.IsRehydrate) + delete(rawMsg, key) + case "isScheduledForDeferredDelete": + err = unpopulate(val, "IsScheduledForDeferredDelete", &a.IsScheduledForDeferredDelete) + delete(rawMsg, key) + case "kpisHealths": + err = unpopulate(val, "KpisHealths", &a.KpisHealths) + delete(rawMsg, key) + case "lastBackupErrorDetail": + err = unpopulate(val, "LastBackupErrorDetail", &a.LastBackupErrorDetail) + delete(rawMsg, key) + case "lastBackupStatus": + err = unpopulate(val, "LastBackupStatus", &a.LastBackupStatus) + delete(rawMsg, key) + case "lastBackupTime": + err = unpopulateTimeRFC3339(val, "LastBackupTime", &a.LastBackupTime) + delete(rawMsg, key) + case "lastRecoveryPoint": + err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &a.LastRecoveryPoint) delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) - case "parentUniqueName": - err = unpopulate(val, "ParentUniqueName", &a.ParentUniqueName) + case "parentType": + err = unpopulate(val, "ParentType", &a.ParentType) delete(rawMsg, key) - case "prebackupvalidation": - err = unpopulate(val, "Prebackupvalidation", &a.Prebackupvalidation) + case "policyId": + err = unpopulate(val, "PolicyID", &a.PolicyID) delete(rawMsg, key) - case "protectableItemType": - err = unpopulate(val, "ProtectableItemType", &a.ProtectableItemType) + case "policyName": + err = unpopulate(val, "PolicyName", &a.PolicyName) + delete(rawMsg, key) + case "protectedItemDataSourceId": + err = unpopulate(val, "ProtectedItemDataSourceID", &a.ProtectedItemDataSourceID) + delete(rawMsg, key) + case "protectedItemHealthStatus": + err = unpopulate(val, "ProtectedItemHealthStatus", &a.ProtectedItemHealthStatus) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &a.ProtectedItemType) delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) + case "protectionStatus": + err = unpopulate(val, "ProtectionStatus", &a.ProtectionStatus) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) + delete(rawMsg, key) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) - case "subinquireditemcount": - err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) delete(rawMsg, key) - case "subprotectableitemcount": - err = unpopulate(val, "Subprotectableitemcount", &a.Subprotectableitemcount) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) case "workloadType": err = unpopulate(val, "WorkloadType", &a.WorkloadType) @@ -3429,9 +3781,9 @@ func (a *AzureVMWorkloadSAPHanaSystemProtectableItem) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (a AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (a AzureVMWorkloadSAPHanaDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) @@ -3440,13 +3792,13 @@ func (a AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) populate(objectMap, "serverName", a.ServerName) populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) - objectMap["workloadItemType"] = "SAPHanaSystem" + objectMap["workloadItemType"] = "SAPHanaDatabase" populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaSystemWorkloadItem. -func (a *AzureVMWorkloadSAPHanaSystemWorkloadItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaDatabaseWorkloadItem. +func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) UnmarshalJSON(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) @@ -3492,9 +3844,9 @@ func (a *AzureVMWorkloadSAPHanaSystemWorkloadItem) UnmarshalJSON(data []byte) er return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (a AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaHSR. +func (a AzureVMWorkloadSAPHanaHSR) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) @@ -3502,7 +3854,7 @@ func (a AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byt populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) - objectMap["protectableItemType"] = "SQLAvailabilityGroupContainer" + objectMap["protectableItemType"] = "SAPHanaHSR" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) @@ -3511,8 +3863,8 @@ func (a AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byt return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLAvailabilityGroupProtectableItem. -func (a *AzureVMWorkloadSQLAvailabilityGroupProtectableItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaHSR. +func (a *AzureVMWorkloadSAPHanaHSR) UnmarshalJSON(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) @@ -3567,9 +3919,9 @@ func (a *AzureVMWorkloadSQLAvailabilityGroupProtectableItem) UnmarshalJSON(data return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLDatabaseProtectableItem. -func (a AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaSystemProtectableItem. +func (a AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) @@ -3577,7 +3929,7 @@ func (a AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) - objectMap["protectableItemType"] = "SQLDataBase" + objectMap["protectableItemType"] = "SAPHanaSystem" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) @@ -3586,8 +3938,8 @@ func (a AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLDatabaseProtectableItem. -func (a *AzureVMWorkloadSQLDatabaseProtectableItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaSystemProtectableItem. +func (a *AzureVMWorkloadSAPHanaSystemProtectableItem) UnmarshalJSON(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) @@ -3642,44 +3994,24 @@ func (a *AzureVMWorkloadSQLDatabaseProtectableItem) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLDatabaseProtectedItem. -func (a AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (a AzureVMWorkloadSAPHanaSystemWorkloadItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) - populate(objectMap, "backupSetName", a.BackupSetName) - populate(objectMap, "containerName", a.ContainerName) - populate(objectMap, "createMode", a.CreateMode) - populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", a.DeferredDeleteTimeInUTC) - populate(objectMap, "deferredDeleteTimeRemaining", a.DeferredDeleteTimeRemaining) - populate(objectMap, "extendedInfo", a.ExtendedInfo) populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "isArchiveEnabled", a.IsArchiveEnabled) - populate(objectMap, "isDeferredDeleteScheduleUpcoming", a.IsDeferredDeleteScheduleUpcoming) - populate(objectMap, "isRehydrate", a.IsRehydrate) - populate(objectMap, "isScheduledForDeferredDelete", a.IsScheduledForDeferredDelete) - populate(objectMap, "kpisHealths", a.KpisHealths) - populate(objectMap, "lastBackupErrorDetail", a.LastBackupErrorDetail) - populate(objectMap, "lastBackupStatus", a.LastBackupStatus) - populateTimeRFC3339(objectMap, "lastBackupTime", a.LastBackupTime) - populateTimeRFC3339(objectMap, "lastRecoveryPoint", a.LastRecoveryPoint) + populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) populate(objectMap, "parentName", a.ParentName) - populate(objectMap, "parentType", a.ParentType) - populate(objectMap, "policyId", a.PolicyID) - populate(objectMap, "policyName", a.PolicyName) - populate(objectMap, "protectedItemDataSourceId", a.ProtectedItemDataSourceID) - populate(objectMap, "protectedItemHealthStatus", a.ProtectedItemHealthStatus) - objectMap["protectedItemType"] = "AzureVmWorkloadSQLDatabase" populate(objectMap, "protectionState", a.ProtectionState) - populate(objectMap, "protectionStatus", a.ProtectionStatus) - populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) - populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) + populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) + objectMap["workloadItemType"] = "SAPHanaSystem" populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLDatabaseProtectedItem. -func (a *AzureVMWorkloadSQLDatabaseProtectedItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaSystemWorkloadItem. +func (a *AzureVMWorkloadSAPHanaSystemWorkloadItem) UnmarshalJSON(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) @@ -3690,89 +4022,29 @@ func (a *AzureVMWorkloadSQLDatabaseProtectedItem) UnmarshalJSON(data []byte) err case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "backupSetName": - err = unpopulate(val, "BackupSetName", &a.BackupSetName) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &a.ContainerName) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &a.CreateMode) - delete(rawMsg, key) - case "deferredDeleteTimeInUTC": - err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &a.DeferredDeleteTimeInUTC) - delete(rawMsg, key) - case "deferredDeleteTimeRemaining": - err = unpopulate(val, "DeferredDeleteTimeRemaining", &a.DeferredDeleteTimeRemaining) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) - delete(rawMsg, key) case "friendlyName": err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &a.IsArchiveEnabled) - delete(rawMsg, key) - case "isDeferredDeleteScheduleUpcoming": - err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &a.IsDeferredDeleteScheduleUpcoming) - delete(rawMsg, key) - case "isRehydrate": - err = unpopulate(val, "IsRehydrate", &a.IsRehydrate) - delete(rawMsg, key) - case "isScheduledForDeferredDelete": - err = unpopulate(val, "IsScheduledForDeferredDelete", &a.IsScheduledForDeferredDelete) - delete(rawMsg, key) - case "kpisHealths": - err = unpopulate(val, "KpisHealths", &a.KpisHealths) - delete(rawMsg, key) - case "lastBackupErrorDetail": - err = unpopulate(val, "LastBackupErrorDetail", &a.LastBackupErrorDetail) - delete(rawMsg, key) - case "lastBackupStatus": - err = unpopulate(val, "LastBackupStatus", &a.LastBackupStatus) - delete(rawMsg, key) - case "lastBackupTime": - err = unpopulateTimeRFC3339(val, "LastBackupTime", &a.LastBackupTime) - delete(rawMsg, key) - case "lastRecoveryPoint": - err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &a.LastRecoveryPoint) + case "isAutoProtectable": + err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) - case "parentType": - err = unpopulate(val, "ParentType", &a.ParentType) - delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &a.PolicyID) - delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &a.PolicyName) - delete(rawMsg, key) - case "protectedItemDataSourceId": - err = unpopulate(val, "ProtectedItemDataSourceID", &a.ProtectedItemDataSourceID) - delete(rawMsg, key) - case "protectedItemHealthStatus": - err = unpopulate(val, "ProtectedItemHealthStatus", &a.ProtectedItemHealthStatus) - delete(rawMsg, key) - case "protectedItemType": - err = unpopulate(val, "ProtectedItemType", &a.ProtectedItemType) - delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) - case "protectionStatus": - err = unpopulate(val, "ProtectionStatus", &a.ProtectionStatus) - delete(rawMsg, key) - case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) - delete(rawMsg, key) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + case "subWorkloadItemCount": + err = unpopulate(val, "SubWorkloadItemCount", &a.SubWorkloadItemCount) + delete(rawMsg, key) + case "subinquireditemcount": + err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) + delete(rawMsg, key) + case "workloadItemType": + err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) delete(rawMsg, key) case "workloadType": err = unpopulate(val, "WorkloadType", &a.WorkloadType) @@ -3785,24 +4057,27 @@ func (a *AzureVMWorkloadSQLDatabaseProtectedItem) UnmarshalJSON(data []byte) err return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLDatabaseWorkloadItem. -func (a AzureVMWorkloadSQLDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (a AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) + populate(objectMap, "isAutoProtected", a.IsAutoProtected) populate(objectMap, "parentName", a.ParentName) + populate(objectMap, "parentUniqueName", a.ParentUniqueName) + populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) + objectMap["protectableItemType"] = "SQLAvailabilityGroupContainer" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) - populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) - objectMap["workloadItemType"] = "SQLDataBase" + populate(objectMap, "subprotectableitemcount", a.Subprotectableitemcount) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLDatabaseWorkloadItem. -func (a *AzureVMWorkloadSQLDatabaseWorkloadItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLAvailabilityGroupProtectableItem. +func (a *AzureVMWorkloadSQLAvailabilityGroupProtectableItem) UnmarshalJSON(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) @@ -3819,23 +4094,32 @@ func (a *AzureVMWorkloadSQLDatabaseWorkloadItem) UnmarshalJSON(data []byte) erro case "isAutoProtectable": err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) delete(rawMsg, key) + case "isAutoProtected": + err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) + case "parentUniqueName": + err = unpopulate(val, "ParentUniqueName", &a.ParentUniqueName) + delete(rawMsg, key) + case "prebackupvalidation": + err = unpopulate(val, "Prebackupvalidation", &a.Prebackupvalidation) + delete(rawMsg, key) + case "protectableItemType": + err = unpopulate(val, "ProtectableItemType", &a.ProtectableItemType) + delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) - case "subWorkloadItemCount": - err = unpopulate(val, "SubWorkloadItemCount", &a.SubWorkloadItemCount) - delete(rawMsg, key) case "subinquireditemcount": err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) delete(rawMsg, key) - case "workloadItemType": - err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) + case "subprotectableitemcount": + err = unpopulate(val, "Subprotectableitemcount", &a.Subprotectableitemcount) delete(rawMsg, key) case "workloadType": err = unpopulate(val, "WorkloadType", &a.WorkloadType) @@ -3848,9 +4132,9 @@ func (a *AzureVMWorkloadSQLDatabaseWorkloadItem) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLInstanceProtectableItem. -func (a AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLDatabaseProtectableItem. +func (a AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) @@ -3858,7 +4142,7 @@ func (a AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) - objectMap["protectableItemType"] = "SQLInstance" + objectMap["protectableItemType"] = "SQLDataBase" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) @@ -3867,8 +4151,8 @@ func (a AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLInstanceProtectableItem. -func (a *AzureVMWorkloadSQLInstanceProtectableItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLDatabaseProtectableItem. +func (a *AzureVMWorkloadSQLDatabaseProtectableItem) UnmarshalJSON(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) @@ -3923,25 +4207,45 @@ func (a *AzureVMWorkloadSQLInstanceProtectableItem) UnmarshalJSON(data []byte) e return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLInstanceWorkloadItem. -func (a AzureVMWorkloadSQLInstanceWorkloadItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLDatabaseProtectedItem. +func (a AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) - populate(objectMap, "dataDirectoryPaths", a.DataDirectoryPaths) + populate(objectMap, "backupSetName", a.BackupSetName) + populate(objectMap, "containerName", a.ContainerName) + populate(objectMap, "createMode", a.CreateMode) + populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", a.DeferredDeleteTimeInUTC) + populate(objectMap, "deferredDeleteTimeRemaining", a.DeferredDeleteTimeRemaining) + populate(objectMap, "extendedInfo", a.ExtendedInfo) populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) + populate(objectMap, "isArchiveEnabled", a.IsArchiveEnabled) + populate(objectMap, "isDeferredDeleteScheduleUpcoming", a.IsDeferredDeleteScheduleUpcoming) + populate(objectMap, "isRehydrate", a.IsRehydrate) + populate(objectMap, "isScheduledForDeferredDelete", a.IsScheduledForDeferredDelete) + populate(objectMap, "kpisHealths", a.KpisHealths) + populate(objectMap, "lastBackupErrorDetail", a.LastBackupErrorDetail) + populate(objectMap, "lastBackupStatus", a.LastBackupStatus) + populateTimeRFC3339(objectMap, "lastBackupTime", a.LastBackupTime) + populateTimeRFC3339(objectMap, "lastRecoveryPoint", a.LastRecoveryPoint) populate(objectMap, "parentName", a.ParentName) + populate(objectMap, "parentType", a.ParentType) + populate(objectMap, "policyId", a.PolicyID) + populate(objectMap, "policyName", a.PolicyName) + populate(objectMap, "protectedItemDataSourceId", a.ProtectedItemDataSourceID) + populate(objectMap, "protectedItemHealthStatus", a.ProtectedItemHealthStatus) + objectMap["protectedItemType"] = "AzureVmWorkloadSQLDatabase" populate(objectMap, "protectionState", a.ProtectionState) + populate(objectMap, "protectionStatus", a.ProtectionStatus) + populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) - populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) - populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) - objectMap["workloadItemType"] = "SQLInstance" + populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) + populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLInstanceWorkloadItem. -func (a *AzureVMWorkloadSQLInstanceWorkloadItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLDatabaseProtectedItem. +func (a *AzureVMWorkloadSQLDatabaseProtectedItem) UnmarshalJSON(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) @@ -3952,32 +4256,92 @@ func (a *AzureVMWorkloadSQLInstanceWorkloadItem) UnmarshalJSON(data []byte) erro case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "dataDirectoryPaths": - err = unpopulate(val, "DataDirectoryPaths", &a.DataDirectoryPaths) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &a.BackupSetName) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &a.ContainerName) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &a.CreateMode) + delete(rawMsg, key) + case "deferredDeleteTimeInUTC": + err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &a.DeferredDeleteTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeRemaining": + err = unpopulate(val, "DeferredDeleteTimeRemaining", &a.DeferredDeleteTimeRemaining) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) delete(rawMsg, key) case "friendlyName": err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "isAutoProtectable": - err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) + case "isArchiveEnabled": + err = unpopulate(val, "IsArchiveEnabled", &a.IsArchiveEnabled) + delete(rawMsg, key) + case "isDeferredDeleteScheduleUpcoming": + err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &a.IsDeferredDeleteScheduleUpcoming) + delete(rawMsg, key) + case "isRehydrate": + err = unpopulate(val, "IsRehydrate", &a.IsRehydrate) + delete(rawMsg, key) + case "isScheduledForDeferredDelete": + err = unpopulate(val, "IsScheduledForDeferredDelete", &a.IsScheduledForDeferredDelete) + delete(rawMsg, key) + case "kpisHealths": + err = unpopulate(val, "KpisHealths", &a.KpisHealths) + delete(rawMsg, key) + case "lastBackupErrorDetail": + err = unpopulate(val, "LastBackupErrorDetail", &a.LastBackupErrorDetail) + delete(rawMsg, key) + case "lastBackupStatus": + err = unpopulate(val, "LastBackupStatus", &a.LastBackupStatus) + delete(rawMsg, key) + case "lastBackupTime": + err = unpopulateTimeRFC3339(val, "LastBackupTime", &a.LastBackupTime) + delete(rawMsg, key) + case "lastRecoveryPoint": + err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &a.LastRecoveryPoint) delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) + case "parentType": + err = unpopulate(val, "ParentType", &a.ParentType) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &a.PolicyID) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &a.PolicyName) + delete(rawMsg, key) + case "protectedItemDataSourceId": + err = unpopulate(val, "ProtectedItemDataSourceID", &a.ProtectedItemDataSourceID) + delete(rawMsg, key) + case "protectedItemHealthStatus": + err = unpopulate(val, "ProtectedItemHealthStatus", &a.ProtectedItemHealthStatus) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &a.ProtectedItemType) + delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) + case "protectionStatus": + err = unpopulate(val, "ProtectionStatus", &a.ProtectionStatus) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &a.ResourceGuardOperationRequests) + delete(rawMsg, key) case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) - case "subWorkloadItemCount": - err = unpopulate(val, "SubWorkloadItemCount", &a.SubWorkloadItemCount) - delete(rawMsg, key) - case "subinquireditemcount": - err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) delete(rawMsg, key) - case "workloadItemType": - err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) case "workloadType": err = unpopulate(val, "WorkloadType", &a.WorkloadType) @@ -3990,20 +4354,24 @@ func (a *AzureVMWorkloadSQLInstanceWorkloadItem) UnmarshalJSON(data []byte) erro return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadAutoProtectionIntent. -func (a AzureWorkloadAutoProtectionIntent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLDatabaseWorkloadItem. +func (a AzureVMWorkloadSQLDatabaseWorkloadItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) - populate(objectMap, "itemId", a.ItemID) - populate(objectMap, "policyId", a.PolicyID) - objectMap["protectionIntentItemType"] = "ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent" + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) + populate(objectMap, "parentName", a.ParentName) populate(objectMap, "protectionState", a.ProtectionState) - populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "serverName", a.ServerName) + populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) + populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) + objectMap["workloadItemType"] = "SQLDataBase" + populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadAutoProtectionIntent. -func (a *AzureWorkloadAutoProtectionIntent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLDatabaseWorkloadItem. +func (a *AzureVMWorkloadSQLDatabaseWorkloadItem) UnmarshalJSON(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) @@ -4014,59 +4382,32 @@ func (a *AzureWorkloadAutoProtectionIntent) UnmarshalJSON(data []byte) error { case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "itemId": - err = unpopulate(val, "ItemID", &a.ItemID) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &a.PolicyID) + case "isAutoProtectable": + err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) delete(rawMsg, key) - case "protectionIntentItemType": - err = unpopulate(val, "ProtectionIntentItemType", &a.ProtectionIntentItemType) + case "parentName": + err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) case "protectionState": err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + case "serverName": + err = unpopulate(val, "ServerName", &a.ServerName) 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 AzureWorkloadBackupRequest. -func (a AzureWorkloadBackupRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupType", a.BackupType) - populate(objectMap, "enableCompression", a.EnableCompression) - objectMap["objectType"] = "AzureWorkloadBackupRequest" - populateTimeRFC3339(objectMap, "recoveryPointExpiryTimeInUTC", a.RecoveryPointExpiryTimeInUTC) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadBackupRequest. -func (a *AzureWorkloadBackupRequest) UnmarshalJSON(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 "backupType": - err = unpopulate(val, "BackupType", &a.BackupType) + case "subWorkloadItemCount": + err = unpopulate(val, "SubWorkloadItemCount", &a.SubWorkloadItemCount) delete(rawMsg, key) - case "enableCompression": - err = unpopulate(val, "EnableCompression", &a.EnableCompression) + case "subinquireditemcount": + err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &a.ObjectType) + case "workloadItemType": + err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) delete(rawMsg, key) - case "recoveryPointExpiryTimeInUTC": - err = unpopulateTimeRFC3339(val, "RecoveryPointExpiryTimeInUTC", &a.RecoveryPointExpiryTimeInUTC) + case "workloadType": + err = unpopulate(val, "WorkloadType", &a.WorkloadType) delete(rawMsg, key) } if err != nil { @@ -4076,25 +4417,27 @@ func (a *AzureWorkloadBackupRequest) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadContainer. -func (a AzureWorkloadContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLInstanceProtectableItem. +func (a AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) - objectMap["containerType"] = ContainerTypeAzureWorkloadContainer - populate(objectMap, "extendedInfo", a.ExtendedInfo) populate(objectMap, "friendlyName", a.FriendlyName) - populate(objectMap, "healthStatus", a.HealthStatus) - populateTimeRFC3339(objectMap, "lastUpdatedTime", a.LastUpdatedTime) - populate(objectMap, "operationType", a.OperationType) - populate(objectMap, "protectableObjectType", a.ProtectableObjectType) - populate(objectMap, "registrationStatus", a.RegistrationStatus) - populate(objectMap, "sourceResourceId", a.SourceResourceID) + populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) + populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "parentName", a.ParentName) + populate(objectMap, "parentUniqueName", a.ParentUniqueName) + populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) + objectMap["protectableItemType"] = "SQLInstance" + populate(objectMap, "protectionState", a.ProtectionState) + populate(objectMap, "serverName", a.ServerName) + populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) + populate(objectMap, "subprotectableitemcount", a.Subprotectableitemcount) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadContainer. -func (a *AzureWorkloadContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLInstanceProtectableItem. +func (a *AzureVMWorkloadSQLInstanceProtectableItem) UnmarshalJSON(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) @@ -4105,35 +4448,41 @@ func (a *AzureWorkloadContainer) UnmarshalJSON(data []byte) error { case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "containerType": - err = unpopulate(val, "ContainerType", &a.ContainerType) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) - delete(rawMsg, key) case "friendlyName": err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "healthStatus": - err = unpopulate(val, "HealthStatus", &a.HealthStatus) + case "isAutoProtectable": + err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) delete(rawMsg, key) - case "lastUpdatedTime": - err = unpopulateTimeRFC3339(val, "LastUpdatedTime", &a.LastUpdatedTime) + case "isAutoProtected": + err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) delete(rawMsg, key) - case "operationType": - err = unpopulate(val, "OperationType", &a.OperationType) + case "parentName": + err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) - case "protectableObjectType": - err = unpopulate(val, "ProtectableObjectType", &a.ProtectableObjectType) + case "parentUniqueName": + err = unpopulate(val, "ParentUniqueName", &a.ParentUniqueName) delete(rawMsg, key) - case "registrationStatus": - err = unpopulate(val, "RegistrationStatus", &a.RegistrationStatus) + case "prebackupvalidation": + err = unpopulate(val, "Prebackupvalidation", &a.Prebackupvalidation) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) + case "protectableItemType": + err = unpopulate(val, "ProtectableItemType", &a.ProtectableItemType) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &a.WorkloadType) + case "protectionState": + err = unpopulate(val, "ProtectionState", &a.ProtectionState) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &a.ServerName) + delete(rawMsg, key) + case "subinquireditemcount": + err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) + delete(rawMsg, key) + case "subprotectableitemcount": + err = unpopulate(val, "Subprotectableitemcount", &a.Subprotectableitemcount) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &a.WorkloadType) delete(rawMsg, key) } if err != nil { @@ -4143,20 +4492,87 @@ func (a *AzureWorkloadContainer) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadContainerAutoProtectionIntent. -func (a AzureWorkloadContainerAutoProtectionIntent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSQLInstanceWorkloadItem. +func (a AzureVMWorkloadSQLInstanceWorkloadItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", a.BackupManagementType) + populate(objectMap, "dataDirectoryPaths", a.DataDirectoryPaths) + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) + populate(objectMap, "parentName", a.ParentName) + populate(objectMap, "protectionState", a.ProtectionState) + populate(objectMap, "serverName", a.ServerName) + populate(objectMap, "subWorkloadItemCount", a.SubWorkloadItemCount) + populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) + objectMap["workloadItemType"] = "SQLInstance" + populate(objectMap, "workloadType", a.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSQLInstanceWorkloadItem. +func (a *AzureVMWorkloadSQLInstanceWorkloadItem) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) + delete(rawMsg, key) + case "dataDirectoryPaths": + err = unpopulate(val, "DataDirectoryPaths", &a.DataDirectoryPaths) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) + delete(rawMsg, key) + case "isAutoProtectable": + err = unpopulate(val, "IsAutoProtectable", &a.IsAutoProtectable) + delete(rawMsg, key) + case "parentName": + err = unpopulate(val, "ParentName", &a.ParentName) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &a.ProtectionState) + delete(rawMsg, key) + case "serverName": + err = unpopulate(val, "ServerName", &a.ServerName) + delete(rawMsg, key) + case "subWorkloadItemCount": + err = unpopulate(val, "SubWorkloadItemCount", &a.SubWorkloadItemCount) + delete(rawMsg, key) + case "subinquireditemcount": + err = unpopulate(val, "Subinquireditemcount", &a.Subinquireditemcount) + delete(rawMsg, key) + case "workloadItemType": + err = unpopulate(val, "WorkloadItemType", &a.WorkloadItemType) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &a.WorkloadType) + 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 AzureWorkloadAutoProtectionIntent. +func (a AzureWorkloadAutoProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "itemId", a.ItemID) populate(objectMap, "policyId", a.PolicyID) - objectMap["protectionIntentItemType"] = ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent + objectMap["protectionIntentItemType"] = "ProtectionIntentItemTypeAzureWorkloadAutoProtectionIntent" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "sourceResourceId", a.SourceResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadContainerAutoProtectionIntent. -func (a *AzureWorkloadContainerAutoProtectionIntent) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadAutoProtectionIntent. +func (a *AzureWorkloadAutoProtectionIntent) UnmarshalJSON(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) @@ -4190,47 +4606,64 @@ func (a *AzureWorkloadContainerAutoProtectionIntent) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadContainerExtendedInfo. -func (a AzureWorkloadContainerExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "hostServerName", a.HostServerName) - populate(objectMap, "inquiryInfo", a.InquiryInfo) - populate(objectMap, "nodesList", a.NodesList) +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadBackupRequest. +func (a AzureWorkloadBackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupType", a.BackupType) + populate(objectMap, "enableCompression", a.EnableCompression) + objectMap["objectType"] = "AzureWorkloadBackupRequest" + populateTimeRFC3339(objectMap, "recoveryPointExpiryTimeInUTC", a.RecoveryPointExpiryTimeInUTC) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadErrorInfo. -func (a AzureWorkloadErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalDetails", a.AdditionalDetails) - populate(objectMap, "errorCode", a.ErrorCode) - populate(objectMap, "errorString", a.ErrorString) - populate(objectMap, "errorTitle", a.ErrorTitle) - populate(objectMap, "recommendations", a.Recommendations) - return json.Marshal(objectMap) +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadBackupRequest. +func (a *AzureWorkloadBackupRequest) UnmarshalJSON(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 "backupType": + err = unpopulate(val, "BackupType", &a.BackupType) + delete(rawMsg, key) + case "enableCompression": + err = unpopulate(val, "EnableCompression", &a.EnableCompression) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &a.ObjectType) + delete(rawMsg, key) + case "recoveryPointExpiryTimeInUTC": + err = unpopulateTimeRFC3339(val, "RecoveryPointExpiryTimeInUTC", &a.RecoveryPointExpiryTimeInUTC) + 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 AzureWorkloadJob. -func (a AzureWorkloadJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionsInfo", a.ActionsInfo) - populate(objectMap, "activityId", a.ActivityID) +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadContainer. +func (a AzureWorkloadContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) - populate(objectMap, "duration", a.Duration) - populateTimeRFC3339(objectMap, "endTime", a.EndTime) - populate(objectMap, "entityFriendlyName", a.EntityFriendlyName) - populate(objectMap, "errorDetails", a.ErrorDetails) + objectMap["containerType"] = ProtectableContainerTypeAzureWorkloadContainer populate(objectMap, "extendedInfo", a.ExtendedInfo) - objectMap["jobType"] = "AzureWorkloadJob" - populate(objectMap, "operation", a.Operation) - populateTimeRFC3339(objectMap, "startTime", a.StartTime) - populate(objectMap, "status", a.Status) + populate(objectMap, "friendlyName", a.FriendlyName) + populate(objectMap, "healthStatus", a.HealthStatus) + populateTimeRFC3339(objectMap, "lastUpdatedTime", a.LastUpdatedTime) + populate(objectMap, "operationType", a.OperationType) + populate(objectMap, "protectableObjectType", a.ProtectableObjectType) + populate(objectMap, "registrationStatus", a.RegistrationStatus) + populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadJob. -func (a *AzureWorkloadJob) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadContainer. +func (a *AzureWorkloadContainer) UnmarshalJSON(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) @@ -4238,41 +4671,35 @@ func (a *AzureWorkloadJob) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "actionsInfo": - err = unpopulate(val, "ActionsInfo", &a.ActionsInfo) - delete(rawMsg, key) - case "activityId": - err = unpopulate(val, "ActivityID", &a.ActivityID) - delete(rawMsg, key) case "backupManagementType": err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "duration": - err = unpopulate(val, "Duration", &a.Duration) + case "containerType": + err = unpopulate(val, "ContainerType", &a.ContainerType) delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &a.EndTime) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) delete(rawMsg, key) - case "entityFriendlyName": - err = unpopulate(val, "EntityFriendlyName", &a.EntityFriendlyName) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &a.FriendlyName) delete(rawMsg, key) - case "errorDetails": - err = unpopulate(val, "ErrorDetails", &a.ErrorDetails) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &a.HealthStatus) delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) + case "lastUpdatedTime": + err = unpopulateTimeRFC3339(val, "LastUpdatedTime", &a.LastUpdatedTime) delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &a.JobType) + case "operationType": + err = unpopulate(val, "OperationType", &a.OperationType) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &a.Operation) + case "protectableObjectType": + err = unpopulate(val, "ProtectableObjectType", &a.ProtectableObjectType) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &a.StartTime) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &a.RegistrationStatus) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &a.Status) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) case "workloadType": err = unpopulate(val, "WorkloadType", &a.WorkloadType) @@ -4285,29 +4712,20 @@ func (a *AzureWorkloadJob) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadJobExtendedInfo. -func (a AzureWorkloadJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dynamicErrorMessage", a.DynamicErrorMessage) - populate(objectMap, "propertyBag", a.PropertyBag) - populate(objectMap, "tasksList", a.TasksList) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadPointInTimeRecoveryPoint. -func (a AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["objectType"] = "AzureWorkloadPointInTimeRecoveryPoint" - populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) - populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) - populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) - populate(objectMap, "timeRanges", a.TimeRanges) - populate(objectMap, "type", a.Type) +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadContainerAutoProtectionIntent. +func (a AzureWorkloadContainerAutoProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", a.BackupManagementType) + populate(objectMap, "itemId", a.ItemID) + populate(objectMap, "policyId", a.PolicyID) + objectMap["protectionIntentItemType"] = ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent + populate(objectMap, "protectionState", a.ProtectionState) + populate(objectMap, "sourceResourceId", a.SourceResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadPointInTimeRecoveryPoint. -func (a *AzureWorkloadPointInTimeRecoveryPoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadContainerAutoProtectionIntent. +func (a *AzureWorkloadContainerAutoProtectionIntent) UnmarshalJSON(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) @@ -4315,23 +4733,23 @@ func (a *AzureWorkloadPointInTimeRecoveryPoint) UnmarshalJSON(data []byte) error for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &a.ObjectType) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) delete(rawMsg, key) - case "recoveryPointMoveReadinessInfo": - err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) + case "itemId": + err = unpopulate(val, "ItemID", &a.ItemID) delete(rawMsg, key) - case "recoveryPointTierDetails": - err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) + case "policyId": + err = unpopulate(val, "PolicyID", &a.PolicyID) delete(rawMsg, key) - case "recoveryPointTimeInUTC": - err = unpopulateTimeRFC3339(val, "RecoveryPointTimeInUTC", &a.RecoveryPointTimeInUTC) + case "protectionIntentItemType": + err = unpopulate(val, "ProtectionIntentItemType", &a.ProtectionIntentItemType) delete(rawMsg, key) - case "timeRanges": - err = unpopulate(val, "TimeRanges", &a.TimeRanges) + case "protectionState": + err = unpopulate(val, "ProtectionState", &a.ProtectionState) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &a.Type) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) delete(rawMsg, key) } if err != nil { @@ -4341,9 +4759,279 @@ func (a *AzureWorkloadPointInTimeRecoveryPoint) UnmarshalJSON(data []byte) error return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadPointInTimeRestoreRequest. +// MarshalJSON implements the json.Marshaller interface for type AzureWorkloadContainerExtendedInfo. +func (a AzureWorkloadContainerExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hostServerName", a.HostServerName) + populate(objectMap, "inquiryInfo", a.InquiryInfo) + populate(objectMap, "nodesList", a.NodesList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadContainerExtendedInfo. +func (a *AzureWorkloadContainerExtendedInfo) UnmarshalJSON(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 "hostServerName": + err = unpopulate(val, "HostServerName", &a.HostServerName) + delete(rawMsg, key) + case "inquiryInfo": + err = unpopulate(val, "InquiryInfo", &a.InquiryInfo) + delete(rawMsg, key) + case "nodesList": + err = unpopulate(val, "NodesList", &a.NodesList) + 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 AzureWorkloadErrorInfo. +func (a AzureWorkloadErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalDetails", a.AdditionalDetails) + populate(objectMap, "errorCode", a.ErrorCode) + populate(objectMap, "errorString", a.ErrorString) + populate(objectMap, "errorTitle", a.ErrorTitle) + populate(objectMap, "recommendations", a.Recommendations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadErrorInfo. +func (a *AzureWorkloadErrorInfo) UnmarshalJSON(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 "additionalDetails": + err = unpopulate(val, "AdditionalDetails", &a.AdditionalDetails) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &a.ErrorCode) + delete(rawMsg, key) + case "errorString": + err = unpopulate(val, "ErrorString", &a.ErrorString) + delete(rawMsg, key) + case "errorTitle": + err = unpopulate(val, "ErrorTitle", &a.ErrorTitle) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &a.Recommendations) + 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 AzureWorkloadJob. +func (a AzureWorkloadJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionsInfo", a.ActionsInfo) + populate(objectMap, "activityId", a.ActivityID) + populate(objectMap, "backupManagementType", a.BackupManagementType) + populate(objectMap, "duration", a.Duration) + populateTimeRFC3339(objectMap, "endTime", a.EndTime) + populate(objectMap, "entityFriendlyName", a.EntityFriendlyName) + populate(objectMap, "errorDetails", a.ErrorDetails) + populate(objectMap, "extendedInfo", a.ExtendedInfo) + objectMap["jobType"] = "AzureWorkloadJob" + populate(objectMap, "operation", a.Operation) + populateTimeRFC3339(objectMap, "startTime", a.StartTime) + populate(objectMap, "status", a.Status) + populate(objectMap, "workloadType", a.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadJob. +func (a *AzureWorkloadJob) UnmarshalJSON(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 "actionsInfo": + err = unpopulate(val, "ActionsInfo", &a.ActionsInfo) + delete(rawMsg, key) + case "activityId": + err = unpopulate(val, "ActivityID", &a.ActivityID) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &a.BackupManagementType) + delete(rawMsg, key) + case "duration": + err = unpopulate(val, "Duration", &a.Duration) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &a.EndTime) + delete(rawMsg, key) + case "entityFriendlyName": + err = unpopulate(val, "EntityFriendlyName", &a.EntityFriendlyName) + delete(rawMsg, key) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &a.ErrorDetails) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &a.ExtendedInfo) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &a.JobType) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &a.Operation) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &a.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &a.WorkloadType) + 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 AzureWorkloadJobExtendedInfo. +func (a AzureWorkloadJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dynamicErrorMessage", a.DynamicErrorMessage) + populate(objectMap, "propertyBag", a.PropertyBag) + populate(objectMap, "tasksList", a.TasksList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadJobExtendedInfo. +func (a *AzureWorkloadJobExtendedInfo) UnmarshalJSON(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 "dynamicErrorMessage": + err = unpopulate(val, "DynamicErrorMessage", &a.DynamicErrorMessage) + delete(rawMsg, key) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &a.PropertyBag) + delete(rawMsg, key) + case "tasksList": + err = unpopulate(val, "TasksList", &a.TasksList) + 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 AzureWorkloadJobTaskDetails. +func (a AzureWorkloadJobTaskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "status", a.Status) + populate(objectMap, "taskId", a.TaskID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadJobTaskDetails. +func (a *AzureWorkloadJobTaskDetails) UnmarshalJSON(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 "status": + err = unpopulate(val, "Status", &a.Status) + delete(rawMsg, key) + case "taskId": + err = unpopulate(val, "TaskID", &a.TaskID) + 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 AzureWorkloadPointInTimeRecoveryPoint. +func (a AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = "AzureWorkloadPointInTimeRecoveryPoint" + populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) + populate(objectMap, "recoveryPointProperties", a.RecoveryPointProperties) + populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) + populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) + populate(objectMap, "timeRanges", a.TimeRanges) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureWorkloadPointInTimeRecoveryPoint. +func (a *AzureWorkloadPointInTimeRecoveryPoint) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &a.ObjectType) + delete(rawMsg, key) + case "recoveryPointMoveReadinessInfo": + err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) + delete(rawMsg, key) + case "recoveryPointProperties": + err = unpopulate(val, "RecoveryPointProperties", &a.RecoveryPointProperties) + delete(rawMsg, key) + case "recoveryPointTierDetails": + err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) + delete(rawMsg, key) + case "recoveryPointTimeInUTC": + err = unpopulateTimeRFC3339(val, "RecoveryPointTimeInUTC", &a.RecoveryPointTimeInUTC) + delete(rawMsg, key) + case "timeRanges": + err = unpopulate(val, "TimeRanges", &a.TimeRanges) + 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 AzureWorkloadPointInTimeRestoreRequest. func (a AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["objectType"] = "AzureWorkloadPointInTimeRestoreRequest" populateTimeRFC3339(objectMap, "pointInTime", a.PointInTime) populate(objectMap, "propertyBag", a.PropertyBag) @@ -4398,9 +5086,10 @@ func (a *AzureWorkloadPointInTimeRestoreRequest) UnmarshalJSON(data []byte) erro // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadRecoveryPoint. func (a AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["objectType"] = "AzureWorkloadRecoveryPoint" populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) + populate(objectMap, "recoveryPointProperties", a.RecoveryPointProperties) populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) populate(objectMap, "type", a.Type) @@ -4422,6 +5111,9 @@ func (a *AzureWorkloadRecoveryPoint) UnmarshalJSON(data []byte) error { case "recoveryPointMoveReadinessInfo": err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) delete(rawMsg, key) + case "recoveryPointProperties": + err = unpopulate(val, "RecoveryPointProperties", &a.RecoveryPointProperties) + delete(rawMsg, key) case "recoveryPointTierDetails": err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) delete(rawMsg, key) @@ -4441,7 +5133,7 @@ func (a *AzureWorkloadRecoveryPoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadRestoreRequest. func (a AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["objectType"] = "AzureWorkloadRestoreRequest" populate(objectMap, "propertyBag", a.PropertyBag) populate(objectMap, "recoveryMode", a.RecoveryMode) @@ -4492,9 +5184,10 @@ func (a *AzureWorkloadRestoreRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaPointInTimeRecoveryPoint. func (a AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["objectType"] = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint" populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) + populate(objectMap, "recoveryPointProperties", a.RecoveryPointProperties) populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) populate(objectMap, "timeRanges", a.TimeRanges) @@ -4517,6 +5210,9 @@ func (a *AzureWorkloadSAPHanaPointInTimeRecoveryPoint) UnmarshalJSON(data []byte case "recoveryPointMoveReadinessInfo": err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) delete(rawMsg, key) + case "recoveryPointProperties": + err = unpopulate(val, "RecoveryPointProperties", &a.RecoveryPointProperties) + delete(rawMsg, key) case "recoveryPointTierDetails": err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) delete(rawMsg, key) @@ -4539,7 +5235,7 @@ func (a *AzureWorkloadSAPHanaPointInTimeRecoveryPoint) UnmarshalJSON(data []byte // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaPointInTimeRestoreRequest. func (a AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["objectType"] = "AzureWorkloadSAPHanaPointInTimeRestoreRequest" populateTimeRFC3339(objectMap, "pointInTime", a.PointInTime) populate(objectMap, "propertyBag", a.PropertyBag) @@ -4594,7 +5290,7 @@ func (a *AzureWorkloadSAPHanaPointInTimeRestoreRequest) UnmarshalJSON(data []byt // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. func (a AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["objectType"] = "AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest" populateTimeRFC3339(objectMap, "pointInTime", a.PointInTime) populate(objectMap, "propertyBag", a.PropertyBag) @@ -4653,9 +5349,10 @@ func (a *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) UnmarshalJS // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaRecoveryPoint. func (a AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["objectType"] = "AzureWorkloadSAPHanaRecoveryPoint" populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) + populate(objectMap, "recoveryPointProperties", a.RecoveryPointProperties) populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) populate(objectMap, "type", a.Type) @@ -4677,6 +5374,9 @@ func (a *AzureWorkloadSAPHanaRecoveryPoint) UnmarshalJSON(data []byte) error { case "recoveryPointMoveReadinessInfo": err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) delete(rawMsg, key) + case "recoveryPointProperties": + err = unpopulate(val, "RecoveryPointProperties", &a.RecoveryPointProperties) + delete(rawMsg, key) case "recoveryPointTierDetails": err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) delete(rawMsg, key) @@ -4696,7 +5396,7 @@ func (a *AzureWorkloadSAPHanaRecoveryPoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaRestoreRequest. func (a AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["objectType"] = "AzureWorkloadSAPHanaRestoreRequest" populate(objectMap, "propertyBag", a.PropertyBag) populate(objectMap, "recoveryMode", a.RecoveryMode) @@ -4747,7 +5447,7 @@ func (a *AzureWorkloadSAPHanaRestoreRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSAPHanaRestoreWithRehydrateRequest. func (a AzureWorkloadSAPHanaRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) objectMap["objectType"] = "AzureWorkloadSAPHanaRestoreWithRehydrateRequest" populate(objectMap, "propertyBag", a.PropertyBag) populate(objectMap, "recoveryMode", a.RecoveryMode) @@ -4802,7 +5502,7 @@ func (a *AzureWorkloadSAPHanaRestoreWithRehydrateRequest) UnmarshalJSON(data []b // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLAutoProtectionIntent. func (a AzureWorkloadSQLAutoProtectionIntent) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "itemId", a.ItemID) populate(objectMap, "policyId", a.PolicyID) @@ -4853,10 +5553,11 @@ func (a *AzureWorkloadSQLAutoProtectionIntent) UnmarshalJSON(data []byte) error // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLPointInTimeRecoveryPoint. func (a AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "extendedInfo", a.ExtendedInfo) objectMap["objectType"] = "AzureWorkloadSQLPointInTimeRecoveryPoint" populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) + populate(objectMap, "recoveryPointProperties", a.RecoveryPointProperties) populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) populate(objectMap, "timeRanges", a.TimeRanges) @@ -4882,6 +5583,9 @@ func (a *AzureWorkloadSQLPointInTimeRecoveryPoint) UnmarshalJSON(data []byte) er case "recoveryPointMoveReadinessInfo": err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) delete(rawMsg, key) + case "recoveryPointProperties": + err = unpopulate(val, "RecoveryPointProperties", &a.RecoveryPointProperties) + delete(rawMsg, key) case "recoveryPointTierDetails": err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) delete(rawMsg, key) @@ -4904,7 +5608,7 @@ func (a *AzureWorkloadSQLPointInTimeRecoveryPoint) UnmarshalJSON(data []byte) er // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLPointInTimeRestoreRequest. func (a AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alternateDirectoryPaths", a.AlternateDirectoryPaths) populate(objectMap, "isNonRecoverable", a.IsNonRecoverable) objectMap["objectType"] = "AzureWorkloadSQLPointInTimeRestoreRequest" @@ -4971,7 +5675,7 @@ func (a *AzureWorkloadSQLPointInTimeRestoreRequest) UnmarshalJSON(data []byte) e // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. func (a AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alternateDirectoryPaths", a.AlternateDirectoryPaths) populate(objectMap, "isNonRecoverable", a.IsNonRecoverable) objectMap["objectType"] = "AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest" @@ -5042,10 +5746,11 @@ func (a *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) UnmarshalJSON(d // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLRecoveryPoint. func (a AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "extendedInfo", a.ExtendedInfo) objectMap["objectType"] = "AzureWorkloadSQLRecoveryPoint" populate(objectMap, "recoveryPointMoveReadinessInfo", a.RecoveryPointMoveReadinessInfo) + populate(objectMap, "recoveryPointProperties", a.RecoveryPointProperties) populate(objectMap, "recoveryPointTierDetails", a.RecoveryPointTierDetails) populateTimeRFC3339(objectMap, "recoveryPointTimeInUTC", a.RecoveryPointTimeInUTC) populate(objectMap, "type", a.Type) @@ -5070,6 +5775,9 @@ func (a *AzureWorkloadSQLRecoveryPoint) UnmarshalJSON(data []byte) error { case "recoveryPointMoveReadinessInfo": err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &a.RecoveryPointMoveReadinessInfo) delete(rawMsg, key) + case "recoveryPointProperties": + err = unpopulate(val, "RecoveryPointProperties", &a.RecoveryPointProperties) + delete(rawMsg, key) case "recoveryPointTierDetails": err = unpopulate(val, "RecoveryPointTierDetails", &a.RecoveryPointTierDetails) delete(rawMsg, key) @@ -5089,7 +5797,7 @@ func (a *AzureWorkloadSQLRecoveryPoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLRecoveryPointExtendedInfo. func (a AzureWorkloadSQLRecoveryPointExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "dataDirectoryPaths", a.DataDirectoryPaths) populateTimeRFC3339(objectMap, "dataDirectoryTimeInUTC", a.DataDirectoryTimeInUTC) return json.Marshal(objectMap) @@ -5120,7 +5828,7 @@ func (a *AzureWorkloadSQLRecoveryPointExtendedInfo) UnmarshalJSON(data []byte) e // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLRestoreRequest. func (a AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alternateDirectoryPaths", a.AlternateDirectoryPaths) populate(objectMap, "isNonRecoverable", a.IsNonRecoverable) objectMap["objectType"] = "AzureWorkloadSQLRestoreRequest" @@ -5183,7 +5891,7 @@ func (a *AzureWorkloadSQLRestoreRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type AzureWorkloadSQLRestoreWithRehydrateRequest. func (a AzureWorkloadSQLRestoreWithRehydrateRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "alternateDirectoryPaths", a.AlternateDirectoryPaths) populate(objectMap, "isNonRecoverable", a.IsNonRecoverable) objectMap["objectType"] = "AzureWorkloadSQLRestoreWithRehydrateRequest" @@ -5248,8 +5956,17 @@ func (a *AzureWorkloadSQLRestoreWithRehydrateRequest) UnmarshalJSON(data []byte) return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type BMSRPQueryObject. -func (b *BMSRPQueryObject) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type BEKDetails. +func (b BEKDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "secretData", b.SecretData) + populate(objectMap, "secretUrl", b.SecretURL) + populate(objectMap, "secretVaultId", b.SecretVaultID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BEKDetails. +func (b *BEKDetails) UnmarshalJSON(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) @@ -5257,20 +5974,14 @@ func (b *BMSRPQueryObject) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "endDate": - err = unpopulateTimeRFC3339(val, "EndDate", &b.EndDate) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &b.ExtendedInfo) - delete(rawMsg, key) - case "moveReadyRPOnly": - err = unpopulate(val, "MoveReadyRPOnly", &b.MoveReadyRPOnly) + case "secretData": + err = unpopulate(val, "SecretData", &b.SecretData) delete(rawMsg, key) - case "restorePointQueryType": - err = unpopulate(val, "RestorePointQueryType", &b.RestorePointQueryType) + case "secretUrl": + err = unpopulate(val, "SecretURL", &b.SecretURL) delete(rawMsg, key) - case "startDate": - err = unpopulateTimeRFC3339(val, "StartDate", &b.StartDate) + case "secretVaultId": + err = unpopulate(val, "SecretVaultID", &b.SecretVaultID) delete(rawMsg, key) } if err != nil { @@ -5280,21 +5991,15 @@ func (b *BMSRPQueryObject) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupEngineBaseResource. -func (b BackupEngineBaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", b.ETag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) +// MarshalJSON implements the json.Marshaller interface for type BMSBackupEngineQueryObject. +func (b BMSBackupEngineQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "expand", b.Expand) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupEngineBaseResource. -func (b *BackupEngineBaseResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSBackupEngineQueryObject. +func (b *BMSBackupEngineQueryObject) UnmarshalJSON(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) @@ -5302,26 +6007,8 @@ func (b *BackupEngineBaseResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &b.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &b.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &b.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "properties": - b.Properties, err = unmarshalBackupEngineBaseClassification(val) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &b.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) + case "expand": + err = unpopulate(val, "Expand", &b.Expand) delete(rawMsg, key) } if err != nil { @@ -5331,22 +6018,17 @@ func (b *BackupEngineBaseResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupEngineExtendedInfo. -func (b BackupEngineExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "availableDiskSpace", b.AvailableDiskSpace) - populate(objectMap, "azureProtectedInstances", b.AzureProtectedInstances) - populate(objectMap, "databaseName", b.DatabaseName) - populate(objectMap, "diskCount", b.DiskCount) - populate(objectMap, "protectedItemsCount", b.ProtectedItemsCount) - populate(objectMap, "protectedServersCount", b.ProtectedServersCount) - populateTimeRFC3339(objectMap, "refreshedAt", b.RefreshedAt) - populate(objectMap, "usedDiskSpace", b.UsedDiskSpace) +// MarshalJSON implements the json.Marshaller interface for type BMSBackupEnginesQueryObject. +func (b BMSBackupEnginesQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", b.BackupManagementType) + populate(objectMap, "expand", b.Expand) + populate(objectMap, "friendlyName", b.FriendlyName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupEngineExtendedInfo. -func (b *BackupEngineExtendedInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSBackupEnginesQueryObject. +func (b *BMSBackupEnginesQueryObject) UnmarshalJSON(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) @@ -5354,29 +6036,14 @@ func (b *BackupEngineExtendedInfo) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "availableDiskSpace": - err = unpopulate(val, "AvailableDiskSpace", &b.AvailableDiskSpace) - delete(rawMsg, key) - case "azureProtectedInstances": - err = unpopulate(val, "AzureProtectedInstances", &b.AzureProtectedInstances) - delete(rawMsg, key) - case "databaseName": - err = unpopulate(val, "DatabaseName", &b.DatabaseName) - delete(rawMsg, key) - case "diskCount": - err = unpopulate(val, "DiskCount", &b.DiskCount) - delete(rawMsg, key) - case "protectedItemsCount": - err = unpopulate(val, "ProtectedItemsCount", &b.ProtectedItemsCount) - delete(rawMsg, key) - case "protectedServersCount": - err = unpopulate(val, "ProtectedServersCount", &b.ProtectedServersCount) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) delete(rawMsg, key) - case "refreshedAt": - err = unpopulateTimeRFC3339(val, "RefreshedAt", &b.RefreshedAt) + case "expand": + err = unpopulate(val, "Expand", &b.Expand) delete(rawMsg, key) - case "usedDiskSpace": - err = unpopulate(val, "UsedDiskSpace", &b.UsedDiskSpace) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &b.FriendlyName) delete(rawMsg, key) } if err != nil { @@ -5386,8 +6053,15 @@ func (b *BackupEngineExtendedInfo) UnmarshalJSON(data []byte) error { return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupManagementUsage. -func (b *BackupManagementUsage) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type BMSBackupSummariesQueryObject. +func (b BMSBackupSummariesQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSBackupSummariesQueryObject. +func (b *BMSBackupSummariesQueryObject) UnmarshalJSON(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) @@ -5395,23 +6069,8 @@ func (b *BackupManagementUsage) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "currentValue": - err = unpopulate(val, "CurrentValue", &b.CurrentValue) - delete(rawMsg, key) - case "limit": - err = unpopulate(val, "Limit", &b.Limit) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) - delete(rawMsg, key) - case "nextResetTime": - err = unpopulateTimeRFC3339(val, "NextResetTime", &b.NextResetTime) - delete(rawMsg, key) - case "quotaPeriod": - err = unpopulate(val, "QuotaPeriod", &b.QuotaPeriod) - delete(rawMsg, key) - case "unit": - err = unpopulate(val, "Unit", &b.Unit) + case "type": + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { @@ -5421,21 +6080,20 @@ func (b *BackupManagementUsage) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupRequestResource. -func (b BackupRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", b.ETag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) +// MarshalJSON implements the json.Marshaller interface for type BMSContainerQueryObject. +func (b BMSContainerQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupEngineName", b.BackupEngineName) + populate(objectMap, "backupManagementType", b.BackupManagementType) + populate(objectMap, "containerType", b.ContainerType) + populate(objectMap, "fabricName", b.FabricName) + populate(objectMap, "friendlyName", b.FriendlyName) + populate(objectMap, "status", b.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type BackupRequestResource. -func (b *BackupRequestResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSContainerQueryObject. +func (b *BMSContainerQueryObject) UnmarshalJSON(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) @@ -5443,26 +6101,23 @@ func (b *BackupRequestResource) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &b.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &b.ID) + case "backupEngineName": + err = unpopulate(val, "BackupEngineName", &b.BackupEngineName) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &b.Location) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &b.Name) + case "containerType": + err = unpopulate(val, "ContainerType", &b.ContainerType) delete(rawMsg, key) - case "properties": - b.Properties, err = unmarshalBackupRequestClassification(val) + case "fabricName": + err = unpopulate(val, "FabricName", &b.FabricName) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &b.Tags) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &b.FriendlyName) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &b.Type) + case "status": + err = unpopulate(val, "Status", &b.Status) delete(rawMsg, key) } if err != nil { @@ -5472,3431 +6127,7982 @@ func (b *BackupRequestResource) UnmarshalJSON(data []byte) error { return nil } -// MarshalJSON implements the json.Marshaller interface for type BackupResourceConfigResource. -func (b BackupResourceConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", b.ETag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackupResourceEncryptionConfigExtendedResource. -func (b BackupResourceEncryptionConfigExtendedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", b.ETag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackupResourceEncryptionConfigResource. -func (b BackupResourceEncryptionConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", b.ETag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackupResourceVaultConfig. -func (b BackupResourceVaultConfig) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "enhancedSecurityState", b.EnhancedSecurityState) - populate(objectMap, "isSoftDeleteFeatureStateEditable", b.IsSoftDeleteFeatureStateEditable) - populate(objectMap, "resourceGuardOperationRequests", b.ResourceGuardOperationRequests) - populate(objectMap, "softDeleteFeatureState", b.SoftDeleteFeatureState) - populate(objectMap, "storageModelType", b.StorageModelType) - populate(objectMap, "storageType", b.StorageType) - populate(objectMap, "storageTypeState", b.StorageTypeState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackupResourceVaultConfigResource. -func (b BackupResourceVaultConfigResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", b.ETag) - populate(objectMap, "id", b.ID) - populate(objectMap, "location", b.Location) - populate(objectMap, "name", b.Name) - populate(objectMap, "properties", b.Properties) - populate(objectMap, "tags", b.Tags) - populate(objectMap, "type", b.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DPMContainerExtendedInfo. -func (d DPMContainerExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "lastRefreshedAt", d.LastRefreshedAt) +// MarshalJSON implements the json.Marshaller interface for type BMSContainersInquiryQueryObject. +func (b BMSContainersInquiryQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", b.BackupManagementType) + populate(objectMap, "workloadType", b.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DPMContainerExtendedInfo. -func (d *DPMContainerExtendedInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSContainersInquiryQueryObject. +func (b *BMSContainersInquiryQueryObject) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "lastRefreshedAt": - err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &d.LastRefreshedAt) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &b.WorkloadType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DPMProtectedItem. -func (d DPMProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupEngineName", d.BackupEngineName) - populate(objectMap, "backupManagementType", d.BackupManagementType) - populate(objectMap, "backupSetName", d.BackupSetName) - populate(objectMap, "containerName", d.ContainerName) - populate(objectMap, "createMode", d.CreateMode) - populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", d.DeferredDeleteTimeInUTC) - populate(objectMap, "deferredDeleteTimeRemaining", d.DeferredDeleteTimeRemaining) - populate(objectMap, "extendedInfo", d.ExtendedInfo) - populate(objectMap, "friendlyName", d.FriendlyName) - populate(objectMap, "isArchiveEnabled", d.IsArchiveEnabled) - populate(objectMap, "isDeferredDeleteScheduleUpcoming", d.IsDeferredDeleteScheduleUpcoming) - populate(objectMap, "isRehydrate", d.IsRehydrate) - populate(objectMap, "isScheduledForDeferredDelete", d.IsScheduledForDeferredDelete) - populateTimeRFC3339(objectMap, "lastRecoveryPoint", d.LastRecoveryPoint) - populate(objectMap, "policyId", d.PolicyID) - populate(objectMap, "policyName", d.PolicyName) - objectMap["protectedItemType"] = "DPMProtectedItem" - populate(objectMap, "protectionState", d.ProtectionState) - populate(objectMap, "resourceGuardOperationRequests", d.ResourceGuardOperationRequests) - populate(objectMap, "sourceResourceId", d.SourceResourceID) - populate(objectMap, "workloadType", d.WorkloadType) +// MarshalJSON implements the json.Marshaller interface for type BMSPOQueryObject. +func (b BMSPOQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", b.BackupManagementType) + populate(objectMap, "containerName", b.ContainerName) + populate(objectMap, "friendlyName", b.FriendlyName) + populate(objectMap, "status", b.Status) + populate(objectMap, "workloadType", b.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DPMProtectedItem. -func (d *DPMProtectedItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSPOQueryObject. +func (b *BMSPOQueryObject) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "backupEngineName": - err = unpopulate(val, "BackupEngineName", &d.BackupEngineName) - delete(rawMsg, key) case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) - delete(rawMsg, key) - case "backupSetName": - err = unpopulate(val, "BackupSetName", &d.BackupSetName) + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) delete(rawMsg, key) case "containerName": - err = unpopulate(val, "ContainerName", &d.ContainerName) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &d.CreateMode) - delete(rawMsg, key) - case "deferredDeleteTimeInUTC": - err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &d.DeferredDeleteTimeInUTC) - delete(rawMsg, key) - case "deferredDeleteTimeRemaining": - err = unpopulate(val, "DeferredDeleteTimeRemaining", &d.DeferredDeleteTimeRemaining) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + err = unpopulate(val, "ContainerName", &b.ContainerName) delete(rawMsg, key) case "friendlyName": - err = unpopulate(val, "FriendlyName", &d.FriendlyName) - delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &d.IsArchiveEnabled) - delete(rawMsg, key) - case "isDeferredDeleteScheduleUpcoming": - err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &d.IsDeferredDeleteScheduleUpcoming) + err = unpopulate(val, "FriendlyName", &b.FriendlyName) delete(rawMsg, key) - case "isRehydrate": - err = unpopulate(val, "IsRehydrate", &d.IsRehydrate) + case "status": + err = unpopulate(val, "Status", &b.Status) delete(rawMsg, key) - case "isScheduledForDeferredDelete": - err = unpopulate(val, "IsScheduledForDeferredDelete", &d.IsScheduledForDeferredDelete) - delete(rawMsg, key) - case "lastRecoveryPoint": - err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &d.LastRecoveryPoint) - delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &d.PolicyID) - delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &d.PolicyName) - delete(rawMsg, key) - case "protectedItemType": - err = unpopulate(val, "ProtectedItemType", &d.ProtectedItemType) - delete(rawMsg, key) - case "protectionState": - err = unpopulate(val, "ProtectionState", &d.ProtectionState) - delete(rawMsg, key) - case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &d.ResourceGuardOperationRequests) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) - delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &d.WorkloadType) + case "workloadType": + err = unpopulate(val, "WorkloadType", &b.WorkloadType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DPMProtectedItemExtendedInfo. -func (d DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "diskStorageUsedInBytes", d.DiskStorageUsedInBytes) - populate(objectMap, "isCollocated", d.IsCollocated) - populate(objectMap, "isPresentOnCloud", d.IsPresentOnCloud) - populate(objectMap, "lastBackupStatus", d.LastBackupStatus) - populateTimeRFC3339(objectMap, "lastRefreshedAt", d.LastRefreshedAt) - populateTimeRFC3339(objectMap, "oldestRecoveryPoint", d.OldestRecoveryPoint) - populateTimeRFC3339(objectMap, "onPremiseLatestRecoveryPoint", d.OnPremiseLatestRecoveryPoint) - populateTimeRFC3339(objectMap, "onPremiseOldestRecoveryPoint", d.OnPremiseOldestRecoveryPoint) - populate(objectMap, "onPremiseRecoveryPointCount", d.OnPremiseRecoveryPointCount) - populate(objectMap, "protectableObjectLoadPath", d.ProtectableObjectLoadPath) - populate(objectMap, "protected", d.Protected) - populate(objectMap, "protectionGroupName", d.ProtectionGroupName) - populate(objectMap, "recoveryPointCount", d.RecoveryPointCount) - populate(objectMap, "totalDiskStorageSizeInBytes", d.TotalDiskStorageSizeInBytes) +// MarshalJSON implements the json.Marshaller interface for type BMSRPQueryObject. +func (b BMSRPQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "endDate", b.EndDate) + populate(objectMap, "extendedInfo", b.ExtendedInfo) + populate(objectMap, "moveReadyRPOnly", b.MoveReadyRPOnly) + populate(objectMap, "restorePointQueryType", b.RestorePointQueryType) + populateTimeRFC3339(objectMap, "startDate", b.StartDate) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DPMProtectedItemExtendedInfo. -func (d *DPMProtectedItemExtendedInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSRPQueryObject. +func (b *BMSRPQueryObject) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "diskStorageUsedInBytes": - err = unpopulate(val, "DiskStorageUsedInBytes", &d.DiskStorageUsedInBytes) - delete(rawMsg, key) - case "isCollocated": - err = unpopulate(val, "IsCollocated", &d.IsCollocated) - delete(rawMsg, key) - case "isPresentOnCloud": - err = unpopulate(val, "IsPresentOnCloud", &d.IsPresentOnCloud) - delete(rawMsg, key) - case "lastBackupStatus": - err = unpopulate(val, "LastBackupStatus", &d.LastBackupStatus) - delete(rawMsg, key) - case "lastRefreshedAt": - err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &d.LastRefreshedAt) - delete(rawMsg, key) - case "oldestRecoveryPoint": - err = unpopulateTimeRFC3339(val, "OldestRecoveryPoint", &d.OldestRecoveryPoint) - delete(rawMsg, key) - case "onPremiseLatestRecoveryPoint": - err = unpopulateTimeRFC3339(val, "OnPremiseLatestRecoveryPoint", &d.OnPremiseLatestRecoveryPoint) - delete(rawMsg, key) - case "onPremiseOldestRecoveryPoint": - err = unpopulateTimeRFC3339(val, "OnPremiseOldestRecoveryPoint", &d.OnPremiseOldestRecoveryPoint) - delete(rawMsg, key) - case "onPremiseRecoveryPointCount": - err = unpopulate(val, "OnPremiseRecoveryPointCount", &d.OnPremiseRecoveryPointCount) - delete(rawMsg, key) - case "protectableObjectLoadPath": - err = unpopulate(val, "ProtectableObjectLoadPath", &d.ProtectableObjectLoadPath) + case "endDate": + err = unpopulateTimeRFC3339(val, "EndDate", &b.EndDate) delete(rawMsg, key) - case "protected": - err = unpopulate(val, "Protected", &d.Protected) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &b.ExtendedInfo) delete(rawMsg, key) - case "protectionGroupName": - err = unpopulate(val, "ProtectionGroupName", &d.ProtectionGroupName) + case "moveReadyRPOnly": + err = unpopulate(val, "MoveReadyRPOnly", &b.MoveReadyRPOnly) delete(rawMsg, key) - case "recoveryPointCount": - err = unpopulate(val, "RecoveryPointCount", &d.RecoveryPointCount) + case "restorePointQueryType": + err = unpopulate(val, "RestorePointQueryType", &b.RestorePointQueryType) delete(rawMsg, key) - case "totalDiskStorageSizeInBytes": - err = unpopulate(val, "TotalDiskStorageSizeInBytes", &d.TotalDiskStorageSizeInBytes) + case "startDate": + err = unpopulateTimeRFC3339(val, "StartDate", &b.StartDate) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DailyRetentionFormat. -func (d DailyRetentionFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "daysOfTheMonth", d.DaysOfTheMonth) +// MarshalJSON implements the json.Marshaller interface for type BMSRefreshContainersQueryObject. +func (b BMSRefreshContainersQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", b.BackupManagementType) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type DailyRetentionSchedule. -func (d DailyRetentionSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "retentionDuration", d.RetentionDuration) - aux := make([]*timeRFC3339, len(d.RetentionTimes), len(d.RetentionTimes)) - for i := 0; i < len(d.RetentionTimes); i++ { - aux[i] = (*timeRFC3339)(d.RetentionTimes[i]) +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSRefreshContainersQueryObject. +func (b *BMSRefreshContainersQueryObject) UnmarshalJSON(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) } - populate(objectMap, "retentionTimes", aux) - return json.Marshal(objectMap) + for key, val := range rawMsg { + var err error + switch key { + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) + 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 DailySchedule. -func (d DailySchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - aux := make([]*timeRFC3339, len(d.ScheduleRunTimes), len(d.ScheduleRunTimes)) - for i := 0; i < len(d.ScheduleRunTimes); i++ { - aux[i] = (*timeRFC3339)(d.ScheduleRunTimes[i]) - } - populate(objectMap, "scheduleRunTimes", aux) +// MarshalJSON implements the json.Marshaller interface for type BMSWorkloadItemQueryObject. +func (b BMSWorkloadItemQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", b.BackupManagementType) + populate(objectMap, "protectionStatus", b.ProtectionStatus) + populate(objectMap, "workloadItemType", b.WorkloadItemType) + populate(objectMap, "workloadType", b.WorkloadType) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type DiskExclusionProperties. -func (d DiskExclusionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "diskLunList", d.DiskLunList) - populate(objectMap, "isInclusionList", d.IsInclusionList) - return json.Marshal(objectMap) +// UnmarshalJSON implements the json.Unmarshaller interface for type BMSWorkloadItemQueryObject. +func (b *BMSWorkloadItemQueryObject) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) + delete(rawMsg, key) + case "protectionStatus": + err = unpopulate(val, "ProtectionStatus", &b.ProtectionStatus) + delete(rawMsg, key) + case "workloadItemType": + err = unpopulate(val, "WorkloadItemType", &b.WorkloadItemType) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &b.WorkloadType) + 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 DpmBackupEngine. -func (d DpmBackupEngine) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "azureBackupAgentVersion", d.AzureBackupAgentVersion) - populate(objectMap, "backupEngineId", d.BackupEngineID) - populate(objectMap, "backupEngineState", d.BackupEngineState) - objectMap["backupEngineType"] = BackupEngineTypeDpmBackupEngine - populate(objectMap, "backupManagementType", d.BackupManagementType) - populate(objectMap, "canReRegister", d.CanReRegister) - populate(objectMap, "dpmVersion", d.DpmVersion) - populate(objectMap, "extendedInfo", d.ExtendedInfo) - populate(objectMap, "friendlyName", d.FriendlyName) - populate(objectMap, "healthStatus", d.HealthStatus) - populate(objectMap, "isAzureBackupAgentUpgradeAvailable", d.IsAzureBackupAgentUpgradeAvailable) - populate(objectMap, "isDpmUpgradeAvailable", d.IsDpmUpgradeAvailable) - populate(objectMap, "registrationStatus", d.RegistrationStatus) +// MarshalJSON implements the json.Marshaller interface for type BackupEngineBase. +func (b BackupEngineBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureBackupAgentVersion", b.AzureBackupAgentVersion) + populate(objectMap, "backupEngineId", b.BackupEngineID) + populate(objectMap, "backupEngineState", b.BackupEngineState) + objectMap["backupEngineType"] = b.BackupEngineType + populate(objectMap, "backupManagementType", b.BackupManagementType) + populate(objectMap, "canReRegister", b.CanReRegister) + populate(objectMap, "dpmVersion", b.DpmVersion) + populate(objectMap, "extendedInfo", b.ExtendedInfo) + populate(objectMap, "friendlyName", b.FriendlyName) + populate(objectMap, "healthStatus", b.HealthStatus) + populate(objectMap, "isAzureBackupAgentUpgradeAvailable", b.IsAzureBackupAgentUpgradeAvailable) + populate(objectMap, "isDpmUpgradeAvailable", b.IsDpmUpgradeAvailable) + populate(objectMap, "registrationStatus", b.RegistrationStatus) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DpmBackupEngine. -func (d *DpmBackupEngine) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupEngineBase. +func (b *BackupEngineBase) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { case "azureBackupAgentVersion": - err = unpopulate(val, "AzureBackupAgentVersion", &d.AzureBackupAgentVersion) + err = unpopulate(val, "AzureBackupAgentVersion", &b.AzureBackupAgentVersion) delete(rawMsg, key) case "backupEngineId": - err = unpopulate(val, "BackupEngineID", &d.BackupEngineID) + err = unpopulate(val, "BackupEngineID", &b.BackupEngineID) delete(rawMsg, key) case "backupEngineState": - err = unpopulate(val, "BackupEngineState", &d.BackupEngineState) + err = unpopulate(val, "BackupEngineState", &b.BackupEngineState) delete(rawMsg, key) case "backupEngineType": - err = unpopulate(val, "BackupEngineType", &d.BackupEngineType) + err = unpopulate(val, "BackupEngineType", &b.BackupEngineType) delete(rawMsg, key) case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) + err = unpopulate(val, "BackupManagementType", &b.BackupManagementType) delete(rawMsg, key) case "canReRegister": - err = unpopulate(val, "CanReRegister", &d.CanReRegister) + err = unpopulate(val, "CanReRegister", &b.CanReRegister) delete(rawMsg, key) case "dpmVersion": - err = unpopulate(val, "DpmVersion", &d.DpmVersion) + err = unpopulate(val, "DpmVersion", &b.DpmVersion) delete(rawMsg, key) case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + err = unpopulate(val, "ExtendedInfo", &b.ExtendedInfo) delete(rawMsg, key) case "friendlyName": - err = unpopulate(val, "FriendlyName", &d.FriendlyName) + err = unpopulate(val, "FriendlyName", &b.FriendlyName) delete(rawMsg, key) case "healthStatus": - err = unpopulate(val, "HealthStatus", &d.HealthStatus) + err = unpopulate(val, "HealthStatus", &b.HealthStatus) delete(rawMsg, key) case "isAzureBackupAgentUpgradeAvailable": - err = unpopulate(val, "IsAzureBackupAgentUpgradeAvailable", &d.IsAzureBackupAgentUpgradeAvailable) + err = unpopulate(val, "IsAzureBackupAgentUpgradeAvailable", &b.IsAzureBackupAgentUpgradeAvailable) delete(rawMsg, key) case "isDpmUpgradeAvailable": - err = unpopulate(val, "IsDpmUpgradeAvailable", &d.IsDpmUpgradeAvailable) + err = unpopulate(val, "IsDpmUpgradeAvailable", &b.IsDpmUpgradeAvailable) delete(rawMsg, key) case "registrationStatus": - err = unpopulate(val, "RegistrationStatus", &d.RegistrationStatus) + err = unpopulate(val, "RegistrationStatus", &b.RegistrationStatus) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DpmContainer. -func (d DpmContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", d.BackupManagementType) - populate(objectMap, "canReRegister", d.CanReRegister) - populate(objectMap, "containerId", d.ContainerID) - objectMap["containerType"] = ContainerTypeDPMContainer - populate(objectMap, "dpmAgentVersion", d.DpmAgentVersion) - populate(objectMap, "dpmServers", d.DpmServers) - populate(objectMap, "extendedInfo", d.ExtendedInfo) - populate(objectMap, "friendlyName", d.FriendlyName) - populate(objectMap, "healthStatus", d.HealthStatus) - populate(objectMap, "protectableObjectType", d.ProtectableObjectType) - populate(objectMap, "protectedItemCount", d.ProtectedItemCount) - populate(objectMap, "protectionStatus", d.ProtectionStatus) - populate(objectMap, "registrationStatus", d.RegistrationStatus) - populate(objectMap, "upgradeAvailable", d.UpgradeAvailable) +// MarshalJSON implements the json.Marshaller interface for type BackupEngineBaseResource. +func (b BackupEngineBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", b.ETag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DpmContainer. -func (d *DpmContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupEngineBaseResource. +func (b *BackupEngineBaseResource) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) - delete(rawMsg, key) - case "canReRegister": - err = unpopulate(val, "CanReRegister", &d.CanReRegister) - delete(rawMsg, key) - case "containerId": - err = unpopulate(val, "ContainerID", &d.ContainerID) - delete(rawMsg, key) - case "containerType": - err = unpopulate(val, "ContainerType", &d.ContainerType) + case "eTag": + err = unpopulate(val, "ETag", &b.ETag) delete(rawMsg, key) - case "dpmAgentVersion": - err = unpopulate(val, "DpmAgentVersion", &d.DpmAgentVersion) + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) - case "dpmServers": - err = unpopulate(val, "DpmServers", &d.DpmServers) + case "location": + err = unpopulate(val, "Location", &b.Location) delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &d.FriendlyName) + case "properties": + b.Properties, err = unmarshalBackupEngineBaseClassification(val) delete(rawMsg, key) - case "healthStatus": - err = unpopulate(val, "HealthStatus", &d.HealthStatus) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) delete(rawMsg, key) - case "protectableObjectType": - err = unpopulate(val, "ProtectableObjectType", &d.ProtectableObjectType) - delete(rawMsg, key) - case "protectedItemCount": - err = unpopulate(val, "ProtectedItemCount", &d.ProtectedItemCount) - delete(rawMsg, key) - case "protectionStatus": - err = unpopulate(val, "ProtectionStatus", &d.ProtectionStatus) - delete(rawMsg, key) - case "registrationStatus": - err = unpopulate(val, "RegistrationStatus", &d.RegistrationStatus) - delete(rawMsg, key) - case "upgradeAvailable": - err = unpopulate(val, "UpgradeAvailable", &d.UpgradeAvailable) + case "type": + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DpmErrorInfo. -func (d DpmErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorString", d.ErrorString) - populate(objectMap, "recommendations", d.Recommendations) +// MarshalJSON implements the json.Marshaller interface for type BackupEngineBaseResourceList. +func (b BackupEngineBaseResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type DpmJob. -func (d DpmJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionsInfo", d.ActionsInfo) - populate(objectMap, "activityId", d.ActivityID) - populate(objectMap, "backupManagementType", d.BackupManagementType) - populate(objectMap, "containerName", d.ContainerName) - populate(objectMap, "containerType", d.ContainerType) - populate(objectMap, "dpmServerName", d.DpmServerName) - populate(objectMap, "duration", d.Duration) - populateTimeRFC3339(objectMap, "endTime", d.EndTime) - populate(objectMap, "entityFriendlyName", d.EntityFriendlyName) - populate(objectMap, "errorDetails", d.ErrorDetails) - populate(objectMap, "extendedInfo", d.ExtendedInfo) - objectMap["jobType"] = "DpmJob" - populate(objectMap, "operation", d.Operation) - populateTimeRFC3339(objectMap, "startTime", d.StartTime) - populate(objectMap, "status", d.Status) - populate(objectMap, "workloadType", d.WorkloadType) +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupEngineBaseResourceList. +func (b *BackupEngineBaseResourceList) UnmarshalJSON(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 BackupEngineExtendedInfo. +func (b BackupEngineExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "availableDiskSpace", b.AvailableDiskSpace) + populate(objectMap, "azureProtectedInstances", b.AzureProtectedInstances) + populate(objectMap, "databaseName", b.DatabaseName) + populate(objectMap, "diskCount", b.DiskCount) + populate(objectMap, "protectedItemsCount", b.ProtectedItemsCount) + populate(objectMap, "protectedServersCount", b.ProtectedServersCount) + populateTimeRFC3339(objectMap, "refreshedAt", b.RefreshedAt) + populate(objectMap, "usedDiskSpace", b.UsedDiskSpace) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DpmJob. -func (d *DpmJob) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupEngineExtendedInfo. +func (b *BackupEngineExtendedInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "actionsInfo": - err = unpopulate(val, "ActionsInfo", &d.ActionsInfo) - delete(rawMsg, key) - case "activityId": - err = unpopulate(val, "ActivityID", &d.ActivityID) - delete(rawMsg, key) - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &d.ContainerName) - delete(rawMsg, key) - case "containerType": - err = unpopulate(val, "ContainerType", &d.ContainerType) - delete(rawMsg, key) - case "dpmServerName": - err = unpopulate(val, "DpmServerName", &d.DpmServerName) - delete(rawMsg, key) - case "duration": - err = unpopulate(val, "Duration", &d.Duration) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &d.EndTime) - delete(rawMsg, key) - case "entityFriendlyName": - err = unpopulate(val, "EntityFriendlyName", &d.EntityFriendlyName) + case "availableDiskSpace": + err = unpopulate(val, "AvailableDiskSpace", &b.AvailableDiskSpace) delete(rawMsg, key) - case "errorDetails": - err = unpopulate(val, "ErrorDetails", &d.ErrorDetails) + case "azureProtectedInstances": + err = unpopulate(val, "AzureProtectedInstances", &b.AzureProtectedInstances) delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + case "databaseName": + err = unpopulate(val, "DatabaseName", &b.DatabaseName) delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &d.JobType) + case "diskCount": + err = unpopulate(val, "DiskCount", &b.DiskCount) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &d.Operation) + case "protectedItemsCount": + err = unpopulate(val, "ProtectedItemsCount", &b.ProtectedItemsCount) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &d.StartTime) + case "protectedServersCount": + err = unpopulate(val, "ProtectedServersCount", &b.ProtectedServersCount) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) + case "refreshedAt": + err = unpopulateTimeRFC3339(val, "RefreshedAt", &b.RefreshedAt) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &d.WorkloadType) + case "usedDiskSpace": + err = unpopulate(val, "UsedDiskSpace", &b.UsedDiskSpace) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type DpmJobExtendedInfo. -func (d DpmJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dynamicErrorMessage", d.DynamicErrorMessage) - populate(objectMap, "propertyBag", d.PropertyBag) - populate(objectMap, "tasksList", d.TasksList) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DpmJobTaskDetails. -func (d DpmJobTaskDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "duration", d.Duration) - populateTimeRFC3339(objectMap, "endTime", d.EndTime) - populateTimeRFC3339(objectMap, "startTime", d.StartTime) - populate(objectMap, "status", d.Status) - populate(objectMap, "taskId", d.TaskID) +// MarshalJSON implements the json.Marshaller interface for type BackupManagementUsage. +func (b BackupManagementUsage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "currentValue", b.CurrentValue) + populate(objectMap, "limit", b.Limit) + populate(objectMap, "name", b.Name) + populateTimeRFC3339(objectMap, "nextResetTime", b.NextResetTime) + populate(objectMap, "quotaPeriod", b.QuotaPeriod) + populate(objectMap, "unit", b.Unit) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type DpmJobTaskDetails. -func (d *DpmJobTaskDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupManagementUsage. +func (b *BackupManagementUsage) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "duration": - err = unpopulate(val, "Duration", &d.Duration) + case "currentValue": + err = unpopulate(val, "CurrentValue", &b.CurrentValue) delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &d.EndTime) + case "limit": + err = unpopulate(val, "Limit", &b.Limit) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &d.StartTime) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &d.Status) + case "nextResetTime": + err = unpopulateTimeRFC3339(val, "NextResetTime", &b.NextResetTime) delete(rawMsg, key) - case "taskId": - err = unpopulate(val, "TaskID", &d.TaskID) + case "quotaPeriod": + err = unpopulate(val, "QuotaPeriod", &b.QuotaPeriod) + delete(rawMsg, key) + case "unit": + err = unpopulate(val, "Unit", &b.Unit) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", d, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", e.Code) - populate(objectMap, "message", e.Message) - populate(objectMap, "recommendations", e.Recommendations) +// MarshalJSON implements the json.Marshaller interface for type BackupManagementUsageList. +func (b BackupManagementUsageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", b.Value) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ExportJobsOperationResultInfo. -func (e *ExportJobsOperationResultInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupManagementUsageList. +func (b *BackupManagementUsageList) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "blobSasKey": - err = unpopulate(val, "BlobSasKey", &e.BlobSasKey) - delete(rawMsg, key) - case "blobUrl": - err = unpopulate(val, "BlobURL", &e.BlobURL) - delete(rawMsg, key) - case "excelFileBlobSasKey": - err = unpopulate(val, "ExcelFileBlobSasKey", &e.ExcelFileBlobSasKey) - delete(rawMsg, key) - case "excelFileBlobUrl": - err = unpopulate(val, "ExcelFileBlobURL", &e.ExcelFileBlobURL) - delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &e.ObjectType) + case "value": + err = unpopulate(val, "Value", &b.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", e, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GenericContainer. -func (g GenericContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", g.BackupManagementType) - objectMap["containerType"] = ContainerTypeGenericContainer - populate(objectMap, "extendedInformation", g.ExtendedInformation) - populate(objectMap, "fabricName", g.FabricName) - populate(objectMap, "friendlyName", g.FriendlyName) - populate(objectMap, "healthStatus", g.HealthStatus) - populate(objectMap, "protectableObjectType", g.ProtectableObjectType) - populate(objectMap, "registrationStatus", g.RegistrationStatus) +// MarshalJSON implements the json.Marshaller interface for type BackupRequest. +func (b BackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = b.ObjectType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GenericContainer. -func (g *GenericContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupRequest. +func (b *BackupRequest) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &g.BackupManagementType) - delete(rawMsg, key) - case "containerType": - err = unpopulate(val, "ContainerType", &g.ContainerType) - delete(rawMsg, key) - case "extendedInformation": - err = unpopulate(val, "ExtendedInformation", &g.ExtendedInformation) - delete(rawMsg, key) - case "fabricName": - err = unpopulate(val, "FabricName", &g.FabricName) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &g.FriendlyName) - delete(rawMsg, key) - case "healthStatus": - err = unpopulate(val, "HealthStatus", &g.HealthStatus) - delete(rawMsg, key) - case "protectableObjectType": - err = unpopulate(val, "ProtectableObjectType", &g.ProtectableObjectType) - delete(rawMsg, key) - case "registrationStatus": - err = unpopulate(val, "RegistrationStatus", &g.RegistrationStatus) + case "objectType": + err = unpopulate(val, "ObjectType", &b.ObjectType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GenericContainerExtendedInfo. -func (g GenericContainerExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "containerIdentityInfo", g.ContainerIdentityInfo) - populate(objectMap, "rawCertData", g.RawCertData) - populate(objectMap, "serviceEndpoints", g.ServiceEndpoints) +// MarshalJSON implements the json.Marshaller interface for type BackupRequestResource. +func (b BackupRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", b.ETag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type GenericProtectedItem. -func (g GenericProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", g.BackupManagementType) - populate(objectMap, "backupSetName", g.BackupSetName) - populate(objectMap, "containerName", g.ContainerName) - populate(objectMap, "createMode", g.CreateMode) - populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", g.DeferredDeleteTimeInUTC) - populate(objectMap, "deferredDeleteTimeRemaining", g.DeferredDeleteTimeRemaining) - populate(objectMap, "fabricName", g.FabricName) - populate(objectMap, "friendlyName", g.FriendlyName) - populate(objectMap, "isArchiveEnabled", g.IsArchiveEnabled) - populate(objectMap, "isDeferredDeleteScheduleUpcoming", g.IsDeferredDeleteScheduleUpcoming) - populate(objectMap, "isRehydrate", g.IsRehydrate) - populate(objectMap, "isScheduledForDeferredDelete", g.IsScheduledForDeferredDelete) - populateTimeRFC3339(objectMap, "lastRecoveryPoint", g.LastRecoveryPoint) - populate(objectMap, "policyId", g.PolicyID) - populate(objectMap, "policyName", g.PolicyName) - populate(objectMap, "policyState", g.PolicyState) - populate(objectMap, "protectedItemId", g.ProtectedItemID) - objectMap["protectedItemType"] = "GenericProtectedItem" - populate(objectMap, "protectionState", g.ProtectionState) - populate(objectMap, "resourceGuardOperationRequests", g.ResourceGuardOperationRequests) - populate(objectMap, "sourceAssociations", g.SourceAssociations) - populate(objectMap, "sourceResourceId", g.SourceResourceID) - populate(objectMap, "workloadType", g.WorkloadType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GenericProtectedItem. -func (g *GenericProtectedItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupRequestResource. +func (b *BackupRequestResource) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &g.BackupManagementType) - delete(rawMsg, key) - case "backupSetName": - err = unpopulate(val, "BackupSetName", &g.BackupSetName) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &g.ContainerName) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &g.CreateMode) - delete(rawMsg, key) - case "deferredDeleteTimeInUTC": - err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &g.DeferredDeleteTimeInUTC) - delete(rawMsg, key) - case "deferredDeleteTimeRemaining": - err = unpopulate(val, "DeferredDeleteTimeRemaining", &g.DeferredDeleteTimeRemaining) - delete(rawMsg, key) - case "fabricName": - err = unpopulate(val, "FabricName", &g.FabricName) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &g.FriendlyName) - delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &g.IsArchiveEnabled) - delete(rawMsg, key) - case "isDeferredDeleteScheduleUpcoming": - err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &g.IsDeferredDeleteScheduleUpcoming) - delete(rawMsg, key) - case "isRehydrate": - err = unpopulate(val, "IsRehydrate", &g.IsRehydrate) + case "eTag": + err = unpopulate(val, "ETag", &b.ETag) delete(rawMsg, key) - case "isScheduledForDeferredDelete": - err = unpopulate(val, "IsScheduledForDeferredDelete", &g.IsScheduledForDeferredDelete) + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) - case "lastRecoveryPoint": - err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &g.LastRecoveryPoint) + case "location": + err = unpopulate(val, "Location", &b.Location) delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &g.PolicyID) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &g.PolicyName) + case "properties": + b.Properties, err = unmarshalBackupRequestClassification(val) delete(rawMsg, key) - case "policyState": - err = unpopulate(val, "PolicyState", &g.PolicyState) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) delete(rawMsg, key) - case "protectedItemId": - err = unpopulate(val, "ProtectedItemID", &g.ProtectedItemID) + case "type": + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) - case "protectedItemType": - err = unpopulate(val, "ProtectedItemType", &g.ProtectedItemType) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackupResourceConfig. +func (b BackupResourceConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "crossRegionRestoreFlag", b.CrossRegionRestoreFlag) + populate(objectMap, "dedupState", b.DedupState) + populate(objectMap, "storageModelType", b.StorageModelType) + populate(objectMap, "storageType", b.StorageType) + populate(objectMap, "storageTypeState", b.StorageTypeState) + populate(objectMap, "xcoolState", b.XcoolState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceConfig. +func (b *BackupResourceConfig) UnmarshalJSON(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 "crossRegionRestoreFlag": + err = unpopulate(val, "CrossRegionRestoreFlag", &b.CrossRegionRestoreFlag) delete(rawMsg, key) - case "protectionState": - err = unpopulate(val, "ProtectionState", &g.ProtectionState) + case "dedupState": + err = unpopulate(val, "DedupState", &b.DedupState) delete(rawMsg, key) - case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &g.ResourceGuardOperationRequests) + case "storageModelType": + err = unpopulate(val, "StorageModelType", &b.StorageModelType) delete(rawMsg, key) - case "sourceAssociations": - err = unpopulate(val, "SourceAssociations", &g.SourceAssociations) + case "storageType": + err = unpopulate(val, "StorageType", &b.StorageType) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &g.SourceResourceID) + case "storageTypeState": + err = unpopulate(val, "StorageTypeState", &b.StorageTypeState) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &g.WorkloadType) + case "xcoolState": + err = unpopulate(val, "XcoolState", &b.XcoolState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GenericProtectionPolicy. -func (g GenericProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["backupManagementType"] = "GenericProtectionPolicy" - populate(objectMap, "fabricName", g.FabricName) - populate(objectMap, "protectedItemsCount", g.ProtectedItemsCount) - populate(objectMap, "resourceGuardOperationRequests", g.ResourceGuardOperationRequests) - populate(objectMap, "subProtectionPolicy", g.SubProtectionPolicy) - populate(objectMap, "timeZone", g.TimeZone) +// MarshalJSON implements the json.Marshaller interface for type BackupResourceConfigResource. +func (b BackupResourceConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", b.ETag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GenericProtectionPolicy. -func (g *GenericProtectionPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceConfigResource. +func (b *BackupResourceConfigResource) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &g.BackupManagementType) + case "eTag": + err = unpopulate(val, "ETag", &b.ETag) delete(rawMsg, key) - case "fabricName": - err = unpopulate(val, "FabricName", &g.FabricName) + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) - case "protectedItemsCount": - err = unpopulate(val, "ProtectedItemsCount", &g.ProtectedItemsCount) + case "location": + err = unpopulate(val, "Location", &b.Location) delete(rawMsg, key) - case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &g.ResourceGuardOperationRequests) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "subProtectionPolicy": - err = unpopulate(val, "SubProtectionPolicy", &g.SubProtectionPolicy) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) delete(rawMsg, key) - case "timeZone": - err = unpopulate(val, "TimeZone", &g.TimeZone) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type GenericRecoveryPoint. -func (g GenericRecoveryPoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "friendlyName", g.FriendlyName) - objectMap["objectType"] = "GenericRecoveryPoint" - populate(objectMap, "recoveryPointAdditionalInfo", g.RecoveryPointAdditionalInfo) - populateTimeRFC3339(objectMap, "recoveryPointTime", g.RecoveryPointTime) - populate(objectMap, "recoveryPointType", g.RecoveryPointType) +// MarshalJSON implements the json.Marshaller interface for type BackupResourceEncryptionConfig. +func (b BackupResourceEncryptionConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encryptionAtRestType", b.EncryptionAtRestType) + populate(objectMap, "infrastructureEncryptionState", b.InfrastructureEncryptionState) + populate(objectMap, "keyUri", b.KeyURI) + populate(objectMap, "lastUpdateStatus", b.LastUpdateStatus) + populate(objectMap, "subscriptionId", b.SubscriptionID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type GenericRecoveryPoint. -func (g *GenericRecoveryPoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceEncryptionConfig. +func (b *BackupResourceEncryptionConfig) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "friendlyName": - err = unpopulate(val, "FriendlyName", &g.FriendlyName) + case "encryptionAtRestType": + err = unpopulate(val, "EncryptionAtRestType", &b.EncryptionAtRestType) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &g.ObjectType) + case "infrastructureEncryptionState": + err = unpopulate(val, "InfrastructureEncryptionState", &b.InfrastructureEncryptionState) delete(rawMsg, key) - case "recoveryPointAdditionalInfo": - err = unpopulate(val, "RecoveryPointAdditionalInfo", &g.RecoveryPointAdditionalInfo) + case "keyUri": + err = unpopulate(val, "KeyURI", &b.KeyURI) delete(rawMsg, key) - case "recoveryPointTime": - err = unpopulateTimeRFC3339(val, "RecoveryPointTime", &g.RecoveryPointTime) + case "lastUpdateStatus": + err = unpopulate(val, "LastUpdateStatus", &b.LastUpdateStatus) delete(rawMsg, key) - case "recoveryPointType": - err = unpopulate(val, "RecoveryPointType", &g.RecoveryPointType) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &b.SubscriptionID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", g, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type HourlySchedule. -func (h HourlySchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "interval", h.Interval) - populate(objectMap, "scheduleWindowDuration", h.ScheduleWindowDuration) - populateTimeRFC3339(objectMap, "scheduleWindowStartTime", h.ScheduleWindowStartTime) +// MarshalJSON implements the json.Marshaller interface for type BackupResourceEncryptionConfigExtended. +func (b BackupResourceEncryptionConfigExtended) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encryptionAtRestType", b.EncryptionAtRestType) + populate(objectMap, "infrastructureEncryptionState", b.InfrastructureEncryptionState) + populate(objectMap, "keyUri", b.KeyURI) + populate(objectMap, "lastUpdateStatus", b.LastUpdateStatus) + populate(objectMap, "subscriptionId", b.SubscriptionID) + populate(objectMap, "useSystemAssignedIdentity", b.UseSystemAssignedIdentity) + populate(objectMap, "userAssignedIdentity", b.UserAssignedIdentity) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type HourlySchedule. -func (h *HourlySchedule) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceEncryptionConfigExtended. +func (b *BackupResourceEncryptionConfigExtended) UnmarshalJSON(data []byte) error { var rawMsg map[string]json.RawMessage if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "interval": - err = unpopulate(val, "Interval", &h.Interval) + case "encryptionAtRestType": + err = unpopulate(val, "EncryptionAtRestType", &b.EncryptionAtRestType) delete(rawMsg, key) - case "scheduleWindowDuration": - err = unpopulate(val, "ScheduleWindowDuration", &h.ScheduleWindowDuration) + case "infrastructureEncryptionState": + err = unpopulate(val, "InfrastructureEncryptionState", &b.InfrastructureEncryptionState) delete(rawMsg, key) - case "scheduleWindowStartTime": - err = unpopulateTimeRFC3339(val, "ScheduleWindowStartTime", &h.ScheduleWindowStartTime) + case "keyUri": + err = unpopulate(val, "KeyURI", &b.KeyURI) + delete(rawMsg, key) + case "lastUpdateStatus": + err = unpopulate(val, "LastUpdateStatus", &b.LastUpdateStatus) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &b.SubscriptionID) + delete(rawMsg, key) + case "useSystemAssignedIdentity": + err = unpopulate(val, "UseSystemAssignedIdentity", &b.UseSystemAssignedIdentity) + delete(rawMsg, key) + case "userAssignedIdentity": + err = unpopulate(val, "UserAssignedIdentity", &b.UserAssignedIdentity) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", h, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ILRRequestResource. -func (i ILRRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", i.ETag) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) +// MarshalJSON implements the json.Marshaller interface for type BackupResourceEncryptionConfigExtendedResource. +func (b BackupResourceEncryptionConfigExtendedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", b.ETag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ILRRequestResource. -func (i *ILRRequestResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceEncryptionConfigExtendedResource. +func (b *BackupResourceEncryptionConfigExtendedResource) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { case "eTag": - err = unpopulate(val, "ETag", &i.ETag) + err = unpopulate(val, "ETag", &b.ETag) delete(rawMsg, key) case "id": - err = unpopulate(val, "ID", &i.ID) + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) case "location": - err = unpopulate(val, "Location", &i.Location) + err = unpopulate(val, "Location", &b.Location) delete(rawMsg, key) case "name": - err = unpopulate(val, "Name", &i.Name) + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) case "properties": - i.Properties, err = unmarshalILRRequestClassification(val) + err = unpopulate(val, "Properties", &b.Properties) delete(rawMsg, key) case "tags": - err = unpopulate(val, "Tags", &i.Tags) + err = unpopulate(val, "Tags", &b.Tags) delete(rawMsg, key) case "type": - err = unpopulate(val, "Type", &i.Type) + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaaSVMContainer. -func (i IaaSVMContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", i.BackupManagementType) - objectMap["containerType"] = ContainerTypeIaasVMContainer - populate(objectMap, "friendlyName", i.FriendlyName) - populate(objectMap, "healthStatus", i.HealthStatus) - populate(objectMap, "protectableObjectType", i.ProtectableObjectType) - populate(objectMap, "registrationStatus", i.RegistrationStatus) - populate(objectMap, "resourceGroup", i.ResourceGroup) - populate(objectMap, "virtualMachineId", i.VirtualMachineID) - populate(objectMap, "virtualMachineVersion", i.VirtualMachineVersion) +// MarshalJSON implements the json.Marshaller interface for type BackupResourceEncryptionConfigResource. +func (b BackupResourceEncryptionConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", b.ETag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaaSVMContainer. -func (i *IaaSVMContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceEncryptionConfigResource. +func (b *BackupResourceEncryptionConfigResource) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &i.BackupManagementType) - delete(rawMsg, key) - case "containerType": - err = unpopulate(val, "ContainerType", &i.ContainerType) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &i.FriendlyName) + case "eTag": + err = unpopulate(val, "ETag", &b.ETag) delete(rawMsg, key) - case "healthStatus": - err = unpopulate(val, "HealthStatus", &i.HealthStatus) + case "id": + err = unpopulate(val, "ID", &b.ID) delete(rawMsg, key) - case "protectableObjectType": - err = unpopulate(val, "ProtectableObjectType", &i.ProtectableObjectType) + case "location": + err = unpopulate(val, "Location", &b.Location) delete(rawMsg, key) - case "registrationStatus": - err = unpopulate(val, "RegistrationStatus", &i.RegistrationStatus) + case "name": + err = unpopulate(val, "Name", &b.Name) delete(rawMsg, key) - case "resourceGroup": - err = unpopulate(val, "ResourceGroup", &i.ResourceGroup) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) delete(rawMsg, key) - case "virtualMachineId": - err = unpopulate(val, "VirtualMachineID", &i.VirtualMachineID) + case "tags": + err = unpopulate(val, "Tags", &b.Tags) delete(rawMsg, key) - case "virtualMachineVersion": - err = unpopulate(val, "VirtualMachineVersion", &i.VirtualMachineVersion) + case "type": + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaaSVMProtectableItem. -func (i IaaSVMProtectableItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", i.BackupManagementType) - populate(objectMap, "friendlyName", i.FriendlyName) - objectMap["protectableItemType"] = "IaaSVMProtectableItem" - populate(objectMap, "protectionState", i.ProtectionState) - populate(objectMap, "resourceGroup", i.ResourceGroup) - populate(objectMap, "virtualMachineId", i.VirtualMachineID) - populate(objectMap, "virtualMachineVersion", i.VirtualMachineVersion) - populate(objectMap, "workloadType", i.WorkloadType) +// MarshalJSON implements the json.Marshaller interface for type BackupResourceVaultConfig. +func (b BackupResourceVaultConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enhancedSecurityState", b.EnhancedSecurityState) + populate(objectMap, "isSoftDeleteFeatureStateEditable", b.IsSoftDeleteFeatureStateEditable) + populate(objectMap, "resourceGuardOperationRequests", b.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteFeatureState", b.SoftDeleteFeatureState) + populate(objectMap, "storageModelType", b.StorageModelType) + populate(objectMap, "storageType", b.StorageType) + populate(objectMap, "storageTypeState", b.StorageTypeState) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaaSVMProtectableItem. -func (i *IaaSVMProtectableItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceVaultConfig. +func (b *BackupResourceVaultConfig) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &i.BackupManagementType) + case "enhancedSecurityState": + err = unpopulate(val, "EnhancedSecurityState", &b.EnhancedSecurityState) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &i.FriendlyName) - delete(rawMsg, key) - case "protectableItemType": - err = unpopulate(val, "ProtectableItemType", &i.ProtectableItemType) + case "isSoftDeleteFeatureStateEditable": + err = unpopulate(val, "IsSoftDeleteFeatureStateEditable", &b.IsSoftDeleteFeatureStateEditable) delete(rawMsg, key) - case "protectionState": - err = unpopulate(val, "ProtectionState", &i.ProtectionState) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &b.ResourceGuardOperationRequests) delete(rawMsg, key) - case "resourceGroup": - err = unpopulate(val, "ResourceGroup", &i.ResourceGroup) + case "softDeleteFeatureState": + err = unpopulate(val, "SoftDeleteFeatureState", &b.SoftDeleteFeatureState) delete(rawMsg, key) - case "virtualMachineId": - err = unpopulate(val, "VirtualMachineID", &i.VirtualMachineID) + case "storageModelType": + err = unpopulate(val, "StorageModelType", &b.StorageModelType) delete(rawMsg, key) - case "virtualMachineVersion": - err = unpopulate(val, "VirtualMachineVersion", &i.VirtualMachineVersion) + case "storageType": + err = unpopulate(val, "StorageType", &b.StorageType) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &i.WorkloadType) + case "storageTypeState": + err = unpopulate(val, "StorageTypeState", &b.StorageTypeState) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaasVMBackupRequest. -func (i IaasVMBackupRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["objectType"] = "IaasVMBackupRequest" - populateTimeRFC3339(objectMap, "recoveryPointExpiryTimeInUTC", i.RecoveryPointExpiryTimeInUTC) +// MarshalJSON implements the json.Marshaller interface for type BackupResourceVaultConfigResource. +func (b BackupResourceVaultConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", b.ETag) + populate(objectMap, "id", b.ID) + populate(objectMap, "location", b.Location) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "tags", b.Tags) + populate(objectMap, "type", b.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMBackupRequest. -func (i *IaasVMBackupRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupResourceVaultConfigResource. +func (b *BackupResourceVaultConfigResource) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &i.ObjectType) + case "eTag": + err = unpopulate(val, "ETag", &b.ETag) delete(rawMsg, key) - case "recoveryPointExpiryTimeInUTC": - err = unpopulateTimeRFC3339(val, "RecoveryPointExpiryTimeInUTC", &i.RecoveryPointExpiryTimeInUTC) + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &b.Location) + 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 "tags": + err = unpopulate(val, "Tags", &b.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaasVMILRRegistrationRequest. -func (i IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "initiatorName", i.InitiatorName) - objectMap["objectType"] = "IaasVMILRRegistrationRequest" - populate(objectMap, "recoveryPointId", i.RecoveryPointID) - populate(objectMap, "renewExistingRegistration", i.RenewExistingRegistration) - populate(objectMap, "virtualMachineId", i.VirtualMachineID) +// MarshalJSON implements the json.Marshaller interface for type BackupStatusRequest. +func (b BackupStatusRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "poLogicalName", b.PoLogicalName) + populate(objectMap, "resourceId", b.ResourceID) + populate(objectMap, "resourceType", b.ResourceType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMILRRegistrationRequest. -func (i *IaasVMILRRegistrationRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupStatusRequest. +func (b *BackupStatusRequest) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "initiatorName": - err = unpopulate(val, "InitiatorName", &i.InitiatorName) + case "poLogicalName": + err = unpopulate(val, "PoLogicalName", &b.PoLogicalName) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &i.ObjectType) - delete(rawMsg, key) - case "recoveryPointId": - err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) - delete(rawMsg, key) - case "renewExistingRegistration": - err = unpopulate(val, "RenewExistingRegistration", &i.RenewExistingRegistration) + case "resourceId": + err = unpopulate(val, "ResourceID", &b.ResourceID) delete(rawMsg, key) - case "virtualMachineId": - err = unpopulate(val, "VirtualMachineID", &i.VirtualMachineID) + case "resourceType": + err = unpopulate(val, "ResourceType", &b.ResourceType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaasVMRecoveryPoint. -func (i IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "isInstantIlrSessionActive", i.IsInstantIlrSessionActive) - populate(objectMap, "isManagedVirtualMachine", i.IsManagedVirtualMachine) - populate(objectMap, "isSourceVMEncrypted", i.IsSourceVMEncrypted) - populate(objectMap, "keyAndSecret", i.KeyAndSecret) - populate(objectMap, "osType", i.OSType) - objectMap["objectType"] = "IaasVMRecoveryPoint" - populate(objectMap, "originalStorageAccountOption", i.OriginalStorageAccountOption) - populate(objectMap, "recoveryPointAdditionalInfo", i.RecoveryPointAdditionalInfo) - populate(objectMap, "recoveryPointDiskConfiguration", i.RecoveryPointDiskConfiguration) - populate(objectMap, "recoveryPointMoveReadinessInfo", i.RecoveryPointMoveReadinessInfo) - populate(objectMap, "recoveryPointTierDetails", i.RecoveryPointTierDetails) - populateTimeRFC3339(objectMap, "recoveryPointTime", i.RecoveryPointTime) - populate(objectMap, "recoveryPointType", i.RecoveryPointType) - populate(objectMap, "sourceVMStorageType", i.SourceVMStorageType) - populate(objectMap, "virtualMachineSize", i.VirtualMachineSize) - populate(objectMap, "zones", i.Zones) +// MarshalJSON implements the json.Marshaller interface for type BackupStatusResponse. +func (b BackupStatusResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containerName", b.ContainerName) + populate(objectMap, "errorCode", b.ErrorCode) + populate(objectMap, "errorMessage", b.ErrorMessage) + populate(objectMap, "fabricName", b.FabricName) + populate(objectMap, "policyName", b.PolicyName) + populate(objectMap, "protectedItemName", b.ProtectedItemName) + populate(objectMap, "protectionStatus", b.ProtectionStatus) + populate(objectMap, "registrationStatus", b.RegistrationStatus) + populate(objectMap, "vaultId", b.VaultID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMRecoveryPoint. -func (i *IaasVMRecoveryPoint) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type BackupStatusResponse. +func (b *BackupStatusResponse) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", b, err) } for key, val := range rawMsg { var err error switch key { - case "isInstantIlrSessionActive": - err = unpopulate(val, "IsInstantIlrSessionActive", &i.IsInstantIlrSessionActive) - delete(rawMsg, key) - case "isManagedVirtualMachine": - err = unpopulate(val, "IsManagedVirtualMachine", &i.IsManagedVirtualMachine) - delete(rawMsg, key) - case "isSourceVMEncrypted": - err = unpopulate(val, "IsSourceVMEncrypted", &i.IsSourceVMEncrypted) - delete(rawMsg, key) - case "keyAndSecret": - err = unpopulate(val, "KeyAndSecret", &i.KeyAndSecret) + case "containerName": + err = unpopulate(val, "ContainerName", &b.ContainerName) delete(rawMsg, key) - case "osType": - err = unpopulate(val, "OSType", &i.OSType) + case "errorCode": + err = unpopulate(val, "ErrorCode", &b.ErrorCode) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &i.ObjectType) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &b.ErrorMessage) delete(rawMsg, key) - case "originalStorageAccountOption": - err = unpopulate(val, "OriginalStorageAccountOption", &i.OriginalStorageAccountOption) + case "fabricName": + err = unpopulate(val, "FabricName", &b.FabricName) delete(rawMsg, key) - case "recoveryPointAdditionalInfo": - err = unpopulate(val, "RecoveryPointAdditionalInfo", &i.RecoveryPointAdditionalInfo) + case "policyName": + err = unpopulate(val, "PolicyName", &b.PolicyName) delete(rawMsg, key) - case "recoveryPointDiskConfiguration": - err = unpopulate(val, "RecoveryPointDiskConfiguration", &i.RecoveryPointDiskConfiguration) + case "protectedItemName": + err = unpopulate(val, "ProtectedItemName", &b.ProtectedItemName) delete(rawMsg, key) - case "recoveryPointMoveReadinessInfo": - err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &i.RecoveryPointMoveReadinessInfo) + case "protectionStatus": + err = unpopulate(val, "ProtectionStatus", &b.ProtectionStatus) delete(rawMsg, key) - case "recoveryPointTierDetails": - err = unpopulate(val, "RecoveryPointTierDetails", &i.RecoveryPointTierDetails) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &b.RegistrationStatus) delete(rawMsg, key) - case "recoveryPointTime": - err = unpopulateTimeRFC3339(val, "RecoveryPointTime", &i.RecoveryPointTime) + case "vaultId": + err = unpopulate(val, "VaultID", &b.VaultID) delete(rawMsg, key) - case "recoveryPointType": - err = unpopulate(val, "RecoveryPointType", &i.RecoveryPointType) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryDisplay. +func (c ClientDiscoveryDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", c.Description) + populate(objectMap, "operation", c.Operation) + populate(objectMap, "provider", c.Provider) + populate(objectMap, "resource", c.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryDisplay. +func (c *ClientDiscoveryDisplay) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &c.Description) delete(rawMsg, key) - case "sourceVMStorageType": - err = unpopulate(val, "SourceVMStorageType", &i.SourceVMStorageType) + case "operation": + err = unpopulate(val, "Operation", &c.Operation) delete(rawMsg, key) - case "virtualMachineSize": - err = unpopulate(val, "VirtualMachineSize", &i.VirtualMachineSize) + case "provider": + err = unpopulate(val, "Provider", &c.Provider) delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &i.Zones) + case "resource": + err = unpopulate(val, "Resource", &c.Resource) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaasVMRestoreRequest. -func (i IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "affinityGroup", i.AffinityGroup) - populate(objectMap, "createNewCloudService", i.CreateNewCloudService) - populate(objectMap, "diskEncryptionSetId", i.DiskEncryptionSetID) - populate(objectMap, "encryptionDetails", i.EncryptionDetails) - populate(objectMap, "identityBasedRestoreDetails", i.IdentityBasedRestoreDetails) - populate(objectMap, "identityInfo", i.IdentityInfo) - objectMap["objectType"] = "IaasVMRestoreRequest" - populate(objectMap, "originalStorageAccountOption", i.OriginalStorageAccountOption) - populate(objectMap, "recoveryPointId", i.RecoveryPointID) - populate(objectMap, "recoveryType", i.RecoveryType) - populate(objectMap, "region", i.Region) - populate(objectMap, "restoreDiskLunList", i.RestoreDiskLunList) - populate(objectMap, "restoreWithManagedDisks", i.RestoreWithManagedDisks) - populate(objectMap, "sourceResourceId", i.SourceResourceID) - populate(objectMap, "storageAccountId", i.StorageAccountID) - populate(objectMap, "subnetId", i.SubnetID) - populate(objectMap, "targetDomainNameId", i.TargetDomainNameID) - populate(objectMap, "targetResourceGroupId", i.TargetResourceGroupID) - populate(objectMap, "targetVirtualMachineId", i.TargetVirtualMachineID) - populate(objectMap, "virtualNetworkId", i.VirtualNetworkID) - populate(objectMap, "zones", i.Zones) +// MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryForLogSpecification. +func (c ClientDiscoveryForLogSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobDuration", c.BlobDuration) + populate(objectMap, "displayName", c.DisplayName) + populate(objectMap, "name", c.Name) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMRestoreRequest. -func (i *IaasVMRestoreRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryForLogSpecification. +func (c *ClientDiscoveryForLogSpecification) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "affinityGroup": - err = unpopulate(val, "AffinityGroup", &i.AffinityGroup) - delete(rawMsg, key) - case "createNewCloudService": - err = unpopulate(val, "CreateNewCloudService", &i.CreateNewCloudService) - delete(rawMsg, key) - case "diskEncryptionSetId": - err = unpopulate(val, "DiskEncryptionSetID", &i.DiskEncryptionSetID) - delete(rawMsg, key) - case "encryptionDetails": - err = unpopulate(val, "EncryptionDetails", &i.EncryptionDetails) - delete(rawMsg, key) - case "identityBasedRestoreDetails": - err = unpopulate(val, "IdentityBasedRestoreDetails", &i.IdentityBasedRestoreDetails) - delete(rawMsg, key) - case "identityInfo": - err = unpopulate(val, "IdentityInfo", &i.IdentityInfo) - delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &i.ObjectType) - delete(rawMsg, key) - case "originalStorageAccountOption": - err = unpopulate(val, "OriginalStorageAccountOption", &i.OriginalStorageAccountOption) - delete(rawMsg, key) - case "recoveryPointId": - err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) - delete(rawMsg, key) - case "recoveryType": - err = unpopulate(val, "RecoveryType", &i.RecoveryType) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &i.Region) - delete(rawMsg, key) - case "restoreDiskLunList": - err = unpopulate(val, "RestoreDiskLunList", &i.RestoreDiskLunList) - delete(rawMsg, key) - case "restoreWithManagedDisks": - err = unpopulate(val, "RestoreWithManagedDisks", &i.RestoreWithManagedDisks) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &i.SourceResourceID) - delete(rawMsg, key) - case "storageAccountId": - err = unpopulate(val, "StorageAccountID", &i.StorageAccountID) - delete(rawMsg, key) - case "subnetId": - err = unpopulate(val, "SubnetID", &i.SubnetID) - delete(rawMsg, key) - case "targetDomainNameId": - err = unpopulate(val, "TargetDomainNameID", &i.TargetDomainNameID) - delete(rawMsg, key) - case "targetResourceGroupId": - err = unpopulate(val, "TargetResourceGroupID", &i.TargetResourceGroupID) + case "blobDuration": + err = unpopulate(val, "BlobDuration", &c.BlobDuration) delete(rawMsg, key) - case "targetVirtualMachineId": - err = unpopulate(val, "TargetVirtualMachineID", &i.TargetVirtualMachineID) - delete(rawMsg, key) - case "virtualNetworkId": - err = unpopulate(val, "VirtualNetworkID", &i.VirtualNetworkID) + case "displayName": + err = unpopulate(val, "DisplayName", &c.DisplayName) delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &i.Zones) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type IaasVMRestoreWithRehydrationRequest. -func (i IaasVMRestoreWithRehydrationRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "affinityGroup", i.AffinityGroup) - populate(objectMap, "createNewCloudService", i.CreateNewCloudService) - populate(objectMap, "diskEncryptionSetId", i.DiskEncryptionSetID) - populate(objectMap, "encryptionDetails", i.EncryptionDetails) - populate(objectMap, "identityBasedRestoreDetails", i.IdentityBasedRestoreDetails) - populate(objectMap, "identityInfo", i.IdentityInfo) - objectMap["objectType"] = "IaasVMRestoreWithRehydrationRequest" - populate(objectMap, "originalStorageAccountOption", i.OriginalStorageAccountOption) - populate(objectMap, "recoveryPointId", i.RecoveryPointID) - populate(objectMap, "recoveryPointRehydrationInfo", i.RecoveryPointRehydrationInfo) - populate(objectMap, "recoveryType", i.RecoveryType) - populate(objectMap, "region", i.Region) - populate(objectMap, "restoreDiskLunList", i.RestoreDiskLunList) - populate(objectMap, "restoreWithManagedDisks", i.RestoreWithManagedDisks) - populate(objectMap, "sourceResourceId", i.SourceResourceID) - populate(objectMap, "storageAccountId", i.StorageAccountID) - populate(objectMap, "subnetId", i.SubnetID) - populate(objectMap, "targetDomainNameId", i.TargetDomainNameID) - populate(objectMap, "targetResourceGroupId", i.TargetResourceGroupID) - populate(objectMap, "targetVirtualMachineId", i.TargetVirtualMachineID) - populate(objectMap, "virtualNetworkId", i.VirtualNetworkID) - populate(objectMap, "zones", i.Zones) +// MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryForProperties. +func (c ClientDiscoveryForProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceSpecification", c.ServiceSpecification) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMRestoreWithRehydrationRequest. -func (i *IaasVMRestoreWithRehydrationRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryForProperties. +func (c *ClientDiscoveryForProperties) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "affinityGroup": - err = unpopulate(val, "AffinityGroup", &i.AffinityGroup) - delete(rawMsg, key) - case "createNewCloudService": - err = unpopulate(val, "CreateNewCloudService", &i.CreateNewCloudService) - delete(rawMsg, key) - case "diskEncryptionSetId": - err = unpopulate(val, "DiskEncryptionSetID", &i.DiskEncryptionSetID) - delete(rawMsg, key) - case "encryptionDetails": - err = unpopulate(val, "EncryptionDetails", &i.EncryptionDetails) - delete(rawMsg, key) - case "identityBasedRestoreDetails": - err = unpopulate(val, "IdentityBasedRestoreDetails", &i.IdentityBasedRestoreDetails) - delete(rawMsg, key) - case "identityInfo": - err = unpopulate(val, "IdentityInfo", &i.IdentityInfo) - delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &i.ObjectType) - delete(rawMsg, key) - case "originalStorageAccountOption": - err = unpopulate(val, "OriginalStorageAccountOption", &i.OriginalStorageAccountOption) - delete(rawMsg, key) - case "recoveryPointId": - err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) - delete(rawMsg, key) - case "recoveryPointRehydrationInfo": - err = unpopulate(val, "RecoveryPointRehydrationInfo", &i.RecoveryPointRehydrationInfo) - delete(rawMsg, key) - case "recoveryType": - err = unpopulate(val, "RecoveryType", &i.RecoveryType) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &i.Region) - delete(rawMsg, key) - case "restoreDiskLunList": - err = unpopulate(val, "RestoreDiskLunList", &i.RestoreDiskLunList) - delete(rawMsg, key) - case "restoreWithManagedDisks": - err = unpopulate(val, "RestoreWithManagedDisks", &i.RestoreWithManagedDisks) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &i.SourceResourceID) - delete(rawMsg, key) - case "storageAccountId": - err = unpopulate(val, "StorageAccountID", &i.StorageAccountID) - delete(rawMsg, key) - case "subnetId": - err = unpopulate(val, "SubnetID", &i.SubnetID) - delete(rawMsg, key) - case "targetDomainNameId": - err = unpopulate(val, "TargetDomainNameID", &i.TargetDomainNameID) - delete(rawMsg, key) - case "targetResourceGroupId": - err = unpopulate(val, "TargetResourceGroupID", &i.TargetResourceGroupID) - delete(rawMsg, key) - case "targetVirtualMachineId": - err = unpopulate(val, "TargetVirtualMachineID", &i.TargetVirtualMachineID) - delete(rawMsg, key) - case "virtualNetworkId": - err = unpopulate(val, "VirtualNetworkID", &i.VirtualNetworkID) - delete(rawMsg, key) - case "zones": - err = unpopulate(val, "Zones", &i.Zones) + case "serviceSpecification": + err = unpopulate(val, "ServiceSpecification", &c.ServiceSpecification) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", i, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type InquiryInfo. -func (i InquiryInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorDetail", i.ErrorDetail) - populate(objectMap, "inquiryDetails", i.InquiryDetails) - populate(objectMap, "status", i.Status) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Job. -func (j Job) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "activityId", j.ActivityID) - populate(objectMap, "backupManagementType", j.BackupManagementType) - populateTimeRFC3339(objectMap, "endTime", j.EndTime) - populate(objectMap, "entityFriendlyName", j.EntityFriendlyName) - objectMap["jobType"] = j.JobType - populate(objectMap, "operation", j.Operation) - populateTimeRFC3339(objectMap, "startTime", j.StartTime) - populate(objectMap, "status", j.Status) +// MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryForServiceSpecification. +func (c ClientDiscoveryForServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "logSpecifications", c.LogSpecifications) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type Job. -func (j *Job) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryForServiceSpecification. +func (c *ClientDiscoveryForServiceSpecification) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "activityId": - err = unpopulate(val, "ActivityID", &j.ActivityID) - delete(rawMsg, key) - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &j.BackupManagementType) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) - delete(rawMsg, key) - case "entityFriendlyName": - err = unpopulate(val, "EntityFriendlyName", &j.EntityFriendlyName) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &j.JobType) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &j.Operation) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) + case "logSpecifications": + err = unpopulate(val, "LogSpecifications", &c.LogSpecifications) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobQueryObject. -func (j *JobQueryObject) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryResponse. +func (c ClientDiscoveryResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryResponse. +func (c *ClientDiscoveryResponse) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &j.BackupManagementType) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) - delete(rawMsg, key) - case "jobId": - err = unpopulate(val, "JobID", &j.JobID) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &j.Operation) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &j.Status) + case "value": + err = unpopulate(val, "Value", &c.Value) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type JobResource. -func (j JobResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", j.ETag) - populate(objectMap, "id", j.ID) - populate(objectMap, "location", j.Location) - populate(objectMap, "name", j.Name) - populate(objectMap, "properties", j.Properties) - populate(objectMap, "tags", j.Tags) - populate(objectMap, "type", j.Type) +// MarshalJSON implements the json.Marshaller interface for type ClientDiscoveryValueForSingleAPI. +func (c ClientDiscoveryValueForSingleAPI) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", c.Display) + populate(objectMap, "name", c.Name) + populate(objectMap, "origin", c.Origin) + populate(objectMap, "properties", c.Properties) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type JobResource. -func (j *JobResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientDiscoveryValueForSingleAPI. +func (c *ClientDiscoveryValueForSingleAPI) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &j.ETag) + case "display": + err = unpopulate(val, "Display", &c.Display) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &j.ID) + case "name": + err = unpopulate(val, "Name", &c.Name) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &j.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &j.Name) + case "origin": + err = unpopulate(val, "Origin", &c.Origin) delete(rawMsg, key) case "properties": - j.Properties, err = unmarshalJobClassification(val) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &j.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &j.Type) + err = unpopulate(val, "Properties", &c.Properties) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", j, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type KPIResourceHealthDetails. -func (k KPIResourceHealthDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "resourceHealthDetails", k.ResourceHealthDetails) - populate(objectMap, "resourceHealthStatus", k.ResourceHealthStatus) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ListRecoveryPointsRecommendedForMoveRequest. -func (l ListRecoveryPointsRecommendedForMoveRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "excludedRPList", l.ExcludedRPList) - populate(objectMap, "objectType", l.ObjectType) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LogSchedulePolicy. -func (l LogSchedulePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "scheduleFrequencyInMins", l.ScheduleFrequencyInMins) - objectMap["schedulePolicyType"] = "LogSchedulePolicy" +// MarshalJSON implements the json.Marshaller interface for type ClientScriptForConnect. +func (c ClientScriptForConnect) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "osType", c.OSType) + populate(objectMap, "scriptContent", c.ScriptContent) + populate(objectMap, "scriptExtension", c.ScriptExtension) + populate(objectMap, "scriptNameSuffix", c.ScriptNameSuffix) + populate(objectMap, "url", c.URL) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LogSchedulePolicy. -func (l *LogSchedulePolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientScriptForConnect. +func (c *ClientScriptForConnect) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "scheduleFrequencyInMins": - err = unpopulate(val, "ScheduleFrequencyInMins", &l.ScheduleFrequencyInMins) + case "osType": + err = unpopulate(val, "OSType", &c.OSType) delete(rawMsg, key) - case "schedulePolicyType": - err = unpopulate(val, "SchedulePolicyType", &l.SchedulePolicyType) + case "scriptContent": + err = unpopulate(val, "ScriptContent", &c.ScriptContent) + delete(rawMsg, key) + case "scriptExtension": + err = unpopulate(val, "ScriptExtension", &c.ScriptExtension) + delete(rawMsg, key) + case "scriptNameSuffix": + err = unpopulate(val, "ScriptNameSuffix", &c.ScriptNameSuffix) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &c.URL) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LongTermRetentionPolicy. -func (l LongTermRetentionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dailySchedule", l.DailySchedule) - populate(objectMap, "monthlySchedule", l.MonthlySchedule) - objectMap["retentionPolicyType"] = "LongTermRetentionPolicy" - populate(objectMap, "weeklySchedule", l.WeeklySchedule) - populate(objectMap, "yearlySchedule", l.YearlySchedule) +// MarshalJSON implements the json.Marshaller interface for type ContainerIdentityInfo. +func (c ContainerIdentityInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "aadTenantId", c.AADTenantID) + populate(objectMap, "audience", c.Audience) + populate(objectMap, "servicePrincipalClientId", c.ServicePrincipalClientID) + populate(objectMap, "uniqueName", c.UniqueName) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermRetentionPolicy. -func (l *LongTermRetentionPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ContainerIdentityInfo. +func (c *ContainerIdentityInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } for key, val := range rawMsg { var err error switch key { - case "dailySchedule": - err = unpopulate(val, "DailySchedule", &l.DailySchedule) - delete(rawMsg, key) - case "monthlySchedule": - err = unpopulate(val, "MonthlySchedule", &l.MonthlySchedule) + case "aadTenantId": + err = unpopulate(val, "AADTenantID", &c.AADTenantID) delete(rawMsg, key) - case "retentionPolicyType": - err = unpopulate(val, "RetentionPolicyType", &l.RetentionPolicyType) + case "audience": + err = unpopulate(val, "Audience", &c.Audience) delete(rawMsg, key) - case "weeklySchedule": - err = unpopulate(val, "WeeklySchedule", &l.WeeklySchedule) + case "servicePrincipalClientId": + err = unpopulate(val, "ServicePrincipalClientID", &c.ServicePrincipalClientID) delete(rawMsg, key) - case "yearlySchedule": - err = unpopulate(val, "YearlySchedule", &l.YearlySchedule) + case "uniqueName": + err = unpopulate(val, "UniqueName", &c.UniqueName) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", c, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type LongTermSchedulePolicy. -func (l LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["schedulePolicyType"] = "LongTermSchedulePolicy" +// MarshalJSON implements the json.Marshaller interface for type DPMContainerExtendedInfo. +func (d DPMContainerExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "lastRefreshedAt", d.LastRefreshedAt) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermSchedulePolicy. -func (l *LongTermSchedulePolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DPMContainerExtendedInfo. +func (d *DPMContainerExtendedInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "schedulePolicyType": - err = unpopulate(val, "SchedulePolicyType", &l.SchedulePolicyType) + case "lastRefreshedAt": + err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &d.LastRefreshedAt) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", l, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MABContainerHealthDetails. -func (m MABContainerHealthDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", m.Code) - populate(objectMap, "message", m.Message) - populate(objectMap, "recommendations", m.Recommendations) - populate(objectMap, "title", m.Title) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MabContainer. -func (m MabContainer) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "agentVersion", m.AgentVersion) - populate(objectMap, "backupManagementType", m.BackupManagementType) - populate(objectMap, "canReRegister", m.CanReRegister) - populate(objectMap, "containerHealthState", m.ContainerHealthState) - populate(objectMap, "containerId", m.ContainerID) - objectMap["containerType"] = ContainerTypeWindows - populate(objectMap, "extendedInfo", m.ExtendedInfo) - populate(objectMap, "friendlyName", m.FriendlyName) - populate(objectMap, "healthStatus", m.HealthStatus) - populate(objectMap, "mabContainerHealthDetails", m.MabContainerHealthDetails) - populate(objectMap, "protectableObjectType", m.ProtectableObjectType) - populate(objectMap, "protectedItemCount", m.ProtectedItemCount) - populate(objectMap, "registrationStatus", m.RegistrationStatus) +// MarshalJSON implements the json.Marshaller interface for type DPMProtectedItem. +func (d DPMProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupEngineName", d.BackupEngineName) + populate(objectMap, "backupManagementType", d.BackupManagementType) + populate(objectMap, "backupSetName", d.BackupSetName) + populate(objectMap, "containerName", d.ContainerName) + populate(objectMap, "createMode", d.CreateMode) + populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", d.DeferredDeleteTimeInUTC) + populate(objectMap, "deferredDeleteTimeRemaining", d.DeferredDeleteTimeRemaining) + populate(objectMap, "extendedInfo", d.ExtendedInfo) + populate(objectMap, "friendlyName", d.FriendlyName) + populate(objectMap, "isArchiveEnabled", d.IsArchiveEnabled) + populate(objectMap, "isDeferredDeleteScheduleUpcoming", d.IsDeferredDeleteScheduleUpcoming) + populate(objectMap, "isRehydrate", d.IsRehydrate) + populate(objectMap, "isScheduledForDeferredDelete", d.IsScheduledForDeferredDelete) + populateTimeRFC3339(objectMap, "lastRecoveryPoint", d.LastRecoveryPoint) + populate(objectMap, "policyId", d.PolicyID) + populate(objectMap, "policyName", d.PolicyName) + objectMap["protectedItemType"] = "DPMProtectedItem" + populate(objectMap, "protectionState", d.ProtectionState) + populate(objectMap, "resourceGuardOperationRequests", d.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", d.SoftDeleteRetentionPeriod) + populate(objectMap, "sourceResourceId", d.SourceResourceID) + populate(objectMap, "workloadType", d.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabContainer. -func (m *MabContainer) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DPMProtectedItem. +func (d *DPMProtectedItem) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "agentVersion": - err = unpopulate(val, "AgentVersion", &m.AgentVersion) + case "backupEngineName": + err = unpopulate(val, "BackupEngineName", &d.BackupEngineName) delete(rawMsg, key) case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) + err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) delete(rawMsg, key) - case "canReRegister": - err = unpopulate(val, "CanReRegister", &m.CanReRegister) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &d.BackupSetName) delete(rawMsg, key) - case "containerHealthState": - err = unpopulate(val, "ContainerHealthState", &m.ContainerHealthState) + case "containerName": + err = unpopulate(val, "ContainerName", &d.ContainerName) delete(rawMsg, key) - case "containerId": - err = unpopulate(val, "ContainerID", &m.ContainerID) + case "createMode": + err = unpopulate(val, "CreateMode", &d.CreateMode) delete(rawMsg, key) - case "containerType": - err = unpopulate(val, "ContainerType", &m.ContainerType) + case "deferredDeleteTimeInUTC": + err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &d.DeferredDeleteTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeRemaining": + err = unpopulate(val, "DeferredDeleteTimeRemaining", &d.DeferredDeleteTimeRemaining) delete(rawMsg, key) case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &m.ExtendedInfo) + err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) delete(rawMsg, key) case "friendlyName": - err = unpopulate(val, "FriendlyName", &m.FriendlyName) + err = unpopulate(val, "FriendlyName", &d.FriendlyName) delete(rawMsg, key) - case "healthStatus": - err = unpopulate(val, "HealthStatus", &m.HealthStatus) + case "isArchiveEnabled": + err = unpopulate(val, "IsArchiveEnabled", &d.IsArchiveEnabled) delete(rawMsg, key) - case "mabContainerHealthDetails": - err = unpopulate(val, "MabContainerHealthDetails", &m.MabContainerHealthDetails) + case "isDeferredDeleteScheduleUpcoming": + err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &d.IsDeferredDeleteScheduleUpcoming) delete(rawMsg, key) - case "protectableObjectType": - err = unpopulate(val, "ProtectableObjectType", &m.ProtectableObjectType) + case "isRehydrate": + err = unpopulate(val, "IsRehydrate", &d.IsRehydrate) delete(rawMsg, key) - case "protectedItemCount": - err = unpopulate(val, "ProtectedItemCount", &m.ProtectedItemCount) + case "isScheduledForDeferredDelete": + err = unpopulate(val, "IsScheduledForDeferredDelete", &d.IsScheduledForDeferredDelete) delete(rawMsg, key) - case "registrationStatus": - err = unpopulate(val, "RegistrationStatus", &m.RegistrationStatus) + case "lastRecoveryPoint": + err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &d.LastRecoveryPoint) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &d.PolicyID) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &d.PolicyName) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &d.ProtectedItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &d.ProtectionState) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &d.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &d.SoftDeleteRetentionPeriod) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &d.WorkloadType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MabContainerExtendedInfo. -func (m MabContainerExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupItemType", m.BackupItemType) - populate(objectMap, "backupItems", m.BackupItems) - populate(objectMap, "lastBackupStatus", m.LastBackupStatus) - populateTimeRFC3339(objectMap, "lastRefreshedAt", m.LastRefreshedAt) - populate(objectMap, "policyName", m.PolicyName) +// MarshalJSON implements the json.Marshaller interface for type DPMProtectedItemExtendedInfo. +func (d DPMProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "diskStorageUsedInBytes", d.DiskStorageUsedInBytes) + populate(objectMap, "isCollocated", d.IsCollocated) + populate(objectMap, "isPresentOnCloud", d.IsPresentOnCloud) + populate(objectMap, "lastBackupStatus", d.LastBackupStatus) + populateTimeRFC3339(objectMap, "lastRefreshedAt", d.LastRefreshedAt) + populateTimeRFC3339(objectMap, "oldestRecoveryPoint", d.OldestRecoveryPoint) + populateTimeRFC3339(objectMap, "onPremiseLatestRecoveryPoint", d.OnPremiseLatestRecoveryPoint) + populateTimeRFC3339(objectMap, "onPremiseOldestRecoveryPoint", d.OnPremiseOldestRecoveryPoint) + populate(objectMap, "onPremiseRecoveryPointCount", d.OnPremiseRecoveryPointCount) + populate(objectMap, "protectableObjectLoadPath", d.ProtectableObjectLoadPath) + populate(objectMap, "protected", d.Protected) + populate(objectMap, "protectionGroupName", d.ProtectionGroupName) + populate(objectMap, "recoveryPointCount", d.RecoveryPointCount) + populate(objectMap, "totalDiskStorageSizeInBytes", d.TotalDiskStorageSizeInBytes) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabContainerExtendedInfo. -func (m *MabContainerExtendedInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type DPMProtectedItemExtendedInfo. +func (d *DPMProtectedItemExtendedInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", d, err) } for key, val := range rawMsg { var err error switch key { - case "backupItemType": - err = unpopulate(val, "BackupItemType", &m.BackupItemType) + case "diskStorageUsedInBytes": + err = unpopulate(val, "DiskStorageUsedInBytes", &d.DiskStorageUsedInBytes) delete(rawMsg, key) - case "backupItems": - err = unpopulate(val, "BackupItems", &m.BackupItems) + case "isCollocated": + err = unpopulate(val, "IsCollocated", &d.IsCollocated) + delete(rawMsg, key) + case "isPresentOnCloud": + err = unpopulate(val, "IsPresentOnCloud", &d.IsPresentOnCloud) delete(rawMsg, key) case "lastBackupStatus": - err = unpopulate(val, "LastBackupStatus", &m.LastBackupStatus) + err = unpopulate(val, "LastBackupStatus", &d.LastBackupStatus) delete(rawMsg, key) case "lastRefreshedAt": - err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &m.LastRefreshedAt) + err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &d.LastRefreshedAt) delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &m.PolicyName) + case "oldestRecoveryPoint": + err = unpopulateTimeRFC3339(val, "OldestRecoveryPoint", &d.OldestRecoveryPoint) delete(rawMsg, key) - } + case "onPremiseLatestRecoveryPoint": + err = unpopulateTimeRFC3339(val, "OnPremiseLatestRecoveryPoint", &d.OnPremiseLatestRecoveryPoint) + delete(rawMsg, key) + case "onPremiseOldestRecoveryPoint": + err = unpopulateTimeRFC3339(val, "OnPremiseOldestRecoveryPoint", &d.OnPremiseOldestRecoveryPoint) + delete(rawMsg, key) + case "onPremiseRecoveryPointCount": + err = unpopulate(val, "OnPremiseRecoveryPointCount", &d.OnPremiseRecoveryPointCount) + delete(rawMsg, key) + case "protectableObjectLoadPath": + err = unpopulate(val, "ProtectableObjectLoadPath", &d.ProtectableObjectLoadPath) + delete(rawMsg, key) + case "protected": + err = unpopulate(val, "Protected", &d.Protected) + delete(rawMsg, key) + case "protectionGroupName": + err = unpopulate(val, "ProtectionGroupName", &d.ProtectionGroupName) + delete(rawMsg, key) + case "recoveryPointCount": + err = unpopulate(val, "RecoveryPointCount", &d.RecoveryPointCount) + delete(rawMsg, key) + case "totalDiskStorageSizeInBytes": + err = unpopulate(val, "TotalDiskStorageSizeInBytes", &d.TotalDiskStorageSizeInBytes) + 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 DailyRetentionFormat. +func (d DailyRetentionFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "daysOfTheMonth", d.DaysOfTheMonth) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DailyRetentionFormat. +func (d *DailyRetentionFormat) UnmarshalJSON(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 "daysOfTheMonth": + err = unpopulate(val, "DaysOfTheMonth", &d.DaysOfTheMonth) + 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 DailyRetentionSchedule. +func (d DailyRetentionSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "retentionDuration", d.RetentionDuration) + aux := make([]*timeRFC3339, len(d.RetentionTimes), len(d.RetentionTimes)) + for i := 0; i < len(d.RetentionTimes); i++ { + aux[i] = (*timeRFC3339)(d.RetentionTimes[i]) + } + populate(objectMap, "retentionTimes", aux) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DailyRetentionSchedule. +func (d *DailyRetentionSchedule) UnmarshalJSON(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 "retentionDuration": + err = unpopulate(val, "RetentionDuration", &d.RetentionDuration) + delete(rawMsg, key) + case "retentionTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "RetentionTimes", &aux) + for _, au := range aux { + d.RetentionTimes = append(d.RetentionTimes, (*time.Time)(au)) + } + 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 DailySchedule. +func (d DailySchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + aux := make([]*timeRFC3339, len(d.ScheduleRunTimes), len(d.ScheduleRunTimes)) + for i := 0; i < len(d.ScheduleRunTimes); i++ { + aux[i] = (*timeRFC3339)(d.ScheduleRunTimes[i]) + } + populate(objectMap, "scheduleRunTimes", aux) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DailySchedule. +func (d *DailySchedule) UnmarshalJSON(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 "scheduleRunTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "ScheduleRunTimes", &aux) + for _, au := range aux { + d.ScheduleRunTimes = append(d.ScheduleRunTimes, (*time.Time)(au)) + } + 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 Day. +func (d Day) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "date", d.Date) + populate(objectMap, "isLast", d.IsLast) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Day. +func (d *Day) UnmarshalJSON(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 "date": + err = unpopulate(val, "Date", &d.Date) + delete(rawMsg, key) + case "isLast": + err = unpopulate(val, "IsLast", &d.IsLast) + 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 DiskExclusionProperties. +func (d DiskExclusionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "diskLunList", d.DiskLunList) + populate(objectMap, "isInclusionList", d.IsInclusionList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskExclusionProperties. +func (d *DiskExclusionProperties) UnmarshalJSON(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 "diskLunList": + err = unpopulate(val, "DiskLunList", &d.DiskLunList) + delete(rawMsg, key) + case "isInclusionList": + err = unpopulate(val, "IsInclusionList", &d.IsInclusionList) + 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 DiskInformation. +func (d DiskInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "lun", d.Lun) + populate(objectMap, "name", d.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiskInformation. +func (d *DiskInformation) UnmarshalJSON(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 "lun": + err = unpopulate(val, "Lun", &d.Lun) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + 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 DistributedNodesInfo. +func (d DistributedNodesInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorDetail", d.ErrorDetail) + populate(objectMap, "nodeName", d.NodeName) + populate(objectMap, "status", d.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DistributedNodesInfo. +func (d *DistributedNodesInfo) UnmarshalJSON(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 "errorDetail": + err = unpopulate(val, "ErrorDetail", &d.ErrorDetail) + delete(rawMsg, key) + case "nodeName": + err = unpopulate(val, "NodeName", &d.NodeName) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + 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 DpmBackupEngine. +func (d DpmBackupEngine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureBackupAgentVersion", d.AzureBackupAgentVersion) + populate(objectMap, "backupEngineId", d.BackupEngineID) + populate(objectMap, "backupEngineState", d.BackupEngineState) + objectMap["backupEngineType"] = BackupEngineTypeDpmBackupEngine + populate(objectMap, "backupManagementType", d.BackupManagementType) + populate(objectMap, "canReRegister", d.CanReRegister) + populate(objectMap, "dpmVersion", d.DpmVersion) + populate(objectMap, "extendedInfo", d.ExtendedInfo) + populate(objectMap, "friendlyName", d.FriendlyName) + populate(objectMap, "healthStatus", d.HealthStatus) + populate(objectMap, "isAzureBackupAgentUpgradeAvailable", d.IsAzureBackupAgentUpgradeAvailable) + populate(objectMap, "isDpmUpgradeAvailable", d.IsDpmUpgradeAvailable) + populate(objectMap, "registrationStatus", d.RegistrationStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DpmBackupEngine. +func (d *DpmBackupEngine) UnmarshalJSON(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 "azureBackupAgentVersion": + err = unpopulate(val, "AzureBackupAgentVersion", &d.AzureBackupAgentVersion) + delete(rawMsg, key) + case "backupEngineId": + err = unpopulate(val, "BackupEngineID", &d.BackupEngineID) + delete(rawMsg, key) + case "backupEngineState": + err = unpopulate(val, "BackupEngineState", &d.BackupEngineState) + delete(rawMsg, key) + case "backupEngineType": + err = unpopulate(val, "BackupEngineType", &d.BackupEngineType) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) + delete(rawMsg, key) + case "canReRegister": + err = unpopulate(val, "CanReRegister", &d.CanReRegister) + delete(rawMsg, key) + case "dpmVersion": + err = unpopulate(val, "DpmVersion", &d.DpmVersion) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &d.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &d.HealthStatus) + delete(rawMsg, key) + case "isAzureBackupAgentUpgradeAvailable": + err = unpopulate(val, "IsAzureBackupAgentUpgradeAvailable", &d.IsAzureBackupAgentUpgradeAvailable) + delete(rawMsg, key) + case "isDpmUpgradeAvailable": + err = unpopulate(val, "IsDpmUpgradeAvailable", &d.IsDpmUpgradeAvailable) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &d.RegistrationStatus) + 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 DpmContainer. +func (d DpmContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", d.BackupManagementType) + populate(objectMap, "canReRegister", d.CanReRegister) + populate(objectMap, "containerId", d.ContainerID) + objectMap["containerType"] = ProtectableContainerTypeDPMContainer + populate(objectMap, "dpmAgentVersion", d.DpmAgentVersion) + populate(objectMap, "dpmServers", d.DpmServers) + populate(objectMap, "extendedInfo", d.ExtendedInfo) + populate(objectMap, "friendlyName", d.FriendlyName) + populate(objectMap, "healthStatus", d.HealthStatus) + populate(objectMap, "protectableObjectType", d.ProtectableObjectType) + populate(objectMap, "protectedItemCount", d.ProtectedItemCount) + populate(objectMap, "protectionStatus", d.ProtectionStatus) + populate(objectMap, "registrationStatus", d.RegistrationStatus) + populate(objectMap, "upgradeAvailable", d.UpgradeAvailable) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DpmContainer. +func (d *DpmContainer) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) + delete(rawMsg, key) + case "canReRegister": + err = unpopulate(val, "CanReRegister", &d.CanReRegister) + delete(rawMsg, key) + case "containerId": + err = unpopulate(val, "ContainerID", &d.ContainerID) + delete(rawMsg, key) + case "containerType": + err = unpopulate(val, "ContainerType", &d.ContainerType) + delete(rawMsg, key) + case "dpmAgentVersion": + err = unpopulate(val, "DpmAgentVersion", &d.DpmAgentVersion) + delete(rawMsg, key) + case "dpmServers": + err = unpopulate(val, "DpmServers", &d.DpmServers) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &d.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &d.HealthStatus) + delete(rawMsg, key) + case "protectableObjectType": + err = unpopulate(val, "ProtectableObjectType", &d.ProtectableObjectType) + delete(rawMsg, key) + case "protectedItemCount": + err = unpopulate(val, "ProtectedItemCount", &d.ProtectedItemCount) + delete(rawMsg, key) + case "protectionStatus": + err = unpopulate(val, "ProtectionStatus", &d.ProtectionStatus) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &d.RegistrationStatus) + delete(rawMsg, key) + case "upgradeAvailable": + err = unpopulate(val, "UpgradeAvailable", &d.UpgradeAvailable) + 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 DpmErrorInfo. +func (d DpmErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorString", d.ErrorString) + populate(objectMap, "recommendations", d.Recommendations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DpmErrorInfo. +func (d *DpmErrorInfo) UnmarshalJSON(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 "errorString": + err = unpopulate(val, "ErrorString", &d.ErrorString) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &d.Recommendations) + 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 DpmJob. +func (d DpmJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionsInfo", d.ActionsInfo) + populate(objectMap, "activityId", d.ActivityID) + populate(objectMap, "backupManagementType", d.BackupManagementType) + populate(objectMap, "containerName", d.ContainerName) + populate(objectMap, "containerType", d.ContainerType) + populate(objectMap, "dpmServerName", d.DpmServerName) + populate(objectMap, "duration", d.Duration) + populateTimeRFC3339(objectMap, "endTime", d.EndTime) + populate(objectMap, "entityFriendlyName", d.EntityFriendlyName) + populate(objectMap, "errorDetails", d.ErrorDetails) + populate(objectMap, "extendedInfo", d.ExtendedInfo) + objectMap["jobType"] = "DpmJob" + populate(objectMap, "operation", d.Operation) + populateTimeRFC3339(objectMap, "startTime", d.StartTime) + populate(objectMap, "status", d.Status) + populate(objectMap, "workloadType", d.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DpmJob. +func (d *DpmJob) UnmarshalJSON(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 "actionsInfo": + err = unpopulate(val, "ActionsInfo", &d.ActionsInfo) + delete(rawMsg, key) + case "activityId": + err = unpopulate(val, "ActivityID", &d.ActivityID) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &d.BackupManagementType) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &d.ContainerName) + delete(rawMsg, key) + case "containerType": + err = unpopulate(val, "ContainerType", &d.ContainerType) + delete(rawMsg, key) + case "dpmServerName": + err = unpopulate(val, "DpmServerName", &d.DpmServerName) + delete(rawMsg, key) + case "duration": + err = unpopulate(val, "Duration", &d.Duration) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &d.EndTime) + delete(rawMsg, key) + case "entityFriendlyName": + err = unpopulate(val, "EntityFriendlyName", &d.EntityFriendlyName) + delete(rawMsg, key) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &d.ErrorDetails) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &d.ExtendedInfo) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &d.JobType) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &d.Operation) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &d.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &d.WorkloadType) + 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 DpmJobExtendedInfo. +func (d DpmJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dynamicErrorMessage", d.DynamicErrorMessage) + populate(objectMap, "propertyBag", d.PropertyBag) + populate(objectMap, "tasksList", d.TasksList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DpmJobExtendedInfo. +func (d *DpmJobExtendedInfo) UnmarshalJSON(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 "dynamicErrorMessage": + err = unpopulate(val, "DynamicErrorMessage", &d.DynamicErrorMessage) + delete(rawMsg, key) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &d.PropertyBag) + delete(rawMsg, key) + case "tasksList": + err = unpopulate(val, "TasksList", &d.TasksList) + 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 DpmJobTaskDetails. +func (d DpmJobTaskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "duration", d.Duration) + populateTimeRFC3339(objectMap, "endTime", d.EndTime) + populateTimeRFC3339(objectMap, "startTime", d.StartTime) + populate(objectMap, "status", d.Status) + populate(objectMap, "taskId", d.TaskID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DpmJobTaskDetails. +func (d *DpmJobTaskDetails) UnmarshalJSON(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 "duration": + err = unpopulate(val, "Duration", &d.Duration) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &d.EndTime) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &d.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &d.Status) + delete(rawMsg, key) + case "taskId": + err = unpopulate(val, "TaskID", &d.TaskID) + 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 EncryptionDetails. +func (e EncryptionDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "encryptionEnabled", e.EncryptionEnabled) + populate(objectMap, "kekUrl", e.KekURL) + populate(objectMap, "kekVaultId", e.KekVaultID) + populate(objectMap, "secretKeyUrl", e.SecretKeyURL) + populate(objectMap, "secretKeyVaultId", e.SecretKeyVaultID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EncryptionDetails. +func (e *EncryptionDetails) UnmarshalJSON(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 "encryptionEnabled": + err = unpopulate(val, "EncryptionEnabled", &e.EncryptionEnabled) + delete(rawMsg, key) + case "kekUrl": + err = unpopulate(val, "KekURL", &e.KekURL) + delete(rawMsg, key) + case "kekVaultId": + err = unpopulate(val, "KekVaultID", &e.KekVaultID) + delete(rawMsg, key) + case "secretKeyUrl": + err = unpopulate(val, "SecretKeyURL", &e.SecretKeyURL) + delete(rawMsg, key) + case "secretKeyVaultId": + err = unpopulate(val, "SecretKeyVaultID", &e.SecretKeyVaultID) + 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 ErrorAdditionalInfo. +func (e ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "info", &e.Info) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorAdditionalInfo. +func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "info": + err = unpopulate(val, "Info", &e.Info) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + populate(objectMap, "recommendations", e.Recommendations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &e.Recommendations) + 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 ExportJobsOperationResultInfo. +func (e ExportJobsOperationResultInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "blobSasKey", e.BlobSasKey) + populate(objectMap, "blobUrl", e.BlobURL) + populate(objectMap, "excelFileBlobSasKey", e.ExcelFileBlobSasKey) + populate(objectMap, "excelFileBlobUrl", e.ExcelFileBlobURL) + objectMap["objectType"] = "ExportJobsOperationResultInfo" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExportJobsOperationResultInfo. +func (e *ExportJobsOperationResultInfo) UnmarshalJSON(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 "blobSasKey": + err = unpopulate(val, "BlobSasKey", &e.BlobSasKey) + delete(rawMsg, key) + case "blobUrl": + err = unpopulate(val, "BlobURL", &e.BlobURL) + delete(rawMsg, key) + case "excelFileBlobSasKey": + err = unpopulate(val, "ExcelFileBlobSasKey", &e.ExcelFileBlobSasKey) + delete(rawMsg, key) + case "excelFileBlobUrl": + err = unpopulate(val, "ExcelFileBlobURL", &e.ExcelFileBlobURL) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &e.ObjectType) + 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 ExtendedProperties. +func (e ExtendedProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "diskExclusionProperties", e.DiskExclusionProperties) + populate(objectMap, "linuxVmApplicationName", e.LinuxVMApplicationName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExtendedProperties. +func (e *ExtendedProperties) UnmarshalJSON(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 "diskExclusionProperties": + err = unpopulate(val, "DiskExclusionProperties", &e.DiskExclusionProperties) + delete(rawMsg, key) + case "linuxVmApplicationName": + err = unpopulate(val, "LinuxVMApplicationName", &e.LinuxVMApplicationName) + 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 FeatureSupportRequest. +func (f FeatureSupportRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["featureType"] = f.FeatureType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FeatureSupportRequest. +func (f *FeatureSupportRequest) UnmarshalJSON(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 "featureType": + err = unpopulate(val, "FeatureType", &f.FeatureType) + 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 GenericContainer. +func (g GenericContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", g.BackupManagementType) + objectMap["containerType"] = ProtectableContainerTypeGenericContainer + populate(objectMap, "extendedInformation", g.ExtendedInformation) + populate(objectMap, "fabricName", g.FabricName) + populate(objectMap, "friendlyName", g.FriendlyName) + populate(objectMap, "healthStatus", g.HealthStatus) + populate(objectMap, "protectableObjectType", g.ProtectableObjectType) + populate(objectMap, "registrationStatus", g.RegistrationStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenericContainer. +func (g *GenericContainer) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &g.BackupManagementType) + delete(rawMsg, key) + case "containerType": + err = unpopulate(val, "ContainerType", &g.ContainerType) + delete(rawMsg, key) + case "extendedInformation": + err = unpopulate(val, "ExtendedInformation", &g.ExtendedInformation) + delete(rawMsg, key) + case "fabricName": + err = unpopulate(val, "FabricName", &g.FabricName) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &g.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &g.HealthStatus) + delete(rawMsg, key) + case "protectableObjectType": + err = unpopulate(val, "ProtectableObjectType", &g.ProtectableObjectType) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &g.RegistrationStatus) + 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 GenericContainerExtendedInfo. +func (g GenericContainerExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containerIdentityInfo", g.ContainerIdentityInfo) + populate(objectMap, "rawCertData", g.RawCertData) + populate(objectMap, "serviceEndpoints", g.ServiceEndpoints) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenericContainerExtendedInfo. +func (g *GenericContainerExtendedInfo) UnmarshalJSON(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 "containerIdentityInfo": + err = unpopulate(val, "ContainerIdentityInfo", &g.ContainerIdentityInfo) + delete(rawMsg, key) + case "rawCertData": + err = unpopulate(val, "RawCertData", &g.RawCertData) + delete(rawMsg, key) + case "serviceEndpoints": + err = unpopulate(val, "ServiceEndpoints", &g.ServiceEndpoints) + 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 GenericProtectedItem. +func (g GenericProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", g.BackupManagementType) + populate(objectMap, "backupSetName", g.BackupSetName) + populate(objectMap, "containerName", g.ContainerName) + populate(objectMap, "createMode", g.CreateMode) + populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", g.DeferredDeleteTimeInUTC) + populate(objectMap, "deferredDeleteTimeRemaining", g.DeferredDeleteTimeRemaining) + populate(objectMap, "fabricName", g.FabricName) + populate(objectMap, "friendlyName", g.FriendlyName) + populate(objectMap, "isArchiveEnabled", g.IsArchiveEnabled) + populate(objectMap, "isDeferredDeleteScheduleUpcoming", g.IsDeferredDeleteScheduleUpcoming) + populate(objectMap, "isRehydrate", g.IsRehydrate) + populate(objectMap, "isScheduledForDeferredDelete", g.IsScheduledForDeferredDelete) + populateTimeRFC3339(objectMap, "lastRecoveryPoint", g.LastRecoveryPoint) + populate(objectMap, "policyId", g.PolicyID) + populate(objectMap, "policyName", g.PolicyName) + populate(objectMap, "policyState", g.PolicyState) + populate(objectMap, "protectedItemId", g.ProtectedItemID) + objectMap["protectedItemType"] = "GenericProtectedItem" + populate(objectMap, "protectionState", g.ProtectionState) + populate(objectMap, "resourceGuardOperationRequests", g.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", g.SoftDeleteRetentionPeriod) + populate(objectMap, "sourceAssociations", g.SourceAssociations) + populate(objectMap, "sourceResourceId", g.SourceResourceID) + populate(objectMap, "workloadType", g.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenericProtectedItem. +func (g *GenericProtectedItem) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &g.BackupManagementType) + delete(rawMsg, key) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &g.BackupSetName) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &g.ContainerName) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &g.CreateMode) + delete(rawMsg, key) + case "deferredDeleteTimeInUTC": + err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &g.DeferredDeleteTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeRemaining": + err = unpopulate(val, "DeferredDeleteTimeRemaining", &g.DeferredDeleteTimeRemaining) + delete(rawMsg, key) + case "fabricName": + err = unpopulate(val, "FabricName", &g.FabricName) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &g.FriendlyName) + delete(rawMsg, key) + case "isArchiveEnabled": + err = unpopulate(val, "IsArchiveEnabled", &g.IsArchiveEnabled) + delete(rawMsg, key) + case "isDeferredDeleteScheduleUpcoming": + err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &g.IsDeferredDeleteScheduleUpcoming) + delete(rawMsg, key) + case "isRehydrate": + err = unpopulate(val, "IsRehydrate", &g.IsRehydrate) + delete(rawMsg, key) + case "isScheduledForDeferredDelete": + err = unpopulate(val, "IsScheduledForDeferredDelete", &g.IsScheduledForDeferredDelete) + delete(rawMsg, key) + case "lastRecoveryPoint": + err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &g.LastRecoveryPoint) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &g.PolicyID) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &g.PolicyName) + delete(rawMsg, key) + case "policyState": + err = unpopulate(val, "PolicyState", &g.PolicyState) + delete(rawMsg, key) + case "protectedItemId": + err = unpopulate(val, "ProtectedItemID", &g.ProtectedItemID) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &g.ProtectedItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &g.ProtectionState) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &g.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &g.SoftDeleteRetentionPeriod) + delete(rawMsg, key) + case "sourceAssociations": + err = unpopulate(val, "SourceAssociations", &g.SourceAssociations) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &g.SourceResourceID) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &g.WorkloadType) + 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 GenericProtectionPolicy. +func (g GenericProtectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["backupManagementType"] = "GenericProtectionPolicy" + populate(objectMap, "fabricName", g.FabricName) + populate(objectMap, "protectedItemsCount", g.ProtectedItemsCount) + populate(objectMap, "resourceGuardOperationRequests", g.ResourceGuardOperationRequests) + populate(objectMap, "subProtectionPolicy", g.SubProtectionPolicy) + populate(objectMap, "timeZone", g.TimeZone) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenericProtectionPolicy. +func (g *GenericProtectionPolicy) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &g.BackupManagementType) + delete(rawMsg, key) + case "fabricName": + err = unpopulate(val, "FabricName", &g.FabricName) + delete(rawMsg, key) + case "protectedItemsCount": + err = unpopulate(val, "ProtectedItemsCount", &g.ProtectedItemsCount) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &g.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "subProtectionPolicy": + err = unpopulate(val, "SubProtectionPolicy", &g.SubProtectionPolicy) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &g.TimeZone) + 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 GenericRecoveryPoint. +func (g GenericRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "friendlyName", g.FriendlyName) + objectMap["objectType"] = "GenericRecoveryPoint" + populate(objectMap, "recoveryPointAdditionalInfo", g.RecoveryPointAdditionalInfo) + populate(objectMap, "recoveryPointProperties", g.RecoveryPointProperties) + populateTimeRFC3339(objectMap, "recoveryPointTime", g.RecoveryPointTime) + populate(objectMap, "recoveryPointType", g.RecoveryPointType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenericRecoveryPoint. +func (g *GenericRecoveryPoint) UnmarshalJSON(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 "friendlyName": + err = unpopulate(val, "FriendlyName", &g.FriendlyName) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &g.ObjectType) + delete(rawMsg, key) + case "recoveryPointAdditionalInfo": + err = unpopulate(val, "RecoveryPointAdditionalInfo", &g.RecoveryPointAdditionalInfo) + delete(rawMsg, key) + case "recoveryPointProperties": + err = unpopulate(val, "RecoveryPointProperties", &g.RecoveryPointProperties) + delete(rawMsg, key) + case "recoveryPointTime": + err = unpopulateTimeRFC3339(val, "RecoveryPointTime", &g.RecoveryPointTime) + delete(rawMsg, key) + case "recoveryPointType": + err = unpopulate(val, "RecoveryPointType", &g.RecoveryPointType) + 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 GetProtectedItemQueryObject. +func (g GetProtectedItemQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "expand", g.Expand) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GetProtectedItemQueryObject. +func (g *GetProtectedItemQueryObject) UnmarshalJSON(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 "expand": + err = unpopulate(val, "Expand", &g.Expand) + 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 HourlySchedule. +func (h HourlySchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "interval", h.Interval) + populate(objectMap, "scheduleWindowDuration", h.ScheduleWindowDuration) + populateTimeRFC3339(objectMap, "scheduleWindowStartTime", h.ScheduleWindowStartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HourlySchedule. +func (h *HourlySchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "interval": + err = unpopulate(val, "Interval", &h.Interval) + delete(rawMsg, key) + case "scheduleWindowDuration": + err = unpopulate(val, "ScheduleWindowDuration", &h.ScheduleWindowDuration) + delete(rawMsg, key) + case "scheduleWindowStartTime": + err = unpopulateTimeRFC3339(val, "ScheduleWindowStartTime", &h.ScheduleWindowStartTime) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", h, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ILRRequest. +func (i ILRRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = i.ObjectType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ILRRequest. +func (i *ILRRequest) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + 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 ILRRequestResource. +func (i ILRRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", i.ETag) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ILRRequestResource. +func (i *ILRRequestResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &i.ETag) + delete(rawMsg, 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": + i.Properties, err = unmarshalILRRequestClassification(val) + 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 IaaSVMContainer. +func (i IaaSVMContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", i.BackupManagementType) + objectMap["containerType"] = ProtectableContainerTypeIaasVMContainer + populate(objectMap, "friendlyName", i.FriendlyName) + populate(objectMap, "healthStatus", i.HealthStatus) + populate(objectMap, "protectableObjectType", i.ProtectableObjectType) + populate(objectMap, "registrationStatus", i.RegistrationStatus) + populate(objectMap, "resourceGroup", i.ResourceGroup) + populate(objectMap, "virtualMachineId", i.VirtualMachineID) + populate(objectMap, "virtualMachineVersion", i.VirtualMachineVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaaSVMContainer. +func (i *IaaSVMContainer) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &i.BackupManagementType) + delete(rawMsg, key) + case "containerType": + err = unpopulate(val, "ContainerType", &i.ContainerType) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &i.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &i.HealthStatus) + delete(rawMsg, key) + case "protectableObjectType": + err = unpopulate(val, "ProtectableObjectType", &i.ProtectableObjectType) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &i.RegistrationStatus) + delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, "ResourceGroup", &i.ResourceGroup) + delete(rawMsg, key) + case "virtualMachineId": + err = unpopulate(val, "VirtualMachineID", &i.VirtualMachineID) + delete(rawMsg, key) + case "virtualMachineVersion": + err = unpopulate(val, "VirtualMachineVersion", &i.VirtualMachineVersion) + 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 IaaSVMProtectableItem. +func (i IaaSVMProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", i.BackupManagementType) + populate(objectMap, "friendlyName", i.FriendlyName) + objectMap["protectableItemType"] = "IaaSVMProtectableItem" + populate(objectMap, "protectionState", i.ProtectionState) + populate(objectMap, "resourceGroup", i.ResourceGroup) + populate(objectMap, "virtualMachineId", i.VirtualMachineID) + populate(objectMap, "virtualMachineVersion", i.VirtualMachineVersion) + populate(objectMap, "workloadType", i.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaaSVMProtectableItem. +func (i *IaaSVMProtectableItem) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &i.BackupManagementType) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &i.FriendlyName) + delete(rawMsg, key) + case "protectableItemType": + err = unpopulate(val, "ProtectableItemType", &i.ProtectableItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &i.ProtectionState) + delete(rawMsg, key) + case "resourceGroup": + err = unpopulate(val, "ResourceGroup", &i.ResourceGroup) + delete(rawMsg, key) + case "virtualMachineId": + err = unpopulate(val, "VirtualMachineID", &i.VirtualMachineID) + delete(rawMsg, key) + case "virtualMachineVersion": + err = unpopulate(val, "VirtualMachineVersion", &i.VirtualMachineVersion) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &i.WorkloadType) + 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 IaasVMBackupRequest. +func (i IaasVMBackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = "IaasVMBackupRequest" + populateTimeRFC3339(objectMap, "recoveryPointExpiryTimeInUTC", i.RecoveryPointExpiryTimeInUTC) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMBackupRequest. +func (i *IaasVMBackupRequest) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + delete(rawMsg, key) + case "recoveryPointExpiryTimeInUTC": + err = unpopulateTimeRFC3339(val, "RecoveryPointExpiryTimeInUTC", &i.RecoveryPointExpiryTimeInUTC) + 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 IaasVMILRRegistrationRequest. +func (i IaasVMILRRegistrationRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "initiatorName", i.InitiatorName) + objectMap["objectType"] = "IaasVMILRRegistrationRequest" + populate(objectMap, "recoveryPointId", i.RecoveryPointID) + populate(objectMap, "renewExistingRegistration", i.RenewExistingRegistration) + populate(objectMap, "virtualMachineId", i.VirtualMachineID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMILRRegistrationRequest. +func (i *IaasVMILRRegistrationRequest) UnmarshalJSON(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 "initiatorName": + err = unpopulate(val, "InitiatorName", &i.InitiatorName) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + delete(rawMsg, key) + case "recoveryPointId": + err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) + delete(rawMsg, key) + case "renewExistingRegistration": + err = unpopulate(val, "RenewExistingRegistration", &i.RenewExistingRegistration) + delete(rawMsg, key) + case "virtualMachineId": + err = unpopulate(val, "VirtualMachineID", &i.VirtualMachineID) + 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 IaasVMRecoveryPoint. +func (i IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isInstantIlrSessionActive", i.IsInstantIlrSessionActive) + populate(objectMap, "isManagedVirtualMachine", i.IsManagedVirtualMachine) + populate(objectMap, "isSourceVMEncrypted", i.IsSourceVMEncrypted) + populate(objectMap, "keyAndSecret", i.KeyAndSecret) + populate(objectMap, "osType", i.OSType) + objectMap["objectType"] = "IaasVMRecoveryPoint" + populate(objectMap, "originalStorageAccountOption", i.OriginalStorageAccountOption) + populate(objectMap, "recoveryPointAdditionalInfo", i.RecoveryPointAdditionalInfo) + populate(objectMap, "recoveryPointDiskConfiguration", i.RecoveryPointDiskConfiguration) + populate(objectMap, "recoveryPointMoveReadinessInfo", i.RecoveryPointMoveReadinessInfo) + populate(objectMap, "recoveryPointProperties", i.RecoveryPointProperties) + populate(objectMap, "recoveryPointTierDetails", i.RecoveryPointTierDetails) + populateTimeRFC3339(objectMap, "recoveryPointTime", i.RecoveryPointTime) + populate(objectMap, "recoveryPointType", i.RecoveryPointType) + populate(objectMap, "sourceVMStorageType", i.SourceVMStorageType) + populate(objectMap, "virtualMachineSize", i.VirtualMachineSize) + populate(objectMap, "zones", i.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMRecoveryPoint. +func (i *IaasVMRecoveryPoint) UnmarshalJSON(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 "isInstantIlrSessionActive": + err = unpopulate(val, "IsInstantIlrSessionActive", &i.IsInstantIlrSessionActive) + delete(rawMsg, key) + case "isManagedVirtualMachine": + err = unpopulate(val, "IsManagedVirtualMachine", &i.IsManagedVirtualMachine) + delete(rawMsg, key) + case "isSourceVMEncrypted": + err = unpopulate(val, "IsSourceVMEncrypted", &i.IsSourceVMEncrypted) + delete(rawMsg, key) + case "keyAndSecret": + err = unpopulate(val, "KeyAndSecret", &i.KeyAndSecret) + delete(rawMsg, key) + case "osType": + err = unpopulate(val, "OSType", &i.OSType) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + delete(rawMsg, key) + case "originalStorageAccountOption": + err = unpopulate(val, "OriginalStorageAccountOption", &i.OriginalStorageAccountOption) + delete(rawMsg, key) + case "recoveryPointAdditionalInfo": + err = unpopulate(val, "RecoveryPointAdditionalInfo", &i.RecoveryPointAdditionalInfo) + delete(rawMsg, key) + case "recoveryPointDiskConfiguration": + err = unpopulate(val, "RecoveryPointDiskConfiguration", &i.RecoveryPointDiskConfiguration) + delete(rawMsg, key) + case "recoveryPointMoveReadinessInfo": + err = unpopulate(val, "RecoveryPointMoveReadinessInfo", &i.RecoveryPointMoveReadinessInfo) + delete(rawMsg, key) + case "recoveryPointProperties": + err = unpopulate(val, "RecoveryPointProperties", &i.RecoveryPointProperties) + delete(rawMsg, key) + case "recoveryPointTierDetails": + err = unpopulate(val, "RecoveryPointTierDetails", &i.RecoveryPointTierDetails) + delete(rawMsg, key) + case "recoveryPointTime": + err = unpopulateTimeRFC3339(val, "RecoveryPointTime", &i.RecoveryPointTime) + delete(rawMsg, key) + case "recoveryPointType": + err = unpopulate(val, "RecoveryPointType", &i.RecoveryPointType) + delete(rawMsg, key) + case "sourceVMStorageType": + err = unpopulate(val, "SourceVMStorageType", &i.SourceVMStorageType) + delete(rawMsg, key) + case "virtualMachineSize": + err = unpopulate(val, "VirtualMachineSize", &i.VirtualMachineSize) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &i.Zones) + 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 IaasVMRestoreRequest. +func (i IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "affinityGroup", i.AffinityGroup) + populate(objectMap, "createNewCloudService", i.CreateNewCloudService) + populate(objectMap, "diskEncryptionSetId", i.DiskEncryptionSetID) + populate(objectMap, "encryptionDetails", i.EncryptionDetails) + populate(objectMap, "identityBasedRestoreDetails", i.IdentityBasedRestoreDetails) + populate(objectMap, "identityInfo", i.IdentityInfo) + objectMap["objectType"] = "IaasVMRestoreRequest" + populate(objectMap, "originalStorageAccountOption", i.OriginalStorageAccountOption) + populate(objectMap, "recoveryPointId", i.RecoveryPointID) + populate(objectMap, "recoveryType", i.RecoveryType) + populate(objectMap, "region", i.Region) + populate(objectMap, "restoreDiskLunList", i.RestoreDiskLunList) + populate(objectMap, "restoreWithManagedDisks", i.RestoreWithManagedDisks) + populate(objectMap, "sourceResourceId", i.SourceResourceID) + populate(objectMap, "storageAccountId", i.StorageAccountID) + populate(objectMap, "subnetId", i.SubnetID) + populate(objectMap, "targetDomainNameId", i.TargetDomainNameID) + populate(objectMap, "targetResourceGroupId", i.TargetResourceGroupID) + populate(objectMap, "targetVirtualMachineId", i.TargetVirtualMachineID) + populate(objectMap, "virtualNetworkId", i.VirtualNetworkID) + populate(objectMap, "zones", i.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMRestoreRequest. +func (i *IaasVMRestoreRequest) UnmarshalJSON(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 "affinityGroup": + err = unpopulate(val, "AffinityGroup", &i.AffinityGroup) + delete(rawMsg, key) + case "createNewCloudService": + err = unpopulate(val, "CreateNewCloudService", &i.CreateNewCloudService) + delete(rawMsg, key) + case "diskEncryptionSetId": + err = unpopulate(val, "DiskEncryptionSetID", &i.DiskEncryptionSetID) + delete(rawMsg, key) + case "encryptionDetails": + err = unpopulate(val, "EncryptionDetails", &i.EncryptionDetails) + delete(rawMsg, key) + case "identityBasedRestoreDetails": + err = unpopulate(val, "IdentityBasedRestoreDetails", &i.IdentityBasedRestoreDetails) + delete(rawMsg, key) + case "identityInfo": + err = unpopulate(val, "IdentityInfo", &i.IdentityInfo) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + delete(rawMsg, key) + case "originalStorageAccountOption": + err = unpopulate(val, "OriginalStorageAccountOption", &i.OriginalStorageAccountOption) + delete(rawMsg, key) + case "recoveryPointId": + err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) + delete(rawMsg, key) + case "recoveryType": + err = unpopulate(val, "RecoveryType", &i.RecoveryType) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &i.Region) + delete(rawMsg, key) + case "restoreDiskLunList": + err = unpopulate(val, "RestoreDiskLunList", &i.RestoreDiskLunList) + delete(rawMsg, key) + case "restoreWithManagedDisks": + err = unpopulate(val, "RestoreWithManagedDisks", &i.RestoreWithManagedDisks) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &i.SourceResourceID) + delete(rawMsg, key) + case "storageAccountId": + err = unpopulate(val, "StorageAccountID", &i.StorageAccountID) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &i.SubnetID) + delete(rawMsg, key) + case "targetDomainNameId": + err = unpopulate(val, "TargetDomainNameID", &i.TargetDomainNameID) + delete(rawMsg, key) + case "targetResourceGroupId": + err = unpopulate(val, "TargetResourceGroupID", &i.TargetResourceGroupID) + delete(rawMsg, key) + case "targetVirtualMachineId": + err = unpopulate(val, "TargetVirtualMachineID", &i.TargetVirtualMachineID) + delete(rawMsg, key) + case "virtualNetworkId": + err = unpopulate(val, "VirtualNetworkID", &i.VirtualNetworkID) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &i.Zones) + 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 IaasVMRestoreWithRehydrationRequest. +func (i IaasVMRestoreWithRehydrationRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "affinityGroup", i.AffinityGroup) + populate(objectMap, "createNewCloudService", i.CreateNewCloudService) + populate(objectMap, "diskEncryptionSetId", i.DiskEncryptionSetID) + populate(objectMap, "encryptionDetails", i.EncryptionDetails) + populate(objectMap, "identityBasedRestoreDetails", i.IdentityBasedRestoreDetails) + populate(objectMap, "identityInfo", i.IdentityInfo) + objectMap["objectType"] = "IaasVMRestoreWithRehydrationRequest" + populate(objectMap, "originalStorageAccountOption", i.OriginalStorageAccountOption) + populate(objectMap, "recoveryPointId", i.RecoveryPointID) + populate(objectMap, "recoveryPointRehydrationInfo", i.RecoveryPointRehydrationInfo) + populate(objectMap, "recoveryType", i.RecoveryType) + populate(objectMap, "region", i.Region) + populate(objectMap, "restoreDiskLunList", i.RestoreDiskLunList) + populate(objectMap, "restoreWithManagedDisks", i.RestoreWithManagedDisks) + populate(objectMap, "sourceResourceId", i.SourceResourceID) + populate(objectMap, "storageAccountId", i.StorageAccountID) + populate(objectMap, "subnetId", i.SubnetID) + populate(objectMap, "targetDomainNameId", i.TargetDomainNameID) + populate(objectMap, "targetResourceGroupId", i.TargetResourceGroupID) + populate(objectMap, "targetVirtualMachineId", i.TargetVirtualMachineID) + populate(objectMap, "virtualNetworkId", i.VirtualNetworkID) + populate(objectMap, "zones", i.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IaasVMRestoreWithRehydrationRequest. +func (i *IaasVMRestoreWithRehydrationRequest) UnmarshalJSON(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 "affinityGroup": + err = unpopulate(val, "AffinityGroup", &i.AffinityGroup) + delete(rawMsg, key) + case "createNewCloudService": + err = unpopulate(val, "CreateNewCloudService", &i.CreateNewCloudService) + delete(rawMsg, key) + case "diskEncryptionSetId": + err = unpopulate(val, "DiskEncryptionSetID", &i.DiskEncryptionSetID) + delete(rawMsg, key) + case "encryptionDetails": + err = unpopulate(val, "EncryptionDetails", &i.EncryptionDetails) + delete(rawMsg, key) + case "identityBasedRestoreDetails": + err = unpopulate(val, "IdentityBasedRestoreDetails", &i.IdentityBasedRestoreDetails) + delete(rawMsg, key) + case "identityInfo": + err = unpopulate(val, "IdentityInfo", &i.IdentityInfo) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + delete(rawMsg, key) + case "originalStorageAccountOption": + err = unpopulate(val, "OriginalStorageAccountOption", &i.OriginalStorageAccountOption) + delete(rawMsg, key) + case "recoveryPointId": + err = unpopulate(val, "RecoveryPointID", &i.RecoveryPointID) + delete(rawMsg, key) + case "recoveryPointRehydrationInfo": + err = unpopulate(val, "RecoveryPointRehydrationInfo", &i.RecoveryPointRehydrationInfo) + delete(rawMsg, key) + case "recoveryType": + err = unpopulate(val, "RecoveryType", &i.RecoveryType) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &i.Region) + delete(rawMsg, key) + case "restoreDiskLunList": + err = unpopulate(val, "RestoreDiskLunList", &i.RestoreDiskLunList) + delete(rawMsg, key) + case "restoreWithManagedDisks": + err = unpopulate(val, "RestoreWithManagedDisks", &i.RestoreWithManagedDisks) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &i.SourceResourceID) + delete(rawMsg, key) + case "storageAccountId": + err = unpopulate(val, "StorageAccountID", &i.StorageAccountID) + delete(rawMsg, key) + case "subnetId": + err = unpopulate(val, "SubnetID", &i.SubnetID) + delete(rawMsg, key) + case "targetDomainNameId": + err = unpopulate(val, "TargetDomainNameID", &i.TargetDomainNameID) + delete(rawMsg, key) + case "targetResourceGroupId": + err = unpopulate(val, "TargetResourceGroupID", &i.TargetResourceGroupID) + delete(rawMsg, key) + case "targetVirtualMachineId": + err = unpopulate(val, "TargetVirtualMachineID", &i.TargetVirtualMachineID) + delete(rawMsg, key) + case "virtualNetworkId": + err = unpopulate(val, "VirtualNetworkID", &i.VirtualNetworkID) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &i.Zones) + 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 IdentityBasedRestoreDetails. +func (i IdentityBasedRestoreDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "objectType", i.ObjectType) + populate(objectMap, "targetStorageAccountId", i.TargetStorageAccountID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityBasedRestoreDetails. +func (i *IdentityBasedRestoreDetails) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &i.ObjectType) + delete(rawMsg, key) + case "targetStorageAccountId": + err = unpopulate(val, "TargetStorageAccountID", &i.TargetStorageAccountID) + 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 IdentityInfo. +func (i IdentityInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isSystemAssignedIdentity", i.IsSystemAssignedIdentity) + populate(objectMap, "managedIdentityResourceId", i.ManagedIdentityResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityInfo. +func (i *IdentityInfo) UnmarshalJSON(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 "isSystemAssignedIdentity": + err = unpopulate(val, "IsSystemAssignedIdentity", &i.IsSystemAssignedIdentity) + delete(rawMsg, key) + case "managedIdentityResourceId": + err = unpopulate(val, "ManagedIdentityResourceID", &i.ManagedIdentityResourceID) + 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 InquiryInfo. +func (i InquiryInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorDetail", i.ErrorDetail) + populate(objectMap, "inquiryDetails", i.InquiryDetails) + populate(objectMap, "status", i.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InquiryInfo. +func (i *InquiryInfo) UnmarshalJSON(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 "errorDetail": + err = unpopulate(val, "ErrorDetail", &i.ErrorDetail) + delete(rawMsg, key) + case "inquiryDetails": + err = unpopulate(val, "InquiryDetails", &i.InquiryDetails) + 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 InquiryValidation. +func (i InquiryValidation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalDetail", i.AdditionalDetail) + populate(objectMap, "errorDetail", i.ErrorDetail) + populate(objectMap, "status", i.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InquiryValidation. +func (i *InquiryValidation) UnmarshalJSON(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 "additionalDetail": + err = unpopulate(val, "AdditionalDetail", &i.AdditionalDetail) + delete(rawMsg, key) + case "errorDetail": + err = unpopulate(val, "ErrorDetail", &i.ErrorDetail) + 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 InstantItemRecoveryTarget. +func (i InstantItemRecoveryTarget) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientScripts", i.ClientScripts) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstantItemRecoveryTarget. +func (i *InstantItemRecoveryTarget) UnmarshalJSON(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 "clientScripts": + err = unpopulate(val, "ClientScripts", &i.ClientScripts) + 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 InstantRPAdditionalDetails. +func (i InstantRPAdditionalDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "azureBackupRGNamePrefix", i.AzureBackupRGNamePrefix) + populate(objectMap, "azureBackupRGNameSuffix", i.AzureBackupRGNameSuffix) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type InstantRPAdditionalDetails. +func (i *InstantRPAdditionalDetails) UnmarshalJSON(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 "azureBackupRGNamePrefix": + err = unpopulate(val, "AzureBackupRGNamePrefix", &i.AzureBackupRGNamePrefix) + delete(rawMsg, key) + case "azureBackupRGNameSuffix": + err = unpopulate(val, "AzureBackupRGNameSuffix", &i.AzureBackupRGNameSuffix) + 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, "activityId", j.ActivityID) + populate(objectMap, "backupManagementType", j.BackupManagementType) + populateTimeRFC3339(objectMap, "endTime", j.EndTime) + populate(objectMap, "entityFriendlyName", j.EntityFriendlyName) + objectMap["jobType"] = j.JobType + populate(objectMap, "operation", j.Operation) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "status", j.Status) + 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 "activityId": + err = unpopulate(val, "ActivityID", &j.ActivityID) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &j.BackupManagementType) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) + delete(rawMsg, key) + case "entityFriendlyName": + err = unpopulate(val, "EntityFriendlyName", &j.EntityFriendlyName) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &j.JobType) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &j.Operation) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &j.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobQueryObject. +func (j JobQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", j.BackupManagementType) + populateTimeRFC3339(objectMap, "endTime", j.EndTime) + populate(objectMap, "jobId", j.JobID) + populate(objectMap, "operation", j.Operation) + populateTimeRFC3339(objectMap, "startTime", j.StartTime) + populate(objectMap, "status", j.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobQueryObject. +func (j *JobQueryObject) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &j.BackupManagementType) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &j.EndTime) + delete(rawMsg, key) + case "jobId": + err = unpopulate(val, "JobID", &j.JobID) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &j.Operation) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &j.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &j.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", j, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type JobResource. +func (j JobResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", j.ETag) + populate(objectMap, "id", j.ID) + populate(objectMap, "location", j.Location) + populate(objectMap, "name", j.Name) + populate(objectMap, "properties", j.Properties) + populate(objectMap, "tags", j.Tags) + populate(objectMap, "type", j.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type JobResource. +func (j *JobResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &j.ETag) + delete(rawMsg, 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": + j.Properties, err = unmarshalJobClassification(val) + 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 JobResourceList. +func (j JobResourceList) 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 JobResourceList. +func (j *JobResourceList) UnmarshalJSON(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 KEKDetails. +func (k KEKDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyBackupData", k.KeyBackupData) + populate(objectMap, "keyUrl", k.KeyURL) + populate(objectMap, "keyVaultId", k.KeyVaultID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KEKDetails. +func (k *KEKDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "keyBackupData": + err = unpopulate(val, "KeyBackupData", &k.KeyBackupData) + delete(rawMsg, key) + case "keyUrl": + err = unpopulate(val, "KeyURL", &k.KeyURL) + delete(rawMsg, key) + case "keyVaultId": + err = unpopulate(val, "KeyVaultID", &k.KeyVaultID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KPIResourceHealthDetails. +func (k KPIResourceHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceHealthDetails", k.ResourceHealthDetails) + populate(objectMap, "resourceHealthStatus", k.ResourceHealthStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KPIResourceHealthDetails. +func (k *KPIResourceHealthDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceHealthDetails": + err = unpopulate(val, "ResourceHealthDetails", &k.ResourceHealthDetails) + delete(rawMsg, key) + case "resourceHealthStatus": + err = unpopulate(val, "ResourceHealthStatus", &k.ResourceHealthStatus) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type KeyAndSecretDetails. +func (k KeyAndSecretDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bekDetails", k.BekDetails) + populate(objectMap, "encryptionMechanism", k.EncryptionMechanism) + populate(objectMap, "kekDetails", k.KekDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyAndSecretDetails. +func (k *KeyAndSecretDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "bekDetails": + err = unpopulate(val, "BekDetails", &k.BekDetails) + delete(rawMsg, key) + case "encryptionMechanism": + err = unpopulate(val, "EncryptionMechanism", &k.EncryptionMechanism) + delete(rawMsg, key) + case "kekDetails": + err = unpopulate(val, "KekDetails", &k.KekDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ListRecoveryPointsRecommendedForMoveRequest. +func (l ListRecoveryPointsRecommendedForMoveRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "excludedRPList", l.ExcludedRPList) + populate(objectMap, "objectType", l.ObjectType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ListRecoveryPointsRecommendedForMoveRequest. +func (l *ListRecoveryPointsRecommendedForMoveRequest) UnmarshalJSON(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 "excludedRPList": + err = unpopulate(val, "ExcludedRPList", &l.ExcludedRPList) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &l.ObjectType) + 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 LogSchedulePolicy. +func (l LogSchedulePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "scheduleFrequencyInMins", l.ScheduleFrequencyInMins) + objectMap["schedulePolicyType"] = "LogSchedulePolicy" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LogSchedulePolicy. +func (l *LogSchedulePolicy) UnmarshalJSON(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 "scheduleFrequencyInMins": + err = unpopulate(val, "ScheduleFrequencyInMins", &l.ScheduleFrequencyInMins) + delete(rawMsg, key) + case "schedulePolicyType": + err = unpopulate(val, "SchedulePolicyType", &l.SchedulePolicyType) + 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, "dailySchedule", l.DailySchedule) + populate(objectMap, "monthlySchedule", l.MonthlySchedule) + objectMap["retentionPolicyType"] = "LongTermRetentionPolicy" + populate(objectMap, "weeklySchedule", l.WeeklySchedule) + populate(objectMap, "yearlySchedule", l.YearlySchedule) + 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 "dailySchedule": + err = unpopulate(val, "DailySchedule", &l.DailySchedule) + delete(rawMsg, key) + case "monthlySchedule": + err = unpopulate(val, "MonthlySchedule", &l.MonthlySchedule) + delete(rawMsg, key) + case "retentionPolicyType": + err = unpopulate(val, "RetentionPolicyType", &l.RetentionPolicyType) + delete(rawMsg, key) + case "weeklySchedule": + err = unpopulate(val, "WeeklySchedule", &l.WeeklySchedule) + delete(rawMsg, key) + case "yearlySchedule": + err = unpopulate(val, "YearlySchedule", &l.YearlySchedule) + 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 LongTermSchedulePolicy. +func (l LongTermSchedulePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["schedulePolicyType"] = "LongTermSchedulePolicy" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LongTermSchedulePolicy. +func (l *LongTermSchedulePolicy) UnmarshalJSON(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 "schedulePolicyType": + err = unpopulate(val, "SchedulePolicyType", &l.SchedulePolicyType) + 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 MABContainerHealthDetails. +func (m MABContainerHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", m.Code) + populate(objectMap, "message", m.Message) + populate(objectMap, "recommendations", m.Recommendations) + populate(objectMap, "title", m.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MABContainerHealthDetails. +func (m *MABContainerHealthDetails) UnmarshalJSON(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 "code": + err = unpopulate(val, "Code", &m.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &m.Message) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &m.Recommendations) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &m.Title) + 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 MabContainer. +func (m MabContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "agentVersion", m.AgentVersion) + populate(objectMap, "backupManagementType", m.BackupManagementType) + populate(objectMap, "canReRegister", m.CanReRegister) + populate(objectMap, "containerHealthState", m.ContainerHealthState) + populate(objectMap, "containerId", m.ContainerID) + objectMap["containerType"] = ProtectableContainerTypeWindows + populate(objectMap, "extendedInfo", m.ExtendedInfo) + populate(objectMap, "friendlyName", m.FriendlyName) + populate(objectMap, "healthStatus", m.HealthStatus) + populate(objectMap, "mabContainerHealthDetails", m.MabContainerHealthDetails) + populate(objectMap, "protectableObjectType", m.ProtectableObjectType) + populate(objectMap, "protectedItemCount", m.ProtectedItemCount) + populate(objectMap, "registrationStatus", m.RegistrationStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabContainer. +func (m *MabContainer) UnmarshalJSON(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 "agentVersion": + err = unpopulate(val, "AgentVersion", &m.AgentVersion) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) + delete(rawMsg, key) + case "canReRegister": + err = unpopulate(val, "CanReRegister", &m.CanReRegister) + delete(rawMsg, key) + case "containerHealthState": + err = unpopulate(val, "ContainerHealthState", &m.ContainerHealthState) + delete(rawMsg, key) + case "containerId": + err = unpopulate(val, "ContainerID", &m.ContainerID) + delete(rawMsg, key) + case "containerType": + err = unpopulate(val, "ContainerType", &m.ContainerType) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &m.ExtendedInfo) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &m.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &m.HealthStatus) + delete(rawMsg, key) + case "mabContainerHealthDetails": + err = unpopulate(val, "MabContainerHealthDetails", &m.MabContainerHealthDetails) + delete(rawMsg, key) + case "protectableObjectType": + err = unpopulate(val, "ProtectableObjectType", &m.ProtectableObjectType) + delete(rawMsg, key) + case "protectedItemCount": + err = unpopulate(val, "ProtectedItemCount", &m.ProtectedItemCount) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &m.RegistrationStatus) + 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 MabContainerExtendedInfo. +func (m MabContainerExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupItemType", m.BackupItemType) + populate(objectMap, "backupItems", m.BackupItems) + populate(objectMap, "lastBackupStatus", m.LastBackupStatus) + populateTimeRFC3339(objectMap, "lastRefreshedAt", m.LastRefreshedAt) + populate(objectMap, "policyName", m.PolicyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabContainerExtendedInfo. +func (m *MabContainerExtendedInfo) UnmarshalJSON(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 "backupItemType": + err = unpopulate(val, "BackupItemType", &m.BackupItemType) + delete(rawMsg, key) + case "backupItems": + err = unpopulate(val, "BackupItems", &m.BackupItems) + delete(rawMsg, key) + case "lastBackupStatus": + err = unpopulate(val, "LastBackupStatus", &m.LastBackupStatus) + delete(rawMsg, key) + case "lastRefreshedAt": + err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &m.LastRefreshedAt) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &m.PolicyName) + 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 MabErrorInfo. +func (m MabErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorString", m.ErrorString) + populate(objectMap, "recommendations", m.Recommendations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabErrorInfo. +func (m *MabErrorInfo) UnmarshalJSON(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 "errorString": + err = unpopulate(val, "ErrorString", &m.ErrorString) + delete(rawMsg, key) + case "recommendations": + err = unpopulate(val, "Recommendations", &m.Recommendations) + 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 MabFileFolderProtectedItem. +func (m MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", m.BackupManagementType) + populate(objectMap, "backupSetName", m.BackupSetName) + populate(objectMap, "computerName", m.ComputerName) + populate(objectMap, "containerName", m.ContainerName) + populate(objectMap, "createMode", m.CreateMode) + populate(objectMap, "deferredDeleteSyncTimeInUTC", m.DeferredDeleteSyncTimeInUTC) + populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", m.DeferredDeleteTimeInUTC) + populate(objectMap, "deferredDeleteTimeRemaining", m.DeferredDeleteTimeRemaining) + populate(objectMap, "extendedInfo", m.ExtendedInfo) + populate(objectMap, "friendlyName", m.FriendlyName) + populate(objectMap, "isArchiveEnabled", m.IsArchiveEnabled) + populate(objectMap, "isDeferredDeleteScheduleUpcoming", m.IsDeferredDeleteScheduleUpcoming) + populate(objectMap, "isRehydrate", m.IsRehydrate) + populate(objectMap, "isScheduledForDeferredDelete", m.IsScheduledForDeferredDelete) + populate(objectMap, "lastBackupStatus", m.LastBackupStatus) + populateTimeRFC3339(objectMap, "lastBackupTime", m.LastBackupTime) + populateTimeRFC3339(objectMap, "lastRecoveryPoint", m.LastRecoveryPoint) + populate(objectMap, "policyId", m.PolicyID) + populate(objectMap, "policyName", m.PolicyName) + objectMap["protectedItemType"] = "MabFileFolderProtectedItem" + populate(objectMap, "protectionState", m.ProtectionState) + populate(objectMap, "resourceGuardOperationRequests", m.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", m.SoftDeleteRetentionPeriod) + populate(objectMap, "sourceResourceId", m.SourceResourceID) + populate(objectMap, "workloadType", m.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabFileFolderProtectedItem. +func (m *MabFileFolderProtectedItem) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) + delete(rawMsg, key) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &m.BackupSetName) + delete(rawMsg, key) + case "computerName": + err = unpopulate(val, "ComputerName", &m.ComputerName) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &m.ContainerName) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &m.CreateMode) + delete(rawMsg, key) + case "deferredDeleteSyncTimeInUTC": + err = unpopulate(val, "DeferredDeleteSyncTimeInUTC", &m.DeferredDeleteSyncTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeInUTC": + err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &m.DeferredDeleteTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeRemaining": + err = unpopulate(val, "DeferredDeleteTimeRemaining", &m.DeferredDeleteTimeRemaining) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &m.ExtendedInfo) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &m.FriendlyName) + delete(rawMsg, key) + case "isArchiveEnabled": + err = unpopulate(val, "IsArchiveEnabled", &m.IsArchiveEnabled) + delete(rawMsg, key) + case "isDeferredDeleteScheduleUpcoming": + err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &m.IsDeferredDeleteScheduleUpcoming) + delete(rawMsg, key) + case "isRehydrate": + err = unpopulate(val, "IsRehydrate", &m.IsRehydrate) + delete(rawMsg, key) + case "isScheduledForDeferredDelete": + err = unpopulate(val, "IsScheduledForDeferredDelete", &m.IsScheduledForDeferredDelete) + delete(rawMsg, key) + case "lastBackupStatus": + err = unpopulate(val, "LastBackupStatus", &m.LastBackupStatus) + delete(rawMsg, key) + case "lastBackupTime": + err = unpopulateTimeRFC3339(val, "LastBackupTime", &m.LastBackupTime) + delete(rawMsg, key) + case "lastRecoveryPoint": + err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &m.LastRecoveryPoint) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &m.PolicyID) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &m.PolicyName) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &m.ProtectedItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &m.ProtectionState) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &m.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &m.SoftDeleteRetentionPeriod) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &m.SourceResourceID) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &m.WorkloadType) + 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 MabFileFolderProtectedItemExtendedInfo. +func (m MabFileFolderProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "lastRefreshedAt", m.LastRefreshedAt) + populateTimeRFC3339(objectMap, "oldestRecoveryPoint", m.OldestRecoveryPoint) + populate(objectMap, "recoveryPointCount", m.RecoveryPointCount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabFileFolderProtectedItemExtendedInfo. +func (m *MabFileFolderProtectedItemExtendedInfo) UnmarshalJSON(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 "lastRefreshedAt": + err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &m.LastRefreshedAt) + delete(rawMsg, key) + case "oldestRecoveryPoint": + err = unpopulateTimeRFC3339(val, "OldestRecoveryPoint", &m.OldestRecoveryPoint) + delete(rawMsg, key) + case "recoveryPointCount": + err = unpopulate(val, "RecoveryPointCount", &m.RecoveryPointCount) + 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 MabJob. +func (m MabJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionsInfo", m.ActionsInfo) + populate(objectMap, "activityId", m.ActivityID) + populate(objectMap, "backupManagementType", m.BackupManagementType) + populate(objectMap, "duration", m.Duration) + populateTimeRFC3339(objectMap, "endTime", m.EndTime) + populate(objectMap, "entityFriendlyName", m.EntityFriendlyName) + populate(objectMap, "errorDetails", m.ErrorDetails) + populate(objectMap, "extendedInfo", m.ExtendedInfo) + objectMap["jobType"] = "MabJob" + populate(objectMap, "mabServerName", m.MabServerName) + populate(objectMap, "mabServerType", m.MabServerType) + populate(objectMap, "operation", m.Operation) + populateTimeRFC3339(objectMap, "startTime", m.StartTime) + populate(objectMap, "status", m.Status) + populate(objectMap, "workloadType", m.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabJob. +func (m *MabJob) UnmarshalJSON(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 "actionsInfo": + err = unpopulate(val, "ActionsInfo", &m.ActionsInfo) + delete(rawMsg, key) + case "activityId": + err = unpopulate(val, "ActivityID", &m.ActivityID) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) + delete(rawMsg, key) + case "duration": + err = unpopulate(val, "Duration", &m.Duration) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) + delete(rawMsg, key) + case "entityFriendlyName": + err = unpopulate(val, "EntityFriendlyName", &m.EntityFriendlyName) + delete(rawMsg, key) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &m.ErrorDetails) + delete(rawMsg, key) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &m.ExtendedInfo) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &m.JobType) + delete(rawMsg, key) + case "mabServerName": + err = unpopulate(val, "MabServerName", &m.MabServerName) + delete(rawMsg, key) + case "mabServerType": + err = unpopulate(val, "MabServerType", &m.MabServerType) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &m.Operation) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &m.WorkloadType) + 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 MabJobExtendedInfo. +func (m MabJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dynamicErrorMessage", m.DynamicErrorMessage) + populate(objectMap, "propertyBag", m.PropertyBag) + populate(objectMap, "tasksList", m.TasksList) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabJobExtendedInfo. +func (m *MabJobExtendedInfo) UnmarshalJSON(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 "dynamicErrorMessage": + err = unpopulate(val, "DynamicErrorMessage", &m.DynamicErrorMessage) + delete(rawMsg, key) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &m.PropertyBag) + delete(rawMsg, key) + case "tasksList": + err = unpopulate(val, "TasksList", &m.TasksList) + 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 MabJobTaskDetails. +func (m MabJobTaskDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "duration", m.Duration) + populateTimeRFC3339(objectMap, "endTime", m.EndTime) + populateTimeRFC3339(objectMap, "startTime", m.StartTime) + populate(objectMap, "status", m.Status) + populate(objectMap, "taskId", m.TaskID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabJobTaskDetails. +func (m *MabJobTaskDetails) UnmarshalJSON(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 "duration": + err = unpopulate(val, "Duration", &m.Duration) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &m.Status) + delete(rawMsg, key) + case "taskId": + err = unpopulate(val, "TaskID", &m.TaskID) + 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 MabProtectionPolicy. +func (m MabProtectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["backupManagementType"] = "MAB" + populate(objectMap, "protectedItemsCount", m.ProtectedItemsCount) + populate(objectMap, "resourceGuardOperationRequests", m.ResourceGuardOperationRequests) + populate(objectMap, "retentionPolicy", m.RetentionPolicy) + populate(objectMap, "schedulePolicy", m.SchedulePolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MabProtectionPolicy. +func (m *MabProtectionPolicy) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) + delete(rawMsg, key) + case "protectedItemsCount": + err = unpopulate(val, "ProtectedItemsCount", &m.ProtectedItemsCount) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &m.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "retentionPolicy": + m.RetentionPolicy, err = unmarshalRetentionPolicyClassification(val) + delete(rawMsg, key) + case "schedulePolicy": + m.SchedulePolicy, err = unmarshalSchedulePolicyClassification(val) + 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 MonthlyRetentionSchedule. +func (m MonthlyRetentionSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "retentionDuration", m.RetentionDuration) + populate(objectMap, "retentionScheduleDaily", m.RetentionScheduleDaily) + populate(objectMap, "retentionScheduleFormatType", m.RetentionScheduleFormatType) + populate(objectMap, "retentionScheduleWeekly", m.RetentionScheduleWeekly) + aux := make([]*timeRFC3339, len(m.RetentionTimes), len(m.RetentionTimes)) + for i := 0; i < len(m.RetentionTimes); i++ { + aux[i] = (*timeRFC3339)(m.RetentionTimes[i]) + } + populate(objectMap, "retentionTimes", aux) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MonthlyRetentionSchedule. +func (m *MonthlyRetentionSchedule) UnmarshalJSON(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 "retentionDuration": + err = unpopulate(val, "RetentionDuration", &m.RetentionDuration) + delete(rawMsg, key) + case "retentionScheduleDaily": + err = unpopulate(val, "RetentionScheduleDaily", &m.RetentionScheduleDaily) + delete(rawMsg, key) + case "retentionScheduleFormatType": + err = unpopulate(val, "RetentionScheduleFormatType", &m.RetentionScheduleFormatType) + delete(rawMsg, key) + case "retentionScheduleWeekly": + err = unpopulate(val, "RetentionScheduleWeekly", &m.RetentionScheduleWeekly) + delete(rawMsg, key) + case "retentionTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "RetentionTimes", &aux) + for _, au := range aux { + m.RetentionTimes = append(m.RetentionTimes, (*time.Time)(au)) + } + 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 MoveRPAcrossTiersRequest. +func (m MoveRPAcrossTiersRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "objectType", m.ObjectType) + populate(objectMap, "sourceTierType", m.SourceTierType) + populate(objectMap, "targetTierType", m.TargetTierType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MoveRPAcrossTiersRequest. +func (m *MoveRPAcrossTiersRequest) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &m.ObjectType) + delete(rawMsg, key) + case "sourceTierType": + err = unpopulate(val, "SourceTierType", &m.SourceTierType) + delete(rawMsg, key) + case "targetTierType": + err = unpopulate(val, "TargetTierType", &m.TargetTierType) + 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 NameInfo. +func (n NameInfo) 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 NameInfo. +func (n *NameInfo) UnmarshalJSON(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 NewErrorResponse. +func (n NewErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", n.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NewErrorResponse. +func (n *NewErrorResponse) UnmarshalJSON(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 "error": + err = unpopulate(val, "Error", &n.Error) + 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 NewErrorResponseError. +func (n NewErrorResponseError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", n.AdditionalInfo) + populate(objectMap, "code", n.Code) + populate(objectMap, "details", n.Details) + populate(objectMap, "message", n.Message) + populate(objectMap, "target", n.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NewErrorResponseError. +func (n *NewErrorResponseError) UnmarshalJSON(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 "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &n.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &n.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &n.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &n.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &n.Target) + 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 OperationResultInfo. +func (o OperationResultInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "jobList", o.JobList) + objectMap["objectType"] = "OperationResultInfo" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultInfo. +func (o *OperationResultInfo) UnmarshalJSON(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 "jobList": + err = unpopulate(val, "JobList", &o.JobList) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + 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 OperationResultInfoBase. +func (o OperationResultInfoBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = o.ObjectType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultInfoBase. +func (o *OperationResultInfoBase) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + 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 OperationResultInfoBaseResource. +func (o OperationResultInfoBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "headers", o.Headers) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "statusCode", o.StatusCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultInfoBaseResource. +func (o *OperationResultInfoBaseResource) UnmarshalJSON(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 "headers": + err = unpopulate(val, "Headers", &o.Headers) + delete(rawMsg, key) + case "operation": + o.Operation, err = unmarshalOperationResultInfoBaseClassification(val) + delete(rawMsg, key) + case "statusCode": + err = unpopulate(val, "StatusCode", &o.StatusCode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationStatus. +func (o OperationStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "endTime", o.EndTime) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populateTimeRFC3339(objectMap, "startTime", o.StartTime) + populate(objectMap, "status", o.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. +func (o *OperationStatus) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &o.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &o.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + o.Properties, err = unmarshalOperationStatusExtendedInfoClassification(val) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationStatusError. +func (o OperationStatusError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", o.Code) + populate(objectMap, "message", o.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusError. +func (o *OperationStatusError) UnmarshalJSON(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 "code": + err = unpopulate(val, "Code", &o.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &o.Message) + 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 OperationStatusExtendedInfo. +func (o OperationStatusExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = o.ObjectType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusExtendedInfo. +func (o *OperationStatusExtendedInfo) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + 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 OperationStatusJobExtendedInfo. +func (o OperationStatusJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "jobId", o.JobID) + objectMap["objectType"] = "OperationStatusJobExtendedInfo" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusJobExtendedInfo. +func (o *OperationStatusJobExtendedInfo) UnmarshalJSON(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 "jobId": + err = unpopulate(val, "JobID", &o.JobID) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + 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 OperationStatusJobsExtendedInfo. +func (o OperationStatusJobsExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "failedJobsError", o.FailedJobsError) + populate(objectMap, "jobIds", o.JobIDs) + objectMap["objectType"] = "OperationStatusJobsExtendedInfo" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusJobsExtendedInfo. +func (o *OperationStatusJobsExtendedInfo) UnmarshalJSON(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 "failedJobsError": + err = unpopulate(val, "FailedJobsError", &o.FailedJobsError) + delete(rawMsg, key) + case "jobIds": + err = unpopulate(val, "JobIDs", &o.JobIDs) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + 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 OperationStatusProvisionILRExtendedInfo. +func (o OperationStatusProvisionILRExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = "OperationStatusProvisionILRExtendedInfo" + populate(objectMap, "recoveryTarget", o.RecoveryTarget) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusProvisionILRExtendedInfo. +func (o *OperationStatusProvisionILRExtendedInfo) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + delete(rawMsg, key) + case "recoveryTarget": + err = unpopulate(val, "RecoveryTarget", &o.RecoveryTarget) + 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 OperationStatusValidateOperationExtendedInfo. +func (o OperationStatusValidateOperationExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = "OperationStatusValidateOperationExtendedInfo" + populate(objectMap, "validateOperationResponse", o.ValidateOperationResponse) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusValidateOperationExtendedInfo. +func (o *OperationStatusValidateOperationExtendedInfo) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &o.ObjectType) + delete(rawMsg, key) + case "validateOperationResponse": + err = unpopulate(val, "ValidateOperationResponse", &o.ValidateOperationResponse) + 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 OperationWorkerResponse. +func (o OperationWorkerResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "headers", o.Headers) + populate(objectMap, "statusCode", o.StatusCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationWorkerResponse. +func (o *OperationWorkerResponse) UnmarshalJSON(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 "headers": + err = unpopulate(val, "Headers", &o.Headers) + delete(rawMsg, key) + case "statusCode": + err = unpopulate(val, "StatusCode", &o.StatusCode) + 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 PointInTimeRange. +func (p PointInTimeRange) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "endTime", p.EndTime) + populateTimeRFC3339(objectMap, "startTime", p.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PointInTimeRange. +func (p *PointInTimeRange) UnmarshalJSON(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 "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &p.EndTime) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &p.StartTime) + 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 PreBackupValidation. +func (p PreBackupValidation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", p.Code) + populate(objectMap, "message", p.Message) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PreBackupValidation. +func (p *PreBackupValidation) UnmarshalJSON(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 "code": + err = unpopulate(val, "Code", &p.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &p.Message) + 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 PreValidateEnableBackupRequest. +func (p PreValidateEnableBackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "resourceId", p.ResourceID) + populate(objectMap, "resourceType", p.ResourceType) + populate(objectMap, "vaultId", p.VaultID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PreValidateEnableBackupRequest. +func (p *PreValidateEnableBackupRequest) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &p.ResourceID) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &p.ResourceType) + delete(rawMsg, key) + case "vaultId": + err = unpopulate(val, "VaultID", &p.VaultID) + 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 PreValidateEnableBackupResponse. +func (p PreValidateEnableBackupResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containerName", p.ContainerName) + populate(objectMap, "errorCode", p.ErrorCode) + populate(objectMap, "errorMessage", p.ErrorMessage) + populate(objectMap, "protectedItemName", p.ProtectedItemName) + populate(objectMap, "recommendation", p.Recommendation) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PreValidateEnableBackupResponse. +func (p *PreValidateEnableBackupResponse) UnmarshalJSON(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 "containerName": + err = unpopulate(val, "ContainerName", &p.ContainerName) + delete(rawMsg, key) + case "errorCode": + err = unpopulate(val, "ErrorCode", &p.ErrorCode) + delete(rawMsg, key) + case "errorMessage": + err = unpopulate(val, "ErrorMessage", &p.ErrorMessage) + delete(rawMsg, key) + case "protectedItemName": + err = unpopulate(val, "ProtectedItemName", &p.ProtectedItemName) + delete(rawMsg, key) + case "recommendation": + err = unpopulate(val, "Recommendation", &p.Recommendation) + 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 PrepareDataMoveRequest. +func (p PrepareDataMoveRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dataMoveLevel", p.DataMoveLevel) + populate(objectMap, "ignoreMoved", p.IgnoreMoved) + populate(objectMap, "sourceContainerArmIds", p.SourceContainerArmIDs) + populate(objectMap, "targetRegion", p.TargetRegion) + populate(objectMap, "targetResourceId", p.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrepareDataMoveRequest. +func (p *PrepareDataMoveRequest) UnmarshalJSON(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 "dataMoveLevel": + err = unpopulate(val, "DataMoveLevel", &p.DataMoveLevel) + delete(rawMsg, key) + case "ignoreMoved": + err = unpopulate(val, "IgnoreMoved", &p.IgnoreMoved) + delete(rawMsg, key) + case "sourceContainerArmIds": + err = unpopulate(val, "SourceContainerArmIDs", &p.SourceContainerArmIDs) + delete(rawMsg, key) + case "targetRegion": + err = unpopulate(val, "TargetRegion", &p.TargetRegion) + delete(rawMsg, key) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &p.TargetResourceID) + 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 PrepareDataMoveResponse. +func (p PrepareDataMoveResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "correlationId", p.CorrelationID) + objectMap["objectType"] = "PrepareDataMoveResponse" + populate(objectMap, "sourceVaultProperties", p.SourceVaultProperties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrepareDataMoveResponse. +func (p *PrepareDataMoveResponse) UnmarshalJSON(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 "correlationId": + err = unpopulate(val, "CorrelationID", &p.CorrelationID) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &p.ObjectType) + delete(rawMsg, key) + case "sourceVaultProperties": + err = unpopulate(val, "SourceVaultProperties", &p.SourceVaultProperties) + 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 PrivateEndpoint. +func (p PrivateEndpoint) 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 PrivateEndpoint. +func (p *PrivateEndpoint) UnmarshalJSON(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 PrivateEndpointConnection. +func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + 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 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 "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 PrivateEndpointConnectionResource. +func (p PrivateEndpointConnectionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", p.ETag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionResource. +func (p *PrivateEndpointConnectionResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &p.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + 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 "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionRequired", p.ActionRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkServiceConnectionState. +func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(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 "actionRequired": + err = unpopulate(val, "ActionRequired", &p.ActionRequired) + 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 ProtectableContainer. +func (p ProtectableContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", p.BackupManagementType) + populate(objectMap, "containerId", p.ContainerID) + populate(objectMap, "friendlyName", p.FriendlyName) + populate(objectMap, "healthStatus", p.HealthStatus) + objectMap["protectableContainerType"] = p.ProtectableContainerType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectableContainer. +func (p *ProtectableContainer) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "containerId": + err = unpopulate(val, "ContainerID", &p.ContainerID) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &p.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &p.HealthStatus) + delete(rawMsg, key) + case "protectableContainerType": + err = unpopulate(val, "ProtectableContainerType", &p.ProtectableContainerType) + 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 ProtectableContainerResource. +func (p ProtectableContainerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", p.ETag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectableContainerResource. +func (p *ProtectableContainerResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &p.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + p.Properties, err = unmarshalProtectableContainerClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 ProtectableContainerResourceList. +func (p ProtectableContainerResourceList) 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 ProtectableContainerResourceList. +func (p *ProtectableContainerResourceList) UnmarshalJSON(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 ProtectedItem. +func (p ProtectedItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", p.BackupManagementType) + populate(objectMap, "backupSetName", p.BackupSetName) + populate(objectMap, "containerName", p.ContainerName) + populate(objectMap, "createMode", p.CreateMode) + populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", p.DeferredDeleteTimeInUTC) + populate(objectMap, "deferredDeleteTimeRemaining", p.DeferredDeleteTimeRemaining) + populate(objectMap, "isArchiveEnabled", p.IsArchiveEnabled) + populate(objectMap, "isDeferredDeleteScheduleUpcoming", p.IsDeferredDeleteScheduleUpcoming) + populate(objectMap, "isRehydrate", p.IsRehydrate) + populate(objectMap, "isScheduledForDeferredDelete", p.IsScheduledForDeferredDelete) + populateTimeRFC3339(objectMap, "lastRecoveryPoint", p.LastRecoveryPoint) + populate(objectMap, "policyId", p.PolicyID) + populate(objectMap, "policyName", p.PolicyName) + objectMap["protectedItemType"] = p.ProtectedItemType + populate(objectMap, "resourceGuardOperationRequests", p.ResourceGuardOperationRequests) + populate(objectMap, "softDeleteRetentionPeriod", p.SoftDeleteRetentionPeriod) + populate(objectMap, "sourceResourceId", p.SourceResourceID) + populate(objectMap, "workloadType", p.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedItem. +func (p *ProtectedItem) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &p.BackupSetName) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &p.ContainerName) + delete(rawMsg, key) + case "createMode": + err = unpopulate(val, "CreateMode", &p.CreateMode) + delete(rawMsg, key) + case "deferredDeleteTimeInUTC": + err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &p.DeferredDeleteTimeInUTC) + delete(rawMsg, key) + case "deferredDeleteTimeRemaining": + err = unpopulate(val, "DeferredDeleteTimeRemaining", &p.DeferredDeleteTimeRemaining) + delete(rawMsg, key) + case "isArchiveEnabled": + err = unpopulate(val, "IsArchiveEnabled", &p.IsArchiveEnabled) + delete(rawMsg, key) + case "isDeferredDeleteScheduleUpcoming": + err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &p.IsDeferredDeleteScheduleUpcoming) + delete(rawMsg, key) + case "isRehydrate": + err = unpopulate(val, "IsRehydrate", &p.IsRehydrate) + delete(rawMsg, key) + case "isScheduledForDeferredDelete": + err = unpopulate(val, "IsScheduledForDeferredDelete", &p.IsScheduledForDeferredDelete) + delete(rawMsg, key) + case "lastRecoveryPoint": + err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &p.LastRecoveryPoint) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &p.PolicyID) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &p.PolicyName) + delete(rawMsg, key) + case "protectedItemType": + err = unpopulate(val, "ProtectedItemType", &p.ProtectedItemType) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &p.ResourceGuardOperationRequests) + delete(rawMsg, key) + case "softDeleteRetentionPeriod": + err = unpopulate(val, "SoftDeleteRetentionPeriod", &p.SoftDeleteRetentionPeriod) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &p.SourceResourceID) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &p.WorkloadType) + 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 ProtectedItemQueryObject. +func (p ProtectedItemQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupEngineName", p.BackupEngineName) + populate(objectMap, "backupManagementType", p.BackupManagementType) + populate(objectMap, "backupSetName", p.BackupSetName) + populate(objectMap, "containerName", p.ContainerName) + populate(objectMap, "fabricName", p.FabricName) + populate(objectMap, "friendlyName", p.FriendlyName) + populate(objectMap, "healthState", p.HealthState) + populate(objectMap, "itemType", p.ItemType) + populate(objectMap, "policyName", p.PolicyName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedItemQueryObject. +func (p *ProtectedItemQueryObject) UnmarshalJSON(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 "backupEngineName": + err = unpopulate(val, "BackupEngineName", &p.BackupEngineName) + delete(rawMsg, key) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "backupSetName": + err = unpopulate(val, "BackupSetName", &p.BackupSetName) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &p.ContainerName) + delete(rawMsg, key) + case "fabricName": + err = unpopulate(val, "FabricName", &p.FabricName) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &p.FriendlyName) + delete(rawMsg, key) + case "healthState": + err = unpopulate(val, "HealthState", &p.HealthState) + delete(rawMsg, key) + case "itemType": + err = unpopulate(val, "ItemType", &p.ItemType) + delete(rawMsg, key) + case "policyName": + err = unpopulate(val, "PolicyName", &p.PolicyName) + 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 ProtectedItemResource. +func (p ProtectedItemResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", p.ETag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedItemResource. +func (p *ProtectedItemResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &p.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + p.Properties, err = unmarshalProtectedItemClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 ProtectedItemResourceList. +func (p ProtectedItemResourceList) 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 ProtectedItemResourceList. +func (p *ProtectedItemResourceList) UnmarshalJSON(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 ProtectionContainer. +func (p ProtectionContainer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", p.BackupManagementType) + objectMap["containerType"] = p.ContainerType + populate(objectMap, "friendlyName", p.FriendlyName) + populate(objectMap, "healthStatus", p.HealthStatus) + populate(objectMap, "protectableObjectType", p.ProtectableObjectType) + populate(objectMap, "registrationStatus", p.RegistrationStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionContainer. +func (p *ProtectionContainer) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "containerType": + err = unpopulate(val, "ContainerType", &p.ContainerType) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &p.FriendlyName) + delete(rawMsg, key) + case "healthStatus": + err = unpopulate(val, "HealthStatus", &p.HealthStatus) + delete(rawMsg, key) + case "protectableObjectType": + err = unpopulate(val, "ProtectableObjectType", &p.ProtectableObjectType) + delete(rawMsg, key) + case "registrationStatus": + err = unpopulate(val, "RegistrationStatus", &p.RegistrationStatus) + 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 ProtectionContainerResource. +func (p ProtectionContainerResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", p.ETag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionContainerResource. +func (p *ProtectionContainerResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &p.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + p.Properties, err = unmarshalProtectionContainerClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 ProtectionContainerResourceList. +func (p ProtectionContainerResourceList) 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 ProtectionContainerResourceList. +func (p *ProtectionContainerResourceList) UnmarshalJSON(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 ProtectionIntent. +func (p ProtectionIntent) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", p.BackupManagementType) + populate(objectMap, "itemId", p.ItemID) + populate(objectMap, "policyId", p.PolicyID) + objectMap["protectionIntentItemType"] = p.ProtectionIntentItemType + populate(objectMap, "protectionState", p.ProtectionState) + populate(objectMap, "sourceResourceId", p.SourceResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionIntent. +func (p *ProtectionIntent) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "itemId": + err = unpopulate(val, "ItemID", &p.ItemID) + delete(rawMsg, key) + case "policyId": + err = unpopulate(val, "PolicyID", &p.PolicyID) + delete(rawMsg, key) + case "protectionIntentItemType": + err = unpopulate(val, "ProtectionIntentItemType", &p.ProtectionIntentItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &p.ProtectionState) + delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &p.SourceResourceID) + 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 ProtectionIntentQueryObject. +func (p ProtectionIntentQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", p.BackupManagementType) + populate(objectMap, "itemName", p.ItemName) + populate(objectMap, "itemType", p.ItemType) + populate(objectMap, "parentName", p.ParentName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionIntentQueryObject. +func (p *ProtectionIntentQueryObject) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "itemName": + err = unpopulate(val, "ItemName", &p.ItemName) + delete(rawMsg, key) + case "itemType": + err = unpopulate(val, "ItemType", &p.ItemType) + delete(rawMsg, key) + case "parentName": + err = unpopulate(val, "ParentName", &p.ParentName) + 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 ProtectionIntentResource. +func (p ProtectionIntentResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", p.ETag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionIntentResource. +func (p *ProtectionIntentResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &p.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + p.Properties, err = unmarshalProtectionIntentClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 ProtectionIntentResourceList. +func (p ProtectionIntentResourceList) 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 ProtectionIntentResourceList. +func (p *ProtectionIntentResourceList) UnmarshalJSON(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 ProtectionPolicy. +func (p ProtectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["backupManagementType"] = p.BackupManagementType + populate(objectMap, "protectedItemsCount", p.ProtectedItemsCount) + populate(objectMap, "resourceGuardOperationRequests", p.ResourceGuardOperationRequests) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionPolicy. +func (p *ProtectionPolicy) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "protectedItemsCount": + err = unpopulate(val, "ProtectedItemsCount", &p.ProtectedItemsCount) + delete(rawMsg, key) + case "resourceGuardOperationRequests": + err = unpopulate(val, "ResourceGuardOperationRequests", &p.ResourceGuardOperationRequests) + 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 ProtectionPolicyQueryObject. +func (p ProtectionPolicyQueryObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", p.BackupManagementType) + populate(objectMap, "fabricName", p.FabricName) + populate(objectMap, "workloadType", p.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionPolicyQueryObject. +func (p *ProtectionPolicyQueryObject) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) + delete(rawMsg, key) + case "fabricName": + err = unpopulate(val, "FabricName", &p.FabricName) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &p.WorkloadType) + 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 ProtectionPolicyResource. +func (p ProtectionPolicyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", p.ETag) + populate(objectMap, "id", p.ID) + populate(objectMap, "location", p.Location) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionPolicyResource. +func (p *ProtectionPolicyResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &p.ETag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &p.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + p.Properties, err = unmarshalProtectionPolicyClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &p.Tags) + 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 ProtectionPolicyResourceList. +func (p ProtectionPolicyResourceList) 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 ProtectionPolicyResourceList. +func (p *ProtectionPolicyResourceList) UnmarshalJSON(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 RecoveryPoint. +func (r RecoveryPoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = r.ObjectType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPoint. +func (r *RecoveryPoint) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &r.ObjectType) + 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 RecoveryPointDiskConfiguration. +func (r RecoveryPointDiskConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "excludedDiskList", r.ExcludedDiskList) + populate(objectMap, "includedDiskList", r.IncludedDiskList) + populate(objectMap, "numberOfDisksAttachedToVm", r.NumberOfDisksAttachedToVM) + populate(objectMap, "numberOfDisksIncludedInBackup", r.NumberOfDisksIncludedInBackup) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointDiskConfiguration. +func (r *RecoveryPointDiskConfiguration) UnmarshalJSON(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 "excludedDiskList": + err = unpopulate(val, "ExcludedDiskList", &r.ExcludedDiskList) + delete(rawMsg, key) + case "includedDiskList": + err = unpopulate(val, "IncludedDiskList", &r.IncludedDiskList) + delete(rawMsg, key) + case "numberOfDisksAttachedToVm": + err = unpopulate(val, "NumberOfDisksAttachedToVM", &r.NumberOfDisksAttachedToVM) + delete(rawMsg, key) + case "numberOfDisksIncludedInBackup": + err = unpopulate(val, "NumberOfDisksIncludedInBackup", &r.NumberOfDisksIncludedInBackup) + 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 RecoveryPointMoveReadinessInfo. +func (r RecoveryPointMoveReadinessInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", r.AdditionalInfo) + populate(objectMap, "isReadyForMove", r.IsReadyForMove) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointMoveReadinessInfo. +func (r *RecoveryPointMoveReadinessInfo) UnmarshalJSON(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 "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &r.AdditionalInfo) + delete(rawMsg, key) + case "isReadyForMove": + err = unpopulate(val, "IsReadyForMove", &r.IsReadyForMove) + 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 RecoveryPointProperties. +func (r RecoveryPointProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "expiryTime", r.ExpiryTime) + populate(objectMap, "ruleName", r.RuleName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointProperties. +func (r *RecoveryPointProperties) UnmarshalJSON(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 "expiryTime": + err = unpopulate(val, "ExpiryTime", &r.ExpiryTime) + delete(rawMsg, key) + case "ruleName": + err = unpopulate(val, "RuleName", &r.RuleName) + 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 RecoveryPointRehydrationInfo. +func (r RecoveryPointRehydrationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "rehydrationPriority", r.RehydrationPriority) + populate(objectMap, "rehydrationRetentionDuration", r.RehydrationRetentionDuration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointRehydrationInfo. +func (r *RecoveryPointRehydrationInfo) UnmarshalJSON(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 "rehydrationPriority": + err = unpopulate(val, "RehydrationPriority", &r.RehydrationPriority) + delete(rawMsg, key) + case "rehydrationRetentionDuration": + err = unpopulate(val, "RehydrationRetentionDuration", &r.RehydrationRetentionDuration) + 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 RecoveryPointResource. +func (r RecoveryPointResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", r.ETag) + 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 RecoveryPointResource. +func (r *RecoveryPointResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &r.ETag) + delete(rawMsg, 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": + r.Properties, err = unmarshalRecoveryPointClassification(val) + 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 RecoveryPointResourceList. +func (r RecoveryPointResourceList) 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 RecoveryPointResourceList. +func (r *RecoveryPointResourceList) UnmarshalJSON(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 RecoveryPointTierInformation. +func (r RecoveryPointTierInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "extendedInfo", r.ExtendedInfo) + populate(objectMap, "status", r.Status) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointTierInformation. +func (r *RecoveryPointTierInformation) UnmarshalJSON(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 "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &r.ExtendedInfo) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) + 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 RecoveryPointTierInformationV2. +func (r RecoveryPointTierInformationV2) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "extendedInfo", r.ExtendedInfo) + populate(objectMap, "status", r.Status) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointTierInformationV2. +func (r *RecoveryPointTierInformationV2) UnmarshalJSON(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 "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &r.ExtendedInfo) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) + 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 Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", r.ETag) + populate(objectMap, "id", r.ID) + populate(objectMap, "location", r.Location) + populate(objectMap, "name", r.Name) + populate(objectMap, "tags", r.Tags) + 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 "eTag": + err = unpopulate(val, "ETag", &r.ETag) + delete(rawMsg, 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 "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 ResourceGuardOperationDetail. +func (r ResourceGuardOperationDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultResourceRequest", r.DefaultResourceRequest) + populate(objectMap, "vaultCriticalOperation", r.VaultCriticalOperation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGuardOperationDetail. +func (r *ResourceGuardOperationDetail) UnmarshalJSON(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 "defaultResourceRequest": + err = unpopulate(val, "DefaultResourceRequest", &r.DefaultResourceRequest) + delete(rawMsg, key) + case "vaultCriticalOperation": + err = unpopulate(val, "VaultCriticalOperation", &r.VaultCriticalOperation) + 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 ResourceGuardProxyBase. +func (r ResourceGuardProxyBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", r.Description) + populate(objectMap, "lastUpdatedTime", r.LastUpdatedTime) + populate(objectMap, "resourceGuardOperationDetails", r.ResourceGuardOperationDetails) + populate(objectMap, "resourceGuardResourceId", r.ResourceGuardResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGuardProxyBase. +func (r *ResourceGuardProxyBase) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &r.Description) + delete(rawMsg, key) + case "lastUpdatedTime": + err = unpopulate(val, "LastUpdatedTime", &r.LastUpdatedTime) + delete(rawMsg, key) + case "resourceGuardOperationDetails": + err = unpopulate(val, "ResourceGuardOperationDetails", &r.ResourceGuardOperationDetails) + delete(rawMsg, key) + case "resourceGuardResourceId": + err = unpopulate(val, "ResourceGuardResourceID", &r.ResourceGuardResourceID) + 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 ResourceGuardProxyBaseResource. +func (r ResourceGuardProxyBaseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", r.ETag) + 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 ResourceGuardProxyBaseResource. +func (r *ResourceGuardProxyBaseResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &r.ETag) + delete(rawMsg, 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", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MabErrorInfo. -func (m MabErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorString", m.ErrorString) - populate(objectMap, "recommendations", m.Recommendations) +// MarshalJSON implements the json.Marshaller interface for type ResourceGuardProxyBaseResourceList. +func (r ResourceGuardProxyBaseResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type MabFileFolderProtectedItem. -func (m MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", m.BackupManagementType) - populate(objectMap, "backupSetName", m.BackupSetName) - populate(objectMap, "computerName", m.ComputerName) - populate(objectMap, "containerName", m.ContainerName) - populate(objectMap, "createMode", m.CreateMode) - populate(objectMap, "deferredDeleteSyncTimeInUTC", m.DeferredDeleteSyncTimeInUTC) - populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", m.DeferredDeleteTimeInUTC) - populate(objectMap, "deferredDeleteTimeRemaining", m.DeferredDeleteTimeRemaining) - populate(objectMap, "extendedInfo", m.ExtendedInfo) - populate(objectMap, "friendlyName", m.FriendlyName) - populate(objectMap, "isArchiveEnabled", m.IsArchiveEnabled) - populate(objectMap, "isDeferredDeleteScheduleUpcoming", m.IsDeferredDeleteScheduleUpcoming) - populate(objectMap, "isRehydrate", m.IsRehydrate) - populate(objectMap, "isScheduledForDeferredDelete", m.IsScheduledForDeferredDelete) - populate(objectMap, "lastBackupStatus", m.LastBackupStatus) - populateTimeRFC3339(objectMap, "lastBackupTime", m.LastBackupTime) - populateTimeRFC3339(objectMap, "lastRecoveryPoint", m.LastRecoveryPoint) - populate(objectMap, "policyId", m.PolicyID) - populate(objectMap, "policyName", m.PolicyName) - objectMap["protectedItemType"] = "MabFileFolderProtectedItem" - populate(objectMap, "protectionState", m.ProtectionState) - populate(objectMap, "resourceGuardOperationRequests", m.ResourceGuardOperationRequests) - populate(objectMap, "sourceResourceId", m.SourceResourceID) - populate(objectMap, "workloadType", m.WorkloadType) +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceGuardProxyBaseResourceList. +func (r *ResourceGuardProxyBaseResourceList) UnmarshalJSON(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 ResourceHealthDetails. +func (r ResourceHealthDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", r.Code) + populate(objectMap, "message", r.Message) + populate(objectMap, "recommendations", r.Recommendations) + populate(objectMap, "title", r.Title) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabFileFolderProtectedItem. -func (m *MabFileFolderProtectedItem) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceHealthDetails. +func (r *ResourceHealthDetails) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) + case "code": + err = unpopulate(val, "Code", &r.Code) delete(rawMsg, key) - case "backupSetName": - err = unpopulate(val, "BackupSetName", &m.BackupSetName) - delete(rawMsg, key) - case "computerName": - err = unpopulate(val, "ComputerName", &m.ComputerName) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &m.ContainerName) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &m.CreateMode) - delete(rawMsg, key) - case "deferredDeleteSyncTimeInUTC": - err = unpopulate(val, "DeferredDeleteSyncTimeInUTC", &m.DeferredDeleteSyncTimeInUTC) - delete(rawMsg, key) - case "deferredDeleteTimeInUTC": - err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &m.DeferredDeleteTimeInUTC) + case "message": + err = unpopulate(val, "Message", &r.Message) delete(rawMsg, key) - case "deferredDeleteTimeRemaining": - err = unpopulate(val, "DeferredDeleteTimeRemaining", &m.DeferredDeleteTimeRemaining) + case "recommendations": + err = unpopulate(val, "Recommendations", &r.Recommendations) delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &m.ExtendedInfo) + case "title": + err = unpopulate(val, "Title", &r.Title) delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, "FriendlyName", &m.FriendlyName) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceList. +func (r ResourceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", r.NextLink) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceList. +func (r *ResourceList) UnmarshalJSON(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 "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &m.IsArchiveEnabled) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestoreFileSpecs. +func (r RestoreFileSpecs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "fileSpecType", r.FileSpecType) + populate(objectMap, "path", r.Path) + populate(objectMap, "targetFolderPath", r.TargetFolderPath) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestoreFileSpecs. +func (r *RestoreFileSpecs) UnmarshalJSON(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 "fileSpecType": + err = unpopulate(val, "FileSpecType", &r.FileSpecType) delete(rawMsg, key) - case "isDeferredDeleteScheduleUpcoming": - err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &m.IsDeferredDeleteScheduleUpcoming) + case "path": + err = unpopulate(val, "Path", &r.Path) delete(rawMsg, key) - case "isRehydrate": - err = unpopulate(val, "IsRehydrate", &m.IsRehydrate) + case "targetFolderPath": + err = unpopulate(val, "TargetFolderPath", &r.TargetFolderPath) delete(rawMsg, key) - case "isScheduledForDeferredDelete": - err = unpopulate(val, "IsScheduledForDeferredDelete", &m.IsScheduledForDeferredDelete) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestoreRequest. +func (r RestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = r.ObjectType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestoreRequest. +func (r *RestoreRequest) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &r.ObjectType) delete(rawMsg, key) - case "lastBackupStatus": - err = unpopulate(val, "LastBackupStatus", &m.LastBackupStatus) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestoreRequestResource. +func (r RestoreRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "eTag", r.ETag) + 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 RestoreRequestResource. +func (r *RestoreRequestResource) UnmarshalJSON(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 "eTag": + err = unpopulate(val, "ETag", &r.ETag) delete(rawMsg, key) - case "lastBackupTime": - err = unpopulateTimeRFC3339(val, "LastBackupTime", &m.LastBackupTime) + case "id": + err = unpopulate(val, "ID", &r.ID) delete(rawMsg, key) - case "lastRecoveryPoint": - err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &m.LastRecoveryPoint) + case "location": + err = unpopulate(val, "Location", &r.Location) delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &m.PolicyID) + case "name": + err = unpopulate(val, "Name", &r.Name) delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &m.PolicyName) + case "properties": + r.Properties, err = unmarshalRestoreRequestClassification(val) delete(rawMsg, key) - case "protectedItemType": - err = unpopulate(val, "ProtectedItemType", &m.ProtectedItemType) + case "tags": + err = unpopulate(val, "Tags", &r.Tags) delete(rawMsg, key) - case "protectionState": - err = unpopulate(val, "ProtectionState", &m.ProtectionState) + case "type": + err = unpopulate(val, "Type", &r.Type) delete(rawMsg, key) - case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &m.ResourceGuardOperationRequests) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RetentionDuration. +func (r RetentionDuration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", r.Count) + populate(objectMap, "durationType", r.DurationType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RetentionDuration. +func (r *RetentionDuration) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &r.Count) delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &m.SourceResourceID) + case "durationType": + err = unpopulate(val, "DurationType", &r.DurationType) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &m.WorkloadType) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RetentionPolicy. +func (r RetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["retentionPolicyType"] = r.RetentionPolicyType + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RetentionPolicy. +func (r *RetentionPolicy) UnmarshalJSON(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 "retentionPolicyType": + err = unpopulate(val, "RetentionPolicyType", &r.RetentionPolicyType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", r, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MabFileFolderProtectedItemExtendedInfo. -func (m MabFileFolderProtectedItemExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "lastRefreshedAt", m.LastRefreshedAt) - populateTimeRFC3339(objectMap, "oldestRecoveryPoint", m.OldestRecoveryPoint) - populate(objectMap, "recoveryPointCount", m.RecoveryPointCount) +// MarshalJSON implements the json.Marshaller interface for type SQLDataDirectory. +func (s SQLDataDirectory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "logicalName", s.LogicalName) + populate(objectMap, "path", s.Path) + populate(objectMap, "type", s.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabFileFolderProtectedItemExtendedInfo. -func (m *MabFileFolderProtectedItemExtendedInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDataDirectory. +func (s *SQLDataDirectory) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "lastRefreshedAt": - err = unpopulateTimeRFC3339(val, "LastRefreshedAt", &m.LastRefreshedAt) + case "logicalName": + err = unpopulate(val, "LogicalName", &s.LogicalName) delete(rawMsg, key) - case "oldestRecoveryPoint": - err = unpopulateTimeRFC3339(val, "OldestRecoveryPoint", &m.OldestRecoveryPoint) + case "path": + err = unpopulate(val, "Path", &s.Path) delete(rawMsg, key) - case "recoveryPointCount": - err = unpopulate(val, "RecoveryPointCount", &m.RecoveryPointCount) + case "type": + err = unpopulate(val, "Type", &s.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MabJob. -func (m MabJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionsInfo", m.ActionsInfo) - populate(objectMap, "activityId", m.ActivityID) - populate(objectMap, "backupManagementType", m.BackupManagementType) - populate(objectMap, "duration", m.Duration) - populateTimeRFC3339(objectMap, "endTime", m.EndTime) - populate(objectMap, "entityFriendlyName", m.EntityFriendlyName) - populate(objectMap, "errorDetails", m.ErrorDetails) - populate(objectMap, "extendedInfo", m.ExtendedInfo) - objectMap["jobType"] = "MabJob" - populate(objectMap, "mabServerName", m.MabServerName) - populate(objectMap, "mabServerType", m.MabServerType) - populate(objectMap, "operation", m.Operation) - populateTimeRFC3339(objectMap, "startTime", m.StartTime) - populate(objectMap, "status", m.Status) - populate(objectMap, "workloadType", m.WorkloadType) +// MarshalJSON implements the json.Marshaller interface for type SQLDataDirectoryMapping. +func (s SQLDataDirectoryMapping) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "mappingType", s.MappingType) + populate(objectMap, "sourceLogicalName", s.SourceLogicalName) + populate(objectMap, "sourcePath", s.SourcePath) + populate(objectMap, "targetPath", s.TargetPath) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabJob. -func (m *MabJob) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SQLDataDirectoryMapping. +func (s *SQLDataDirectoryMapping) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "actionsInfo": - err = unpopulate(val, "ActionsInfo", &m.ActionsInfo) - delete(rawMsg, key) - case "activityId": - err = unpopulate(val, "ActivityID", &m.ActivityID) - delete(rawMsg, key) - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) - delete(rawMsg, key) - case "duration": - err = unpopulate(val, "Duration", &m.Duration) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) - delete(rawMsg, key) - case "entityFriendlyName": - err = unpopulate(val, "EntityFriendlyName", &m.EntityFriendlyName) - delete(rawMsg, key) - case "errorDetails": - err = unpopulate(val, "ErrorDetails", &m.ErrorDetails) - delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &m.ExtendedInfo) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &m.JobType) - delete(rawMsg, key) - case "mabServerName": - err = unpopulate(val, "MabServerName", &m.MabServerName) + case "mappingType": + err = unpopulate(val, "MappingType", &s.MappingType) delete(rawMsg, key) - case "mabServerType": - err = unpopulate(val, "MabServerType", &m.MabServerType) - delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &m.Operation) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) + case "sourceLogicalName": + err = unpopulate(val, "SourceLogicalName", &s.SourceLogicalName) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) + case "sourcePath": + err = unpopulate(val, "SourcePath", &s.SourcePath) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &m.WorkloadType) + case "targetPath": + err = unpopulate(val, "TargetPath", &s.TargetPath) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MabJobExtendedInfo. -func (m MabJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dynamicErrorMessage", m.DynamicErrorMessage) - populate(objectMap, "propertyBag", m.PropertyBag) - populate(objectMap, "tasksList", m.TasksList) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type MabJobTaskDetails. -func (m MabJobTaskDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "duration", m.Duration) - populateTimeRFC3339(objectMap, "endTime", m.EndTime) - populateTimeRFC3339(objectMap, "startTime", m.StartTime) - populate(objectMap, "status", m.Status) - populate(objectMap, "taskId", m.TaskID) +// MarshalJSON implements the json.Marshaller interface for type SchedulePolicy. +func (s SchedulePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["schedulePolicyType"] = s.SchedulePolicyType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabJobTaskDetails. -func (m *MabJobTaskDetails) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SchedulePolicy. +func (s *SchedulePolicy) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "duration": - err = unpopulate(val, "Duration", &m.Duration) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &m.EndTime) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &m.StartTime) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &m.Status) - delete(rawMsg, key) - case "taskId": - err = unpopulate(val, "TaskID", &m.TaskID) + case "schedulePolicyType": + err = unpopulate(val, "SchedulePolicyType", &s.SchedulePolicyType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MabProtectionPolicy. -func (m MabProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["backupManagementType"] = "MAB" - populate(objectMap, "protectedItemsCount", m.ProtectedItemsCount) - populate(objectMap, "resourceGuardOperationRequests", m.ResourceGuardOperationRequests) - populate(objectMap, "retentionPolicy", m.RetentionPolicy) - populate(objectMap, "schedulePolicy", m.SchedulePolicy) +// MarshalJSON implements the json.Marshaller interface for type SecurityPinBase. +func (s SecurityPinBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceGuardOperationRequests", s.ResourceGuardOperationRequests) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type MabProtectionPolicy. -func (m *MabProtectionPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type SecurityPinBase. +func (s *SecurityPinBase) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &m.BackupManagementType) - delete(rawMsg, key) - case "protectedItemsCount": - err = unpopulate(val, "ProtectedItemsCount", &m.ProtectedItemsCount) - delete(rawMsg, key) case "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &m.ResourceGuardOperationRequests) - delete(rawMsg, key) - case "retentionPolicy": - m.RetentionPolicy, err = unmarshalRetentionPolicyClassification(val) - delete(rawMsg, key) - case "schedulePolicy": - m.SchedulePolicy, err = unmarshalSchedulePolicyClassification(val) + err = unpopulate(val, "ResourceGuardOperationRequests", &s.ResourceGuardOperationRequests) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", m, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type MonthlyRetentionSchedule. -func (m MonthlyRetentionSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "retentionDuration", m.RetentionDuration) - populate(objectMap, "retentionScheduleDaily", m.RetentionScheduleDaily) - populate(objectMap, "retentionScheduleFormatType", m.RetentionScheduleFormatType) - populate(objectMap, "retentionScheduleWeekly", m.RetentionScheduleWeekly) - aux := make([]*timeRFC3339, len(m.RetentionTimes), len(m.RetentionTimes)) - for i := 0; i < len(m.RetentionTimes); i++ { - aux[i] = (*timeRFC3339)(m.RetentionTimes[i]) - } - populate(objectMap, "retentionTimes", aux) +// MarshalJSON implements the json.Marshaller interface for type Settings. +func (s Settings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isCompression", s.IsCompression) + populate(objectMap, "issqlcompression", s.Issqlcompression) + populate(objectMap, "timeZone", s.TimeZone) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultInfo. -func (o *OperationResultInfo) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type Settings. +func (s *Settings) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "jobList": - err = unpopulate(val, "JobList", &o.JobList) + case "isCompression": + err = unpopulate(val, "IsCompression", &s.IsCompression) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &o.ObjectType) + case "issqlcompression": + err = unpopulate(val, "Issqlcompression", &s.Issqlcompression) + delete(rawMsg, key) + case "timeZone": + err = unpopulate(val, "TimeZone", &s.TimeZone) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultInfoBaseResource. -func (o *OperationResultInfoBaseResource) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type SimpleRetentionPolicy. +func (s SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "retentionDuration", s.RetentionDuration) + objectMap["retentionPolicyType"] = "SimpleRetentionPolicy" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SimpleRetentionPolicy. +func (s *SimpleRetentionPolicy) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "headers": - err = unpopulate(val, "Headers", &o.Headers) - delete(rawMsg, key) - case "operation": - o.Operation, err = unmarshalOperationResultInfoBaseClassification(val) + case "retentionDuration": + err = unpopulate(val, "RetentionDuration", &s.RetentionDuration) delete(rawMsg, key) - case "statusCode": - err = unpopulate(val, "StatusCode", &o.StatusCode) + case "retentionPolicyType": + err = unpopulate(val, "RetentionPolicyType", &s.RetentionPolicyType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatus. -func (o *OperationStatus) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type SimpleSchedulePolicy. +func (s SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "hourlySchedule", s.HourlySchedule) + objectMap["schedulePolicyType"] = "SimpleSchedulePolicy" + populate(objectMap, "scheduleRunDays", s.ScheduleRunDays) + populate(objectMap, "scheduleRunFrequency", s.ScheduleRunFrequency) + aux := make([]*timeRFC3339, len(s.ScheduleRunTimes), len(s.ScheduleRunTimes)) + for i := 0; i < len(s.ScheduleRunTimes); i++ { + aux[i] = (*timeRFC3339)(s.ScheduleRunTimes[i]) + } + populate(objectMap, "scheduleRunTimes", aux) + populate(objectMap, "scheduleWeeklyFrequency", s.ScheduleWeeklyFrequency) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SimpleSchedulePolicy. +func (s *SimpleSchedulePolicy) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &o.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, "Error", &o.Error) + case "hourlySchedule": + err = unpopulate(val, "HourlySchedule", &s.HourlySchedule) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &o.ID) + case "schedulePolicyType": + err = unpopulate(val, "SchedulePolicyType", &s.SchedulePolicyType) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &o.Name) + case "scheduleRunDays": + err = unpopulate(val, "ScheduleRunDays", &s.ScheduleRunDays) delete(rawMsg, key) - case "properties": - o.Properties, err = unmarshalOperationStatusExtendedInfoClassification(val) + case "scheduleRunFrequency": + err = unpopulate(val, "ScheduleRunFrequency", &s.ScheduleRunFrequency) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &o.StartTime) + case "scheduleRunTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "ScheduleRunTimes", &aux) + for _, au := range aux { + s.ScheduleRunTimes = append(s.ScheduleRunTimes, (*time.Time)(au)) + } delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &o.Status) + case "scheduleWeeklyFrequency": + err = unpopulate(val, "ScheduleWeeklyFrequency", &s.ScheduleWeeklyFrequency) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusJobExtendedInfo. -func (o *OperationStatusJobExtendedInfo) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type SimpleSchedulePolicyV2. +func (s SimpleSchedulePolicyV2) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "dailySchedule", s.DailySchedule) + populate(objectMap, "hourlySchedule", s.HourlySchedule) + objectMap["schedulePolicyType"] = "SimpleSchedulePolicyV2" + populate(objectMap, "scheduleRunFrequency", s.ScheduleRunFrequency) + populate(objectMap, "weeklySchedule", s.WeeklySchedule) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SimpleSchedulePolicyV2. +func (s *SimpleSchedulePolicyV2) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "jobId": - err = unpopulate(val, "JobID", &o.JobID) + case "dailySchedule": + err = unpopulate(val, "DailySchedule", &s.DailySchedule) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &o.ObjectType) + case "hourlySchedule": + err = unpopulate(val, "HourlySchedule", &s.HourlySchedule) + delete(rawMsg, key) + case "schedulePolicyType": + err = unpopulate(val, "SchedulePolicyType", &s.SchedulePolicyType) + delete(rawMsg, key) + case "scheduleRunFrequency": + err = unpopulate(val, "ScheduleRunFrequency", &s.ScheduleRunFrequency) + delete(rawMsg, key) + case "weeklySchedule": + err = unpopulate(val, "WeeklySchedule", &s.WeeklySchedule) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusJobsExtendedInfo. -func (o *OperationStatusJobsExtendedInfo) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type SubProtectionPolicy. +func (s SubProtectionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "policyType", s.PolicyType) + populate(objectMap, "retentionPolicy", s.RetentionPolicy) + populate(objectMap, "schedulePolicy", s.SchedulePolicy) + populate(objectMap, "tieringPolicy", s.TieringPolicy) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubProtectionPolicy. +func (s *SubProtectionPolicy) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } for key, val := range rawMsg { var err error switch key { - case "failedJobsError": - err = unpopulate(val, "FailedJobsError", &o.FailedJobsError) + case "policyType": + err = unpopulate(val, "PolicyType", &s.PolicyType) delete(rawMsg, key) - case "jobIds": - err = unpopulate(val, "JobIDs", &o.JobIDs) + case "retentionPolicy": + s.RetentionPolicy, err = unmarshalRetentionPolicyClassification(val) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &o.ObjectType) + case "schedulePolicy": + s.SchedulePolicy, err = unmarshalSchedulePolicyClassification(val) + delete(rawMsg, key) + case "tieringPolicy": + err = unpopulate(val, "TieringPolicy", &s.TieringPolicy) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", s, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusProvisionILRExtendedInfo. -func (o *OperationStatusProvisionILRExtendedInfo) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type TargetAFSRestoreInfo. +func (t TargetAFSRestoreInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", t.Name) + populate(objectMap, "targetResourceId", t.TargetResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TargetAFSRestoreInfo. +func (t *TargetAFSRestoreInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &o.ObjectType) + case "name": + err = unpopulate(val, "Name", &t.Name) delete(rawMsg, key) - case "recoveryTarget": - err = unpopulate(val, "RecoveryTarget", &o.RecoveryTarget) + case "targetResourceId": + err = unpopulate(val, "TargetResourceID", &t.TargetResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationStatusValidateOperationExtendedInfo. -func (o *OperationStatusValidateOperationExtendedInfo) UnmarshalJSON(data []byte) error { +// MarshalJSON implements the json.Marshaller interface for type TargetRestoreInfo. +func (t TargetRestoreInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "containerId", t.ContainerID) + populate(objectMap, "databaseName", t.DatabaseName) + populate(objectMap, "overwriteOption", t.OverwriteOption) + populate(objectMap, "targetDirectoryForFileRestore", t.TargetDirectoryForFileRestore) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TargetRestoreInfo. +func (t *TargetRestoreInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &o.ObjectType) + case "containerId": + err = unpopulate(val, "ContainerID", &t.ContainerID) delete(rawMsg, key) - case "validateOperationResponse": - err = unpopulate(val, "ValidateOperationResponse", &o.ValidateOperationResponse) + case "databaseName": + err = unpopulate(val, "DatabaseName", &t.DatabaseName) + delete(rawMsg, key) + case "overwriteOption": + err = unpopulate(val, "OverwriteOption", &t.OverwriteOption) + delete(rawMsg, key) + case "targetDirectoryForFileRestore": + err = unpopulate(val, "TargetDirectoryForFileRestore", &t.TargetDirectoryForFileRestore) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", o, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PointInTimeRange. -func (p PointInTimeRange) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", p.EndTime) - populateTimeRFC3339(objectMap, "startTime", p.StartTime) +// MarshalJSON implements the json.Marshaller interface for type TieringPolicy. +func (t TieringPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "duration", t.Duration) + populate(objectMap, "durationType", t.DurationType) + populate(objectMap, "tieringMode", t.TieringMode) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PointInTimeRange. -func (p *PointInTimeRange) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TieringPolicy. +func (t *TieringPolicy) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &p.EndTime) + case "duration": + err = unpopulate(val, "Duration", &t.Duration) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &p.StartTime) + case "durationType": + err = unpopulate(val, "DurationType", &t.DurationType) + delete(rawMsg, key) + case "tieringMode": + err = unpopulate(val, "TieringMode", &t.TieringMode) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrepareDataMoveRequest. -func (p PrepareDataMoveRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dataMoveLevel", p.DataMoveLevel) - populate(objectMap, "ignoreMoved", p.IgnoreMoved) - populate(objectMap, "sourceContainerArmIds", p.SourceContainerArmIDs) - populate(objectMap, "targetRegion", p.TargetRegion) - populate(objectMap, "targetResourceId", p.TargetResourceID) +// MarshalJSON implements the json.Marshaller interface for type TokenInformation. +func (t TokenInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "expiryTimeInUtcTicks", t.ExpiryTimeInUTCTicks) + populate(objectMap, "securityPIN", t.SecurityPIN) + populate(objectMap, "token", t.Token) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type PrepareDataMoveResponse. -func (p *PrepareDataMoveResponse) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TokenInformation. +func (t *TokenInformation) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "correlationId": - err = unpopulate(val, "CorrelationID", &p.CorrelationID) + case "expiryTimeInUtcTicks": + err = unpopulate(val, "ExpiryTimeInUTCTicks", &t.ExpiryTimeInUTCTicks) delete(rawMsg, key) - case "objectType": - err = unpopulate(val, "ObjectType", &p.ObjectType) + case "securityPIN": + err = unpopulate(val, "SecurityPIN", &t.SecurityPIN) delete(rawMsg, key) - case "sourceVaultProperties": - err = unpopulate(val, "SourceVaultProperties", &p.SourceVaultProperties) + case "token": + err = unpopulate(val, "Token", &t.Token) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionResource. -func (p PrivateEndpointConnectionResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", p.ETag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ProtectableContainerResource. -func (p ProtectableContainerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", p.ETag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) +// MarshalJSON implements the json.Marshaller interface for type TriggerDataMoveRequest. +func (t TriggerDataMoveRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "correlationId", t.CorrelationID) + populate(objectMap, "dataMoveLevel", t.DataMoveLevel) + populate(objectMap, "pauseGC", t.PauseGC) + populate(objectMap, "sourceContainerArmIds", t.SourceContainerArmIDs) + populate(objectMap, "sourceRegion", t.SourceRegion) + populate(objectMap, "sourceResourceId", t.SourceResourceID) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectableContainerResource. -func (p *ProtectableContainerResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type TriggerDataMoveRequest. +func (t *TriggerDataMoveRequest) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &p.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) + case "correlationId": + err = unpopulate(val, "CorrelationID", &t.CorrelationID) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) + case "dataMoveLevel": + err = unpopulate(val, "DataMoveLevel", &t.DataMoveLevel) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) + case "pauseGC": + err = unpopulate(val, "PauseGC", &t.PauseGC) delete(rawMsg, key) - case "properties": - p.Properties, err = unmarshalProtectableContainerClassification(val) + case "sourceContainerArmIds": + err = unpopulate(val, "SourceContainerArmIDs", &t.SourceContainerArmIDs) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "sourceRegion": + err = unpopulate(val, "SourceRegion", &t.SourceRegion) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &t.SourceResourceID) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", t, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProtectedItem. -func (p ProtectedItem) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "backupManagementType", p.BackupManagementType) - populate(objectMap, "backupSetName", p.BackupSetName) - populate(objectMap, "containerName", p.ContainerName) - populate(objectMap, "createMode", p.CreateMode) - populateTimeRFC3339(objectMap, "deferredDeleteTimeInUTC", p.DeferredDeleteTimeInUTC) - populate(objectMap, "deferredDeleteTimeRemaining", p.DeferredDeleteTimeRemaining) - populate(objectMap, "isArchiveEnabled", p.IsArchiveEnabled) - populate(objectMap, "isDeferredDeleteScheduleUpcoming", p.IsDeferredDeleteScheduleUpcoming) - populate(objectMap, "isRehydrate", p.IsRehydrate) - populate(objectMap, "isScheduledForDeferredDelete", p.IsScheduledForDeferredDelete) - populateTimeRFC3339(objectMap, "lastRecoveryPoint", p.LastRecoveryPoint) - populate(objectMap, "policyId", p.PolicyID) - populate(objectMap, "policyName", p.PolicyName) - objectMap["protectedItemType"] = p.ProtectedItemType - populate(objectMap, "resourceGuardOperationRequests", p.ResourceGuardOperationRequests) - populate(objectMap, "sourceResourceId", p.SourceResourceID) - populate(objectMap, "workloadType", p.WorkloadType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedItem. -func (p *ProtectedItem) UnmarshalJSON(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 "backupManagementType": - err = unpopulate(val, "BackupManagementType", &p.BackupManagementType) - delete(rawMsg, key) - case "backupSetName": - err = unpopulate(val, "BackupSetName", &p.BackupSetName) - delete(rawMsg, key) - case "containerName": - err = unpopulate(val, "ContainerName", &p.ContainerName) - delete(rawMsg, key) - case "createMode": - err = unpopulate(val, "CreateMode", &p.CreateMode) - delete(rawMsg, key) - case "deferredDeleteTimeInUTC": - err = unpopulateTimeRFC3339(val, "DeferredDeleteTimeInUTC", &p.DeferredDeleteTimeInUTC) - delete(rawMsg, key) - case "deferredDeleteTimeRemaining": - err = unpopulate(val, "DeferredDeleteTimeRemaining", &p.DeferredDeleteTimeRemaining) - delete(rawMsg, key) - case "isArchiveEnabled": - err = unpopulate(val, "IsArchiveEnabled", &p.IsArchiveEnabled) - delete(rawMsg, key) - case "isDeferredDeleteScheduleUpcoming": - err = unpopulate(val, "IsDeferredDeleteScheduleUpcoming", &p.IsDeferredDeleteScheduleUpcoming) - delete(rawMsg, key) - case "isRehydrate": - err = unpopulate(val, "IsRehydrate", &p.IsRehydrate) - delete(rawMsg, key) - case "isScheduledForDeferredDelete": - err = unpopulate(val, "IsScheduledForDeferredDelete", &p.IsScheduledForDeferredDelete) - delete(rawMsg, key) - case "lastRecoveryPoint": - err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &p.LastRecoveryPoint) - delete(rawMsg, key) - case "policyId": - err = unpopulate(val, "PolicyID", &p.PolicyID) - delete(rawMsg, key) - case "policyName": - err = unpopulate(val, "PolicyName", &p.PolicyName) - delete(rawMsg, key) - case "protectedItemType": - err = unpopulate(val, "ProtectedItemType", &p.ProtectedItemType) - delete(rawMsg, key) +// MarshalJSON implements the json.Marshaller interface for type UnlockDeleteRequest. +func (u UnlockDeleteRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceGuardOperationRequests", u.ResourceGuardOperationRequests) + populate(objectMap, "resourceToBeDeleted", u.ResourceToBeDeleted) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UnlockDeleteRequest. +func (u *UnlockDeleteRequest) UnmarshalJSON(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 "resourceGuardOperationRequests": - err = unpopulate(val, "ResourceGuardOperationRequests", &p.ResourceGuardOperationRequests) - delete(rawMsg, key) - case "sourceResourceId": - err = unpopulate(val, "SourceResourceID", &p.SourceResourceID) + err = unpopulate(val, "ResourceGuardOperationRequests", &u.ResourceGuardOperationRequests) delete(rawMsg, key) - case "workloadType": - err = unpopulate(val, "WorkloadType", &p.WorkloadType) + case "resourceToBeDeleted": + err = unpopulate(val, "ResourceToBeDeleted", &u.ResourceToBeDeleted) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProtectedItemResource. -func (p ProtectedItemResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", p.ETag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) +// MarshalJSON implements the json.Marshaller interface for type UnlockDeleteResponse. +func (u UnlockDeleteResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "unlockDeleteExpiryTime", u.UnlockDeleteExpiryTime) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectedItemResource. -func (p *ProtectedItemResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type UnlockDeleteResponse. +func (u *UnlockDeleteResponse) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &p.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - p.Properties, err = unmarshalProtectedItemClassification(val) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "unlockDeleteExpiryTime": + err = unpopulate(val, "UnlockDeleteExpiryTime", &u.UnlockDeleteExpiryTime) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", u, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProtectionContainerResource. -func (p ProtectionContainerResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", p.ETag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) +// MarshalJSON implements the json.Marshaller interface for type ValidateIaasVMRestoreOperationRequest. +func (v ValidateIaasVMRestoreOperationRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = "ValidateIaasVMRestoreOperationRequest" + populate(objectMap, "restoreRequest", v.RestoreRequest) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionContainerResource. -func (p *ProtectionContainerResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateIaasVMRestoreOperationRequest. +func (v *ValidateIaasVMRestoreOperationRequest) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &p.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - p.Properties, err = unmarshalProtectionContainerClassification(val) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) + case "objectType": + err = unpopulate(val, "ObjectType", &v.ObjectType) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "restoreRequest": + v.RestoreRequest, err = unmarshalRestoreRequestClassification(val) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProtectionIntentResource. -func (p ProtectionIntentResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", p.ETag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) +// MarshalJSON implements the json.Marshaller interface for type ValidateOperationRequest. +func (v ValidateOperationRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = v.ObjectType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionIntentResource. -func (p *ProtectionIntentResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateOperationRequest. +func (v *ValidateOperationRequest) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &p.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - p.Properties, err = unmarshalProtectionIntentClassification(val) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "objectType": + err = unpopulate(val, "ObjectType", &v.ObjectType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ProtectionPolicy. -func (p ProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["backupManagementType"] = p.BackupManagementType - populate(objectMap, "protectedItemsCount", p.ProtectedItemsCount) - populate(objectMap, "resourceGuardOperationRequests", p.ResourceGuardOperationRequests) +// MarshalJSON implements the json.Marshaller interface for type ValidateOperationResponse. +func (v ValidateOperationResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "validationResults", v.ValidationResults) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type ProtectionPolicyResource. -func (p ProtectionPolicyResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", p.ETag) - populate(objectMap, "id", p.ID) - populate(objectMap, "location", p.Location) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateOperationResponse. +func (v *ValidateOperationResponse) UnmarshalJSON(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 "validationResults": + err = unpopulate(val, "ValidationResults", &v.ValidationResults) + 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 ValidateOperationsResponse. +func (v ValidateOperationsResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "validateOperationResponse", v.ValidateOperationResponse) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ProtectionPolicyResource. -func (p *ProtectionPolicyResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateOperationsResponse. +func (v *ValidateOperationsResponse) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &p.ETag) - delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &p.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &p.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &p.Name) - delete(rawMsg, key) - case "properties": - p.Properties, err = unmarshalProtectionPolicyClassification(val) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &p.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &p.Type) + case "validateOperationResponse": + err = unpopulate(val, "ValidateOperationResponse", &v.ValidateOperationResponse) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", p, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RecoveryPointDiskConfiguration. -func (r RecoveryPointDiskConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "excludedDiskList", r.ExcludedDiskList) - populate(objectMap, "includedDiskList", r.IncludedDiskList) - populate(objectMap, "numberOfDisksAttachedToVm", r.NumberOfDisksAttachedToVM) - populate(objectMap, "numberOfDisksIncludedInBackup", r.NumberOfDisksIncludedInBackup) +// MarshalJSON implements the json.Marshaller interface for type ValidateRestoreOperationRequest. +func (v ValidateRestoreOperationRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = "ValidateRestoreOperationRequest" + populate(objectMap, "restoreRequest", v.RestoreRequest) return json.Marshal(objectMap) } -// MarshalJSON implements the json.Marshaller interface for type RecoveryPointResource. -func (r RecoveryPointResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", r.ETag) - 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) +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateRestoreOperationRequest. +func (v *ValidateRestoreOperationRequest) UnmarshalJSON(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 "objectType": + err = unpopulate(val, "ObjectType", &v.ObjectType) + delete(rawMsg, key) + case "restoreRequest": + v.RestoreRequest, err = unmarshalRestoreRequestClassification(val) + 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 VaultJob. +func (v VaultJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionsInfo", v.ActionsInfo) + populate(objectMap, "activityId", v.ActivityID) + populate(objectMap, "backupManagementType", v.BackupManagementType) + populate(objectMap, "duration", v.Duration) + populateTimeRFC3339(objectMap, "endTime", v.EndTime) + populate(objectMap, "entityFriendlyName", v.EntityFriendlyName) + populate(objectMap, "errorDetails", v.ErrorDetails) + populate(objectMap, "extendedInfo", v.ExtendedInfo) + objectMap["jobType"] = "VaultJob" + populate(objectMap, "operation", v.Operation) + populateTimeRFC3339(objectMap, "startTime", v.StartTime) + populate(objectMap, "status", v.Status) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RecoveryPointResource. -func (r *RecoveryPointResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultJob. +func (v *VaultJob) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &r.ETag) + case "actionsInfo": + err = unpopulate(val, "ActionsInfo", &v.ActionsInfo) + delete(rawMsg, key) + case "activityId": + err = unpopulate(val, "ActivityID", &v.ActivityID) delete(rawMsg, key) - case "id": - err = unpopulate(val, "ID", &r.ID) + case "backupManagementType": + err = unpopulate(val, "BackupManagementType", &v.BackupManagementType) delete(rawMsg, key) - case "location": - err = unpopulate(val, "Location", &r.Location) + case "duration": + err = unpopulate(val, "Duration", &v.Duration) delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) + case "endTime": + err = unpopulateTimeRFC3339(val, "EndTime", &v.EndTime) delete(rawMsg, key) - case "properties": - r.Properties, err = unmarshalRecoveryPointClassification(val) + case "entityFriendlyName": + err = unpopulate(val, "EntityFriendlyName", &v.EntityFriendlyName) delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + case "errorDetails": + err = unpopulate(val, "ErrorDetails", &v.ErrorDetails) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "extendedInfo": + err = unpopulate(val, "ExtendedInfo", &v.ExtendedInfo) + delete(rawMsg, key) + case "jobType": + err = unpopulate(val, "JobType", &v.JobType) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &v.Operation) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, "StartTime", &v.StartTime) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &v.Status) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type RecoveryPointTierInformation. -func (r RecoveryPointTierInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedInfo", r.ExtendedInfo) - populate(objectMap, "status", r.Status) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RecoveryPointTierInformationV2. -func (r RecoveryPointTierInformationV2) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "extendedInfo", r.ExtendedInfo) - populate(objectMap, "status", r.Status) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type Resource. -func (r Resource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", r.ETag) - populate(objectMap, "id", r.ID) - populate(objectMap, "location", r.Location) - populate(objectMap, "name", r.Name) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceGuardProxyBase. -func (r ResourceGuardProxyBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", r.Description) - populate(objectMap, "lastUpdatedTime", r.LastUpdatedTime) - populate(objectMap, "resourceGuardOperationDetails", r.ResourceGuardOperationDetails) - populate(objectMap, "resourceGuardResourceId", r.ResourceGuardResourceID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ResourceGuardProxyBaseResource. -func (r ResourceGuardProxyBaseResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", r.ETag) - 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 ResourceHealthDetails. -func (r ResourceHealthDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", r.Code) - populate(objectMap, "message", r.Message) - populate(objectMap, "recommendations", r.Recommendations) - populate(objectMap, "title", r.Title) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RestoreRequestResource. -func (r RestoreRequestResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "eTag", r.ETag) - 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) +// MarshalJSON implements the json.Marshaller interface for type VaultJobErrorInfo. +func (v VaultJobErrorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "errorCode", v.ErrorCode) + populate(objectMap, "errorString", v.ErrorString) + populate(objectMap, "recommendations", v.Recommendations) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type RestoreRequestResource. -func (r *RestoreRequestResource) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultJobErrorInfo. +func (v *VaultJobErrorInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "eTag": - err = unpopulate(val, "ETag", &r.ETag) - delete(rawMsg, 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) + case "errorCode": + err = unpopulate(val, "ErrorCode", &v.ErrorCode) delete(rawMsg, key) - case "properties": - r.Properties, err = unmarshalRestoreRequestClassification(val) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, "Tags", &r.Tags) + case "errorString": + err = unpopulate(val, "ErrorString", &v.ErrorString) delete(rawMsg, key) - case "type": - err = unpopulate(val, "Type", &r.Type) + case "recommendations": + err = unpopulate(val, "Recommendations", &v.Recommendations) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", r, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SecurityPinBase. -func (s SecurityPinBase) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "resourceGuardOperationRequests", s.ResourceGuardOperationRequests) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SimpleRetentionPolicy. -func (s SimpleRetentionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "retentionDuration", s.RetentionDuration) - objectMap["retentionPolicyType"] = "SimpleRetentionPolicy" +// MarshalJSON implements the json.Marshaller interface for type VaultJobExtendedInfo. +func (v VaultJobExtendedInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "propertyBag", v.PropertyBag) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SimpleRetentionPolicy. -func (s *SimpleRetentionPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultJobExtendedInfo. +func (v *VaultJobExtendedInfo) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "retentionDuration": - err = unpopulate(val, "RetentionDuration", &s.RetentionDuration) - delete(rawMsg, key) - case "retentionPolicyType": - err = unpopulate(val, "RetentionPolicyType", &s.RetentionPolicyType) + case "propertyBag": + err = unpopulate(val, "PropertyBag", &v.PropertyBag) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SimpleSchedulePolicy. -func (s SimpleSchedulePolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "hourlySchedule", s.HourlySchedule) - objectMap["schedulePolicyType"] = "SimpleSchedulePolicy" - populate(objectMap, "scheduleRunDays", s.ScheduleRunDays) - populate(objectMap, "scheduleRunFrequency", s.ScheduleRunFrequency) - aux := make([]*timeRFC3339, len(s.ScheduleRunTimes), len(s.ScheduleRunTimes)) - for i := 0; i < len(s.ScheduleRunTimes); i++ { - aux[i] = (*timeRFC3339)(s.ScheduleRunTimes[i]) - } - populate(objectMap, "scheduleRunTimes", aux) - populate(objectMap, "scheduleWeeklyFrequency", s.ScheduleWeeklyFrequency) +// MarshalJSON implements the json.Marshaller interface for type VaultStorageConfigOperationResultResponse. +func (v VaultStorageConfigOperationResultResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = v.ObjectType return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SimpleSchedulePolicy. -func (s *SimpleSchedulePolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type VaultStorageConfigOperationResultResponse. +func (v *VaultStorageConfigOperationResultResponse) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } for key, val := range rawMsg { var err error switch key { - case "hourlySchedule": - err = unpopulate(val, "HourlySchedule", &s.HourlySchedule) - delete(rawMsg, key) - case "schedulePolicyType": - err = unpopulate(val, "SchedulePolicyType", &s.SchedulePolicyType) - delete(rawMsg, key) - case "scheduleRunDays": - err = unpopulate(val, "ScheduleRunDays", &s.ScheduleRunDays) - delete(rawMsg, key) - case "scheduleRunFrequency": - err = unpopulate(val, "ScheduleRunFrequency", &s.ScheduleRunFrequency) - delete(rawMsg, key) - case "scheduleRunTimes": - var aux []*timeRFC3339 - err = unpopulate(val, "ScheduleRunTimes", &aux) - for _, au := range aux { - s.ScheduleRunTimes = append(s.ScheduleRunTimes, (*time.Time)(au)) - } - delete(rawMsg, key) - case "scheduleWeeklyFrequency": - err = unpopulate(val, "ScheduleWeeklyFrequency", &s.ScheduleWeeklyFrequency) + case "objectType": + err = unpopulate(val, "ObjectType", &v.ObjectType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", v, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SimpleSchedulePolicyV2. -func (s SimpleSchedulePolicyV2) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dailySchedule", s.DailySchedule) - populate(objectMap, "hourlySchedule", s.HourlySchedule) - objectMap["schedulePolicyType"] = "SimpleSchedulePolicyV2" - populate(objectMap, "scheduleRunFrequency", s.ScheduleRunFrequency) - populate(objectMap, "weeklySchedule", s.WeeklySchedule) +// MarshalJSON implements the json.Marshaller interface for type WeeklyRetentionFormat. +func (w WeeklyRetentionFormat) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "daysOfTheWeek", w.DaysOfTheWeek) + populate(objectMap, "weeksOfTheMonth", w.WeeksOfTheMonth) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SimpleSchedulePolicyV2. -func (s *SimpleSchedulePolicyV2) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WeeklyRetentionFormat. +func (w *WeeklyRetentionFormat) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { - case "dailySchedule": - err = unpopulate(val, "DailySchedule", &s.DailySchedule) - delete(rawMsg, key) - case "hourlySchedule": - err = unpopulate(val, "HourlySchedule", &s.HourlySchedule) - delete(rawMsg, key) - case "schedulePolicyType": - err = unpopulate(val, "SchedulePolicyType", &s.SchedulePolicyType) - delete(rawMsg, key) - case "scheduleRunFrequency": - err = unpopulate(val, "ScheduleRunFrequency", &s.ScheduleRunFrequency) + case "daysOfTheWeek": + err = unpopulate(val, "DaysOfTheWeek", &w.DaysOfTheWeek) delete(rawMsg, key) - case "weeklySchedule": - err = unpopulate(val, "WeeklySchedule", &s.WeeklySchedule) + case "weeksOfTheMonth": + err = unpopulate(val, "WeeksOfTheMonth", &w.WeeksOfTheMonth) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type SubProtectionPolicy. -func (s SubProtectionPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "policyType", s.PolicyType) - populate(objectMap, "retentionPolicy", s.RetentionPolicy) - populate(objectMap, "schedulePolicy", s.SchedulePolicy) +// MarshalJSON implements the json.Marshaller interface for type WeeklyRetentionSchedule. +func (w WeeklyRetentionSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "daysOfTheWeek", w.DaysOfTheWeek) + populate(objectMap, "retentionDuration", w.RetentionDuration) + aux := make([]*timeRFC3339, len(w.RetentionTimes), len(w.RetentionTimes)) + for i := 0; i < len(w.RetentionTimes); i++ { + aux[i] = (*timeRFC3339)(w.RetentionTimes[i]) + } + populate(objectMap, "retentionTimes", aux) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type SubProtectionPolicy. -func (s *SubProtectionPolicy) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WeeklyRetentionSchedule. +func (w *WeeklyRetentionSchedule) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { - case "policyType": - err = unpopulate(val, "PolicyType", &s.PolicyType) + case "daysOfTheWeek": + err = unpopulate(val, "DaysOfTheWeek", &w.DaysOfTheWeek) delete(rawMsg, key) - case "retentionPolicy": - s.RetentionPolicy, err = unmarshalRetentionPolicyClassification(val) + case "retentionDuration": + err = unpopulate(val, "RetentionDuration", &w.RetentionDuration) delete(rawMsg, key) - case "schedulePolicy": - s.SchedulePolicy, err = unmarshalSchedulePolicyClassification(val) + case "retentionTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "RetentionTimes", &aux) + for _, au := range aux { + w.RetentionTimes = append(w.RetentionTimes, (*time.Time)(au)) + } delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type TriggerDataMoveRequest. -func (t TriggerDataMoveRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "correlationId", t.CorrelationID) - populate(objectMap, "dataMoveLevel", t.DataMoveLevel) - populate(objectMap, "pauseGC", t.PauseGC) - populate(objectMap, "sourceContainerArmIds", t.SourceContainerArmIDs) - populate(objectMap, "sourceRegion", t.SourceRegion) - populate(objectMap, "sourceResourceId", t.SourceResourceID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type UnlockDeleteRequest. -func (u UnlockDeleteRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "resourceGuardOperationRequests", u.ResourceGuardOperationRequests) - populate(objectMap, "resourceToBeDeleted", u.ResourceToBeDeleted) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ValidateIaasVMRestoreOperationRequest. -func (v ValidateIaasVMRestoreOperationRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["objectType"] = "ValidateIaasVMRestoreOperationRequest" - populate(objectMap, "restoreRequest", v.RestoreRequest) +// MarshalJSON implements the json.Marshaller interface for type WeeklySchedule. +func (w WeeklySchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "scheduleRunDays", w.ScheduleRunDays) + aux := make([]*timeRFC3339, len(w.ScheduleRunTimes), len(w.ScheduleRunTimes)) + for i := 0; i < len(w.ScheduleRunTimes); i++ { + aux[i] = (*timeRFC3339)(w.ScheduleRunTimes[i]) + } + populate(objectMap, "scheduleRunTimes", aux) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateIaasVMRestoreOperationRequest. -func (v *ValidateIaasVMRestoreOperationRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WeeklySchedule. +func (w *WeeklySchedule) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &v.ObjectType) + case "scheduleRunDays": + err = unpopulate(val, "ScheduleRunDays", &w.ScheduleRunDays) delete(rawMsg, key) - case "restoreRequest": - v.RestoreRequest, err = unmarshalRestoreRequestClassification(val) + case "scheduleRunTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "ScheduleRunTimes", &aux) + for _, au := range aux { + w.ScheduleRunTimes = append(w.ScheduleRunTimes, (*time.Time)(au)) + } delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type ValidateRestoreOperationRequest. -func (v ValidateRestoreOperationRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["objectType"] = "ValidateRestoreOperationRequest" - populate(objectMap, "restoreRequest", v.RestoreRequest) +// MarshalJSON implements the json.Marshaller interface for type WorkloadInquiryDetails. +func (w WorkloadInquiryDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "inquiryValidation", w.InquiryValidation) + populate(objectMap, "itemCount", w.ItemCount) + populate(objectMap, "type", w.Type) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateRestoreOperationRequest. -func (v *ValidateRestoreOperationRequest) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadInquiryDetails. +func (w *WorkloadInquiryDetails) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { - case "objectType": - err = unpopulate(val, "ObjectType", &v.ObjectType) + case "inquiryValidation": + err = unpopulate(val, "InquiryValidation", &w.InquiryValidation) delete(rawMsg, key) - case "restoreRequest": - v.RestoreRequest, err = unmarshalRestoreRequestClassification(val) + case "itemCount": + err = unpopulate(val, "ItemCount", &w.ItemCount) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VaultJob. -func (v VaultJob) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionsInfo", v.ActionsInfo) - populate(objectMap, "activityId", v.ActivityID) - populate(objectMap, "backupManagementType", v.BackupManagementType) - populate(objectMap, "duration", v.Duration) - populateTimeRFC3339(objectMap, "endTime", v.EndTime) - populate(objectMap, "entityFriendlyName", v.EntityFriendlyName) - populate(objectMap, "errorDetails", v.ErrorDetails) - populate(objectMap, "extendedInfo", v.ExtendedInfo) - objectMap["jobType"] = "VaultJob" - populate(objectMap, "operation", v.Operation) - populateTimeRFC3339(objectMap, "startTime", v.StartTime) - populate(objectMap, "status", v.Status) +// MarshalJSON implements the json.Marshaller interface for type WorkloadItem. +func (w WorkloadItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", w.BackupManagementType) + populate(objectMap, "friendlyName", w.FriendlyName) + populate(objectMap, "protectionState", w.ProtectionState) + objectMap["workloadItemType"] = w.WorkloadItemType + populate(objectMap, "workloadType", w.WorkloadType) return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type VaultJob. -func (v *VaultJob) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadItem. +func (w *WorkloadItem) UnmarshalJSON(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) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } for key, val := range rawMsg { var err error switch key { - case "actionsInfo": - err = unpopulate(val, "ActionsInfo", &v.ActionsInfo) - delete(rawMsg, key) - case "activityId": - err = unpopulate(val, "ActivityID", &v.ActivityID) - delete(rawMsg, key) case "backupManagementType": - err = unpopulate(val, "BackupManagementType", &v.BackupManagementType) - delete(rawMsg, key) - case "duration": - err = unpopulate(val, "Duration", &v.Duration) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, "EndTime", &v.EndTime) - delete(rawMsg, key) - case "entityFriendlyName": - err = unpopulate(val, "EntityFriendlyName", &v.EntityFriendlyName) - delete(rawMsg, key) - case "errorDetails": - err = unpopulate(val, "ErrorDetails", &v.ErrorDetails) + err = unpopulate(val, "BackupManagementType", &w.BackupManagementType) delete(rawMsg, key) - case "extendedInfo": - err = unpopulate(val, "ExtendedInfo", &v.ExtendedInfo) - delete(rawMsg, key) - case "jobType": - err = unpopulate(val, "JobType", &v.JobType) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &w.FriendlyName) delete(rawMsg, key) - case "operation": - err = unpopulate(val, "Operation", &v.Operation) + case "protectionState": + err = unpopulate(val, "ProtectionState", &w.ProtectionState) delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, "StartTime", &v.StartTime) + case "workloadItemType": + err = unpopulate(val, "WorkloadItemType", &w.WorkloadItemType) delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &v.Status) + case "workloadType": + err = unpopulate(val, "WorkloadType", &w.WorkloadType) delete(rawMsg, key) } if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", v, err) + return fmt.Errorf("unmarshalling type %T: %v", w, err) } } return nil } -// MarshalJSON implements the json.Marshaller interface for type VaultJobErrorInfo. -func (v VaultJobErrorInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorCode", v.ErrorCode) - populate(objectMap, "errorString", v.ErrorString) - populate(objectMap, "recommendations", v.Recommendations) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type VaultJobExtendedInfo. -func (v VaultJobExtendedInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "propertyBag", v.PropertyBag) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WeeklyRetentionFormat. -func (w WeeklyRetentionFormat) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "daysOfTheWeek", w.DaysOfTheWeek) - populate(objectMap, "weeksOfTheMonth", w.WeeksOfTheMonth) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WeeklyRetentionSchedule. -func (w WeeklyRetentionSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "daysOfTheWeek", w.DaysOfTheWeek) - populate(objectMap, "retentionDuration", w.RetentionDuration) - aux := make([]*timeRFC3339, len(w.RetentionTimes), len(w.RetentionTimes)) - for i := 0; i < len(w.RetentionTimes); i++ { - aux[i] = (*timeRFC3339)(w.RetentionTimes[i]) - } - populate(objectMap, "retentionTimes", aux) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type WeeklySchedule. -func (w WeeklySchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "scheduleRunDays", w.ScheduleRunDays) - aux := make([]*timeRFC3339, len(w.ScheduleRunTimes), len(w.ScheduleRunTimes)) - for i := 0; i < len(w.ScheduleRunTimes); i++ { - aux[i] = (*timeRFC3339)(w.ScheduleRunTimes[i]) - } - populate(objectMap, "scheduleRunTimes", aux) - return json.Marshal(objectMap) -} - // MarshalJSON implements the json.Marshaller interface for type WorkloadItemResource. func (w WorkloadItemResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "eTag", w.ETag) populate(objectMap, "id", w.ID) populate(objectMap, "location", w.Location) @@ -8945,9 +14151,83 @@ func (w *WorkloadItemResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkloadItemResourceList. +func (w WorkloadItemResourceList) 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 WorkloadItemResourceList. +func (w *WorkloadItemResourceList) UnmarshalJSON(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 WorkloadProtectableItem. +func (w WorkloadProtectableItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "backupManagementType", w.BackupManagementType) + populate(objectMap, "friendlyName", w.FriendlyName) + objectMap["protectableItemType"] = w.ProtectableItemType + populate(objectMap, "protectionState", w.ProtectionState) + populate(objectMap, "workloadType", w.WorkloadType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WorkloadProtectableItem. +func (w *WorkloadProtectableItem) UnmarshalJSON(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 "backupManagementType": + err = unpopulate(val, "BackupManagementType", &w.BackupManagementType) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, "FriendlyName", &w.FriendlyName) + delete(rawMsg, key) + case "protectableItemType": + err = unpopulate(val, "ProtectableItemType", &w.ProtectableItemType) + delete(rawMsg, key) + case "protectionState": + err = unpopulate(val, "ProtectionState", &w.ProtectionState) + delete(rawMsg, key) + case "workloadType": + err = unpopulate(val, "WorkloadType", &w.WorkloadType) + 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 WorkloadProtectableItemResource. func (w WorkloadProtectableItemResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "eTag", w.ETag) populate(objectMap, "id", w.ID) populate(objectMap, "location", w.Location) @@ -8996,9 +14276,40 @@ func (w *WorkloadProtectableItemResource) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type WorkloadProtectableItemResourceList. +func (w WorkloadProtectableItemResourceList) 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 WorkloadProtectableItemResourceList. +func (w *WorkloadProtectableItemResourceList) UnmarshalJSON(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 YearlyRetentionSchedule. func (y YearlyRetentionSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) + objectMap := make(map[string]any) populate(objectMap, "monthsOfYear", y.MonthsOfYear) populate(objectMap, "retentionDuration", y.RetentionDuration) populate(objectMap, "retentionScheduleDaily", y.RetentionScheduleDaily) @@ -9012,7 +14323,46 @@ func (y YearlyRetentionSchedule) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -func populate(m map[string]interface{}, k string, v interface{}) { +// UnmarshalJSON implements the json.Unmarshaller interface for type YearlyRetentionSchedule. +func (y *YearlyRetentionSchedule) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", y, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "monthsOfYear": + err = unpopulate(val, "MonthsOfYear", &y.MonthsOfYear) + delete(rawMsg, key) + case "retentionDuration": + err = unpopulate(val, "RetentionDuration", &y.RetentionDuration) + delete(rawMsg, key) + case "retentionScheduleDaily": + err = unpopulate(val, "RetentionScheduleDaily", &y.RetentionScheduleDaily) + delete(rawMsg, key) + case "retentionScheduleFormatType": + err = unpopulate(val, "RetentionScheduleFormatType", &y.RetentionScheduleFormatType) + delete(rawMsg, key) + case "retentionScheduleWeekly": + err = unpopulate(val, "RetentionScheduleWeekly", &y.RetentionScheduleWeekly) + delete(rawMsg, key) + case "retentionTimes": + var aux []*timeRFC3339 + err = unpopulate(val, "RetentionTimes", &aux) + for _, au := range aux { + y.RetentionTimes = append(y.RetentionTimes, (*time.Time)(au)) + } + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", y, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { if v == nil { return } else if azcore.IsNullValue(v) { @@ -9022,7 +14372,7 @@ func populate(m map[string]interface{}, k string, v interface{}) { } } -func unpopulate(data json.RawMessage, fn string, v interface{}) error { +func unpopulate(data json.RawMessage, fn string, v any) error { if data == nil { return nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_operation_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client.go similarity index 87% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_operation_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client.go index 0bd94c75acfd..734c8a8497ce 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_operation_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type OperationClient struct { } // NewOperationClient creates a new instance of OperationClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewOperationClient(subscriptionID string, credential azcore.TokenCredential // Validate - Validate operation for specified backed up item. This is a synchronous operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - resource validate operation request -// options - OperationClientValidateOptions contains the optional parameters for the OperationClient.Validate method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - resource validate operation request +// - options - OperationClientValidateOptions contains the optional parameters for the OperationClient.Validate method. func (client *OperationClient) Validate(ctx context.Context, vaultName string, resourceGroupName string, parameters ValidateOperationRequestClassification, options *OperationClientValidateOptions) (OperationClientValidateResponse, error) { req, err := client.validateCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { @@ -96,7 +98,7 @@ func (client *OperationClient) validateCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client_example_test.go new file mode 100644 index 000000000000..439d9e396fae --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client_example_test.go @@ -0,0 +1,121 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk.json +func ExampleOperationClient_Validate_validateOperation() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewOperationClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Validate(ctx, "testVault", "testRG", &armrecoveryservicesbackup.ValidateIaasVMRestoreOperationRequest{ + ObjectType: to.Ptr("ValidateIaasVMRestoreOperationRequest"), + RestoreRequest: &armrecoveryservicesbackup.IaasVMRestoreRequest{ + ObjectType: to.Ptr("IaasVMRestoreRequest"), + CreateNewCloudService: to.Ptr(true), + EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ + EncryptionEnabled: to.Ptr(false), + }, + IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ + IsSystemAssignedIdentity: to.Ptr(false), + ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), + }, + OriginalStorageAccountOption: to.Ptr(false), + RecoveryPointID: to.Ptr("348916168024334"), + RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), + Region: to.Ptr("southeastasia"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ValidateOperationsResponse = armrecoveryservicesbackup.ValidateOperationsResponse{ + // ValidateOperationResponse: &armrecoveryservicesbackup.ValidateOperationResponse{ + // ValidationResults: []*armrecoveryservicesbackup.ErrorDetail{ + // { + // Code: to.Ptr("UserErrorCoreCountSubscriptionQuotaReached"), + // Message: to.Ptr("Core Count subscription quota has been reached."), + // Recommendations: []*string{ + // to.Ptr("Contact Azure support to increase the limits.")}, + // }}, + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk_IdentityBasedRestoreDetails.json +func ExampleOperationClient_Validate_validateOperationWithIdentityBasedRestoreDetails() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewOperationClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Validate(ctx, "testVault", "testRG", &armrecoveryservicesbackup.ValidateIaasVMRestoreOperationRequest{ + ObjectType: to.Ptr("ValidateIaasVMRestoreOperationRequest"), + RestoreRequest: &armrecoveryservicesbackup.IaasVMRestoreRequest{ + ObjectType: to.Ptr("IaasVMRestoreRequest"), + CreateNewCloudService: to.Ptr(true), + EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ + EncryptionEnabled: to.Ptr(false), + }, + IdentityBasedRestoreDetails: &armrecoveryservicesbackup.IdentityBasedRestoreDetails{ + TargetStorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), + }, + IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ + IsSystemAssignedIdentity: to.Ptr(false), + ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), + }, + OriginalStorageAccountOption: to.Ptr(false), + RecoveryPointID: to.Ptr("348916168024334"), + RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), + Region: to.Ptr("southeastasia"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ValidateOperationsResponse = armrecoveryservicesbackup.ValidateOperationsResponse{ + // ValidateOperationResponse: &armrecoveryservicesbackup.ValidateOperationResponse{ + // ValidationResults: []*armrecoveryservicesbackup.ErrorDetail{ + // { + // Code: to.Ptr("UserErrorCoreCountSubscriptionQuotaReached"), + // Message: to.Ptr("Core Count subscription quota has been reached."), + // Recommendations: []*string{ + // to.Ptr("Contact Azure support to increase the limits.")}, + // }}, + // }, + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_operations_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client.go similarity index 89% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_operations_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client.go index a931c0fa78ff..10148bbd1dab 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_operations_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup @@ -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 - Returns the list of available operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2023-01-01 +// - 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", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client_example_test.go new file mode 100644 index 000000000000..d0c712139859 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client_example_test.go @@ -0,0 +1,496 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/ListOperations.json +func ExampleOperationsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewOperationsClient(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager(nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ClientDiscoveryResponse = armrecoveryservicesbackup.ClientDiscoveryResponse{ + // Value: []*armrecoveryservicesbackup.ClientDiscoveryValueForSingleAPI{ + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/usages/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns usage details for a Recovery Services Vault."), + // Operation: to.Ptr("Recovery Services Vault usage details."), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Vault Usage"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupUsageSummaries/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns summaries for Protected Items and Protected Servers for a Recovery Services ."), + // Operation: to.Ptr("Recovery Services Protected Items and Protected Servers usage summaries details."), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Usages Summaries"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/storageConfig/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns Storage Configuration for Recovery Services Vault."), + // Operation: to.Ptr("Get Resource Storage Config"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Vault Storage Config"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/storageConfig/write"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Updates Storage Configuration for Recovery Services Vault."), + // Operation: to.Ptr("Write Resource Storage Config"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Vault Storage Config"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupconfig/vaultconfig/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns Configuration for Recovery Services Vault."), + // Operation: to.Ptr("Get Resource Config"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Vault Config"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupconfig/vaultconfig/write"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Updates Configuration for Recovery Services Vault."), + // Operation: to.Ptr("Update Resource Config"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Vault Config"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/tokenInfo/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns token information for Recovery Services Vault."), + // Operation: to.Ptr("Get Vault Token Info"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Token Info"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupSecurityPIN/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns Security PIN Information for Recovery Services Vault."), + // Operation: to.Ptr("Get Security PIN Info"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("SecurityPINInfo"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupManagementMetaData/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns Backup Management Metadata for Recovery Services Vault."), + // Operation: to.Ptr("Get Backup Management Metadata"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Management Metadata"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupOperationResults/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns Backup Operation Result for Recovery Services Vault."), + // Operation: to.Ptr("Get Backup Operation Result"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Operation Results"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupOperations/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns Backup Operation Status for Recovery Services Vault."), + // Operation: to.Ptr("Get Backup Operation Status"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Operation Status"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobs/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns all Job Objects"), + // Operation: to.Ptr("Get Jobs"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Jobs"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobs/cancel/action"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Cancel the Job"), + // Operation: to.Ptr("Cancel Jobs"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Jobs"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobsExport/action"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Export Jobs"), + // Operation: to.Ptr("Export Jobs"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Export Backup Jobs"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobs/operationResults/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns the Result of Job Operation."), + // Operation: to.Ptr("Get Job Operation Result"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Jobs Operation Results"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobsExport/operationResults/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns the Result of Export Job Operation."), + // Operation: to.Ptr("Get Export Job Operation Result"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Export Backup Jobs Operation Results"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Get Recovery Points for Protected Items."), + // Operation: to.Ptr("Get Recovery Points"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Recovery Points"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/restore/action"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Restore Recovery Points for Protected Items."), + // Operation: to.Ptr("Restore Recovery Points"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Recovery Points"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/provisionInstantItemRecovery/action"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Provision Instant Item Recovery for Protected Item"), + // Operation: to.Ptr("Provision Instant Item Recovery for Protected Item"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Recovery Points"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/revokeInstantItemRecovery/action"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Revoke Instant Item Recovery for Protected Item"), + // Operation: to.Ptr("Revoke Instant Item Recovery for Protected Item"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Recovery Points"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns all Protection Policies"), + // Operation: to.Ptr("Get Protection Policy"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Policies"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/write"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Creates Protection Policy"), + // Operation: to.Ptr("Create Protection Policy"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Policies"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/delete"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Delete a Protection Policy"), + // Operation: to.Ptr("Delete Protection Policy"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Policies"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/operationResults/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Get Results of Policy Operation."), + // Operation: to.Ptr("Get Policy Operation Results"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Policy Operation Results"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/operationsStatus/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Get Status of Policy Operation."), + // Operation: to.Ptr("Get Policy Operation Status"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Policy Operation Status"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns object details of the Protected Item"), + // Operation: to.Ptr("Get Protected Item Details"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Protected Items"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupProtectedItems/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns the list of all Protected Items."), + // Operation: to.Ptr("Get All Protected Items"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Protected Items"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/write"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Create a backup Protected Item"), + // Operation: to.Ptr("Create Backup Protected Item"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Protected Items"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/delete"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Deletes Protected Item"), + // Operation: to.Ptr("Delete Protected Items"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Protected Items"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/operationResults/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Gets Result of Operation Performed on Protected Items."), + // Operation: to.Ptr("Get Protected Items Operation Results"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Protected Item Operation Results"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/operationsStatus/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns the status of Operation performed on Protected Items."), + // Operation: to.Ptr("Get Protected Items operation status"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Protected Item Operation Status"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/backup/action"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Performs Backup for Protected Item."), + // Operation: to.Ptr("Backup Protected Item"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Protected Items"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupProtectableItems/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns list of all Protectable Items."), + // Operation: to.Ptr("Get Protectable Items"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Protectable Items"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/refreshContainers/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Refreshes the container list"), + // Operation: to.Ptr("Refresh container"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Refresh Containers"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/operationResults/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns status of the operation"), + // Operation: to.Ptr("Get Operation Results"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Refresh Containers Operation Results"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupProtectionContainers/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns all containers belonging to the subscription"), + // Operation: to.Ptr("Get Containers In Subscription"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Protection Containers"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns all registered containers"), + // Operation: to.Ptr("Get Registered Container"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Protection Containers"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/operationResults/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Gets result of Operation performed on Protection Container."), + // Operation: to.Ptr("Get Container Operation Results"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Protection Containers Operation Results"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupEngines"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Returns all the backup management servers registered with vault."), + // Operation: to.Ptr("List of backup management servers."), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Engines"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupStatus"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Check Backup Status for Recovery Services Vaults"), + // Operation: to.Ptr("Check Backup Status for Vault"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Backup Status"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPreValidateProtection"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr(""), + // Operation: to.Ptr("Pre Validate Enable Protection"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("PreValidate Protection"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupValidateFeatures"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Validate Features"), + // Operation: to.Ptr("Validate Features"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Validate Features"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/backupProtectionIntent/write"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Create a backup Protection Intent"), + // Operation: to.Ptr("Create backup Protection Intent"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Protection Intent"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/{fabricName}/protectionContainers/{containerName}/items/read"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Get all items in a container"), + // Operation: to.Ptr("Get all items in a container"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Workload Items"), + // }, + // Origin: to.Ptr("user"), + // }, + // { + // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/inquire/action"), + // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ + // Description: to.Ptr("Get all items in a container"), + // Operation: to.Ptr("Get all items in a container"), + // Provider: to.Ptr("microsoft.recoveryservices"), + // Resource: to.Ptr("Protection Containers Inquire"), + // }, + // Origin: to.Ptr("user"), + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/polymorphic_helpers.go similarity index 90% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_polymorphic_helpers.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/polymorphic_helpers.go index 2a4d745ec89a..871bf5e7506f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/polymorphic_helpers.go @@ -5,6 +5,7 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armrecoveryservicesbackup @@ -14,7 +15,7 @@ func unmarshalBackupEngineBaseClassification(rawMsg json.RawMessage) (BackupEngi if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -34,7 +35,7 @@ func unmarshalBackupRequestClassification(rawMsg json.RawMessage) (BackupRequest if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -56,7 +57,7 @@ func unmarshalILRRequestClassification(rawMsg json.RawMessage) (ILRRequestClassi if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -76,7 +77,7 @@ func unmarshalJobClassification(rawMsg json.RawMessage) (JobClassification, erro if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -106,7 +107,7 @@ func unmarshalOperationResultInfoBaseClassification(rawMsg json.RawMessage) (Ope if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -126,7 +127,7 @@ func unmarshalOperationStatusExtendedInfoClassification(rawMsg json.RawMessage) if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -150,15 +151,15 @@ func unmarshalProtectableContainerClassification(rawMsg json.RawMessage) (Protec if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } var b ProtectableContainerClassification switch m["protectableContainerType"] { - case string(ContainerTypeStorageContainer): + case string(ProtectableContainerTypeStorageContainer): b = &AzureStorageProtectableContainer{} - case string(ContainerTypeVMAppContainer): + case string(ProtectableContainerTypeVMAppContainer): b = &AzureVMAppContainerProtectableContainer{} default: b = &ProtectableContainer{} @@ -170,7 +171,7 @@ func unmarshalProtectedItemClassification(rawMsg json.RawMessage) (ProtectedItem if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -184,6 +185,8 @@ func unmarshalProtectedItemClassification(rawMsg json.RawMessage) (ProtectedItem b = &AzureVMWorkloadProtectedItem{} case "AzureVmWorkloadSAPAseDatabase": b = &AzureVMWorkloadSAPAseDatabaseProtectedItem{} + case "AzureVmWorkloadSAPHanaDBInstance": + b = &AzureVMWorkloadSAPHanaDBInstanceProtectedItem{} case "AzureVmWorkloadSAPHanaDatabase": b = &AzureVMWorkloadSAPHanaDatabaseProtectedItem{} case "AzureVmWorkloadSQLDatabase": @@ -210,35 +213,35 @@ func unmarshalProtectionContainerClassification(rawMsg json.RawMessage) (Protect if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } var b ProtectionContainerClassification switch m["containerType"] { - case string(ContainerTypeAzureBackupServerContainer): + case string(ProtectableContainerTypeAzureBackupServerContainer): b = &AzureBackupServerContainer{} - case string(ContainerTypeAzureSQLContainer): + case string(ProtectableContainerTypeAzureSQLContainer): b = &AzureSQLContainer{} - case string(ContainerTypeAzureWorkloadContainer): + case string(ProtectableContainerTypeAzureWorkloadContainer): b = &AzureWorkloadContainer{} - case string(ContainerTypeDPMContainer): + case string(ProtectableContainerTypeDPMContainer): b = &DpmContainer{} - case string(ContainerTypeGenericContainer): + case string(ProtectableContainerTypeGenericContainer): b = &GenericContainer{} - case string(ContainerTypeIaasVMContainer): + case string(ProtectableContainerTypeIaasVMContainer): b = &IaaSVMContainer{} - case string(ContainerTypeMicrosoftClassicComputeVirtualMachines): + case string(ProtectableContainerTypeMicrosoftClassicComputeVirtualMachines): b = &AzureIaaSClassicComputeVMContainer{} - case string(ContainerTypeMicrosoftComputeVirtualMachines): + case string(ProtectableContainerTypeMicrosoftComputeVirtualMachines): b = &AzureIaaSComputeVMContainer{} - case string(ContainerTypeSQLAGWorkLoadContainer): + case string(ProtectableContainerTypeSQLAGWorkLoadContainer): b = &AzureSQLAGWorkloadContainerProtectionContainer{} - case string(ContainerTypeStorageContainer): + case string(ProtectableContainerTypeStorageContainer): b = &AzureStorageContainer{} - case string(ContainerTypeVMAppContainer): + case string(ProtectableContainerTypeVMAppContainer): b = &AzureVMAppContainerProtectionContainer{} - case string(ContainerTypeWindows): + case string(ProtectableContainerTypeWindows): b = &MabContainer{} default: b = &ProtectionContainer{} @@ -250,7 +253,7 @@ func unmarshalProtectionIntentClassification(rawMsg json.RawMessage) (Protection if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -276,7 +279,7 @@ func unmarshalProtectionPolicyClassification(rawMsg json.RawMessage) (Protection if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -304,7 +307,7 @@ func unmarshalRecoveryPointClassification(rawMsg json.RawMessage) (RecoveryPoint if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -338,7 +341,7 @@ func unmarshalRestoreRequestClassification(rawMsg json.RawMessage) (RestoreReque if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -380,7 +383,7 @@ func unmarshalRetentionPolicyClassification(rawMsg json.RawMessage) (RetentionPo if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -400,7 +403,7 @@ func unmarshalSchedulePolicyClassification(rawMsg json.RawMessage) (SchedulePoli if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -424,7 +427,7 @@ func unmarshalVaultStorageConfigOperationResultResponseClassification(rawMsg jso if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -442,7 +445,7 @@ func unmarshalWorkloadItemClassification(rawMsg json.RawMessage) (WorkloadItemCl if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -472,7 +475,7 @@ func unmarshalWorkloadProtectableItemClassification(rawMsg json.RawMessage) (Wor if rawMsg == nil { return nil, nil } - var m map[string]interface{} + var m map[string]any if err := json.Unmarshal(rawMsg, &m); err != nil { return nil, err } @@ -490,8 +493,12 @@ func unmarshalWorkloadProtectableItemClassification(rawMsg json.RawMessage) (Wor b = &AzureIaaSComputeVMProtectableItem{} case "SAPAseSystem": b = &AzureVMWorkloadSAPAseSystemProtectableItem{} + case "SAPHanaDBInstance": + b = &AzureVMWorkloadSAPHanaDBInstance{} case "SAPHanaDatabase": b = &AzureVMWorkloadSAPHanaDatabaseProtectableItem{} + case "SAPHanaHSR": + b = &AzureVMWorkloadSAPHanaHSR{} case "SAPHanaSystem": b = &AzureVMWorkloadSAPHanaSystemProtectableItem{} case "SQLAvailabilityGroupContainer": diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_privateendpoint_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client.go similarity index 87% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_privateendpoint_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client.go index dfff28f1ad05..fdffeb959934 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_privateendpoint_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type PrivateEndpointClient struct { } // NewPrivateEndpointClient creates a new instance of PrivateEndpointClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPrivateEndpointClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewPrivateEndpointClient(subscriptionID string, credential azcore.TokenCred // GetOperationStatus - Gets the operation status for a private endpoint connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// privateEndpointConnectionName - The name of the private endpoint connection. -// operationID - Operation id -// options - PrivateEndpointClientGetOperationStatusOptions contains the optional parameters for the PrivateEndpointClient.GetOperationStatus -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - privateEndpointConnectionName - The name of the private endpoint connection. +// - operationID - Operation id +// - options - PrivateEndpointClientGetOperationStatusOptions contains the optional parameters for the PrivateEndpointClient.GetOperationStatus +// method. func (client *PrivateEndpointClient) GetOperationStatus(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, operationID string, options *PrivateEndpointClientGetOperationStatusOptions) (PrivateEndpointClientGetOperationStatusResponse, error) { req, err := client.getOperationStatusCreateRequest(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, operationID, options) if err != nil { @@ -106,7 +108,7 @@ func (client *PrivateEndpointClient) getOperationStatusCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client_example_test.go new file mode 100644 index 000000000000..20063afcc905 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client_example_test.go @@ -0,0 +1,45 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnectionOperationStatus.json +func ExamplePrivateEndpointClient_GetOperationStatus() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewPrivateEndpointClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.GetOperationStatus(ctx, "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", "0f48183b-0a44-4dca-aec1-bba5daab888a", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.OperationStatus = armrecoveryservicesbackup.OperationStatus{ + // Name: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.5901592Z"); return t}()), + // ID: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.5901592Z"); return t}()), + // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_privateendpointconnection_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_privateendpointconnection_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client.go index c2c4e85ecd73..fbb71bbd84c4 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_privateendpointconnection_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type PrivateEndpointConnectionClient struct { } // NewPrivateEndpointConnectionClient creates a new instance of PrivateEndpointConnectionClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore // BeginDelete - Delete Private Endpoint requests. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// privateEndpointConnectionName - The name of the private endpoint connection. -// options - PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - privateEndpointConnectionName - The name of the private endpoint connection. +// - options - PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete +// method. func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, options) @@ -76,7 +78,8 @@ func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, // Delete - Delete Private Endpoint requests. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// +// Generated from API version 2023-01-01 func (client *PrivateEndpointConnectionClient) deleteOperation(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, options) if err != nil { @@ -116,7 +119,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,12 +127,13 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C // Get - Get Private Endpoint Connection. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// privateEndpointConnectionName - The name of the private endpoint connection. -// options - PrivateEndpointConnectionClientGetOptions contains the optional parameters for the PrivateEndpointConnectionClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - privateEndpointConnectionName - The name of the private endpoint connection. +// - options - PrivateEndpointConnectionClientGetOptions contains the optional parameters for the PrivateEndpointConnectionClient.Get +// method. func (client *PrivateEndpointConnectionClient) Get(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientGetOptions) (PrivateEndpointConnectionClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, options) if err != nil { @@ -169,7 +173,7 @@ func (client *PrivateEndpointConnectionClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -186,13 +190,14 @@ func (client *PrivateEndpointConnectionClient) getHandleResponse(resp *http.Resp // BeginPut - Approve or Reject Private Endpoint requests. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// privateEndpointConnectionName - The name of the private endpoint connection. -// parameters - Request body for operation -// options - PrivateEndpointConnectionClientBeginPutOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginPut -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - privateEndpointConnectionName - The name of the private endpoint connection. +// - parameters - Request body for operation +// - options - PrivateEndpointConnectionClientBeginPutOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginPut +// method. func (client *PrivateEndpointConnectionClient) BeginPut(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, parameters PrivateEndpointConnectionResource, options *PrivateEndpointConnectionClientBeginPutOptions) (*runtime.Poller[PrivateEndpointConnectionClientPutResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.put(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, parameters, options) @@ -207,7 +212,8 @@ func (client *PrivateEndpointConnectionClient) BeginPut(ctx context.Context, vau // Put - Approve or Reject Private Endpoint requests. This call is made by Backup Admin. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// +// Generated from API version 2023-01-01 func (client *PrivateEndpointConnectionClient) put(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, parameters PrivateEndpointConnectionResource, options *PrivateEndpointConnectionClientBeginPutOptions) (*http.Response, error) { req, err := client.putCreateRequest(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, parameters, options) if err != nil { @@ -247,7 +253,7 @@ func (client *PrivateEndpointConnectionClient) putCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client_example_test.go new file mode 100644 index 000000000000..303f00240bac --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client_example_test.go @@ -0,0 +1,125 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnection.json +func ExamplePrivateEndpointConnectionClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewPrivateEndpointConnectionClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PrivateEndpointConnectionResource = armrecoveryservicesbackup.PrivateEndpointConnectionResource{ + // Name: to.Ptr("gaallatestpe1.3592346090307038890.backup.5704c932-249a-490b-a142-1396838cd3b"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.RecoveryServicesBVTD2/vaults/gaallavaultbvtd2msi/privateEndpointConnections/gaallatestpe3.3592346090307038890.backup.5704c932-249a-490b-a142-1396838cd3b"), + // Properties: &armrecoveryservicesbackup.PrivateEndpointConnection{ + // PrivateEndpoint: &armrecoveryservicesbackup.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.Network/privateEndpoints/gaallatestpe3"), + // }, + // PrivateLinkServiceConnectionState: &armrecoveryservicesbackup.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Approved by johndoe@company.com"), + // Status: to.Ptr(armrecoveryservicesbackup.PrivateEndpointConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armrecoveryservicesbackup.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/PrivateEndpointConnection/PutPrivateEndpointConnection.json +func ExamplePrivateEndpointConnectionClient_BeginPut() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewPrivateEndpointConnectionClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginPut(ctx, "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", armrecoveryservicesbackup.PrivateEndpointConnectionResource{ + Properties: &armrecoveryservicesbackup.PrivateEndpointConnection{ + PrivateEndpoint: &armrecoveryservicesbackup.PrivateEndpoint{ + ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.Network/privateEndpoints/gaallatestpe3"), + }, + PrivateLinkServiceConnectionState: &armrecoveryservicesbackup.PrivateLinkServiceConnectionState{ + Description: to.Ptr("Approved by johndoe@company.com"), + Status: to.Ptr(armrecoveryservicesbackup.PrivateEndpointConnectionStatusApproved), + }, + ProvisioningState: to.Ptr(armrecoveryservicesbackup.ProvisioningStateSucceeded), + }, + }, 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) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PrivateEndpointConnectionResource = armrecoveryservicesbackup.PrivateEndpointConnectionResource{ + // Name: to.Ptr("gaallatestpe1.3592346090307038890.backup.5704c932-249a-490b-a142-1396838cd3b"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/privateEndpointConnections"), + // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.RecoveryServicesBVTD2/vaults/gaallavaultbvtd2msi/privateEndpointConnections/gaallatestpe3.3592346090307038890.backup.5704c932-249a-490b-a142-1396838cd3b"), + // Properties: &armrecoveryservicesbackup.PrivateEndpointConnection{ + // PrivateEndpoint: &armrecoveryservicesbackup.PrivateEndpoint{ + // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.Network/privateEndpoints/gaallatestpe3"), + // }, + // PrivateLinkServiceConnectionState: &armrecoveryservicesbackup.PrivateLinkServiceConnectionState{ + // Description: to.Ptr("Approved by johndoe@company.com"), + // Status: to.Ptr(armrecoveryservicesbackup.PrivateEndpointConnectionStatusApproved), + // }, + // ProvisioningState: to.Ptr(armrecoveryservicesbackup.ProvisioningStateSucceeded), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/PrivateEndpointConnection/DeletePrivateEndpointConnection.json +func ExamplePrivateEndpointConnectionClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewPrivateEndpointConnectionClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", 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/recoveryservices/armrecoveryservicesbackup/zz_generated_protectablecontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client.go similarity index 89% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectablecontainers_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client.go index b26e6ab02a06..cdff7137ce4d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectablecontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ProtectableContainersClient struct { } // NewProtectableContainersClient creates a new instance of ProtectableContainersClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProtectableContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProtectableContainersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,12 +56,12 @@ func NewProtectableContainersClient(subscriptionID string, credential azcore.Tok } // NewListPager - Lists the containers that can be registered to Recovery Services Vault. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - ProtectableContainersClientListOptions contains the optional parameters for the ProtectableContainersClient.List -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - ProtectableContainersClientListOptions contains the optional parameters for the ProtectableContainersClient.NewListPager +// method. func (client *ProtectableContainersClient) NewListPager(vaultName string, resourceGroupName string, fabricName string, options *ProtectableContainersClientListOptions) *runtime.Pager[ProtectableContainersClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ProtectableContainersClientListResponse]{ More: func(page ProtectableContainersClientListResponse) bool { @@ -113,7 +114,7 @@ func (client *ProtectableContainersClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client_example_test.go new file mode 100644 index 000000000000..052ef3b7f9bf --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client_example_test.go @@ -0,0 +1,71 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureStorage/ProtectableContainers_List.json +func ExampleProtectableContainersClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectableContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("testvault", "testRg", "Azure", &armrecoveryservicesbackup.ProtectableContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureStorage' and workloadType eq 'AzureFileShare'")}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ProtectableContainerResourceList = armrecoveryservicesbackup.ProtectableContainerResourceList{ + // Value: []*armrecoveryservicesbackup.ProtectableContainerResource{ + // { + // Name: to.Ptr("StorageContainer;storage;test-rg;testst"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectableContainers"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.RecoveryServices/vaults/testvault/backupFabrics/Azure/protectableContainers/StorageContainer;storage;test-rg;teststorage"), + // Properties: &armrecoveryservicesbackup.AzureStorageProtectableContainer{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), + // ContainerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorage"), + // FriendlyName: to.Ptr("teststorage"), + // HealthStatus: to.Ptr("Healthy"), + // ProtectableContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), + // }, + // }, + // { + // Name: to.Ptr("StorageContainer;ClassicStorage;test-rg;teststorage"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectableContainers"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.RecoveryServices/vaults/testvault/backupFabrics/Azure/protectableContainers/StorageContainer;ClassicStorage;test-rg;teststorage"), + // Properties: &armrecoveryservicesbackup.AzureStorageProtectableContainer{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), + // ContainerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.ClassicStorage/storageAccounts/teststorage"), + // FriendlyName: to.Ptr("teststorage"), + // HealthStatus: to.Ptr("Healthy"), + // ProtectableContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditemoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client.go similarity index 85% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditemoperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client.go index 20e83697bb71..62b020c790be 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditemoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ProtectedItemOperationResultsClient struct { } // NewProtectedItemOperationResultsClient creates a new instance of ProtectedItemOperationResultsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProtectedItemOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProtectedItemOperationResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,15 +57,16 @@ func NewProtectedItemOperationResultsClient(subscriptionID string, credential az // Get - Fetches the result of any operation on the backup item. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the backup item. -// containerName - Container name associated with the backup item. -// protectedItemName - Backup item name whose details are to be fetched. -// operationID - OperationID which represents the operation whose result needs to be fetched. -// options - ProtectedItemOperationResultsClientGetOptions contains the optional parameters for the ProtectedItemOperationResultsClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the backup item. +// - containerName - Container name associated with the backup item. +// - protectedItemName - Backup item name whose details are to be fetched. +// - operationID - OperationID which represents the operation whose result needs to be fetched. +// - options - ProtectedItemOperationResultsClientGetOptions contains the optional parameters for the ProtectedItemOperationResultsClient.Get +// method. func (client *ProtectedItemOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string, options *ProtectedItemOperationResultsClientGetOptions) (ProtectedItemOperationResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationID, options) if err != nil { @@ -116,7 +118,7 @@ func (client *ProtectedItemOperationResultsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client_example_test.go new file mode 100644 index 000000000000..3bd8950a8aa5 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client_example_test.go @@ -0,0 +1,59 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ProtectedItemOperationResults.json +func ExampleProtectedItemOperationResultsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectedItemOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "00000000-0000-0000-0000-000000000000", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ + // Name: to.Ptr("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/protectedItems/VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // ContainerName: to.Ptr("iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), + // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), + // ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), + // FriendlyName: to.Ptr("netvmtestv2vm1"), + // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), + // LastBackupStatus: to.Ptr("Completed"), + // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048723Z"); return t}()), + // ProtectedItemDataID: to.Ptr("636482643132986882"), + // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), + // ProtectionStatus: to.Ptr("Healthy"), + // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + // }, + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditemoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditemoperationstatuses_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client.go index 78a841e89ed4..65282f6a5865 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditemoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ProtectedItemOperationStatusesClient struct { } // NewProtectedItemOperationStatusesClient creates a new instance of ProtectedItemOperationStatusesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProtectedItemOperationStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProtectedItemOperationStatusesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,15 +59,16 @@ func NewProtectedItemOperationStatusesClient(subscriptionID string, credential a // or failed. You can refer to the OperationStatus enum for all the possible states of // the operation. Some operations create jobs. This method returns the list of jobs associated with the operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the backup item. -// containerName - Container name associated with the backup item. -// protectedItemName - Backup item name whose details are to be fetched. -// operationID - OperationID represents the operation whose status needs to be fetched. -// options - ProtectedItemOperationStatusesClientGetOptions contains the optional parameters for the ProtectedItemOperationStatusesClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the backup item. +// - containerName - Container name associated with the backup item. +// - protectedItemName - Backup item name whose details are to be fetched. +// - operationID - OperationID represents the operation whose status needs to be fetched. +// - options - ProtectedItemOperationStatusesClientGetOptions contains the optional parameters for the ProtectedItemOperationStatusesClient.Get +// method. func (client *ProtectedItemOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string, options *ProtectedItemOperationStatusesClientGetOptions) (ProtectedItemOperationStatusesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationID, options) if err != nil { @@ -118,7 +120,7 @@ func (client *ProtectedItemOperationStatusesClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client_example_test.go new file mode 100644 index 000000000000..204ee4a69aa6 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client_example_test.go @@ -0,0 +1,49 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ProtectedItemOperationStatus.json +func ExampleProtectedItemOperationStatusesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectedItemOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "00000000-0000-0000-0000-000000000000", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.OperationStatus = armrecoveryservicesbackup.OperationStatus{ + // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-29T06:04:18.207325Z"); return t}()), + // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Properties: &armrecoveryservicesbackup.OperationStatusJobExtendedInfo{ + // ObjectType: to.Ptr("OperationStatusJobExtendedInfo"), + // JobID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-29T06:04:18.207325Z"); return t}()), + // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client.go similarity index 85% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditems_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client.go index 2169380f4b0d..8e4c88d9da04 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protecteditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ProtectedItemsClient struct { } // NewProtectedItemsClient creates a new instance of ProtectedItemsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProtectedItemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProtectedItemsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,15 +59,16 @@ func NewProtectedItemsClient(subscriptionID string, credential azcore.TokenCrede // is an asynchronous operation. To know the status of the operation, call the // GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the backup item. -// containerName - Container name associated with the backup item. -// protectedItemName - Item name to be backed up. -// parameters - resource backed up item -// options - ProtectedItemsClientCreateOrUpdateOptions contains the optional parameters for the ProtectedItemsClient.CreateOrUpdate -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the backup item. +// - containerName - Container name associated with the backup item. +// - protectedItemName - Item name to be backed up. +// - parameters - resource backed up item +// - options - ProtectedItemsClientCreateOrUpdateOptions contains the optional parameters for the ProtectedItemsClient.CreateOrUpdate +// method. func (client *ProtectedItemsClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ProtectedItemResource, options *ProtectedItemsClientCreateOrUpdateOptions) (ProtectedItemsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, options) if err != nil { @@ -114,7 +116,7 @@ func (client *ProtectedItemsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -132,13 +134,14 @@ func (client *ProtectedItemsClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Used to disable backup of an item within a container. This is an asynchronous operation. To know the status of // the request, call the GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the backed up item. -// containerName - Container name associated with the backed up item. -// protectedItemName - Backed up item to be deleted. -// options - ProtectedItemsClientDeleteOptions contains the optional parameters for the ProtectedItemsClient.Delete method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the backed up item. +// - containerName - Container name associated with the backed up item. +// - protectedItemName - Backed up item to be deleted. +// - options - ProtectedItemsClientDeleteOptions contains the optional parameters for the ProtectedItemsClient.Delete method. func (client *ProtectedItemsClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, options *ProtectedItemsClientDeleteOptions) (ProtectedItemsClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, options) if err != nil { @@ -186,7 +189,7 @@ func (client *ProtectedItemsClient) deleteCreateRequest(ctx context.Context, vau return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -195,13 +198,14 @@ func (client *ProtectedItemsClient) deleteCreateRequest(ctx context.Context, vau // Get - Provides the details of the backed up item. This is an asynchronous operation. To know the status of the operation, // call the GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the backed up item. -// containerName - Container name associated with the backed up item. -// protectedItemName - Backed up item name whose details are to be fetched. -// options - ProtectedItemsClientGetOptions contains the optional parameters for the ProtectedItemsClient.Get method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the backed up item. +// - containerName - Container name associated with the backed up item. +// - protectedItemName - Backed up item name whose details are to be fetched. +// - options - ProtectedItemsClientGetOptions contains the optional parameters for the ProtectedItemsClient.Get method. func (client *ProtectedItemsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, options *ProtectedItemsClientGetOptions) (ProtectedItemsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, options) if err != nil { @@ -249,7 +253,7 @@ func (client *ProtectedItemsClient) getCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client_example_test.go new file mode 100644 index 000000000000..bb7fad8ffd81 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client_example_test.go @@ -0,0 +1,214 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json +func ExampleProtectedItemsClient_Get_getProtectedClassicVirtualMachineDetails() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "Azure", "iaasvmcontainer;iaasvmcontainer;iaasvm-rg;iaasvm-1", "vm;iaasvmcontainer;iaasvm-rg;iaasvm-1", &armrecoveryservicesbackup.ProtectedItemsClientGetOptions{Filter: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ + // Name: to.Ptr("VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainer;iaasvm-rg;iaasvm-1/protectedItems/VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSClassicComputeVMProtectedItem{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // ContainerName: to.Ptr("iaasvmcontainer;iaasvm-rg;iaasvm-1"), + // LastRecoveryPoint: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-22T12:25:32.048723Z"); return t}()), + // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), + // ProtectedItemType: to.Ptr("Microsoft.ClassicCompute/virtualMachines"), + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), + // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), + // FriendlyName: to.Ptr("iaasvm-1"), + // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), + // LastBackupStatus: to.Ptr("Completed"), + // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048723Z"); return t}()), + // ProtectedItemDataID: to.Ptr("636482643132986882"), + // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), + // ProtectionStatus: to.Ptr("Healthy"), + // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/Compute_ProtectedItem_Get.json +func ExampleProtectedItemsClient_Get_getProtectedVirtualMachineDetails() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "Azure", "iaasvmcontainer;iaasvmcontainerv2;iaasvm-rg;iaasvm-1", "vm;iaasvmcontainerv2;iaasvm-rg;iaasvm-1", &armrecoveryservicesbackup.ProtectedItemsClientGetOptions{Filter: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ + // Name: to.Ptr("VM;iaasvmcontainerv2;iaasvm-rg;iaasvm-1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;iaasvm-rg;iaasvm-1/protectedItems/VM;iaasvmcontainerv2;iaasvm-rg;iaasvm-1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // ContainerName: to.Ptr("iaasvmcontainerv2;iaasvm-rg;iaasvm-1"), + // LastRecoveryPoint: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-22T12:25:32.048723Z"); return t}()), + // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), + // ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.Compute/virtualMachines/iaasvm-1"), + // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), + // FriendlyName: to.Ptr("iaasvm-1"), + // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), + // LastBackupStatus: to.Ptr("Completed"), + // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048723Z"); return t}()), + // ProtectedItemDataID: to.Ptr("636482643132986882"), + // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), + // ProtectionStatus: to.Ptr("Healthy"), + // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.Compute/virtualMachines/iaasvm-1"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ConfigureProtection.json +func ExampleProtectedItemsClient_CreateOrUpdate_enableProtectionOnAzureIaasVm() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", armrecoveryservicesbackup.ProtectedItemResource{ + Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ + PolicyID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/DefaultPolicy"), + ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ + // Name: to.Ptr("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/protectedItems/VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // ContainerName: to.Ptr("iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), + // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), + // ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), + // FriendlyName: to.Ptr("netvmtestv2vm1"), + // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), + // LastBackupStatus: to.Ptr("Completed"), + // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048723Z"); return t}()), + // ProtectedItemDataID: to.Ptr("636482643132986882"), + // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), + // ProtectionStatus: to.Ptr("Healthy"), + // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/StopProtection.json +func ExampleProtectedItemsClient_CreateOrUpdate_stopProtectionWithRetainDataOnAzureIaasVm() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", armrecoveryservicesbackup.ProtectedItemResource{ + Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ + ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtectionStopped), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ + // Name: to.Ptr("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/protectedItems/VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // ContainerName: to.Ptr("iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), + // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), + // ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), + // FriendlyName: to.Ptr("netvmtestv2vm1"), + // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), + // LastBackupStatus: to.Ptr("Completed"), + // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048723Z"); return t}()), + // ProtectedItemDataID: to.Ptr("636482643132986882"), + // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtectionStopped), + // ProtectionStatus: to.Ptr("Healthy"), + // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/ProtectedItem_Delete.json +func ExampleProtectedItemsClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Delete(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "Azure", "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontaineroperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontaineroperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client.go index 4d8f3a4418ec..53ecd95323b0 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontaineroperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ProtectionContainerOperationResultsClient struct { } // NewProtectionContainerOperationResultsClient creates a new instance of ProtectionContainerOperationResultsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProtectionContainerOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProtectionContainerOperationResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewProtectionContainerOperationResultsClient(subscriptionID string, credent // Get - Fetches the result of any operation on the container. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the container. -// containerName - Container name whose information should be fetched. -// operationID - Operation ID which represents the operation whose result needs to be fetched. -// options - ProtectionContainerOperationResultsClientGetOptions contains the optional parameters for the ProtectionContainerOperationResultsClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the container. +// - containerName - Container name whose information should be fetched. +// - operationID - Operation ID which represents the operation whose result needs to be fetched. +// - options - ProtectionContainerOperationResultsClientGetOptions contains the optional parameters for the ProtectionContainerOperationResultsClient.Get +// method. func (client *ProtectionContainerOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, operationID string, options *ProtectionContainerOperationResultsClientGetOptions) (ProtectionContainerOperationResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, operationID, options) if err != nil { @@ -111,7 +113,7 @@ func (client *ProtectionContainerOperationResultsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client_example_test.go new file mode 100644 index 000000000000..cbf84b7778e2 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client_example_test.go @@ -0,0 +1,77 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureStorage/ProtectionContainers_Inquire_Result.json +func ExampleProtectionContainerOperationResultsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionContainerOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "testvault", "test-rg", "Azure", "VMAppContainer;Compute;testRG;testSQL", "00000000-0000-0000-0000-000000000000", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionContainerResource = armrecoveryservicesbackup.ProtectionContainerResource{ + // Name: to.Ptr("VMAppContainer;Compute;testRG;testSQL"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;testRG;testSQL"), + // Properties: &armrecoveryservicesbackup.AzureVMAppContainerProtectionContainer{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureWorkload), + // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeVMAppContainer), + // FriendlyName: to.Ptr("testSQL"), + // ExtendedInfo: &armrecoveryservicesbackup.AzureWorkloadContainerExtendedInfo{ + // HostServerName: to.Ptr("testsql"), + // InquiryInfo: &armrecoveryservicesbackup.InquiryInfo{ + // ErrorDetail: &armrecoveryservicesbackup.ErrorDetail{ + // Code: to.Ptr("Success"), + // Message: to.Ptr("Not Available"), + // Recommendations: []*string{ + // to.Ptr("Not Available")}, + // }, + // InquiryDetails: []*armrecoveryservicesbackup.WorkloadInquiryDetails{ + // { + // Type: to.Ptr("sql"), + // InquiryValidation: &armrecoveryservicesbackup.InquiryValidation{ + // ErrorDetail: &armrecoveryservicesbackup.ErrorDetail{ + // Code: to.Ptr("Success"), + // Message: to.Ptr("Not Available"), + // Recommendations: []*string{ + // to.Ptr("Not Available")}, + // }, + // Status: to.Ptr("Success"), + // }, + // ItemCount: to.Ptr[int64](14), + // }}, + // Status: to.Ptr("Success"), + // }, + // NodesList: []*armrecoveryservicesbackup.DistributedNodesInfo{ + // }, + // }, + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testSQL"), + // }, + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontainerrefreshoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client.go similarity index 85% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontainerrefreshoperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client.go index 66c262c53bd6..1fa7cbc2fc60 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontainerrefreshoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ProtectionContainerRefreshOperationResultsClient struct { } // NewProtectionContainerRefreshOperationResultsClient creates a new instance of ProtectionContainerRefreshOperationResultsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProtectionContainerRefreshOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProtectionContainerRefreshOperationResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewProtectionContainerRefreshOperationResultsClient(subscriptionID string, // Get - Provides the result of the refresh operation triggered by the BeginRefresh operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the container. -// operationID - Operation ID associated with the operation whose result needs to be fetched. -// options - ProtectionContainerRefreshOperationResultsClientGetOptions contains the optional parameters for the ProtectionContainerRefreshOperationResultsClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the container. +// - operationID - Operation ID associated with the operation whose result needs to be fetched. +// - options - ProtectionContainerRefreshOperationResultsClientGetOptions contains the optional parameters for the ProtectionContainerRefreshOperationResultsClient.Get +// method. func (client *ProtectionContainerRefreshOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, operationID string, options *ProtectionContainerRefreshOperationResultsClientGetOptions) (ProtectionContainerRefreshOperationResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, operationID, options) if err != nil { @@ -106,7 +108,7 @@ func (client *ProtectionContainerRefreshOperationResultsClient) getCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainerrefreshoperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client_example_test.go similarity index 73% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainerrefreshoperationresults_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client_example_test.go index c94e33a84a2a..316da09eeebb 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainerrefreshoperationresults_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client_example_test.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 armrecoveryservicesbackup_test @@ -13,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/RefreshContainers_OperationResults.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/RefreshContainers_OperationResults.json func ExampleProtectionContainerRefreshOperationResultsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -27,12 +28,7 @@ func ExampleProtectionContainerRefreshOperationResultsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - _, err = client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "Azure", - "00000000-0000-0000-0000-000000000000", - nil) + _, err = client.Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "00000000-0000-0000-0000-000000000000", nil) if err != nil { log.Fatalf("failed to finish the request: %v", err) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client.go similarity index 85% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontainers_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client.go index 653d17ff255d..08a40e4dc2a4 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectioncontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ProtectionContainersClient struct { } // NewProtectionContainersClient creates a new instance of ProtectionContainersClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProtectionContainersClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProtectionContainersClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewProtectionContainersClient(subscriptionID string, credential azcore.Toke // Get - Gets details of the specific container registered to your Recovery Services Vault. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Name of the fabric where the container belongs. -// containerName - Name of the container whose details need to be fetched. -// options - ProtectionContainersClientGetOptions contains the optional parameters for the ProtectionContainersClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Name of the fabric where the container belongs. +// - containerName - Name of the container whose details need to be fetched. +// - options - ProtectionContainersClientGetOptions contains the optional parameters for the ProtectionContainersClient.Get +// method. func (client *ProtectionContainersClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, options *ProtectionContainersClientGetOptions) (ProtectionContainersClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, options) if err != nil { @@ -106,7 +108,7 @@ func (client *ProtectionContainersClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,13 +125,14 @@ func (client *ProtectionContainersClient) getHandleResponse(resp *http.Response) // Inquire - This is an async operation and the results should be tracked using location header or Azure-async-url. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric Name associated with the container. -// containerName - Name of the container in which inquiry needs to be triggered. -// options - ProtectionContainersClientInquireOptions contains the optional parameters for the ProtectionContainersClient.Inquire -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric Name associated with the container. +// - containerName - Name of the container in which inquiry needs to be triggered. +// - options - ProtectionContainersClientInquireOptions contains the optional parameters for the ProtectionContainersClient.Inquire +// method. func (client *ProtectionContainersClient) Inquire(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, options *ProtectionContainersClientInquireOptions) (ProtectionContainersClientInquireResponse, error) { req, err := client.inquireCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, options) if err != nil { @@ -173,7 +176,7 @@ func (client *ProtectionContainersClient) inquireCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -186,12 +189,13 @@ func (client *ProtectionContainersClient) inquireCreateRequest(ctx context.Conte // asynchronous operation. To know the status of the operation, call // GetRefreshOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated the container. -// options - ProtectionContainersClientRefreshOptions contains the optional parameters for the ProtectionContainersClient.Refresh -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated the container. +// - options - ProtectionContainersClientRefreshOptions contains the optional parameters for the ProtectionContainersClient.Refresh +// method. func (client *ProtectionContainersClient) Refresh(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, options *ProtectionContainersClientRefreshOptions) (ProtectionContainersClientRefreshResponse, error) { req, err := client.refreshCreateRequest(ctx, vaultName, resourceGroupName, fabricName, options) if err != nil { @@ -231,7 +235,7 @@ func (client *ProtectionContainersClient) refreshCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -243,14 +247,15 @@ func (client *ProtectionContainersClient) refreshCreateRequest(ctx context.Conte // Register - Registers the container with Recovery Services vault. This is an asynchronous operation. To track the operation // status, use location header to call get latest status of the operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the container. -// containerName - Name of the container to be registered. -// parameters - Request body for operation -// options - ProtectionContainersClientRegisterOptions contains the optional parameters for the ProtectionContainersClient.Register -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the container. +// - containerName - Name of the container to be registered. +// - parameters - Request body for operation +// - options - ProtectionContainersClientRegisterOptions contains the optional parameters for the ProtectionContainersClient.Register +// method. func (client *ProtectionContainersClient) Register(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, parameters ProtectionContainerResource, options *ProtectionContainersClientRegisterOptions) (ProtectionContainersClientRegisterResponse, error) { req, err := client.registerCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, parameters, options) if err != nil { @@ -294,7 +299,7 @@ func (client *ProtectionContainersClient) registerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -313,13 +318,14 @@ func (client *ProtectionContainersClient) registerHandleResponse(resp *http.Resp // whether the backend service has finished processing the request, call Get Container // Operation Result API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Name of the fabric where the container belongs. -// containerName - Name of the container which needs to be unregistered from the Recovery Services Vault. -// options - ProtectionContainersClientUnregisterOptions contains the optional parameters for the ProtectionContainersClient.Unregister -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Name of the fabric where the container belongs. +// - containerName - Name of the container which needs to be unregistered from the Recovery Services Vault. +// - options - ProtectionContainersClientUnregisterOptions contains the optional parameters for the ProtectionContainersClient.Unregister +// method. func (client *ProtectionContainersClient) Unregister(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, options *ProtectionContainersClientUnregisterOptions) (ProtectionContainersClientUnregisterResponse, error) { req, err := client.unregisterCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, options) if err != nil { @@ -363,7 +369,7 @@ func (client *ProtectionContainersClient) unregisterCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client_example_test.go new file mode 100644 index 000000000000..a6008e561651 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client_example_test.go @@ -0,0 +1,171 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureWorkload/ProtectionContainers_Get.json +func ExampleProtectionContainersClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "testVault", "testRg", "Azure", "VMAppContainer;Compute;testRG;testSQL", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionContainerResource = armrecoveryservicesbackup.ProtectionContainerResource{ + // Name: to.Ptr("VMAppContainer;Compute;testRG;testSQL"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;testRG;testSQL"), + // Properties: &armrecoveryservicesbackup.AzureVMAppContainerProtectionContainer{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureWorkload), + // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeVMAppContainer), + // FriendlyName: to.Ptr("testSQL"), + // ExtendedInfo: &armrecoveryservicesbackup.AzureWorkloadContainerExtendedInfo{ + // HostServerName: to.Ptr("testsql"), + // InquiryInfo: &armrecoveryservicesbackup.InquiryInfo{ + // ErrorDetail: &armrecoveryservicesbackup.ErrorDetail{ + // Code: to.Ptr("Success"), + // Message: to.Ptr("Not Available"), + // Recommendations: []*string{ + // to.Ptr("Not Available")}, + // }, + // InquiryDetails: []*armrecoveryservicesbackup.WorkloadInquiryDetails{ + // { + // Type: to.Ptr("sql"), + // InquiryValidation: &armrecoveryservicesbackup.InquiryValidation{ + // ErrorDetail: &armrecoveryservicesbackup.ErrorDetail{ + // Code: to.Ptr("Success"), + // Message: to.Ptr("Not Available"), + // Recommendations: []*string{ + // to.Ptr("Not Available")}, + // }, + // Status: to.Ptr("Success"), + // }, + // ItemCount: to.Ptr[int64](14), + // }}, + // Status: to.Ptr("Success"), + // }, + // NodesList: []*armrecoveryservicesbackup.DistributedNodesInfo{ + // }, + // }, + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testSQL"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureStorage/ProtectionContainers_Register.json +func ExampleProtectionContainersClient_Register() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Register(ctx, "swaggertestvault", "SwaggerTestRg", "Azure", "StorageContainer;Storage;SwaggerTestRg;swaggertestsa", armrecoveryservicesbackup.ProtectionContainerResource{ + Properties: &armrecoveryservicesbackup.AzureStorageContainer{ + BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), + ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), + FriendlyName: to.Ptr("swaggertestsa"), + AcquireStorageAccountLock: to.Ptr(armrecoveryservicesbackup.AcquireStorageAccountLockAcquire), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionContainerResource = armrecoveryservicesbackup.ProtectionContainerResource{ + // Name: to.Ptr("StorageContainer;Storage;SwaggerTestRg;swaggertestsa"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/swaggertestvault/backupFabrics/Azure/protectionContainers/StorageContainer;Storage;SwaggerTestRg;swaggertestsa"), + // Properties: &armrecoveryservicesbackup.AzureStorageContainer{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), + // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), + // FriendlyName: to.Ptr("swaggertestsa"), + // HealthStatus: to.Ptr("Healthy"), + // RegistrationStatus: to.Ptr("Registered"), + // AcquireStorageAccountLock: to.Ptr(armrecoveryservicesbackup.AcquireStorageAccountLockAcquire), + // ProtectedItemCount: to.Ptr[int64](0), + // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureWorkload/ProtectionContainers_Unregister.json +func ExampleProtectionContainersClient_Unregister() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Unregister(ctx, "testVault", "testRg", "Azure", "storagecontainer;Storage;test-rg;teststorage", 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/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureStorage/ProtectionContainers_Inquire.json +func ExampleProtectionContainersClient_Inquire() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Inquire(ctx, "testvault", "test-rg", "Azure", "storagecontainer;Storage;test-rg;teststorage", &armrecoveryservicesbackup.ProtectionContainersClientInquireOptions{Filter: 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/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/RefreshContainers.json +func ExampleProtectionContainersClient_Refresh() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Refresh(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", &armrecoveryservicesbackup.ProtectionContainersClientRefreshOptions{Filter: nil}) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionintent_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionintent_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client.go index 0ce8720d1d3c..b9fccbb3e7cd 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionintent_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ProtectionIntentClient struct { } // NewProtectionIntentClient creates a new instance of ProtectionIntentClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProtectionIntentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProtectionIntentClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,14 +57,15 @@ func NewProtectionIntentClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Create Intent for Enabling backup of an item. This is a synchronous operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the backup item. -// intentObjectName - Intent object name. -// parameters - resource backed up item -// options - ProtectionIntentClientCreateOrUpdateOptions contains the optional parameters for the ProtectionIntentClient.CreateOrUpdate -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the backup item. +// - intentObjectName - Intent object name. +// - parameters - resource backed up item +// - options - ProtectionIntentClientCreateOrUpdateOptions contains the optional parameters for the ProtectionIntentClient.CreateOrUpdate +// method. func (client *ProtectionIntentClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters ProtectionIntentResource, options *ProtectionIntentClientCreateOrUpdateOptions) (ProtectionIntentClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, vaultName, resourceGroupName, fabricName, intentObjectName, parameters, options) if err != nil { @@ -107,7 +109,7 @@ func (client *ProtectionIntentClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -124,12 +126,13 @@ func (client *ProtectionIntentClient) createOrUpdateHandleResponse(resp *http.Re // Delete - Used to remove intent from an item // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the intent. -// intentObjectName - Intent to be deleted. -// options - ProtectionIntentClientDeleteOptions contains the optional parameters for the ProtectionIntentClient.Delete method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the intent. +// - intentObjectName - Intent to be deleted. +// - options - ProtectionIntentClientDeleteOptions contains the optional parameters for the ProtectionIntentClient.Delete method. func (client *ProtectionIntentClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, options *ProtectionIntentClientDeleteOptions) (ProtectionIntentClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, vaultName, resourceGroupName, fabricName, intentObjectName, options) if err != nil { @@ -173,7 +176,7 @@ func (client *ProtectionIntentClient) deleteCreateRequest(ctx context.Context, v return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -181,12 +184,13 @@ func (client *ProtectionIntentClient) deleteCreateRequest(ctx context.Context, v // Get - Provides the details of the protection intent up item. This is an asynchronous operation. To know the status of the // operation, call the GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the backed up item. -// intentObjectName - Backed up item name whose details are to be fetched. -// options - ProtectionIntentClientGetOptions contains the optional parameters for the ProtectionIntentClient.Get method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the backed up item. +// - intentObjectName - Backed up item name whose details are to be fetched. +// - options - ProtectionIntentClientGetOptions contains the optional parameters for the ProtectionIntentClient.Get method. func (client *ProtectionIntentClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, options *ProtectionIntentClientGetOptions) (ProtectionIntentClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, intentObjectName, options) if err != nil { @@ -230,7 +234,7 @@ func (client *ProtectionIntentClient) getCreateRequest(ctx context.Context, vaul return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,11 +254,12 @@ func (client *ProtectionIntentClient) getHandleResponse(resp *http.Response) (Pr // 2. VM is already protected // 3. Any VM related configuration passed in properties. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// azureRegion - Azure region to hit Api -// parameters - Enable backup validation request on Virtual Machine -// options - ProtectionIntentClientValidateOptions contains the optional parameters for the ProtectionIntentClient.Validate -// method. +// +// Generated from API version 2023-01-01 +// - azureRegion - Azure region to hit Api +// - parameters - Enable backup validation request on Virtual Machine +// - options - ProtectionIntentClientValidateOptions contains the optional parameters for the ProtectionIntentClient.Validate +// method. func (client *ProtectionIntentClient) Validate(ctx context.Context, azureRegion string, parameters PreValidateEnableBackupRequest, options *ProtectionIntentClientValidateOptions) (ProtectionIntentClientValidateResponse, error) { req, err := client.validateCreateRequest(ctx, azureRegion, parameters, options) if err != nil { @@ -286,7 +291,7 @@ func (client *ProtectionIntentClient) validateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client_example_test.go new file mode 100644 index 000000000000..7b3453427126 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client_example_test.go @@ -0,0 +1,137 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ProtectionIntent_Validate.json +func ExampleProtectionIntentClient_Validate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Validate(ctx, "southeastasia", armrecoveryservicesbackup.PreValidateEnableBackupRequest{ + Properties: to.Ptr(""), + ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arunaupgrade/providers/Microsoft.Compute/VirtualMachines/upgrade1"), + ResourceType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), + VaultID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/Vaults/myVault"), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.PreValidateEnableBackupResponse = armrecoveryservicesbackup.PreValidateEnableBackupResponse{ + // ContainerName: to.Ptr("iaasvmcontainer;iaasvmcontainerv2;arunaupgrade;upgrade1"), + // ErrorCode: to.Ptr("VirtualMachineAlreadyProtected"), + // ErrorMessage: to.Ptr("Virtual machine with same name and same resource group is already protected. Please select `Disable' choice above for backup and go to backup item corresponding to this VM in the vault"), + // ProtectedItemName: to.Ptr("vm;iaasvmcontainerv2;arunaupgrade;upgrade1"), + // Recommendation: to.Ptr("Please do not enable protection again."), + // Status: to.Ptr(armrecoveryservicesbackup.ValidationStatusFailed), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureWorkload/BackupProtectionIntent_Get.json +func ExampleProtectionIntentClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "myVault", "myRG", "Azure", "249D9B07-D2EF-4202-AA64-65F35418564E", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionIntentResource = armrecoveryservicesbackup.ProtectionIntentResource{ + // Name: to.Ptr("249D9B07-D2EF-4202-AA64-65F35418564E"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupProtectionIntent"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupFabrics/Azure/backupProtectionIntent/249D9B07-D2EF-4202-AA64-65F35418564E"), + // Properties: &armrecoveryservicesbackup.AzureWorkloadContainerAutoProtectionIntent{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureWorkload), + // ItemID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupProtectionContainer/VMAppContainer;Compute;testVmName/backupProtectableItems/SQLInstance;MSSQLSERVER"), + // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), + // ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ProtectionIntent_CreateOrUpdate.json +func ExampleProtectionIntentClient_CreateOrUpdate() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, "myVault", "myRG", "Azure", "vm;iaasvmcontainerv2;chamsrgtest;chamscandel", armrecoveryservicesbackup.ProtectionIntentResource{ + Properties: &armrecoveryservicesbackup.AzureResourceProtectionIntent{ + PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), + ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureResourceItem), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/chamsrgtest/providers/Microsoft.Compute/virtualMachines/chamscandel"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionIntentResource = armrecoveryservicesbackup.ProtectionIntentResource{ + // Name: to.Ptr("vm;iaasvmcontainerv2;chamsrgtest;chamscandel"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupProtectionIntent"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupFabrics/Azure/backupProtectionIntent/vm;iaasvmcontainerv2;chamsrgtest;chamscandel"), + // Properties: &armrecoveryservicesbackup.AzureResourceProtectionIntent{ + // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), + // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), + // ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureResourceItem), + // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStatusProtected), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureWorkload/BackupProtectionIntent_Delete.json +func ExampleProtectionIntentClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Delete(ctx, "myVault", "myRG", "Azure", "249D9B07-D2EF-4202-AA64-65F35418564E", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client.go similarity index 87% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicies_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client.go index e9685fc0d0d8..f644bfa4b15f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ProtectionPoliciesClient struct { } // NewProtectionPoliciesClient creates a new instance of ProtectionPoliciesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProtectionPoliciesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProtectionPoliciesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +58,14 @@ func NewProtectionPoliciesClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Creates or modifies a backup policy. This is an asynchronous operation. Status of the operation can be // fetched using GetPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// policyName - Backup policy to be created. -// parameters - resource backup policy -// options - ProtectionPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ProtectionPoliciesClient.CreateOrUpdate -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - policyName - Backup policy to be created. +// - parameters - resource backup policy +// - options - ProtectionPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ProtectionPoliciesClient.CreateOrUpdate +// method. func (client *ProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters ProtectionPolicyResource, options *ProtectionPoliciesClientCreateOrUpdateOptions) (ProtectionPoliciesClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, vaultName, resourceGroupName, policyName, parameters, options) if err != nil { @@ -103,7 +105,7 @@ func (client *ProtectionPoliciesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -121,12 +123,13 @@ func (client *ProtectionPoliciesClient) createOrUpdateHandleResponse(resp *http. // BeginDelete - Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status // of the operation can be fetched using GetProtectionPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// policyName - Backup policy to be deleted. -// options - ProtectionPoliciesClientBeginDeleteOptions contains the optional parameters for the ProtectionPoliciesClient.BeginDelete -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - policyName - Backup policy to be deleted. +// - options - ProtectionPoliciesClientBeginDeleteOptions contains the optional parameters for the ProtectionPoliciesClient.BeginDelete +// method. func (client *ProtectionPoliciesClient) BeginDelete(ctx context.Context, vaultName string, resourceGroupName string, policyName string, options *ProtectionPoliciesClientBeginDeleteOptions) (*runtime.Poller[ProtectionPoliciesClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, vaultName, resourceGroupName, policyName, options) @@ -142,7 +145,8 @@ func (client *ProtectionPoliciesClient) BeginDelete(ctx context.Context, vaultNa // Delete - Deletes specified backup policy from your Recovery Services Vault. This is an asynchronous operation. Status of // the operation can be fetched using GetProtectionPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// +// Generated from API version 2023-01-01 func (client *ProtectionPoliciesClient) deleteOperation(ctx context.Context, vaultName string, resourceGroupName string, policyName string, options *ProtectionPoliciesClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, vaultName, resourceGroupName, policyName, options) if err != nil { @@ -182,7 +186,7 @@ func (client *ProtectionPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -191,11 +195,12 @@ func (client *ProtectionPoliciesClient) deleteCreateRequest(ctx context.Context, // Get - Provides the details of the backup policies associated to Recovery Services Vault. This is an asynchronous operation. // Status of the operation can be fetched using GetPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// policyName - Backup policy information to be fetched. -// options - ProtectionPoliciesClientGetOptions contains the optional parameters for the ProtectionPoliciesClient.Get method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - policyName - Backup policy information to be fetched. +// - options - ProtectionPoliciesClientGetOptions contains the optional parameters for the ProtectionPoliciesClient.Get method. func (client *ProtectionPoliciesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, options *ProtectionPoliciesClientGetOptions) (ProtectionPoliciesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, policyName, options) if err != nil { @@ -235,7 +240,7 @@ func (client *ProtectionPoliciesClient) getCreateRequest(ctx context.Context, va return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client_example_test.go new file mode 100644 index 000000000000..9b49995f081c --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client_example_test.go @@ -0,0 +1,1232 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/V2Policy/v2-Get-Policy.json +func ExampleProtectionPoliciesClient_Get_getAzureIaasVmEnhancedProtectionPolicyDetails() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "v2-daily-sample", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ + // Name: to.Ptr("v2-daily-sample"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/v2-daily-sample"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // ProtectedItemsCount: to.Ptr[int32](0), + // InstantRpRetentionRangeInDays: to.Ptr[int32](30), + // PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](1), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), + // DailySchedule: &armrecoveryservicesbackup.DailySchedule{ + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, + // }, + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + // }, + // TimeZone: to.Ptr("Pacific Standard Time"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ProtectionPolicies_Get.json +func ExampleProtectionPoliciesClient_Get_getAzureIaasVmProtectionPolicyDetails() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ + // Name: to.Ptr("testPolicy1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // ProtectedItemsCount: to.Ptr[int32](0), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](1), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // TimeZone: to.Ptr("Pacific Standard Time"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Daily.json +func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateDailyAzureStorageProtectionPolicy() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, "swaggertestvault", "SwaggerTestRg", "dailyPolicy2", armrecoveryservicesbackup.ProtectionPolicyResource{ + Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ + BackupManagementType: to.Ptr("AzureStorage"), + RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](5), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, + }, + MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](60), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), + }, + RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, + }, + WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](12), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, + }, + YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ + MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ + to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](10), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), + }, + RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, + }, + }, + SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + ScheduleRunTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, + }, + TimeZone: to.Ptr("UTC"), + WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeAzureFileShare), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ + // Name: to.Ptr("dailyPolicy2"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/swaggertestvault/backupPolicies/dailyPolicy2"), + // Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureStorage"), + // ProtectedItemsCount: to.Ptr[int32](0), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](5), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00Z"); return t}())}, + // }, + // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](60), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), + // }, + // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00Z"); return t}())}, + // }, + // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](12), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00Z"); return t}())}, + // }, + // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ + // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ + // to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](10), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), + // }, + // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00Z"); return t}())}, + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // TimeZone: to.Ptr("UTC"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/V2Policy/IaaS_v2_hourly.json +func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateEnhancedAzureVmProtectionPolicyWithHourlyBackup() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "v2-daily-sample", armrecoveryservicesbackup.ProtectionPolicyResource{ + Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + BackupManagementType: to.Ptr("AzureIaasVM"), + InstantRpRetentionRangeInDays: to.Ptr[int32](30), + PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), + RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](180), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t }())}, + }, + MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](60), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), + }, + RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t }())}, + }, + WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](12), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t }())}, + }, + YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ + MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ + to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](10), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), + }, + RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t }())}, + }, + }, + SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ + SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), + HourlySchedule: &armrecoveryservicesbackup.HourlySchedule{ + Interval: to.Ptr[int32](4), + ScheduleWindowDuration: to.Ptr[int32](16), + ScheduleWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00Z"); return t }()), + }, + ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeHourly), + }, + TimeZone: to.Ptr("India Standard Time"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ + // Name: to.Ptr("v2-daily-sample"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/v2-daily-sample"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // ProtectedItemsCount: to.Ptr[int32](0), + // InstantRpRetentionRangeInDays: to.Ptr[int32](30), + // PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](180), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t}())}, + // }, + // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](60), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), + // }, + // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t}())}, + // }, + // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](12), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t}())}, + // }, + // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ + // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ + // to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](10), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), + // }, + // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), + // HourlySchedule: &armrecoveryservicesbackup.HourlySchedule{ + // Interval: to.Ptr[int32](4), + // ScheduleWindowDuration: to.Ptr[int32](16), + // ScheduleWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00Z"); return t}()), + // }, + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeHourly), + // }, + // TimeZone: to.Ptr("India Standard Time"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/V2Policy/IaaS_v2_daily.json +func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateEnhancedAzureVmProtectionPolicyWithDailyBackup() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "v2-daily-sample", armrecoveryservicesbackup.ProtectionPolicyResource{ + Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + BackupManagementType: to.Ptr("AzureIaasVM"), + InstantRpRetentionRangeInDays: to.Ptr[int32](30), + PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), + RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](180), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t }())}, + }, + MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](60), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), + }, + RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t }())}, + }, + WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](12), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t }())}, + }, + YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ + MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ + to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](10), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), + }, + RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t }())}, + }, + }, + SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ + SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), + DailySchedule: &armrecoveryservicesbackup.DailySchedule{ + ScheduleRunTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, + }, + ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + }, + TimeZone: to.Ptr("India Standard Time"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ + // Name: to.Ptr("v2-daily-sample"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/v2-daily-sample"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // ProtectedItemsCount: to.Ptr[int32](0), + // InstantRpRetentionRangeInDays: to.Ptr[int32](30), + // PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](180), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t}())}, + // }, + // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](60), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), + // }, + // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t}())}, + // }, + // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](12), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t}())}, + // }, + // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ + // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ + // to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](10), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), + // }, + // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), + // DailySchedule: &armrecoveryservicesbackup.DailySchedule{ + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, + // }, + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + // }, + // TimeZone: to.Ptr("India Standard Time"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Complex.json +func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateFullAzureVmProtectionPolicy() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", armrecoveryservicesbackup.ProtectionPolicyResource{ + Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + BackupManagementType: to.Ptr("AzureIaasVM"), + RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](2), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), + }, + RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), + to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, + WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst), + to.Ptr(armrecoveryservicesbackup.WeekOfMonthThird)}, + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, + }, + WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), + to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), + to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](1), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, + }, + YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ + MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ + to.Ptr(armrecoveryservicesbackup.MonthOfYearFebruary), + to.Ptr(armrecoveryservicesbackup.MonthOfYearNovember)}, + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](4), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), + }, + RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), + to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, + WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + to.Ptr(armrecoveryservicesbackup.WeekOfMonthFourth)}, + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, + }, + }, + SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), + to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), + to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, + ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), + ScheduleRunTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, + }, + TimeZone: to.Ptr("Pacific Standard Time"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ + // Name: to.Ptr("testPolicy1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // ProtectedItemsCount: to.Ptr[int32](0), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](2), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), + // }, + // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), + // to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, + // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst), + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthThird)}, + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, + // }, + // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), + // to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), + // to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](1), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, + // }, + // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ + // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ + // to.Ptr(armrecoveryservicesbackup.MonthOfYearFebruary), + // to.Ptr(armrecoveryservicesbackup.MonthOfYearNovember)}, + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](4), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), + // }, + // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), + // to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, + // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFourth)}, + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), + // to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), + // to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // TimeZone: to.Ptr("Pacific Standard Time"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureWorkload/ProtectionPolicies_CreateOrUpdate_Complex.json +func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateFullAzureWorkloadProtectionPolicy() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", armrecoveryservicesbackup.ProtectionPolicyResource{ + Properties: &armrecoveryservicesbackup.AzureVMWorkloadProtectionPolicy{ + BackupManagementType: to.Ptr("AzureWorkload"), + Settings: &armrecoveryservicesbackup.Settings{ + Issqlcompression: to.Ptr(false), + TimeZone: to.Ptr("Pacific Standard Time"), + }, + SubProtectionPolicy: []*armrecoveryservicesbackup.SubProtectionPolicy{ + { + PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeFull), + RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](1), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), + }, + RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + to.Ptr(armrecoveryservicesbackup.WeekOfMonthSecond)}, + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, + }, + WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday), + to.Ptr(armrecoveryservicesbackup.DayOfWeekTuesday)}, + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](2), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, + }, + YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ + MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ + to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary), + to.Ptr(armrecoveryservicesbackup.MonthOfYearJune), + to.Ptr(armrecoveryservicesbackup.MonthOfYearDecember)}, + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](1), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), + }, + RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + to.Ptr(armrecoveryservicesbackup.WeekOfMonthLast)}, + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, + }, + }, + SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday), + to.Ptr(armrecoveryservicesbackup.DayOfWeekTuesday)}, + ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), + ScheduleRunTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, + }, + }, + { + PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeDifferential), + RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ + RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](8), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + }, + }, + SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekFriday)}, + ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), + ScheduleRunTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, + }, + }, + { + PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeLog), + RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ + RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](7), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + }, + }, + SchedulePolicy: &armrecoveryservicesbackup.LogSchedulePolicy{ + SchedulePolicyType: to.Ptr("LogSchedulePolicy"), + ScheduleFrequencyInMins: to.Ptr[int32](60), + }, + }}, + WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeSQLDataBase), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ + // Name: to.Ptr("testPolicy1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), + // Properties: &armrecoveryservicesbackup.AzureVMWorkloadProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureWorkload"), + // ProtectedItemsCount: to.Ptr[int32](0), + // Settings: &armrecoveryservicesbackup.Settings{ + // Issqlcompression: to.Ptr(false), + // TimeZone: to.Ptr("Pacific Standard Time"), + // }, + // SubProtectionPolicy: []*armrecoveryservicesbackup.SubProtectionPolicy{ + // { + // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeFull), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](1), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), + // }, + // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthSecond)}, + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, + // }, + // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday), + // to.Ptr(armrecoveryservicesbackup.DayOfWeekTuesday)}, + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](2), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, + // }, + // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ + // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ + // to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary), + // to.Ptr(armrecoveryservicesbackup.MonthOfYearJune), + // to.Ptr(armrecoveryservicesbackup.MonthOfYearDecember)}, + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](1), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), + // }, + // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthLast)}, + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday), + // to.Ptr(armrecoveryservicesbackup.DayOfWeekTuesday)}, + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // }, + // { + // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeDifferential), + // RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ + // RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](8), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekFriday)}, + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // }, + // { + // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeLog), + // RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ + // RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](7), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.LogSchedulePolicy{ + // SchedulePolicyType: to.Ptr("LogSchedulePolicy"), + // ScheduleFrequencyInMins: to.Ptr[int32](60), + // }, + // }}, + // WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeSQLDataBase), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hourly.json +func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateHourlyAzureStorageProtectionPolicy() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, "swaggertestvault", "SwaggerTestRg", "newPolicy2", armrecoveryservicesbackup.ProtectionPolicyResource{ + Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ + BackupManagementType: to.Ptr("AzureStorage"), + RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](5), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + }, + }, + MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](60), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), + }, + RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + }, + }, + WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](12), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), + }, + }, + YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ + MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ + to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](10), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), + }, + RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + }, + }, + }, + SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + HourlySchedule: &armrecoveryservicesbackup.HourlySchedule{ + Interval: to.Ptr[int32](4), + ScheduleWindowDuration: to.Ptr[int32](12), + ScheduleWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }()), + }, + ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeHourly), + }, + TimeZone: to.Ptr("UTC"), + WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeAzureFileShare), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ + // Name: to.Ptr("newPolicy2"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/swaggertestvault/backupPolicies/newPolicy2"), + // Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureStorage"), + // ProtectedItemsCount: to.Ptr[int32](0), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](5), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T20:00:00Z"); return t}())}, + // }, + // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](60), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), + // }, + // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T20:00:00Z"); return t}())}, + // }, + // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](12), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T20:00:00Z"); return t}())}, + // }, + // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ + // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ + // to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](10), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), + // }, + // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), + // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ + // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ + // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, + // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ + // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T20:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // HourlySchedule: &armrecoveryservicesbackup.HourlySchedule{ + // Interval: to.Ptr[int32](4), + // ScheduleWindowDuration: to.Ptr[int32](12), + // ScheduleWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00Z"); return t}()), + // }, + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeHourly), + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // TimeZone: to.Ptr("UTC"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Simple.json +func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateSimpleAzureVmProtectionPolicy() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", armrecoveryservicesbackup.ProtectionPolicyResource{ + Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + BackupManagementType: to.Ptr("AzureIaasVM"), + RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + Count: to.Ptr[int32](1), + DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + }, + RetentionTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t }())}, + }, + }, + SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + ScheduleRunTimes: []*time.Time{ + to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t }())}, + }, + TimeZone: to.Ptr("Pacific Standard Time"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ + // Name: to.Ptr("testPolicy1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // ProtectedItemsCount: to.Ptr[int32](0), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](1), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // TimeZone: to.Ptr("Pacific Standard Time"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ProtectionPolicies_Delete.json +func ExampleProtectionPoliciesClient_BeginDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginDelete(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", 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/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicyoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicyoperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client.go index d56626c67f6e..9cb82b29c776 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicyoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ProtectionPolicyOperationResultsClient struct { } // NewProtectionPolicyOperationResultsClient creates a new instance of ProtectionPolicyOperationResultsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProtectionPolicyOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProtectionPolicyOperationResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +57,14 @@ func NewProtectionPolicyOperationResultsClient(subscriptionID string, credential // Get - Provides the result of an operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// policyName - Backup policy name whose operation's result needs to be fetched. -// operationID - Operation ID which represents the operation whose result needs to be fetched. -// options - ProtectionPolicyOperationResultsClientGetOptions contains the optional parameters for the ProtectionPolicyOperationResultsClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - policyName - Backup policy name whose operation's result needs to be fetched. +// - operationID - Operation ID which represents the operation whose result needs to be fetched. +// - options - ProtectionPolicyOperationResultsClientGetOptions contains the optional parameters for the ProtectionPolicyOperationResultsClient.Get +// method. func (client *ProtectionPolicyOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string, options *ProtectionPolicyOperationResultsClientGetOptions) (ProtectionPolicyOperationResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, policyName, operationID, options) if err != nil { @@ -106,7 +108,7 @@ func (client *ProtectionPolicyOperationResultsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client_example_test.go new file mode 100644 index 000000000000..64969be1c0dc --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client_example_test.go @@ -0,0 +1,66 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ProtectionPolicyOperationResults_Get.json +func ExampleProtectionPolicyOperationResultsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionPolicyOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", "00000000-0000-0000-0000-000000000000", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ + // Name: to.Ptr("testPolicy1"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), + // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), + // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ + // BackupManagementType: to.Ptr("AzureIaasVM"), + // ProtectedItemsCount: to.Ptr[int32](1), + // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ + // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), + // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ + // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ + // Count: to.Ptr[int32](1), + // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), + // }, + // RetentionTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, + // }, + // }, + // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ + // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), + // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), + // ScheduleRunTimes: []*time.Time{ + // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, + // ScheduleWeeklyFrequency: to.Ptr[int32](0), + // }, + // TimeZone: to.Ptr("Pacific Standard Time"), + // }, + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicyoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicyoperationstatuses_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client.go index b5ceb9e62c1f..c39a5327378a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_protectionpolicyoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ProtectionPolicyOperationStatusesClient struct { } // NewProtectionPolicyOperationStatusesClient creates a new instance of ProtectionPolicyOperationStatusesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProtectionPolicyOperationStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProtectionPolicyOperationStatusesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +59,14 @@ func NewProtectionPolicyOperationStatusesClient(subscriptionID string, credentia // or failed. You can refer to the Operation Status enum for all the possible states of // an operation. Some operations create jobs. This method returns the list of jobs associated with operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// policyName - Backup policy name whose operation's status needs to be fetched. -// operationID - Operation ID which represents an operation whose status needs to be fetched. -// options - ProtectionPolicyOperationStatusesClientGetOptions contains the optional parameters for the ProtectionPolicyOperationStatusesClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - policyName - Backup policy name whose operation's status needs to be fetched. +// - operationID - Operation ID which represents an operation whose status needs to be fetched. +// - options - ProtectionPolicyOperationStatusesClientGetOptions contains the optional parameters for the ProtectionPolicyOperationStatusesClient.Get +// method. func (client *ProtectionPolicyOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string, options *ProtectionPolicyOperationStatusesClientGetOptions) (ProtectionPolicyOperationStatusesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, policyName, operationID, options) if err != nil { @@ -108,7 +110,7 @@ func (client *ProtectionPolicyOperationStatusesClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client_example_test.go new file mode 100644 index 000000000000..73f5e1c897ca --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client_example_test.go @@ -0,0 +1,52 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ProtectionPolicyOperationStatuses_Get.json +func ExampleProtectionPolicyOperationStatusesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewProtectionPolicyOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", "00000000-0000-0000-0000-000000000000", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.OperationStatus = armrecoveryservicesbackup.OperationStatus{ + // Name: to.Ptr("GetProtectionPolicyOperationStatus"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T12:57:32.1142968Z"); return t}()), + // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Properties: &armrecoveryservicesbackup.OperationStatusJobsExtendedInfo{ + // ObjectType: to.Ptr("OperationStatusJobsExtendedInfo"), + // FailedJobsError: map[string]*string{ + // }, + // JobIDs: []*string{ + // to.Ptr("00000000-0000-0000-0000-000000000000")}, + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T12:57:32.1142968Z"); return t}()), + // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_recoverypoints_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_recoverypoints_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client.go index 0cd4c82556d8..394f01c2c912 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_recoverypoints_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type RecoveryPointsClient struct { } // NewRecoveryPointsClient creates a new instance of RecoveryPointsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRecoveryPointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RecoveryPointsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +58,15 @@ func NewRecoveryPointsClient(subscriptionID string, credential azcore.TokenCrede // Get - Provides the information of the backed up data identified using RecoveryPointID. This is an asynchronous operation. // To know the status of the operation, call the GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with backed up item. -// containerName - Container name associated with backed up item. -// protectedItemName - Backed up item name whose backup data needs to be fetched. -// recoveryPointID - RecoveryPointID represents the backed up data to be fetched. -// options - RecoveryPointsClientGetOptions contains the optional parameters for the RecoveryPointsClient.Get method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with backed up item. +// - containerName - Container name associated with backed up item. +// - protectedItemName - Backed up item name whose backup data needs to be fetched. +// - recoveryPointID - RecoveryPointID represents the backed up data to be fetched. +// - options - RecoveryPointsClientGetOptions contains the optional parameters for the RecoveryPointsClient.Get method. func (client *RecoveryPointsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, options *RecoveryPointsClientGetOptions) (RecoveryPointsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, options) if err != nil { @@ -116,7 +118,7 @@ func (client *RecoveryPointsClient) getCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -132,14 +134,14 @@ func (client *RecoveryPointsClient) getHandleResponse(resp *http.Response) (Reco } // NewListPager - Lists the backup copies for the backed up item. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the backed up item. -// containerName - Container name associated with the backed up item. -// protectedItemName - Backed up item whose backup copies are to be fetched. -// options - RecoveryPointsClientListOptions contains the optional parameters for the RecoveryPointsClient.List method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the backed up item. +// - containerName - Container name associated with the backed up item. +// - protectedItemName - Backed up item whose backup copies are to be fetched. +// - options - RecoveryPointsClientListOptions contains the optional parameters for the RecoveryPointsClient.NewListPager method. func (client *RecoveryPointsClient) NewListPager(vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, options *RecoveryPointsClientListOptions) *runtime.Pager[RecoveryPointsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[RecoveryPointsClientListResponse]{ More: func(page RecoveryPointsClientListResponse) bool { @@ -200,7 +202,7 @@ func (client *RecoveryPointsClient) listCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client_example_test.go new file mode 100644 index 000000000000..496d1c98b847 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client_example_test.go @@ -0,0 +1,167 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/RecoveryPoints_List.json +func ExampleRecoveryPointsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewRecoveryPointsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("rshvault", "rshhtestmdvmrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", &armrecoveryservicesbackup.RecoveryPointsClientListOptions{Filter: nil}) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.RecoveryPointResourceList = armrecoveryservicesbackup.RecoveryPointResourceList{ + // Value: []*armrecoveryservicesbackup.RecoveryPointResource{ + // { + // Name: to.Ptr("22244821112382"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/22244821112382"), + // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ + // ObjectType: to.Ptr("IaasVMRecoveryPoint"), + // IsInstantIlrSessionActive: to.Ptr(false), + // IsManagedVirtualMachine: to.Ptr(true), + // IsSourceVMEncrypted: to.Ptr(false), + // OriginalStorageAccountOption: to.Ptr(false), + // RecoveryPointAdditionalInfo: to.Ptr(""), + // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ + // "Archive": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ + // IsReadyForMove: to.Ptr(true), + // }, + // }, + // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ + // { + // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), + // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), + // }, + // { + // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), + // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusValid), + // }}, + // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-21T22:48:25.4353958Z"); return t}()), + // RecoveryPointType: to.Ptr("CrashConsistent"), + // SourceVMStorageType: to.Ptr("NormalStorage"), + // VirtualMachineSize: to.Ptr("Standard_D1"), + // }, + // }, + // { + // Name: to.Ptr("24977149827250"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/24977149827250"), + // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ + // ObjectType: to.Ptr("IaasVMRecoveryPoint"), + // IsInstantIlrSessionActive: to.Ptr(false), + // IsManagedVirtualMachine: to.Ptr(true), + // IsSourceVMEncrypted: to.Ptr(false), + // OriginalStorageAccountOption: to.Ptr(false), + // RecoveryPointAdditionalInfo: to.Ptr(""), + // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ + // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ + // AdditionalInfo: to.Ptr("Recovery point cannot be moved to archive tier since it has already been moved."), + // IsReadyForMove: to.Ptr(false), + // }, + // }, + // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ + // { + // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), + // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), + // }, + // { + // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), + // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), + // }, + // { + // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), + // ExtendedInfo: map[string]*string{ + // "RehydratedRPExpiryTime": to.Ptr("2020-12-21T22:48:25.4353958Z"), + // }, + // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusRehydrated), + // }}, + // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-20T22:49:44.3317945Z"); return t}()), + // RecoveryPointType: to.Ptr("CrashConsistent"), + // SourceVMStorageType: to.Ptr("NormalStorage"), + // VirtualMachineSize: to.Ptr("Standard_D1"), + // Zones: []*string{ + // to.Ptr("1")}, + // }, + // }}, + // } + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/RecoveryPoints_Get.json +func ExampleRecoveryPointsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewRecoveryPointsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "rshvault", "rshhtestmdvmrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", "26083826328862", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.RecoveryPointResource = armrecoveryservicesbackup.RecoveryPointResource{ + // Name: to.Ptr("26083826328862"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/26083826328862"), + // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ + // ObjectType: to.Ptr("IaasVMRecoveryPoint"), + // IsInstantIlrSessionActive: to.Ptr(false), + // IsManagedVirtualMachine: to.Ptr(true), + // IsSourceVMEncrypted: to.Ptr(false), + // OriginalStorageAccountOption: to.Ptr(false), + // RecoveryPointAdditionalInfo: to.Ptr(""), + // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ + // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ + // IsReadyForMove: to.Ptr(true), + // }, + // }, + // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ + // { + // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), + // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusValid), + // }}, + // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-22T22:32:46.6088472Z"); return t}()), + // RecoveryPointType: to.Ptr("CrashConsistent"), + // SourceVMStorageType: to.Ptr("NormalStorage"), + // VirtualMachineSize: to.Ptr("Standard_D1"), + // Zones: []*string{ + // to.Ptr("1")}, + // }, + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_recoverypointsrecommendedformove_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client.go similarity index 89% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_recoverypointsrecommendedformove_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client.go index 9bb18d31537e..659b535d4dd5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_recoverypointsrecommendedformove_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type RecoveryPointsRecommendedForMoveClient struct { } // NewRecoveryPointsRecommendedForMoveClient creates a new instance of RecoveryPointsRecommendedForMoveClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRecoveryPointsRecommendedForMoveClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RecoveryPointsRecommendedForMoveClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,13 +56,13 @@ func NewRecoveryPointsRecommendedForMoveClient(subscriptionID string, credential } // NewListPager - Lists the recovery points recommended for move to another tier -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - List Recovery points Recommended for Move Request -// options - RecoveryPointsRecommendedForMoveClientListOptions contains the optional parameters for the RecoveryPointsRecommendedForMoveClient.List -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - List Recovery points Recommended for Move Request +// - options - RecoveryPointsRecommendedForMoveClientListOptions contains the optional parameters for the RecoveryPointsRecommendedForMoveClient.NewListPager +// method. func (client *RecoveryPointsRecommendedForMoveClient) NewListPager(vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ListRecoveryPointsRecommendedForMoveRequest, options *RecoveryPointsRecommendedForMoveClientListOptions) *runtime.Pager[RecoveryPointsRecommendedForMoveClientListResponse] { return runtime.NewPager(runtime.PagingHandler[RecoveryPointsRecommendedForMoveClientListResponse]{ More: func(page RecoveryPointsRecommendedForMoveClientListResponse) bool { @@ -122,7 +123,7 @@ func (client *RecoveryPointsRecommendedForMoveClient) listCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client_example_test.go new file mode 100644 index 000000000000..4a0e47ddb770 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client_example_test.go @@ -0,0 +1,123 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/RecoveryPointsRecommendedForMove_List.json +func ExampleRecoveryPointsRecommendedForMoveClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewRecoveryPointsRecommendedForMoveClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewListPager("rshvault", "rshhtestmdvmrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", armrecoveryservicesbackup.ListRecoveryPointsRecommendedForMoveRequest{ + ExcludedRPList: []*string{ + to.Ptr("348916168024334"), + to.Ptr("348916168024335")}, + ObjectType: to.Ptr("ListRecoveryPointsRecommendedForMoveRequest"), + }, nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.RecoveryPointResourceList = armrecoveryservicesbackup.RecoveryPointResourceList{ + // Value: []*armrecoveryservicesbackup.RecoveryPointResource{ + // { + // Name: to.Ptr("22244821112382"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/22244821112382"), + // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ + // ObjectType: to.Ptr("IaasVMRecoveryPoint"), + // IsInstantIlrSessionActive: to.Ptr(false), + // IsManagedVirtualMachine: to.Ptr(true), + // IsSourceVMEncrypted: to.Ptr(false), + // OriginalStorageAccountOption: to.Ptr(false), + // RecoveryPointAdditionalInfo: to.Ptr(""), + // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ + // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ + // IsReadyForMove: to.Ptr(true), + // }, + // }, + // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ + // { + // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), + // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), + // }, + // { + // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), + // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusValid), + // }}, + // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-21T22:48:25.4353958Z"); return t}()), + // RecoveryPointType: to.Ptr("CrashConsistent"), + // SourceVMStorageType: to.Ptr("NormalStorage"), + // VirtualMachineSize: to.Ptr("Standard_D1"), + // }, + // }, + // { + // Name: to.Ptr("24977149827250"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), + // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/24977149827250"), + // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ + // ObjectType: to.Ptr("IaasVMRecoveryPoint"), + // IsInstantIlrSessionActive: to.Ptr(false), + // IsManagedVirtualMachine: to.Ptr(true), + // IsSourceVMEncrypted: to.Ptr(false), + // OriginalStorageAccountOption: to.Ptr(false), + // RecoveryPointAdditionalInfo: to.Ptr(""), + // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ + // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ + // IsReadyForMove: to.Ptr(true), + // }, + // }, + // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ + // { + // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), + // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), + // }, + // { + // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), + // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), + // }, + // { + // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), + // ExtendedInfo: map[string]*string{ + // "RehydratedRPExpiryTime": to.Ptr("2020-12-21T22:48:25.4353958Z"), + // }, + // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusRehydrated), + // }}, + // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-20T22:49:44.3317945Z"); return t}()), + // RecoveryPointType: to.Ptr("CrashConsistent"), + // SourceVMStorageType: to.Ptr("NormalStorage"), + // VirtualMachineSize: to.Ptr("Standard_D1"), + // Zones: []*string{ + // to.Ptr("1")}, + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_resourceguardproxies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client.go similarity index 88% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_resourceguardproxies_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client.go index af406e23cd6a..68ca3efbcb59 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_resourceguardproxies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ResourceGuardProxiesClient struct { } // NewResourceGuardProxiesClient creates a new instance of ResourceGuardProxiesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewResourceGuardProxiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceGuardProxiesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -55,12 +56,12 @@ func NewResourceGuardProxiesClient(subscriptionID string, credential azcore.Toke } // NewGetPager - List the ResourceGuardProxies under vault -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - ResourceGuardProxiesClientGetOptions contains the optional parameters for the ResourceGuardProxiesClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - ResourceGuardProxiesClientGetOptions contains the optional parameters for the ResourceGuardProxiesClient.NewGetPager +// method. func (client *ResourceGuardProxiesClient) NewGetPager(vaultName string, resourceGroupName string, options *ResourceGuardProxiesClientGetOptions) *runtime.Pager[ResourceGuardProxiesClientGetResponse] { return runtime.NewPager(runtime.PagingHandler[ResourceGuardProxiesClientGetResponse]{ More: func(page ResourceGuardProxiesClientGetResponse) bool { @@ -109,7 +110,7 @@ func (client *ResourceGuardProxiesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client_example_test.go new file mode 100644 index 000000000000..b38484d41709 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client_example_test.go @@ -0,0 +1,65 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json +func ExampleResourceGuardProxiesClient_NewGetPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewResourceGuardProxiesClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := client.NewGetPager("sampleVault", "SampleResourceGroup", nil) + for pager.More() { + page, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + } + for _, v := range page.Value { + // You could use page here. We use blank identifier for just demo purposes. + _ = v + } + // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // page.ResourceGuardProxyBaseResourceList = armrecoveryservicesbackup.ResourceGuardProxyBaseResourceList{ + // Value: []*armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ + // { + // Name: to.Ptr("swaggerExample"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies"), + // ID: to.Ptr("/backupmanagement/resources/sampleVault/backupResourceGuardProxies/swaggerExample"), + // Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ + // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), + // LastUpdatedTime: to.Ptr("2021-02-11T12:20:47.8210031Z"), + // ResourceGuardOperationDetails: []*armrecoveryservicesbackup.ResourceGuardOperationDetail{ + // { + // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteResourceGuardProxyRequests/default"), + // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), + // }, + // { + // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/disableSoftDeleteRequests/default"), + // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), + // }}, + // ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_resourceguardproxy_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client.go similarity index 87% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_resourceguardproxy_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client.go index b6485eb7b7b7..82740cd3355b 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_resourceguardproxy_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ResourceGuardProxyClient struct { } // NewResourceGuardProxyClient creates a new instance of ResourceGuardProxyClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewResourceGuardProxyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ResourceGuardProxyClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +57,12 @@ func NewResourceGuardProxyClient(subscriptionID string, credential azcore.TokenC // Delete - Delete ResourceGuardProxy under vault // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - ResourceGuardProxyClientDeleteOptions contains the optional parameters for the ResourceGuardProxyClient.Delete -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - ResourceGuardProxyClientDeleteOptions contains the optional parameters for the ResourceGuardProxyClient.Delete +// method. func (client *ResourceGuardProxyClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string, options *ResourceGuardProxyClientDeleteOptions) (ResourceGuardProxyClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, vaultName, resourceGroupName, resourceGuardProxyName, options) if err != nil { @@ -100,7 +102,7 @@ func (client *ResourceGuardProxyClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -108,10 +110,11 @@ func (client *ResourceGuardProxyClient) deleteCreateRequest(ctx context.Context, // Get - Returns ResourceGuardProxy under vault and with the name referenced in request // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - ResourceGuardProxyClientGetOptions contains the optional parameters for the ResourceGuardProxyClient.Get method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - ResourceGuardProxyClientGetOptions contains the optional parameters for the ResourceGuardProxyClient.Get method. func (client *ResourceGuardProxyClient) Get(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string, options *ResourceGuardProxyClientGetOptions) (ResourceGuardProxyClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, resourceGuardProxyName, options) if err != nil { @@ -151,7 +154,7 @@ func (client *ResourceGuardProxyClient) getCreateRequest(ctx context.Context, va return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -168,11 +171,12 @@ func (client *ResourceGuardProxyClient) getHandleResponse(resp *http.Response) ( // Put - Add or Update ResourceGuardProxy under vault Secures vault critical operations // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - Request body for operation -// options - ResourceGuardProxyClientPutOptions contains the optional parameters for the ResourceGuardProxyClient.Put method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - Request body for operation +// - options - ResourceGuardProxyClientPutOptions contains the optional parameters for the ResourceGuardProxyClient.Put method. func (client *ResourceGuardProxyClient) Put(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string, parameters ResourceGuardProxyBaseResource, options *ResourceGuardProxyClientPutOptions) (ResourceGuardProxyClientPutResponse, error) { req, err := client.putCreateRequest(ctx, vaultName, resourceGroupName, resourceGuardProxyName, parameters, options) if err != nil { @@ -212,7 +216,7 @@ func (client *ResourceGuardProxyClient) putCreateRequest(ctx context.Context, va return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -229,12 +233,13 @@ func (client *ResourceGuardProxyClient) putHandleResponse(resp *http.Response) ( // UnlockDelete - Secures delete ResourceGuardProxy operations. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - Request body for operation -// options - ResourceGuardProxyClientUnlockDeleteOptions contains the optional parameters for the ResourceGuardProxyClient.UnlockDelete -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - Request body for operation +// - options - ResourceGuardProxyClientUnlockDeleteOptions contains the optional parameters for the ResourceGuardProxyClient.UnlockDelete +// method. func (client *ResourceGuardProxyClient) UnlockDelete(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string, parameters UnlockDeleteRequest, options *ResourceGuardProxyClientUnlockDeleteOptions) (ResourceGuardProxyClientUnlockDeleteResponse, error) { req, err := client.unlockDeleteCreateRequest(ctx, vaultName, resourceGroupName, resourceGuardProxyName, parameters, options) if err != nil { @@ -274,7 +279,7 @@ func (client *ResourceGuardProxyClient) unlockDeleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client_example_test.go new file mode 100644 index 000000000000..2854391e9037 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client_example_test.go @@ -0,0 +1,145 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json +func ExampleResourceGuardProxyClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewResourceGuardProxyClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "sampleVault", "SampleResourceGroup", "swaggerExample", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ResourceGuardProxyBaseResource = armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ + // Name: to.Ptr("swaggerExample"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies"), + // ID: to.Ptr("/backupmanagement/resources/sampleVault/backupResourceGuardProxies/swaggerExample"), + // Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ + // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), + // LastUpdatedTime: to.Ptr("2021-02-11T12:20:47.8210031Z"), + // ResourceGuardOperationDetails: []*armrecoveryservicesbackup.ResourceGuardOperationDetail{ + // { + // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteResourceGuardProxyRequests/default"), + // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), + // }, + // { + // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/resourceguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/disableSoftDeleteRequests/default"), + // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), + // }}, + // ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json +func ExampleResourceGuardProxyClient_Put() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewResourceGuardProxyClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Put(ctx, "sampleVault", "SampleResourceGroup", "swaggerExample", armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ + Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ + ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), + }, + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ResourceGuardProxyBaseResource = armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ + // Name: to.Ptr("swaggerExample"), + // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies"), + // ID: to.Ptr("/backupmanagement/resources/sampleVault/backupResourceGuardProxies/swaggerExample"), + // Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ + // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), + // LastUpdatedTime: to.Ptr("2021-02-11T12:20:47.8210031Z"), + // ResourceGuardOperationDetails: []*armrecoveryservicesbackup.ResourceGuardOperationDetail{ + // { + // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteResourceGuardProxyRequests/default"), + // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), + // }, + // { + // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/disableSoftDeleteRequests/default"), + // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), + // }}, + // ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), + // }, + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json +func ExampleResourceGuardProxyClient_Delete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewResourceGuardProxyClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + _, err = client.Delete(ctx, "sampleVault", "SampleResourceGroup", "swaggerExample", 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/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json +func ExampleResourceGuardProxyClient_UnlockDelete() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewResourceGuardProxyClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.UnlockDelete(ctx, "sampleVault", "SampleResourceGroup", "swaggerExample", armrecoveryservicesbackup.UnlockDeleteRequest{ + ResourceGuardOperationRequests: []*string{ + to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteProtectedItemRequests/default")}, + ResourceToBeDeleted: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/gaallarg/providers/Microsoft.RecoveryServices/vaults/MercuryCrrVault/backupFabrics/Azure/protectionContainers/VMAppContainer;compute;crrtestrg;crrtestvm/protectedItems/SQLDataBase;mssqlserver;testdb"), + }, nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.UnlockDeleteResponse = armrecoveryservicesbackup.UnlockDeleteResponse{ + // UnlockDeleteExpiryTime: to.Ptr("2021-02-11T13:12:27.7870742Z"), + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_response_types.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/response_types.go similarity index 92% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_response_types.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/response_types.go index 503e61ea7611..439ea8cfe97a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_response_types.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup @@ -28,12 +29,12 @@ type BackupEnginesClientGetResponse struct { BackupEngineBaseResource } -// BackupEnginesClientListResponse contains the response from method BackupEnginesClient.List. +// BackupEnginesClientListResponse contains the response from method BackupEnginesClient.NewListPager. type BackupEnginesClientListResponse struct { BackupEngineBaseResourceList } -// BackupJobsClientListResponse contains the response from method BackupJobsClient.List. +// BackupJobsClientListResponse contains the response from method BackupJobsClient.NewListPager. type BackupJobsClientListResponse struct { JobResourceList } @@ -48,27 +49,27 @@ type BackupOperationStatusesClientGetResponse struct { OperationStatus } -// BackupPoliciesClientListResponse contains the response from method BackupPoliciesClient.List. +// BackupPoliciesClientListResponse contains the response from method BackupPoliciesClient.NewListPager. type BackupPoliciesClientListResponse struct { ProtectionPolicyResourceList } -// BackupProtectableItemsClientListResponse contains the response from method BackupProtectableItemsClient.List. +// BackupProtectableItemsClientListResponse contains the response from method BackupProtectableItemsClient.NewListPager. type BackupProtectableItemsClientListResponse struct { WorkloadProtectableItemResourceList } -// BackupProtectedItemsClientListResponse contains the response from method BackupProtectedItemsClient.List. +// BackupProtectedItemsClientListResponse contains the response from method BackupProtectedItemsClient.NewListPager. type BackupProtectedItemsClientListResponse struct { ProtectedItemResourceList } -// BackupProtectionContainersClientListResponse contains the response from method BackupProtectionContainersClient.List. +// BackupProtectionContainersClientListResponse contains the response from method BackupProtectionContainersClient.NewListPager. type BackupProtectionContainersClientListResponse struct { ProtectionContainerResourceList } -// BackupProtectionIntentClientListResponse contains the response from method BackupProtectionIntentClient.List. +// BackupProtectionIntentClientListResponse contains the response from method BackupProtectionIntentClient.NewListPager. type BackupProtectionIntentClientListResponse struct { ProtectionIntentResourceList } @@ -118,12 +119,12 @@ type BackupStatusClientGetResponse struct { BackupStatusResponse } -// BackupUsageSummariesClientListResponse contains the response from method BackupUsageSummariesClient.List. +// BackupUsageSummariesClientListResponse contains the response from method BackupUsageSummariesClient.NewListPager. type BackupUsageSummariesClientListResponse struct { BackupManagementUsageList } -// BackupWorkloadItemsClientListResponse contains the response from method BackupWorkloadItemsClient.List. +// BackupWorkloadItemsClientListResponse contains the response from method BackupWorkloadItemsClient.NewListPager. type BackupWorkloadItemsClientListResponse struct { WorkloadItemResourceList } @@ -133,12 +134,12 @@ type BackupsClientTriggerResponse struct { // placeholder for future response values } -// ClientBMSPrepareDataMoveResponse contains the response from method Client.BMSPrepareDataMove. +// ClientBMSPrepareDataMoveResponse contains the response from method Client.BeginBMSPrepareDataMove. type ClientBMSPrepareDataMoveResponse struct { // placeholder for future response values } -// ClientBMSTriggerDataMoveResponse contains the response from method Client.BMSTriggerDataMove. +// ClientBMSTriggerDataMoveResponse contains the response from method Client.BeginBMSTriggerDataMove. type ClientBMSTriggerDataMoveResponse struct { // placeholder for future response values } @@ -148,11 +149,16 @@ type ClientGetOperationStatusResponse struct { OperationStatus } -// ClientMoveRecoveryPointResponse contains the response from method Client.MoveRecoveryPoint. +// ClientMoveRecoveryPointResponse contains the response from method Client.BeginMoveRecoveryPoint. type ClientMoveRecoveryPointResponse struct { // placeholder for future response values } +// DeletedProtectionContainersClientListResponse contains the response from method DeletedProtectionContainersClient.NewListPager. +type DeletedProtectionContainersClientListResponse struct { + ProtectionContainerResourceList +} + // ExportJobsOperationResultsClientGetResponse contains the response from method ExportJobsOperationResultsClient.Get. type ExportJobsOperationResultsClientGetResponse struct { OperationResultInfoBaseResource @@ -198,7 +204,7 @@ type OperationClientValidateResponse struct { ValidateOperationsResponse } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { ClientDiscoveryResponse } @@ -208,7 +214,7 @@ type PrivateEndpointClientGetOperationStatusResponse struct { OperationStatus } -// PrivateEndpointConnectionClientDeleteResponse contains the response from method PrivateEndpointConnectionClient.Delete. +// PrivateEndpointConnectionClientDeleteResponse contains the response from method PrivateEndpointConnectionClient.BeginDelete. type PrivateEndpointConnectionClientDeleteResponse struct { // placeholder for future response values } @@ -218,12 +224,12 @@ type PrivateEndpointConnectionClientGetResponse struct { PrivateEndpointConnectionResource } -// PrivateEndpointConnectionClientPutResponse contains the response from method PrivateEndpointConnectionClient.Put. +// PrivateEndpointConnectionClientPutResponse contains the response from method PrivateEndpointConnectionClient.BeginPut. type PrivateEndpointConnectionClientPutResponse struct { PrivateEndpointConnectionResource } -// ProtectableContainersClientListResponse contains the response from method ProtectableContainersClient.List. +// ProtectableContainersClientListResponse contains the response from method ProtectableContainersClient.NewListPager. type ProtectableContainersClientListResponse struct { ProtectableContainerResourceList } @@ -313,7 +319,7 @@ type ProtectionPoliciesClientCreateOrUpdateResponse struct { ProtectionPolicyResource } -// ProtectionPoliciesClientDeleteResponse contains the response from method ProtectionPoliciesClient.Delete. +// ProtectionPoliciesClientDeleteResponse contains the response from method ProtectionPoliciesClient.BeginDelete. type ProtectionPoliciesClientDeleteResponse struct { // placeholder for future response values } @@ -338,17 +344,17 @@ type RecoveryPointsClientGetResponse struct { RecoveryPointResource } -// RecoveryPointsClientListResponse contains the response from method RecoveryPointsClient.List. +// RecoveryPointsClientListResponse contains the response from method RecoveryPointsClient.NewListPager. type RecoveryPointsClientListResponse struct { RecoveryPointResourceList } -// RecoveryPointsRecommendedForMoveClientListResponse contains the response from method RecoveryPointsRecommendedForMoveClient.List. +// RecoveryPointsRecommendedForMoveClientListResponse contains the response from method RecoveryPointsRecommendedForMoveClient.NewListPager. type RecoveryPointsRecommendedForMoveClientListResponse struct { RecoveryPointResourceList } -// ResourceGuardProxiesClientGetResponse contains the response from method ResourceGuardProxiesClient.Get. +// ResourceGuardProxiesClientGetResponse contains the response from method ResourceGuardProxiesClient.NewGetPager. type ResourceGuardProxiesClientGetResponse struct { ResourceGuardProxyBaseResourceList } @@ -373,7 +379,7 @@ type ResourceGuardProxyClientUnlockDeleteResponse struct { UnlockDeleteResponse } -// RestoresClientTriggerResponse contains the response from method RestoresClient.Trigger. +// RestoresClientTriggerResponse contains the response from method RestoresClient.BeginTrigger. type RestoresClientTriggerResponse struct { // placeholder for future response values } @@ -383,7 +389,7 @@ type SecurityPINsClientGetResponse struct { TokenInformation } -// ValidateOperationClientTriggerResponse contains the response from method ValidateOperationClient.Trigger. +// ValidateOperationClientTriggerResponse contains the response from method ValidateOperationClient.BeginTrigger. type ValidateOperationClientTriggerResponse struct { // placeholder for future response values } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_restores_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_restores_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client.go index 10c057c70838..8d66f32b25fc 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_restores_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type RestoresClient struct { } // NewRestoresClient creates a new instance of RestoresClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRestoresClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RestoresClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,15 +58,16 @@ func NewRestoresClient(subscriptionID string, credential azcore.TokenCredential, // BeginTrigger - Restores the specified backed up data. This is an asynchronous operation. To know the status of this API // call, use GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// fabricName - Fabric name associated with the backed up items. -// containerName - Container name associated with the backed up items. -// protectedItemName - Backed up item to be restored. -// recoveryPointID - Recovery point ID which represents the backed up data to be restored. -// parameters - resource restore request -// options - RestoresClientBeginTriggerOptions contains the optional parameters for the RestoresClient.BeginTrigger method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - fabricName - Fabric name associated with the backed up items. +// - containerName - Container name associated with the backed up items. +// - protectedItemName - Backed up item to be restored. +// - recoveryPointID - Recovery point ID which represents the backed up data to be restored. +// - parameters - resource restore request +// - options - RestoresClientBeginTriggerOptions contains the optional parameters for the RestoresClient.BeginTrigger method. func (client *RestoresClient) BeginTrigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters RestoreRequestResource, options *RestoresClientBeginTriggerOptions) (*runtime.Poller[RestoresClientTriggerResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.trigger(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters, options) @@ -81,7 +83,8 @@ func (client *RestoresClient) BeginTrigger(ctx context.Context, vaultName string // Trigger - Restores the specified backed up data. This is an asynchronous operation. To know the status of this API call, // use GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// +// Generated from API version 2023-01-01 func (client *RestoresClient) trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters RestoreRequestResource, options *RestoresClientBeginTriggerOptions) (*http.Response, error) { req, err := client.triggerCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters, options) if err != nil { @@ -133,7 +136,7 @@ func (client *RestoresClient) triggerCreateRequest(ctx context.Context, vaultNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client_example_test.go new file mode 100644 index 000000000000..500edda8165c --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client_example_test.go @@ -0,0 +1,267 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json +func ExampleRestoresClient_BeginTrigger_restoreDisksWithIaasVmRestoreRequest() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewRestoresClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ + Properties: &armrecoveryservicesbackup.IaasVMRestoreRequest{ + ObjectType: to.Ptr("IaasVMRestoreRequest"), + CreateNewCloudService: to.Ptr(true), + EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ + EncryptionEnabled: to.Ptr(false), + }, + IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ + IsSystemAssignedIdentity: to.Ptr(false), + ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), + }, + OriginalStorageAccountOption: to.Ptr(false), + RecoveryPointID: to.Ptr("348916168024334"), + RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), + Region: to.Ptr("southeastasia"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), + }, + }, 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/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json +func ExampleRestoresClient_BeginTrigger_restoreDisksWithIaasVmRestoreRequestWithIdentityBasedRestoreDetails() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewRestoresClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ + Properties: &armrecoveryservicesbackup.IaasVMRestoreRequest{ + ObjectType: to.Ptr("IaasVMRestoreRequest"), + CreateNewCloudService: to.Ptr(true), + EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ + EncryptionEnabled: to.Ptr(false), + }, + IdentityBasedRestoreDetails: &armrecoveryservicesbackup.IdentityBasedRestoreDetails{ + TargetStorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), + }, + IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ + IsSystemAssignedIdentity: to.Ptr(false), + ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), + }, + OriginalStorageAccountOption: to.Ptr(false), + RecoveryPointID: to.Ptr("348916168024334"), + RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), + Region: to.Ptr("southeastasia"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + }, + }, 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/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreWithRehydrationRequest.json +func ExampleRestoresClient_BeginTrigger_restoreDisksWithIaasVmRestoreWithRehydrationRequest() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewRestoresClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ + Properties: &armrecoveryservicesbackup.IaasVMRestoreWithRehydrationRequest{ + ObjectType: to.Ptr("IaasVMRestoreWithRehydrationRequest"), + CreateNewCloudService: to.Ptr(true), + EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ + EncryptionEnabled: to.Ptr(false), + }, + OriginalStorageAccountOption: to.Ptr(false), + RecoveryPointID: to.Ptr("348916168024334"), + RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), + Region: to.Ptr("southeastasia"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), + RecoveryPointRehydrationInfo: &armrecoveryservicesbackup.RecoveryPointRehydrationInfo{ + RehydrationPriority: to.Ptr(armrecoveryservicesbackup.RehydrationPriorityStandard), + RehydrationRetentionDuration: to.Ptr("P7D"), + }, + }, + }, 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/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest.json +func ExampleRestoresClient_BeginTrigger_restoreToNewAzureIaasVmWithIaasVmRestoreRequest() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewRestoresClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ + Properties: &armrecoveryservicesbackup.IaasVMRestoreRequest{ + ObjectType: to.Ptr("IaasVMRestoreRequest"), + CreateNewCloudService: to.Ptr(false), + EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ + EncryptionEnabled: to.Ptr(false), + }, + IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ + IsSystemAssignedIdentity: to.Ptr(true), + }, + OriginalStorageAccountOption: to.Ptr(false), + RecoveryPointID: to.Ptr("348916168024334"), + RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeAlternateLocation), + Region: to.Ptr("southeastasia"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Storage/storageAccounts/testingAccount"), + SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default"), + TargetResourceGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2"), + TargetVirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2/providers/Microsoft.Compute/virtualmachines/RSMDALRVM981435"), + VirtualNetworkID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet"), + }, + }, 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/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json +func ExampleRestoresClient_BeginTrigger_restoreToNewAzureIaasVmWithIaasVmRestoreRequestWithIdentityBasedRestoreDetails() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewRestoresClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ + Properties: &armrecoveryservicesbackup.IaasVMRestoreRequest{ + ObjectType: to.Ptr("IaasVMRestoreRequest"), + CreateNewCloudService: to.Ptr(false), + EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ + EncryptionEnabled: to.Ptr(false), + }, + IdentityBasedRestoreDetails: &armrecoveryservicesbackup.IdentityBasedRestoreDetails{ + TargetStorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Storage/storageAccounts/testingAccount"), + }, + IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ + IsSystemAssignedIdentity: to.Ptr(true), + }, + OriginalStorageAccountOption: to.Ptr(false), + RecoveryPointID: to.Ptr("348916168024334"), + RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeAlternateLocation), + Region: to.Ptr("southeastasia"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default"), + TargetResourceGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2"), + TargetVirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2/providers/Microsoft.Compute/virtualmachines/RSMDALRVM981435"), + VirtualNetworkID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet"), + }, + }, 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/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreWithRehydrationRequest.json +func ExampleRestoresClient_BeginTrigger_restoreToNewAzureIaasVmWithIaasVmRestoreWithRehydrationRequest() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewRestoresClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ + Properties: &armrecoveryservicesbackup.IaasVMRestoreWithRehydrationRequest{ + ObjectType: to.Ptr("IaasVMRestoreWithRehydrationRequest"), + CreateNewCloudService: to.Ptr(false), + EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ + EncryptionEnabled: to.Ptr(false), + }, + OriginalStorageAccountOption: to.Ptr(false), + RecoveryPointID: to.Ptr("348916168024334"), + RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeAlternateLocation), + Region: to.Ptr("southeastasia"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Storage/storageAccounts/testingAccount"), + SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default"), + TargetResourceGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2"), + TargetVirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2/providers/Microsoft.Compute/virtualmachines/RSMDALRVM981435"), + VirtualNetworkID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet"), + RecoveryPointRehydrationInfo: &armrecoveryservicesbackup.RecoveryPointRehydrationInfo{ + RehydrationPriority: to.Ptr(armrecoveryservicesbackup.RehydrationPriorityHigh), + RehydrationRetentionDuration: to.Ptr("P7D"), + }, + }, + }, 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/recoveryservices/armrecoveryservicesbackup/zz_generated_securitypins_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client.go similarity index 88% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_securitypins_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client.go index d73873399d77..3cfe26d07356 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_securitypins_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type SecurityPINsClient struct { } // NewSecurityPINsClient creates a new instance of SecurityPINsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSecurityPINsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SecurityPINsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,10 +57,11 @@ func NewSecurityPINsClient(subscriptionID string, credential azcore.TokenCredent // Get - Get the security PIN. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// options - SecurityPINsClientGetOptions contains the optional parameters for the SecurityPINsClient.Get method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - options - SecurityPINsClientGetOptions contains the optional parameters for the SecurityPINsClient.Get method. func (client *SecurityPINsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, options *SecurityPINsClientGetOptions) (SecurityPINsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, options) if err != nil { @@ -95,7 +97,7 @@ func (client *SecurityPINsClient) getCreateRequest(ctx context.Context, vaultNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_securitypins_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client_example_test.go similarity index 54% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_securitypins_client_test.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client_example_test.go index 9b9f1a01966c..a1a82e258e96 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_securitypins_client_test.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client_example_test.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 armrecoveryservicesbackup_test @@ -13,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupSecurityPin_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/Common/BackupSecurityPin_Get.json func ExampleSecurityPINsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -27,13 +28,16 @@ func ExampleSecurityPINsClient_Get() { if err != nil { log.Fatalf("failed to create client: %v", err) } - res, err := client.Get(ctx, - "SwaggerTest", - "SwaggerTestRg", - &armrecoveryservicesbackup.SecurityPINsClientGetOptions{Parameters: nil}) + res, err := client.Get(ctx, "SwaggerTest", "SwaggerTestRg", &armrecoveryservicesbackup.SecurityPINsClientGetOptions{Parameters: nil}) if err != nil { log.Fatalf("failed to finish the request: %v", err) } - // TODO: use response item + // You could use response here. We use blank identifier for just demo purposes. _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.TokenInformation = armrecoveryservicesbackup.TokenInformation{ + // ExpiryTimeInUTCTicks: to.Ptr[int64](636495150137443100), + // SecurityPIN: to.Ptr("200432"), + // Token: to.Ptr("200432"), + // } } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_time_rfc3339.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/time_rfc3339.go similarity index 96% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/time_rfc3339.go index 53a33e130bf5..38bf7b8e0001 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/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 armrecoveryservicesbackup @@ -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/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperation_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client.go similarity index 87% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperation_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client.go index 265a67434378..2fd3f767fe39 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperation_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ValidateOperationClient struct { } // NewValidateOperationClient creates a new instance of ValidateOperationClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewValidateOperationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ValidateOperationClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +58,13 @@ func NewValidateOperationClient(subscriptionID string, credential azcore.TokenCr // BeginTrigger - Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking // headers which can be tracked using GetValidateOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// parameters - resource validate operation request -// options - ValidateOperationClientBeginTriggerOptions contains the optional parameters for the ValidateOperationClient.BeginTrigger -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - parameters - resource validate operation request +// - options - ValidateOperationClientBeginTriggerOptions contains the optional parameters for the ValidateOperationClient.BeginTrigger +// method. func (client *ValidateOperationClient) BeginTrigger(ctx context.Context, vaultName string, resourceGroupName string, parameters ValidateOperationRequestClassification, options *ValidateOperationClientBeginTriggerOptions) (*runtime.Poller[ValidateOperationClientTriggerResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.trigger(ctx, vaultName, resourceGroupName, parameters, options) @@ -78,7 +80,8 @@ func (client *ValidateOperationClient) BeginTrigger(ctx context.Context, vaultNa // Trigger - Validate operation for specified backed up item in the form of an asynchronous operation. Returns tracking headers // which can be tracked using GetValidateOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 +// +// Generated from API version 2023-01-01 func (client *ValidateOperationClient) trigger(ctx context.Context, vaultName string, resourceGroupName string, parameters ValidateOperationRequestClassification, options *ValidateOperationClientBeginTriggerOptions) (*http.Response, error) { req, err := client.triggerCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { @@ -114,7 +117,7 @@ func (client *ValidateOperationClient) triggerCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client_example_test.go new file mode 100644 index 000000000000..fede9f526a6d --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client_example_test.go @@ -0,0 +1,59 @@ +//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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/TriggerValidateOperation_RestoreDisk.json +func ExampleValidateOperationClient_BeginTrigger() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewValidateOperationClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := client.BeginTrigger(ctx, "testVault", "testRG", &armrecoveryservicesbackup.ValidateIaasVMRestoreOperationRequest{ + ObjectType: to.Ptr("ValidateIaasVMRestoreOperationRequest"), + RestoreRequest: &armrecoveryservicesbackup.IaasVMRestoreRequest{ + ObjectType: to.Ptr("IaasVMRestoreRequest"), + CreateNewCloudService: to.Ptr(true), + EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ + EncryptionEnabled: to.Ptr(false), + }, + IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ + IsSystemAssignedIdentity: to.Ptr(false), + ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), + }, + OriginalStorageAccountOption: to.Ptr(false), + RecoveryPointID: to.Ptr("348916168024334"), + RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), + Region: to.Ptr("southeastasia"), + SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), + StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), + }, + }, 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/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client.go similarity index 86% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperationresults_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client.go index 49eb69242657..6b2aaed012ea 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ValidateOperationResultsClient struct { } // NewValidateOperationResultsClient creates a new instance of ValidateOperationResultsClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewValidateOperationResultsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ValidateOperationResultsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +57,13 @@ func NewValidateOperationResultsClient(subscriptionID string, credential azcore. // Get - Fetches the result of a triggered validate operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// operationID - OperationID which represents the operation whose result needs to be fetched. -// options - ValidateOperationResultsClientGetOptions contains the optional parameters for the ValidateOperationResultsClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - operationID - OperationID which represents the operation whose result needs to be fetched. +// - options - ValidateOperationResultsClientGetOptions contains the optional parameters for the ValidateOperationResultsClient.Get +// method. func (client *ValidateOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *ValidateOperationResultsClientGetOptions) (ValidateOperationResultsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { @@ -101,7 +103,7 @@ func (client *ValidateOperationResultsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client_example_test.go new file mode 100644 index 000000000000..cebce54cc650 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client_example_test.go @@ -0,0 +1,49 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ValidateOperationResults.json +func ExampleValidateOperationResultsClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewValidateOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.ValidateOperationsResponse = armrecoveryservicesbackup.ValidateOperationsResponse{ + // ValidateOperationResponse: &armrecoveryservicesbackup.ValidateOperationResponse{ + // ValidationResults: []*armrecoveryservicesbackup.ErrorDetail{ + // { + // Code: to.Ptr("UserErrorCoreCountSubscriptionQuotaReached"), + // Message: to.Ptr("Core Count subscription quota has been reached."), + // Recommendations: []*string{ + // to.Ptr("Contact Azure support to increase the limits.")}, + // }}, + // }, + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client.go similarity index 87% rename from sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperationstatuses_client.go rename to sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client.go index f4f2d5bae359..bf16e4eeaf17 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/zz_generated_validateoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_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 armrecoveryservicesbackup @@ -31,9 +32,9 @@ type ValidateOperationStatusesClient struct { } // NewValidateOperationStatusesClient creates a new instance of ValidateOperationStatusesClient with the specified values. -// subscriptionID - The subscription Id. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The subscription Id. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewValidateOperationStatusesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ValidateOperationStatusesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +59,13 @@ func NewValidateOperationStatusesClient(subscriptionID string, credential azcore // refer to the OperationStatus enum for all the possible states of the operation. If // operation has completed, this method returns the list of errors obtained while validating the operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2022-02-01 -// vaultName - The name of the recovery services vault. -// resourceGroupName - The name of the resource group where the recovery services vault is present. -// operationID - OperationID represents the operation whose status needs to be fetched. -// options - ValidateOperationStatusesClientGetOptions contains the optional parameters for the ValidateOperationStatusesClient.Get -// method. +// +// Generated from API version 2023-01-01 +// - vaultName - The name of the recovery services vault. +// - resourceGroupName - The name of the resource group where the recovery services vault is present. +// - operationID - OperationID represents the operation whose status needs to be fetched. +// - options - ValidateOperationStatusesClientGetOptions contains the optional parameters for the ValidateOperationStatusesClient.Get +// method. func (client *ValidateOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *ValidateOperationStatusesClientGetOptions) (ValidateOperationStatusesClientGetResponse, error) { req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { @@ -103,7 +105,7 @@ func (client *ValidateOperationStatusesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2022-02-01") + reqQP.Set("api-version", "2023-01-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client_example_test.go new file mode 100644 index 000000000000..556ad0b77684 --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client_example_test.go @@ -0,0 +1,57 @@ +//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 armrecoveryservicesbackup_test + +import ( + "context" + "log" + + "github.com/Azure/azure-sdk-for-go/sdk/azidentity" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v2" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/3751704f5318f1175875c94b66af769db917f2d3/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-01-01/examples/AzureIaasVm/ValidateOperationStatus.json +func ExampleValidateOperationStatusesClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + client, err := armrecoveryservicesbackup.NewValidateOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := client.Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + } + // You could use response here. We use blank identifier for just demo purposes. + _ = res + // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. + // res.OperationStatus = armrecoveryservicesbackup.OperationStatus{ + // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-29T06:04:18.207325Z"); return t}()), + // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), + // Properties: &armrecoveryservicesbackup.OperationStatusValidateOperationExtendedInfo{ + // ObjectType: to.Ptr("OperationStatusValidateOperationExtendedInfo"), + // ValidateOperationResponse: &armrecoveryservicesbackup.ValidateOperationResponse{ + // ValidationResults: []*armrecoveryservicesbackup.ErrorDetail{ + // { + // Code: to.Ptr("UserErrorCoreCountSubscriptionQuotaReached"), + // Message: to.Ptr("Core Count subscription quota has been reached."), + // Recommendations: []*string{ + // to.Ptr("Contact Azure support to increase the limits.")}, + // }}, + // }, + // }, + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-29T06:04:18.207325Z"); return t}()), + // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), + // } +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupengines_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupengines_client_test.go deleted file mode 100644 index a8913b89bc28..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupengines_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Dpm/BackupEngines_List.json -func ExampleBackupEnginesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupEnginesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("testVault", - "testRG", - &armrecoveryservicesbackup.BackupEnginesClientListOptions{Filter: nil, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Dpm/BackupEngines_Get.json -func ExampleBackupEnginesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupEnginesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testVault", - "testRG", - "testServer", - &armrecoveryservicesbackup.BackupEnginesClientGetOptions{Filter: nil, - SkipToken: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupjobs_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupjobs_client_test.go deleted file mode 100644 index 73c24ff03dc7..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupjobs_client_test.go +++ /dev/null @@ -1,45 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/ListJobs.json -func ExampleBackupJobsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupJobsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("NetSDKTestRsVault", - "SwaggerTestRg", - &armrecoveryservicesbackup.BackupJobsClientListOptions{Filter: nil, - 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 - } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationstatuses_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationstatuses_client_test.go deleted file mode 100644 index 9b795da734e0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupoperationstatuses_client_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/ProtectedItem_Delete_OperationStatus.json -func ExampleBackupOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backuppolicies_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backuppolicies_client_test.go deleted file mode 100644 index 6375ff93710e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backuppolicies_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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/BackupPolicies_List.json -func ExampleBackupPoliciesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("NetSDKTestRsVault", - "SwaggerTestRg", - &armrecoveryservicesbackup.BackupPoliciesClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'")}) - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectableitems_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectableitems_client_test.go deleted file mode 100644 index 691ecad8c377..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectableitems_client_test.go +++ /dev/null @@ -1,46 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/BackupProtectableItems_List.json -func ExampleBackupProtectableItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupProtectableItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("NetSDKTestRsVault", - "SwaggerTestRg", - &armrecoveryservicesbackup.BackupProtectableItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'"), - 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 - } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotecteditems_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotecteditems_client_test.go deleted file mode 100644 index 31cb83afc857..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotecteditems_client_test.go +++ /dev/null @@ -1,46 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/BackupProtectedItems_List.json -func ExampleBackupProtectedItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("NetSDKTestRsVault", - "SwaggerTestRg", - &armrecoveryservicesbackup.BackupProtectedItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM' and itemType eq 'VM'"), - 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 - } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectioncontainers_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectioncontainers_client_test.go deleted file mode 100644 index bdfef7fed858..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectioncontainers_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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureStorage/ProtectionContainers_List.json -func ExampleBackupProtectionContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("testVault", - "testRg", - &armrecoveryservicesbackup.BackupProtectionContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'")}) - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectionintent_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectionintent_client_test.go deleted file mode 100644 index 20885bbf9225..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupprotectionintent_client_test.go +++ /dev/null @@ -1,45 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureWorkload/BackupProtectionIntent_List.json -func ExampleBackupProtectionIntentClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("myVault", - "myRG", - &armrecoveryservicesbackup.BackupProtectionIntentClientListOptions{Filter: nil, - 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 - } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourceencryptionconfigs_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourceencryptionconfigs_client_test.go deleted file mode 100644 index 78b145b43284..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourceencryptionconfigs_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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/BackupResourceEncryptionConfig_Get.json -func ExampleBackupResourceEncryptionConfigsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceEncryptionConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rishTestVault", - "rishgrp", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/BackupResourceEncryptionConfig_Put.json -func ExampleBackupResourceEncryptionConfigsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceEncryptionConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "source-rsv", - "test-rg", - armrecoveryservicesbackup.BackupResourceEncryptionConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceEncryptionConfig{ - EncryptionAtRestType: to.Ptr(armrecoveryservicesbackup.EncryptionAtRestTypeCustomerManaged), - InfrastructureEncryptionState: to.Ptr(armrecoveryservicesbackup.InfrastructureEncryptionState("true")), - KeyURI: to.Ptr("https://gktestkv1.vault.azure.net/keys/Test1/ed2e8cdc7f86477ebf0c6462b504a9ed"), - SubscriptionID: to.Ptr("1a2311d9-66f5-47d3-a9fb-7a37da63934b"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcestorageconfigsnoncrr_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcestorageconfigsnoncrr_client_test.go deleted file mode 100644 index e34464adc6b0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcestorageconfigsnoncrr_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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupStorageConfig_Get.json -func ExampleBackupResourceStorageConfigsNonCRRClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceStorageConfigsNonCRRClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupStorageConfig_Put.json -func ExampleBackupResourceStorageConfigsNonCRRClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceStorageConfigsNonCRRClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - armrecoveryservicesbackup.BackupResourceConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceConfig{ - StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), - StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateUnlocked), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupStorageConfig_Patch.json -func ExampleBackupResourceStorageConfigsNonCRRClient_Patch() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceStorageConfigsNonCRRClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Patch(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - armrecoveryservicesbackup.BackupResourceConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceConfig{ - StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), - StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateUnlocked), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcevaultconfigs_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcevaultconfigs_client_test.go deleted file mode 100644 index d51f276eef30..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupresourcevaultconfigs_client_test.go +++ /dev/null @@ -1,95 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupResourceVaultConfigs_Get.json -func ExampleBackupResourceVaultConfigsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceVaultConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "SwaggerTest", - "SwaggerTestRg", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupResourceVaultConfigs_Patch.json -func ExampleBackupResourceVaultConfigsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceVaultConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "SwaggerTest", - "SwaggerTestRg", - armrecoveryservicesbackup.BackupResourceVaultConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ - EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupResourceVaultConfigs_Put.json -func ExampleBackupResourceVaultConfigsClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupResourceVaultConfigsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Put(ctx, - "SwaggerTest", - "SwaggerTestRg", - armrecoveryservicesbackup.BackupResourceVaultConfigResource{ - Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ - EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), - SoftDeleteFeatureState: to.Ptr(armrecoveryservicesbackup.SoftDeleteFeatureStateEnabled), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupstatus_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupstatus_client_test.go deleted file mode 100644 index cbba6c17e7a3..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupstatus_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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/GetBackupStatus.json -func ExampleBackupStatusClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupStatusClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "southeastasia", - armrecoveryservicesbackup.BackupStatusRequest{ - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Compute/VirtualMachines/testVm"), - ResourceType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupusagesummaries_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupusagesummaries_client_test.go deleted file mode 100644 index d05bdb545d0a..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupusagesummaries_client_test.go +++ /dev/null @@ -1,46 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/BackupProtectionContainers_UsageSummary_Get.json -func ExampleBackupUsageSummariesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupUsageSummariesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("testVault", - "testRG", - &armrecoveryservicesbackup.BackupUsageSummariesClientListOptions{Filter: to.Ptr("type eq 'BackupProtectionContainerCountSummary'"), - 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 - } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupworkloaditems_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupworkloaditems_client_test.go deleted file mode 100644 index 808e73bea499..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_backupworkloaditems_client_test.go +++ /dev/null @@ -1,48 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureWorkload/BackupWorkloadItems_List.json -func ExampleBackupWorkloadItemsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewBackupWorkloadItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("suchandr-seacan-rsv", - "testRg", - "Azure", - "VMAppContainer;Compute;bvtdtestag;sqlserver-1", - &armrecoveryservicesbackup.BackupWorkloadItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'"), - 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 - } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_exportjobsoperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_exportjobsoperationresults_client_test.go deleted file mode 100644 index bb169e407f69..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_exportjobsoperationresults_client_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/ExportJobsOperationResult.json -func ExampleExportJobsOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewExportJobsOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobdetails_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobdetails_client_test.go deleted file mode 100644 index 924363803561..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_jobdetails_client_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/GetJobDetails.json -func ExampleJobDetailsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewJobDetailsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operation_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operation_client_test.go deleted file mode 100644 index 5c148937c83e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operation_client_test.go +++ /dev/null @@ -1,60 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk.json -func ExampleOperationClient_Validate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewOperationClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Validate(ctx, - "testVault", - "testRG", - &armrecoveryservicesbackup.ValidateIaasVMRestoreOperationRequest{ - ObjectType: to.Ptr("ValidateIaasVMRestoreOperationRequest"), - RestoreRequest: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operations_client_test.go deleted file mode 100644 index c88f34bab51e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_operations_client_test.go +++ /dev/null @@ -1,41 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ListOperations.json -func ExampleOperationsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewOperationsClient(cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpoint_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpoint_client_test.go deleted file mode 100644 index cffd02abd5ff..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpoint_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnectionOperationStatus.json -func ExamplePrivateEndpointClient_GetOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewPrivateEndpointClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetOperationStatus(ctx, - "gaallavaultbvtd2msi", - "gaallaRG", - "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", - "0f48183b-0a44-4dca-aec1-bba5daab888a", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpointconnection_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpointconnection_client_test.go deleted file mode 100644 index 4b6d642df182..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_privateendpointconnection_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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PrivateEndpointConnection/GetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewPrivateEndpointConnectionClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "gaallavaultbvtd2msi", - "gaallaRG", - "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PrivateEndpointConnection/PutPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_BeginPut() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewPrivateEndpointConnectionClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPut(ctx, - "gaallavaultbvtd2msi", - "gaallaRG", - "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", - armrecoveryservicesbackup.PrivateEndpointConnectionResource{ - Properties: &armrecoveryservicesbackup.PrivateEndpointConnection{ - PrivateEndpoint: &armrecoveryservicesbackup.PrivateEndpoint{ - ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.Network/privateEndpoints/gaallatestpe3"), - }, - PrivateLinkServiceConnectionState: &armrecoveryservicesbackup.PrivateLinkServiceConnectionState{ - Description: to.Ptr("Approved by johndoe@company.com"), - Status: to.Ptr(armrecoveryservicesbackup.PrivateEndpointConnectionStatusApproved), - }, - ProvisioningState: to.Ptr(armrecoveryservicesbackup.ProvisioningStateSucceeded), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/PrivateEndpointConnection/DeletePrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewPrivateEndpointConnectionClient("04cf684a-d41f-4550-9f70-7708a3a2283b", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "gaallavaultbvtd2msi", - "gaallaRG", - "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectablecontainers_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectablecontainers_client_test.go deleted file mode 100644 index 0a8fa43b56b0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectablecontainers_client_test.go +++ /dev/null @@ -1,45 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureStorage/ProtectableContainers_List.json -func ExampleProtectableContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectableContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("testvault", - "testRg", - "Azure", - &armrecoveryservicesbackup.ProtectableContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureStorage' and workloadType eq 'AzureFileShare'")}) - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationresults_client_test.go deleted file mode 100644 index abddb7e687f0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationresults_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectedItemOperationResults.json -func ExampleProtectedItemOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectedItemOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationstatuses_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationstatuses_client_test.go deleted file mode 100644 index cd3df261a20f..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditemoperationstatuses_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectedItemOperationStatus.json -func ExampleProtectedItemOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectedItemOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditems_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditems_client_test.go deleted file mode 100644 index ea89d9f8a0e4..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protecteditems_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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json -func ExampleProtectedItemsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - "Azure", - "iaasvmcontainer;iaasvmcontainer;iaasvm-rg;iaasvm-1", - "vm;iaasvmcontainer;iaasvm-rg;iaasvm-1", - &armrecoveryservicesbackup.ProtectedItemsClientGetOptions{Filter: 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ConfigureProtection.json -func ExampleProtectedItemsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - armrecoveryservicesbackup.ProtectedItemResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - PolicyID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/DefaultPolicy"), - ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/ProtectedItem_Delete.json -func ExampleProtectedItemsClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectedItemsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "PySDKBackupTestRsVault", - "PythonSDKBackupTestRg", - "Azure", - "iaasvmcontainer;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", - "vm;iaasvmcontainerv2;pysdktestrg;pysdktestv2vm1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontaineroperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontaineroperationresults_client_test.go deleted file mode 100644 index ac9f878a2c1c..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontaineroperationresults_client_test.go +++ /dev/null @@ -1,42 +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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureStorage/ProtectionContainers_Inquire_Result.json -func ExampleProtectionContainerOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainerOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testvault", - "test-rg", - "Azure", - "VMAppContainer;Compute;testRG;testSQL", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainers_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainers_client_test.go deleted file mode 100644 index a787d14a6b8d..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectioncontainers_client_test.go +++ /dev/null @@ -1,140 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureWorkload/ProtectionContainers_Get.json -func ExampleProtectionContainersClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "testVault", - "testRg", - "Azure", - "VMAppContainer;Compute;testRG;testSQL", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureStorage/ProtectionContainers_Register.json -func ExampleProtectionContainersClient_Register() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Register(ctx, - "swaggertestvault", - "SwaggerTestRg", - "Azure", - "StorageContainer;Storage;SwaggerTestRg;swaggertestsa", - armrecoveryservicesbackup.ProtectionContainerResource{ - Properties: &armrecoveryservicesbackup.AzureStorageContainer{ - BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - ContainerType: to.Ptr(armrecoveryservicesbackup.ContainerTypeStorageContainer), - FriendlyName: to.Ptr("swaggertestsa"), - AcquireStorageAccountLock: to.Ptr(armrecoveryservicesbackup.AcquireStorageAccountLockAcquire), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa"), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureWorkload/ProtectionContainers_Unregister.json -func ExampleProtectionContainersClient_Unregister() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Unregister(ctx, - "testVault", - "testRg", - "Azure", - "storagecontainer;Storage;test-rg;teststorage", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureStorage/ProtectionContainers_Inquire.json -func ExampleProtectionContainersClient_Inquire() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Inquire(ctx, - "testvault", - "test-rg", - "Azure", - "storagecontainer;Storage;test-rg;teststorage", - &armrecoveryservicesbackup.ProtectionContainersClientInquireOptions{Filter: 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/Common/RefreshContainers.json -func ExampleProtectionContainersClient_Refresh() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionContainersClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Refresh(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "Azure", - &armrecoveryservicesbackup.ProtectionContainersClientRefreshOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionintent_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionintent_client_test.go deleted file mode 100644 index 4fafe3ea4390..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionintent_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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectionIntent_Validate.json -func ExampleProtectionIntentClient_Validate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Validate(ctx, - "southeastasia", - armrecoveryservicesbackup.PreValidateEnableBackupRequest{ - Properties: to.Ptr(""), - ResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arunaupgrade/providers/Microsoft.Compute/VirtualMachines/upgrade1"), - ResourceType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - VaultID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/Vaults/myVault"), - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureWorkload/BackupProtectionIntent_Get.json -func ExampleProtectionIntentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "myVault", - "myRG", - "Azure", - "249D9B07-D2EF-4202-AA64-65F35418564E", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectionIntent_CreateOrUpdate.json -func ExampleProtectionIntentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "myVault", - "myRG", - "Azure", - "vm;iaasvmcontainerv2;chamsrgtest;chamscandel", - armrecoveryservicesbackup.ProtectionIntentResource{ - Properties: &armrecoveryservicesbackup.AzureResourceProtectionIntent{ - PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), - ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureResourceItem), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/chamsrgtest/providers/Microsoft.Compute/virtualMachines/chamscandel"), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureWorkload/BackupProtectionIntent_Delete.json -func ExampleProtectionIntentClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionIntentClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "myVault", - "myRG", - "Azure", - "249D9B07-D2EF-4202-AA64-65F35418564E", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicies_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicies_client_test.go deleted file mode 100644 index e735c451d487..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicies_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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/V2Policy/v2-Get-Policy.json -func ExampleProtectionPoliciesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "v2-daily-sample", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Daily.json -func ExampleProtectionPoliciesClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "swaggertestvault", - "SwaggerTestRg", - "dailyPolicy2", - armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ - BackupManagementType: to.Ptr("AzureStorage"), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](5), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](60), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](12), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](10), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }())}, - }, - TimeZone: to.Ptr("UTC"), - WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeAzureFileShare), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectionPolicies_Delete.json -func ExampleProtectionPoliciesClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionPoliciesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "testPolicy1", - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationresults_client_test.go deleted file mode 100644 index 62b203fbc99f..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationresults_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectionPolicyOperationResults_Get.json -func ExampleProtectionPolicyOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionPolicyOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "testPolicy1", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationstatuses_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationstatuses_client_test.go deleted file mode 100644 index 641c1dd40f73..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_protectionpolicyoperationstatuses_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ProtectionPolicyOperationStatuses_Get.json -func ExampleProtectionPolicyOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewProtectionPolicyOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "testPolicy1", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypoints_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypoints_client_test.go deleted file mode 100644 index 12c40ec40f82..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypoints_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/RecoveryPoints_List.json -func ExampleRecoveryPointsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewRecoveryPointsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rshvault", - "rshhtestmdvmrg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", - "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", - &armrecoveryservicesbackup.RecoveryPointsClientListOptions{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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/RecoveryPoints_Get.json -func ExampleRecoveryPointsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewRecoveryPointsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rshvault", - "rshhtestmdvmrg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", - "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", - "26083826328862", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypointsrecommendedformove_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypointsrecommendedformove_client_test.go deleted file mode 100644 index 3b0540d3561e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoverypointsrecommendedformove_client_test.go +++ /dev/null @@ -1,53 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/RecoveryPointsRecommendedForMove_List.json -func ExampleRecoveryPointsRecommendedForMoveClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewRecoveryPointsRecommendedForMoveClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rshvault", - "rshhtestmdvmrg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", - "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", - armrecoveryservicesbackup.ListRecoveryPointsRecommendedForMoveRequest{ - ExcludedRPList: []*string{ - to.Ptr("348916168024334"), - to.Ptr("348916168024335")}, - ObjectType: to.Ptr("ListRecoveryPointsRecommendedForMoveRequest"), - }, - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoveryservicesbackupclient_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoveryservicesbackupclient_client_test.go deleted file mode 100644 index 4284dc238163..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_recoveryservicesbackupclient_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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/BackupDataMove/BackupDataMoveOperationStatus_Get.json -func ExampleClient_GetOperationStatus() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetOperationStatus(ctx, - "source-rsv", - "sourceRG", - "00000000-0000-0000-0000-000000000000", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/BackupDataMove/PrepareDataMove_Post.json -func ExampleClient_BeginBMSPrepareDataMove() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginBMSPrepareDataMove(ctx, - "source-rsv", - "sourceRG", - armrecoveryservicesbackup.PrepareDataMoveRequest{ - DataMoveLevel: to.Ptr(armrecoveryservicesbackup.DataMoveLevelVault), - TargetRegion: to.Ptr("USGov Virginia"), - TargetResourceID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/targetRG/providers/Microsoft.RecoveryServices/vaults/target-rsv"), - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/BackupDataMove/TriggerDataMove_Post.json -func ExampleClient_BeginBMSTriggerDataMove() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginBMSTriggerDataMove(ctx, - "target-rsv", - "targetRG", - armrecoveryservicesbackup.TriggerDataMoveRequest{ - CorrelationID: to.Ptr("MTg2OTcyMzM4NzYyMjc1NDY3Nzs1YmUzYmVmNi04YjJiLTRhOTItOTllYi01NTM0MDllYjk2NjE="), - DataMoveLevel: to.Ptr(armrecoveryservicesbackup.DataMoveLevelVault), - SourceRegion: to.Ptr("USGov Iowa"), - SourceResourceID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/sourceRG/providers/Microsoft.RecoveryServices/vaults/source-rsv"), - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/TriggerRecoveryPointMove_Post.json -func ExampleClient_BeginMoveRecoveryPoint() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginMoveRecoveryPoint(ctx, - "testVault", - "netsdktestrg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "348916168024334", - armrecoveryservicesbackup.MoveRPAcrossTiersRequest{ - ObjectType: to.Ptr("MoveRPAcrossTiersRequest"), - SourceTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - TargetTierType: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), - }, - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxies_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxies_client_test.go deleted file mode 100644 index d77452b45754..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxies_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 armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json -func ExampleResourceGuardProxiesClient_NewGetPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewResourceGuardProxiesClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewGetPager("sampleVault", - "SampleResourceGroup", - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxy_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxy_client_test.go deleted file mode 100644 index 181bb797271c..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_resourceguardproxy_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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json -func ExampleResourceGuardProxyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewResourceGuardProxyClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "sampleVault", - "SampleResourceGroup", - "swaggerExample", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json -func ExampleResourceGuardProxyClient_Put() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewResourceGuardProxyClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Put(ctx, - "sampleVault", - "SampleResourceGroup", - "swaggerExample", - armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ - Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ - ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - }, - }, - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json -func ExampleResourceGuardProxyClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewResourceGuardProxyClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "sampleVault", - "SampleResourceGroup", - "swaggerExample", - 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/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json -func ExampleResourceGuardProxyClient_UnlockDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewResourceGuardProxyClient("0b352192-dcac-4cc7-992e-a96190ccc68c", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.UnlockDelete(ctx, - "sampleVault", - "SampleResourceGroup", - "swaggerExample", - armrecoveryservicesbackup.UnlockDeleteRequest{ - ResourceGuardOperationRequests: []*string{ - to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteProtectedItemRequests/default")}, - ResourceToBeDeleted: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/gaallarg/providers/Microsoft.RecoveryServices/vaults/MercuryCrrVault/backupFabrics/Azure/protectionContainers/VMAppContainer;compute;crrtestrg;crrtestvm/protectedItems/SQLDataBase;mssqlserver;testdb"), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_restores_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_restores_client_test.go deleted file mode 100644 index c49694252209..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_restores_client_test.go +++ /dev/null @@ -1,65 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json -func ExampleRestoresClient_BeginTrigger() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewRestoresClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTrigger(ctx, - "testVault", - "netsdktestrg", - "Azure", - "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", - "348916168024334", - armrecoveryservicesbackup.RestoreRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - }, - }, - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperation_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperation_client_test.go deleted file mode 100644 index 100653b71c3a..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperation_client_test.go +++ /dev/null @@ -1,62 +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 armrecoveryservicesbackup_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/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/TriggerValidateOperation_RestoreDisk.json -func ExampleValidateOperationClient_BeginTrigger() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewValidateOperationClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginTrigger(ctx, - "testVault", - "testRG", - &armrecoveryservicesbackup.ValidateIaasVMRestoreOperationRequest{ - ObjectType: to.Ptr("ValidateIaasVMRestoreOperationRequest"), - RestoreRequest: &armrecoveryservicesbackup.IaasVMRestoreRequest{ - ObjectType: to.Ptr("IaasVMRestoreRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(false), - ManagedIdentityResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/asmaskarRG1/providers/Microsoft.ManagedIdentity/userAssignedIdentities/asmaskartestmsi"), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeRestoreDisks), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - StorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - }, - }, - 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/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationresults_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationresults_client_test.go deleted file mode 100644 index e20de3400e83..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationresults_client_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ValidateOperationResults.json -func ExampleValidateOperationResultsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewValidateOperationResultsClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationstatuses_client_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationstatuses_client_test.go deleted file mode 100644 index e629c96c6795..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/ze_generated_example_validateoperationstatuses_client_test.go +++ /dev/null @@ -1,40 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armrecoveryservicesbackup_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2022-02-01/examples/AzureIaasVm/ValidateOperationStatus.json -func ExampleValidateOperationStatusesClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armrecoveryservicesbackup.NewValidateOperationStatusesClient("00000000-0000-0000-0000-000000000000", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "NetSDKTestRsVault", - "SwaggerTestRg", - "00000000-0000-0000-0000-000000000000", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} From b88b6dd0a944aab774ba0637a6778f36bb935a50 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Thu, 19 Jan 2023 11:23:24 +0800 Subject: [PATCH 2/2] Update CHANGELOG.md --- .../recoveryservices/armrecoveryservicesbackup/CHANGELOG.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md index 8a779f6f1408..b561c800242a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md @@ -14,15 +14,12 @@ - Type of `AzureVMAppContainerProtectionContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` - Type of `AzureWorkloadContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` - Type of `DpmContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` -- Type of `ErrorAdditionalInfo.Info` has been changed from `interface{}` to `any` - Type of `GenericContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` - Type of `IaaSVMContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` - Type of `MabContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` - Type of `ProtectableContainer.ProtectableContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` - Type of `ProtectionContainer.ContainerType` has been changed from `*ContainerType` to `*ProtectableContainerType` - Const `ContainerTypeAzureWorkloadContainer`, `ContainerTypeMicrosoftClassicComputeVirtualMachines`, `ContainerTypeMicrosoftComputeVirtualMachines` from type alias `ContainerType` has been removed -- Struct `CloudError` has been removed -- Struct `CloudErrorBody` has been removed ### Features Added @@ -90,4 +87,4 @@ The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryse To migrate the existing applications to the latest version, please refer to [Migration Guide](https://aka.ms/azsdk/go/mgmt/migration). -To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt). \ No newline at end of file +To learn more, please refer to our documentation [Quick Start](https://aka.ms/azsdk/go/mgmt).