From aeddf9c145a2879b262f8a74dd17b4d5c8412131 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 13 Feb 2023 06:51:15 +0000 Subject: [PATCH] CodeGen from PR 22313 in Azure/azure-rest-api-specs Merge 7008bab2a2c687c64b60e1dfa53e28f497794bc2 into 47d1d82108a0db0395ed4eca106622becee7fbb4 --- .../armapimanagement/CHANGELOG.md | 179 + ..._generated_api_client.go => api_client.go} | 122 +- ...stic_client.go => apidiagnostic_client.go} | 115 +- ...piexport_client.go => apiexport_client.go} | 27 +- ..._apiissue_client.go => apiissue_client.go} | 110 +- ...client.go => apiissueattachment_client.go} | 106 +- ...nt_client.go => apiissuecomment_client.go} | 104 +- .../armapimanagement/apimapis_live_test.go | 493 - .../apimapiversionsets_live_test.go | 142 - .../apimauthorizationservers_live_test.go | 160 - .../armapimanagement/apimcaches_live_test.go | 140 - .../apimdeployment_live_test.go | 194 - .../apimgateways_live_test.go | 195 - .../armapimanagement/apimgroups_live_test.go | 138 - .../apimidentityprovider_live_test.go | 148 - .../apimnamedvalues_live_test.go | 158 - .../apimnotifications_live_test.go | 144 - .../apimopenidconnectproviders_live_test.go | 146 - .../apimpolicies_live_test.go | 132 - .../apimportalrevisions_live_test.go | 138 - .../apimportalsettings_live_test.go | 174 - .../apimprivatelink_live_test.go | 283 - .../apimproducts_live_test.go | 359 - .../armapimanagement/apimreports_live_test.go | 189 - .../armapimanagement/apimschema_live_test.go | 133 - .../apimsubscriptions_live_test.go | 209 - .../armapimanagement/apimtags_live_test.go | 139 - .../armapimanagement/apimtenant_live_test.go | 205 - .../armapimanagement/apimusers_live_test.go | 200 - ...ation_client.go => apioperation_client.go} | 126 +- ...client.go => apioperationpolicy_client.go} | 115 +- ...pipolicy_client.go => apipolicy_client.go} | 99 +- ...product_client.go => apiproduct_client.go} | 23 +- ...release_client.go => apirelease_client.go} | 113 +- ...vision_client.go => apirevision_client.go} | 24 +- ...pischema_client.go => apischema_client.go} | 103 +- ..._client.go => apitagdescription_client.go} | 114 +- ...nset_client.go => apiversionset_client.go} | 103 +- .../armapimanagement/apiwiki_client.go | 377 + .../armapimanagement/apiwikis_client.go | 130 + .../armapimanagement/authorization_client.go | 416 + .../authorizationaccesspolicy_client.go | 369 + .../authorizationloginlinks_client.go | 128 + .../authorizationprovider_client.go | 329 + ...lient.go => authorizationserver_client.go} | 122 +- .../armapimanagement/autorest.md | 6 +- ...ed_backend_client.go => backend_client.go} | 115 +- ...erated_cache_client.go => cache_client.go} | 97 +- ...ficate_client.go => certificate_client.go} | 99 +- .../{zz_generated_client.go => client.go} | 26 +- ...zz_generated_constants.go => constants.go} | 144 +- ...ntitem_client.go => contentitem_client.go} | 101 +- ...nttype_client.go => contenttype_client.go} | 76 +- ...client.go => delegationsettings_client.go} | 79 +- ...es_client.go => deletedservices_client.go} | 47 +- ...gnostic_client.go => diagnostic_client.go} | 101 +- .../armapimanagement/documentation_client.go | 449 + ...late_client.go => emailtemplate_client.go} | 103 +- ...ed_gateway_client.go => gateway_client.go} | 149 +- ...ewayapi_client.go => gatewayapi_client.go} | 79 +- ... => gatewaycertificateauthority_client.go} | 106 +- ...=> gatewayhostnameconfiguration_client.go} | 106 +- ...chema_client.go => globalschema_client.go} | 87 +- .../apimanagement/armapimanagement/go.mod | 20 +- .../apimanagement/armapimanagement/go.sum | 35 - .../graphqlapiresolver_client.go | 497 + .../graphqlapiresolverpolicy_client.go | 440 + ...erated_group_client.go => group_client.go} | 97 +- ...roupuser_client.go => groupuser_client.go} | 69 +- ...r_client.go => identityprovider_client.go} | 118 +- ...erated_issue_client.go => issue_client.go} | 33 +- ...ated_logger_client.go => logger_client.go} | 98 +- .../{zz_generated_models.go => models.go} | 1348 +- .../armapimanagement/models_serde.go | 15398 ++++++++++++++++ ...edvalue_client.go => namedvalue_client.go} | 138 +- ...atus_client.go => networkstatus_client.go} | 38 +- ...ation_client.go => notification_client.go} | 50 +- ...o => notificationrecipientemail_client.go} | 74 +- ...go => notificationrecipientuser_client.go} | 74 +- ...ent.go => openidconnectprovider_client.go} | 124 +- ...peration_client.go => operation_client.go} | 25 +- ...rations_client.go => operations_client.go} | 13 +- ...undnetworkdependenciesendpoints_client.go} | 21 +- ...ated_policy_client.go => policy_client.go} | 77 +- ..._client.go => policydescription_client.go} | 21 +- .../armapimanagement/policyfragment_client.go | 459 + .../armapimanagement/portalconfig_client.go | 375 + ...ion_client.go => portalrevision_client.go} | 90 +- ...ngs_client.go => portalsettings_client.go} | 21 +- ...go => privateendpointconnection_client.go} | 101 +- ...ed_product_client.go => product_client.go} | 110 +- ...ductapi_client.go => productapi_client.go} | 79 +- ...group_client.go => productgroup_client.go} | 73 +- ...licy_client.go => productpolicy_client.go} | 93 +- ...ient.go => productsubscriptions_client.go} | 24 +- .../armapimanagement/productwiki_client.go | 379 + .../armapimanagement/productwikis_client.go | 133 + ...client.go => quotabycounterkeys_client.go} | 48 +- ..._client.go => quotabyperiodkeys_client.go} | 50 +- ...ated_region_client.go => region_client.go} | 21 +- ...ed_reports_client.go => reports_client.go} | 415 +- ...ed_response_types.go => response_types.go} | 533 +- ...ed_service_client.go => service_client.go} | 239 +- ...ceskus_client.go => serviceskus_client.go} | 22 +- ...ngs_client.go => signinsettings_client.go} | 64 +- ...ngs_client.go => signupsettings_client.go} | 64 +- ...enerated_skus_client.go => skus_client.go} | 16 +- ...ption_client.go => subscription_client.go} | 146 +- ..._generated_tag_client.go => tag_client.go} | 353 +- ...source_client.go => tagresource_client.go} | 22 +- ...ccess_client.go => tenantaccess_client.go} | 133 +- ...it_client.go => tenantaccessgit_client.go} | 38 +- ...lient.go => tenantconfiguration_client.go} | 83 +- ...ngs_client.go => tenantsettings_client.go} | 35 +- ...erated_time_rfc3339.go => time_rfc3339.go} | 3 +- ...enerated_user_client.go => user_client.go} | 127 +- ....go => userconfirmationpassword_client.go} | 23 +- ...sergroup_client.go => usergroup_client.go} | 22 +- ...ies_client.go => useridentities_client.go} | 22 +- ...n_client.go => usersubscription_client.go} | 38 +- .../ze_generated_example_api_client_test.go | 224 - ...rated_example_apidiagnostic_client_test.go | 250 - ...generated_example_apiexport_client_test.go | 42 - ..._generated_example_apiissue_client_test.go | 183 - ..._example_apiissueattachment_client_test.go | 153 - ...ted_example_apiissuecomment_client_test.go | 155 - ...example_apimanagementclient_client_test.go | 67 - ...ple_apimanagementoperations_client_test.go | 41 - ...xample_apimanagementservice_client_test.go | 381 - ...le_apimanagementserviceskus_client_test.go | 9 - ...d_example_apimanagementskus_client_test.go | 41 - ...erated_example_apioperation_client_test.go | 202 - ..._example_apioperationpolicy_client_test.go | 145 - ...generated_example_apipolicy_client_test.go | 117 - ...enerated_example_apiproduct_client_test.go | 47 - ...enerated_example_apirelease_client_test.go | 178 - ...nerated_example_apirevision_client_test.go | 47 - ...generated_example_apischema_client_test.go | 123 - ...d_example_apitagdescription_client_test.go | 148 - ...rated_example_apiversionset_client_test.go | 174 - ...example_authorizationserver_client_test.go | 211 - ...e_generated_example_backend_client_test.go | 228 - .../ze_generated_example_cache_client_test.go | 172 - ...nerated_example_certificate_client_test.go | 166 - ...nerated_example_contentitem_client_test.go | 137 - ...nerated_example_contenttype_client_test.go | 111 - ..._example_delegationsettings_client_test.go | 149 - ...ted_example_deletedservices_client_test.go | 87 - ...enerated_example_diagnostic_client_test.go | 244 - ...rated_example_emailtemplate_client_test.go | 171 - ...e_generated_example_gateway_client_test.go | 252 - ...enerated_example_gatewayapi_client_test.go | 121 - ...gatewaycertificateauthority_client_test.go | 146 - ...atewayhostnameconfiguration_client_test.go | 151 - ...erated_example_globalschema_client_test.go | 147 - .../ze_generated_example_group_client_test.go | 170 - ...generated_example_groupuser_client_test.go | 115 - ...ed_example_identityprovider_client_test.go | 192 - .../ze_generated_example_issue_client_test.go | 69 - ...ze_generated_example_logger_client_test.go | 175 - ...enerated_example_namedvalue_client_test.go | 239 - ...rated_example_networkstatus_client_test.go | 62 - ...erated_example_notification_client_test.go | 91 - ..._notificationrecipientemail_client_test.go | 108 - ...e_notificationrecipientuser_client_test.go | 108 - ...ample_openidconnectprovider_client_test.go | 196 - ...generated_example_operation_client_test.go | 48 - ...etworkdependenciesendpoints_client_test.go | 39 - ...ze_generated_example_policy_client_test.go | 135 - ...d_example_policydescription_client_test.go | 40 - ...ated_example_portalrevision_client_test.go | 156 - ...ated_example_portalsettings_client_test.go | 39 - ...e_privateendpointconnection_client_test.go | 173 - ...e_generated_example_product_client_test.go | 202 - ...enerated_example_productapi_client_test.go | 115 - ...erated_example_productgroup_client_test.go | 115 - ...rated_example_productpolicy_client_test.go | 140 - ...xample_productsubscriptions_client_test.go | 47 - ..._example_quotabycounterkeys_client_test.go | 70 - ...d_example_quotabyperiodkeys_client_test.go | 72 - ...ze_generated_example_region_client_test.go | 43 - ...e_generated_example_reports_client_test.go | 226 - ...ated_example_signinsettings_client_test.go | 113 - ...ated_example_signupsettings_client_test.go | 123 - ...erated_example_subscription_client_test.go | 242 - .../ze_generated_example_tag_client_test.go | 420 - ...nerated_example_tagresource_client_test.go | 46 - ...erated_example_tenantaccess_client_test.go | 211 - ...ted_example_tenantaccessgit_client_test.go | 59 - ...example_tenantconfiguration_client_test.go | 137 - ...ated_example_tenantsettings_client_test.go | 66 - .../ze_generated_example_user_client_test.go | 212 - ...le_userconfirmationpassword_client_test.go | 38 - ...generated_example_usergroup_client_test.go | 47 - ...ated_example_useridentities_client_test.go | 44 - ...ed_example_usersubscription_client_test.go | 71 - .../zz_generated_models_serde.go | 2330 --- 197 files changed, 25270 insertions(+), 20199 deletions(-) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_api_client.go => api_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apidiagnostic_client.go => apidiagnostic_client.go} (83%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apiexport_client.go => apiexport_client.go} (82%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apiissue_client.go => apiissue_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apiissueattachment_client.go => apiissueattachment_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apiissuecomment_client.go => apiissuecomment_client.go} (84%) delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimapis_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimapiversionsets_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimauthorizationservers_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimcaches_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimdeployment_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimgateways_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimgroups_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimidentityprovider_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimnamedvalues_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimnotifications_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimopenidconnectproviders_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimpolicies_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimportalrevisions_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimportalsettings_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimprivatelink_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimproducts_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimreports_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimschema_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimsubscriptions_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimtags_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimtenant_live_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apimusers_live_test.go rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apioperation_client.go => apioperation_client.go} (81%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apioperationpolicy_client.go => apioperationpolicy_client.go} (81%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apipolicy_client.go => apipolicy_client.go} (82%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apiproduct_client.go => apiproduct_client.go} (86%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apirelease_client.go => apirelease_client.go} (83%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apirevision_client.go => apirevision_client.go} (86%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apischema_client.go => apischema_client.go} (82%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apitagdescription_client.go => apitagdescription_client.go} (81%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_apiversionset_client.go => apiversionset_client.go} (84%) create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apiwiki_client.go create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/apiwikis_client.go create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/authorization_client.go create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/authorizationaccesspolicy_client.go create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/authorizationloginlinks_client.go create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/authorizationprovider_client.go rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_authorizationserver_client.go => authorizationserver_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_backend_client.go => backend_client.go} (83%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_cache_client.go => cache_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_certificate_client.go => certificate_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_client.go => client.go} (87%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_constants.go => constants.go} (90%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_contentitem_client.go => contentitem_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_contenttype_client.go => contenttype_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_delegationsettings_client.go => delegationsettings_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_deletedservices_client.go => deletedservices_client.go} (87%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_diagnostic_client.go => diagnostic_client.go} (84%) create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/documentation_client.go rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_emailtemplate_client.go => emailtemplate_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_gateway_client.go => gateway_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_gatewayapi_client.go => gatewayapi_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_gatewaycertificateauthority_client.go => gatewaycertificateauthority_client.go} (83%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_gatewayhostnameconfiguration_client.go => gatewayhostnameconfiguration_client.go} (83%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_globalschema_client.go => globalschema_client.go} (85%) create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolver_client.go create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolverpolicy_client.go rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_group_client.go => group_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_groupuser_client.go => groupuser_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_identityprovider_client.go => identityprovider_client.go} (86%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_issue_client.go => issue_client.go} (87%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_logger_client.go => logger_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_models.go => models.go} (87%) create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/models_serde.go rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_namedvalue_client.go => namedvalue_client.go} (86%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_networkstatus_client.go => networkstatus_client.go} (86%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_notification_client.go => notification_client.go} (88%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_notificationrecipientemail_client.go => notificationrecipientemail_client.go} (86%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_notificationrecipientuser_client.go => notificationrecipientuser_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_openidconnectprovider_client.go => openidconnectprovider_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_operation_client.go => operation_client.go} (86%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_operations_client.go => operations_client.go} (90%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_outboundnetworkdependenciesendpoints_client.go => outboundnetworkdependenciesendpoints_client.go} (87%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_policy_client.go => policy_client.go} (86%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_policydescription_client.go => policydescription_client.go} (87%) create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/policyfragment_client.go create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/portalconfig_client.go rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_portalrevision_client.go => portalrevision_client.go} (86%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_portalsettings_client.go => portalsettings_client.go} (87%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_privateendpointconnection_client.go => privateendpointconnection_client.go} (87%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_product_client.go => product_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_productapi_client.go => productapi_client.go} (83%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_productgroup_client.go => productgroup_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_productpolicy_client.go => productpolicy_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_productsubscriptions_client.go => productsubscriptions_client.go} (87%) create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/productwiki_client.go create mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/productwikis_client.go rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_quotabycounterkeys_client.go => quotabycounterkeys_client.go} (81%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_quotabyperiodkeys_client.go => quotabyperiodkeys_client.go} (81%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_region_client.go => region_client.go} (87%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_reports_client.go => reports_client.go} (73%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_response_types.go => response_types.go} (80%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_service_client.go => service_client.go} (80%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_serviceskus_client.go => serviceskus_client.go} (87%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_signinsettings_client.go => signinsettings_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_signupsettings_client.go => signupsettings_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_skus_client.go => skus_client.go} (87%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_subscription_client.go => subscription_client.go} (84%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_tag_client.go => tag_client.go} (83%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_tagresource_client.go => tagresource_client.go} (87%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_tenantaccess_client.go => tenantaccess_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_tenantaccessgit_client.go => tenantaccessgit_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_tenantconfiguration_client.go => tenantconfiguration_client.go} (87%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_tenantsettings_client.go => tenantsettings_client.go} (87%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_time_rfc3339.go => time_rfc3339.go} (96%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_user_client.go => user_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_userconfirmationpassword_client.go => userconfirmationpassword_client.go} (85%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_usergroup_client.go => usergroup_client.go} (86%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_useridentities_client.go => useridentities_client.go} (86%) rename sdk/resourcemanager/apimanagement/armapimanagement/{zz_generated_usersubscription_client.go => usersubscription_client.go} (86%) delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_api_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apidiagnostic_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiexport_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissue_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissueattachment_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissuecomment_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementclient_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementoperations_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementservice_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementserviceskus_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementskus_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperation_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperationpolicy_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apipolicy_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiproduct_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirelease_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirevision_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apischema_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apitagdescription_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiversionset_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_authorizationserver_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_backend_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_cache_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_certificate_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contentitem_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contenttype_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_delegationsettings_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_deletedservices_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_diagnostic_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_emailtemplate_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gateway_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayapi_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewaycertificateauthority_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayhostnameconfiguration_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_globalschema_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_group_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_groupuser_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_identityprovider_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_issue_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_logger_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_namedvalue_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_networkstatus_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notification_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientemail_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientuser_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_openidconnectprovider_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_operation_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_outboundnetworkdependenciesendpoints_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policy_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policydescription_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalrevision_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalsettings_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_privateendpointconnection_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_product_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productapi_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productgroup_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productpolicy_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productsubscriptions_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabycounterkeys_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabyperiodkeys_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_region_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_reports_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signinsettings_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signupsettings_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_subscription_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tag_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tagresource_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccess_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccessgit_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantconfiguration_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantsettings_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_user_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_userconfirmationpassword_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usergroup_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_useridentities_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usersubscription_client_test.go delete mode 100644 sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_models_serde.go diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/CHANGELOG.md b/sdk/resourcemanager/apimanagement/armapimanagement/CHANGELOG.md index a01cfc74d2d2..779cdce919f9 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/CHANGELOG.md +++ b/sdk/resourcemanager/apimanagement/armapimanagement/CHANGELOG.md @@ -1,5 +1,184 @@ # Release History +## 2.0.0 (2023-02-13) +### Breaking Changes + +- Function `*ContentItemClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, string, *ContentItemClientCreateOrUpdateOptions)` to `(context.Context, string, string, string, string, ContentItemContract, *ContentItemClientCreateOrUpdateOptions)` +- Function `*ContentTypeClient.CreateOrUpdate` parameter(s) have been changed from `(context.Context, string, string, string, *ContentTypeClientCreateOrUpdateOptions)` to `(context.Context, string, string, string, ContentTypeContract, *ContentTypeClientCreateOrUpdateOptions)` + +### Features Added + +- New type alias `AsyncResolverStatus` with values `AsyncResolverStatusFailed`, `AsyncResolverStatusInProgress`, `AsyncResolverStatusStarted`, `AsyncResolverStatusSucceeded` +- New type alias `AuthorizationType` with values `AuthorizationTypeOAuth2` +- New type alias `NatGatewayState` with values `NatGatewayStateDisabled`, `NatGatewayStateEnabled` +- New type alias `OAuth2GrantType` with values `OAuth2GrantTypeAuthorizationCode`, `OAuth2GrantTypeClientCredentials` +- New type alias `PolicyFragmentContentFormat` with values `PolicyFragmentContentFormatRawxml`, `PolicyFragmentContentFormatXML` +- New type alias `PortalSettingsCspMode` with values `PortalSettingsCspModeDisabled`, `PortalSettingsCspModeEnabled`, `PortalSettingsCspModeReportOnly` +- New type alias `TranslateRequiredQueryParametersConduct` with values `TranslateRequiredQueryParametersConductQuery`, `TranslateRequiredQueryParametersConductTemplate` +- New function `NewAPIWikiClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APIWikiClient, error)` +- New function `*APIWikiClient.CreateOrUpdate(context.Context, string, string, string, WikiContract, *APIWikiClientCreateOrUpdateOptions) (APIWikiClientCreateOrUpdateResponse, error)` +- New function `*APIWikiClient.Delete(context.Context, string, string, string, string, *APIWikiClientDeleteOptions) (APIWikiClientDeleteResponse, error)` +- New function `*APIWikiClient.Get(context.Context, string, string, string, *APIWikiClientGetOptions) (APIWikiClientGetResponse, error)` +- New function `*APIWikiClient.GetEntityTag(context.Context, string, string, string, *APIWikiClientGetEntityTagOptions) (APIWikiClientGetEntityTagResponse, error)` +- New function `*APIWikiClient.Update(context.Context, string, string, string, string, WikiUpdateContract, *APIWikiClientUpdateOptions) (APIWikiClientUpdateResponse, error)` +- New function `NewAPIWikisClient(string, azcore.TokenCredential, *arm.ClientOptions) (*APIWikisClient, error)` +- New function `*APIWikisClient.NewListPager(string, string, string, *APIWikisClientListOptions) *runtime.Pager[APIWikisClientListResponse]` +- New function `NewAuthorizationAccessPolicyClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AuthorizationAccessPolicyClient, error)` +- New function `*AuthorizationAccessPolicyClient.CreateOrUpdate(context.Context, string, string, string, string, string, AuthorizationAccessPolicyContract, *AuthorizationAccessPolicyClientCreateOrUpdateOptions) (AuthorizationAccessPolicyClientCreateOrUpdateResponse, error)` +- New function `*AuthorizationAccessPolicyClient.Delete(context.Context, string, string, string, string, string, string, *AuthorizationAccessPolicyClientDeleteOptions) (AuthorizationAccessPolicyClientDeleteResponse, error)` +- New function `*AuthorizationAccessPolicyClient.Get(context.Context, string, string, string, string, string, *AuthorizationAccessPolicyClientGetOptions) (AuthorizationAccessPolicyClientGetResponse, error)` +- New function `*AuthorizationAccessPolicyClient.NewListByAuthorizationPager(string, string, string, string, *AuthorizationAccessPolicyClientListByAuthorizationOptions) *runtime.Pager[AuthorizationAccessPolicyClientListByAuthorizationResponse]` +- New function `NewAuthorizationClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AuthorizationClient, error)` +- New function `*AuthorizationClient.ConfirmConsentCode(context.Context, string, string, string, string, AuthorizationConfirmConsentCodeRequestContract, *AuthorizationClientConfirmConsentCodeOptions) (AuthorizationClientConfirmConsentCodeResponse, error)` +- New function `*AuthorizationClient.CreateOrUpdate(context.Context, string, string, string, string, AuthorizationContract, *AuthorizationClientCreateOrUpdateOptions) (AuthorizationClientCreateOrUpdateResponse, error)` +- New function `*AuthorizationClient.Delete(context.Context, string, string, string, string, string, *AuthorizationClientDeleteOptions) (AuthorizationClientDeleteResponse, error)` +- New function `*AuthorizationClient.Get(context.Context, string, string, string, string, *AuthorizationClientGetOptions) (AuthorizationClientGetResponse, error)` +- New function `*AuthorizationClient.NewListByAuthorizationProviderPager(string, string, string, *AuthorizationClientListByAuthorizationProviderOptions) *runtime.Pager[AuthorizationClientListByAuthorizationProviderResponse]` +- New function `NewAuthorizationLoginLinksClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AuthorizationLoginLinksClient, error)` +- New function `*AuthorizationLoginLinksClient.Post(context.Context, string, string, string, string, AuthorizationLoginRequestContract, *AuthorizationLoginLinksClientPostOptions) (AuthorizationLoginLinksClientPostResponse, error)` +- New function `NewAuthorizationProviderClient(string, azcore.TokenCredential, *arm.ClientOptions) (*AuthorizationProviderClient, error)` +- New function `*AuthorizationProviderClient.CreateOrUpdate(context.Context, string, string, string, AuthorizationProviderContract, *AuthorizationProviderClientCreateOrUpdateOptions) (AuthorizationProviderClientCreateOrUpdateResponse, error)` +- New function `*AuthorizationProviderClient.Delete(context.Context, string, string, string, string, *AuthorizationProviderClientDeleteOptions) (AuthorizationProviderClientDeleteResponse, error)` +- New function `*AuthorizationProviderClient.Get(context.Context, string, string, string, *AuthorizationProviderClientGetOptions) (AuthorizationProviderClientGetResponse, error)` +- New function `*AuthorizationProviderClient.NewListByServicePager(string, string, *AuthorizationProviderClientListByServiceOptions) *runtime.Pager[AuthorizationProviderClientListByServiceResponse]` +- New function `NewDocumentationClient(string, azcore.TokenCredential, *arm.ClientOptions) (*DocumentationClient, error)` +- New function `*DocumentationClient.CreateOrUpdate(context.Context, string, string, string, DocumentationContract, *DocumentationClientCreateOrUpdateOptions) (DocumentationClientCreateOrUpdateResponse, error)` +- New function `*DocumentationClient.Delete(context.Context, string, string, string, string, *DocumentationClientDeleteOptions) (DocumentationClientDeleteResponse, error)` +- New function `*DocumentationClient.Get(context.Context, string, string, string, *DocumentationClientGetOptions) (DocumentationClientGetResponse, error)` +- New function `*DocumentationClient.GetEntityTag(context.Context, string, string, string, *DocumentationClientGetEntityTagOptions) (DocumentationClientGetEntityTagResponse, error)` +- New function `*DocumentationClient.NewListByServicePager(string, string, *DocumentationClientListByServiceOptions) *runtime.Pager[DocumentationClientListByServiceResponse]` +- New function `*DocumentationClient.Update(context.Context, string, string, string, string, DocumentationUpdateContract, *DocumentationClientUpdateOptions) (DocumentationClientUpdateResponse, error)` +- New function `NewGraphQLAPIResolverClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GraphQLAPIResolverClient, error)` +- New function `*GraphQLAPIResolverClient.CreateOrUpdate(context.Context, string, string, string, string, ResolverContract, *GraphQLAPIResolverClientCreateOrUpdateOptions) (GraphQLAPIResolverClientCreateOrUpdateResponse, error)` +- New function `*GraphQLAPIResolverClient.Delete(context.Context, string, string, string, string, string, *GraphQLAPIResolverClientDeleteOptions) (GraphQLAPIResolverClientDeleteResponse, error)` +- New function `*GraphQLAPIResolverClient.Get(context.Context, string, string, string, string, *GraphQLAPIResolverClientGetOptions) (GraphQLAPIResolverClientGetResponse, error)` +- New function `*GraphQLAPIResolverClient.GetEntityTag(context.Context, string, string, string, string, *GraphQLAPIResolverClientGetEntityTagOptions) (GraphQLAPIResolverClientGetEntityTagResponse, error)` +- New function `*GraphQLAPIResolverClient.NewListByAPIPager(string, string, string, *GraphQLAPIResolverClientListByAPIOptions) *runtime.Pager[GraphQLAPIResolverClientListByAPIResponse]` +- New function `*GraphQLAPIResolverClient.Update(context.Context, string, string, string, string, string, ResolverUpdateContract, *GraphQLAPIResolverClientUpdateOptions) (GraphQLAPIResolverClientUpdateResponse, error)` +- New function `NewGraphQLAPIResolverPolicyClient(string, azcore.TokenCredential, *arm.ClientOptions) (*GraphQLAPIResolverPolicyClient, error)` +- New function `*GraphQLAPIResolverPolicyClient.CreateOrUpdate(context.Context, string, string, string, string, PolicyIDName, PolicyContract, *GraphQLAPIResolverPolicyClientCreateOrUpdateOptions) (GraphQLAPIResolverPolicyClientCreateOrUpdateResponse, error)` +- New function `*GraphQLAPIResolverPolicyClient.Delete(context.Context, string, string, string, string, PolicyIDName, string, *GraphQLAPIResolverPolicyClientDeleteOptions) (GraphQLAPIResolverPolicyClientDeleteResponse, error)` +- New function `*GraphQLAPIResolverPolicyClient.Get(context.Context, string, string, string, string, PolicyIDName, *GraphQLAPIResolverPolicyClientGetOptions) (GraphQLAPIResolverPolicyClientGetResponse, error)` +- New function `*GraphQLAPIResolverPolicyClient.GetEntityTag(context.Context, string, string, string, string, PolicyIDName, *GraphQLAPIResolverPolicyClientGetEntityTagOptions) (GraphQLAPIResolverPolicyClientGetEntityTagResponse, error)` +- New function `*GraphQLAPIResolverPolicyClient.NewListByResolverPager(string, string, string, string, *GraphQLAPIResolverPolicyClientListByResolverOptions) *runtime.Pager[GraphQLAPIResolverPolicyClientListByResolverResponse]` +- New function `NewPolicyFragmentClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PolicyFragmentClient, error)` +- New function `*PolicyFragmentClient.BeginCreateOrUpdate(context.Context, string, string, string, PolicyFragmentContract, *PolicyFragmentClientBeginCreateOrUpdateOptions) (*runtime.Poller[PolicyFragmentClientCreateOrUpdateResponse], error)` +- New function `*PolicyFragmentClient.Delete(context.Context, string, string, string, string, *PolicyFragmentClientDeleteOptions) (PolicyFragmentClientDeleteResponse, error)` +- New function `*PolicyFragmentClient.Get(context.Context, string, string, string, *PolicyFragmentClientGetOptions) (PolicyFragmentClientGetResponse, error)` +- New function `*PolicyFragmentClient.GetEntityTag(context.Context, string, string, string, *PolicyFragmentClientGetEntityTagOptions) (PolicyFragmentClientGetEntityTagResponse, error)` +- New function `*PolicyFragmentClient.ListByService(context.Context, string, string, *PolicyFragmentClientListByServiceOptions) (PolicyFragmentClientListByServiceResponse, error)` +- New function `*PolicyFragmentClient.ListReferences(context.Context, string, string, string, *PolicyFragmentClientListReferencesOptions) (PolicyFragmentClientListReferencesResponse, error)` +- New function `NewPortalConfigClient(string, azcore.TokenCredential, *arm.ClientOptions) (*PortalConfigClient, error)` +- New function `*PortalConfigClient.CreateOrUpdate(context.Context, string, string, string, string, PortalConfigContract, *PortalConfigClientCreateOrUpdateOptions) (PortalConfigClientCreateOrUpdateResponse, error)` +- New function `*PortalConfigClient.Get(context.Context, string, string, string, *PortalConfigClientGetOptions) (PortalConfigClientGetResponse, error)` +- New function `*PortalConfigClient.GetEntityTag(context.Context, string, string, string, *PortalConfigClientGetEntityTagOptions) (PortalConfigClientGetEntityTagResponse, error)` +- New function `*PortalConfigClient.ListByService(context.Context, string, string, *PortalConfigClientListByServiceOptions) (PortalConfigClientListByServiceResponse, error)` +- New function `*PortalConfigClient.Update(context.Context, string, string, string, string, PortalConfigContract, *PortalConfigClientUpdateOptions) (PortalConfigClientUpdateResponse, error)` +- New function `NewProductWikiClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ProductWikiClient, error)` +- New function `*ProductWikiClient.CreateOrUpdate(context.Context, string, string, string, WikiContract, *ProductWikiClientCreateOrUpdateOptions) (ProductWikiClientCreateOrUpdateResponse, error)` +- New function `*ProductWikiClient.Delete(context.Context, string, string, string, string, *ProductWikiClientDeleteOptions) (ProductWikiClientDeleteResponse, error)` +- New function `*ProductWikiClient.Get(context.Context, string, string, string, *ProductWikiClientGetOptions) (ProductWikiClientGetResponse, error)` +- New function `*ProductWikiClient.GetEntityTag(context.Context, string, string, string, *ProductWikiClientGetEntityTagOptions) (ProductWikiClientGetEntityTagResponse, error)` +- New function `*ProductWikiClient.Update(context.Context, string, string, string, string, WikiUpdateContract, *ProductWikiClientUpdateOptions) (ProductWikiClientUpdateResponse, error)` +- New function `NewProductWikisClient(string, azcore.TokenCredential, *arm.ClientOptions) (*ProductWikisClient, error)` +- New function `*ProductWikisClient.NewListPager(string, string, string, *ProductWikisClientListOptions) *runtime.Pager[ProductWikisClientListResponse]` +- New function `*ServiceClient.BeginMigrateToStv2(context.Context, string, string, *ServiceClientBeginMigrateToStv2Options) (*runtime.Poller[ServiceClientMigrateToStv2Response], error)` +- New struct `APIWikiClient` +- New struct `APIWikisClient` +- New struct `APIWikisClientListResponse` +- New struct `AuthorizationAccessPolicyClient` +- New struct `AuthorizationAccessPolicyClientListByAuthorizationResponse` +- New struct `AuthorizationAccessPolicyCollection` +- New struct `AuthorizationAccessPolicyContract` +- New struct `AuthorizationAccessPolicyContractProperties` +- New struct `AuthorizationClient` +- New struct `AuthorizationClientListByAuthorizationProviderResponse` +- New struct `AuthorizationCollection` +- New struct `AuthorizationConfirmConsentCodeRequestContract` +- New struct `AuthorizationContract` +- New struct `AuthorizationContractProperties` +- New struct `AuthorizationError` +- New struct `AuthorizationLoginLinksClient` +- New struct `AuthorizationLoginRequestContract` +- New struct `AuthorizationLoginResponseContract` +- New struct `AuthorizationProviderClient` +- New struct `AuthorizationProviderClientListByServiceResponse` +- New struct `AuthorizationProviderCollection` +- New struct `AuthorizationProviderContract` +- New struct `AuthorizationProviderContractProperties` +- New struct `AuthorizationProviderOAuth2GrantTypes` +- New struct `AuthorizationProviderOAuth2Settings` +- New struct `DocumentationClient` +- New struct `DocumentationClientListByServiceResponse` +- New struct `DocumentationCollection` +- New struct `DocumentationContract` +- New struct `DocumentationContractProperties` +- New struct `DocumentationUpdateContract` +- New struct `GraphQLAPIResolverClient` +- New struct `GraphQLAPIResolverClientListByAPIResponse` +- New struct `GraphQLAPIResolverPolicyClient` +- New struct `GraphQLAPIResolverPolicyClientListByResolverResponse` +- New struct `PolicyFragmentClient` +- New struct `PolicyFragmentClientCreateOrUpdateResponse` +- New struct `PolicyFragmentCollection` +- New struct `PolicyFragmentContract` +- New struct `PolicyFragmentContractProperties` +- New struct `PortalConfigClient` +- New struct `PortalConfigCollection` +- New struct `PortalConfigContract` +- New struct `PortalConfigCorsProperties` +- New struct `PortalConfigCspProperties` +- New struct `PortalConfigDelegationProperties` +- New struct `PortalConfigProperties` +- New struct `PortalConfigPropertiesSignin` +- New struct `PortalConfigPropertiesSignup` +- New struct `PortalConfigTermsOfServiceProperties` +- New struct `ProductWikiClient` +- New struct `ProductWikisClient` +- New struct `ProductWikisClientListResponse` +- New struct `ProxyResource` +- New struct `ResolverCollection` +- New struct `ResolverContract` +- New struct `ResolverEntityBaseContract` +- New struct `ResolverResultContract` +- New struct `ResolverResultContractProperties` +- New struct `ResolverResultLogItemContract` +- New struct `ResolverUpdateContract` +- New struct `ResolverUpdateContractProperties` +- New struct `ResourceCollection` +- New struct `ResourceCollectionValueItem` +- New struct `ServiceClientMigrateToStv2Response` +- New struct `WikiCollection` +- New struct `WikiContract` +- New struct `WikiContractProperties` +- New struct `WikiDocumentationContract` +- New struct `WikiUpdateContract` +- New field `TranslateRequiredQueryParametersConduct` in struct `APICreateOrUpdateProperties` +- New field `NatGatewayState` in struct `AdditionalLocation` +- New field `OutboundPublicIPAddresses` in struct `AdditionalLocation` +- New field `OAuth2AuthenticationSettings` in struct `AuthenticationSettingsContract` +- New field `OpenidAuthenticationSettings` in struct `AuthenticationSettingsContract` +- New field `UseInAPIDocumentation` in struct `AuthorizationServerContractProperties` +- New field `UseInTestConsole` in struct `AuthorizationServerContractProperties` +- New field `UseInAPIDocumentation` in struct `AuthorizationServerUpdateContractProperties` +- New field `UseInTestConsole` in struct `AuthorizationServerUpdateContractProperties` +- New field `Metrics` in struct `DiagnosticContractProperties` +- New field `ClientLibrary` in struct `IdentityProviderBaseParameters` +- New field `ClientLibrary` in struct `IdentityProviderContractProperties` +- New field `ClientLibrary` in struct `IdentityProviderCreateContractProperties` +- New field `ClientLibrary` in struct `IdentityProviderUpdateProperties` +- New field `UseInAPIDocumentation` in struct `OpenidConnectProviderContractProperties` +- New field `UseInTestConsole` in struct `OpenidConnectProviderContractProperties` +- New field `UseInAPIDocumentation` in struct `OpenidConnectProviderUpdateContractProperties` +- New field `UseInTestConsole` in struct `OpenidConnectProviderUpdateContractProperties` +- New field `NatGatewayState` in struct `ServiceBaseProperties` +- New field `OutboundPublicIPAddresses` in struct `ServiceBaseProperties` +- New field `NatGatewayState` in struct `ServiceProperties` +- New field `OutboundPublicIPAddresses` in struct `ServiceProperties` +- New field `NatGatewayState` in struct `ServiceUpdateProperties` +- New field `OutboundPublicIPAddresses` in struct `ServiceUpdateProperties` + + ## 1.0.0 (2022-05-17) The package of `github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement` 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/apimanagement/armapimanagement/zz_generated_api_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/api_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_api_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/api_client.go index 6cb4fb0957c6..8806170fc469 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_api_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/api_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 armapimanagement @@ -32,10 +33,9 @@ type APIClient struct { } // NewAPIClient creates a new instance of APIClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewAPIClient(subscriptionID string, credential azcore.TokenCredential, opti // BeginCreateOrUpdate - Creates new or updates existing specified API of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// parameters - Create or update parameters. -// options - APIClientBeginCreateOrUpdateOptions contains the optional parameters for the APIClient.BeginCreateOrUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - parameters - Create or update parameters. +// - options - APIClientBeginCreateOrUpdateOptions contains the optional parameters for the APIClient.BeginCreateOrUpdate method. func (client *APIClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, parameters APICreateOrUpdateParameter, options *APIClientBeginCreateOrUpdateOptions) (*runtime.Poller[APIClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, apiID, parameters, options) @@ -81,7 +82,8 @@ func (client *APIClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupN // CreateOrUpdate - Creates new or updates existing specified API of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *APIClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, parameters APICreateOrUpdateParameter, options *APIClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, parameters, options) if err != nil { @@ -121,7 +123,7 @@ func (client *APIClient) createOrUpdateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -132,14 +134,15 @@ func (client *APIClient) createOrUpdateCreateRequest(ctx context.Context, resour // Delete - Deletes the specified API of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - APIClientDeleteOptions contains the optional parameters for the APIClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APIClientDeleteOptions contains the optional parameters for the APIClient.Delete method. func (client *APIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, options *APIClientDeleteOptions) (APIClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, ifMatch, options) if err != nil { @@ -182,7 +185,7 @@ func (client *APIClient) deleteCreateRequest(ctx context.Context, resourceGroupN if options != nil && options.DeleteRevisions != nil { reqQP.Set("deleteRevisions", strconv.FormatBool(*options.DeleteRevisions)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -191,12 +194,13 @@ func (client *APIClient) deleteCreateRequest(ctx context.Context, resourceGroupN // Get - Gets the details of the API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// options - APIClientGetOptions contains the optional parameters for the APIClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - APIClientGetOptions contains the optional parameters for the APIClient.Get method. func (client *APIClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIClientGetOptions) (APIClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, options) if err != nil { @@ -236,7 +240,7 @@ func (client *APIClient) getCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,12 +259,13 @@ func (client *APIClient) getHandleResponse(resp *http.Response) (APIClientGetRes } // GetEntityTag - Gets the entity state (Etag) version of the API specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// options - APIClientGetEntityTagOptions contains the optional parameters for the APIClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - APIClientGetEntityTagOptions contains the optional parameters for the APIClient.GetEntityTag method. func (client *APIClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIClientGetEntityTagOptions) (APIClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, options) if err != nil { @@ -300,7 +305,7 @@ func (client *APIClient) getEntityTagCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -317,11 +322,11 @@ func (client *APIClient) getEntityTagHandleResponse(resp *http.Response) (APICli } // NewListByServicePager - Lists all APIs of the API Management service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - APIClientListByServiceOptions contains the optional parameters for the APIClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - APIClientListByServiceOptions contains the optional parameters for the APIClient.NewListByServicePager method. func (client *APIClient) NewListByServicePager(resourceGroupName string, serviceName string, options *APIClientListByServiceOptions) *runtime.Pager[APIClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[APIClientListByServiceResponse]{ More: func(page APIClientListByServiceResponse) bool { @@ -385,7 +390,7 @@ func (client *APIClient) listByServiceCreateRequest(ctx context.Context, resourc if options != nil && options.ExpandAPIVersionSet != nil { reqQP.Set("expandApiVersionSet", strconv.FormatBool(*options.ExpandAPIVersionSet)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -401,11 +406,11 @@ func (client *APIClient) listByServiceHandleResponse(resp *http.Response) (APICl } // NewListByTagsPager - Lists a collection of apis associated with tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - APIClientListByTagsOptions contains the optional parameters for the APIClient.ListByTags method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - APIClientListByTagsOptions contains the optional parameters for the APIClient.NewListByTagsPager method. func (client *APIClient) NewListByTagsPager(resourceGroupName string, serviceName string, options *APIClientListByTagsOptions) *runtime.Pager[APIClientListByTagsResponse] { return runtime.NewPager(runtime.PagingHandler[APIClientListByTagsResponse]{ More: func(page APIClientListByTagsResponse) bool { @@ -466,7 +471,7 @@ func (client *APIClient) listByTagsCreateRequest(ctx context.Context, resourceGr if options != nil && options.IncludeNotTaggedApis != nil { reqQP.Set("includeNotTaggedApis", strconv.FormatBool(*options.IncludeNotTaggedApis)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -483,15 +488,16 @@ func (client *APIClient) listByTagsHandleResponse(resp *http.Response) (APIClien // Update - Updates the specified API of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - API Update Contract parameters. -// options - APIClientUpdateOptions contains the optional parameters for the APIClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - API Update Contract parameters. +// - options - APIClientUpdateOptions contains the optional parameters for the APIClient.Update method. func (client *APIClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, parameters APIUpdateContract, options *APIClientUpdateOptions) (APIClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, ifMatch, parameters, options) if err != nil { @@ -531,7 +537,7 @@ func (client *APIClient) updateCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apidiagnostic_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apidiagnostic_client.go similarity index 83% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apidiagnostic_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apidiagnostic_client.go index 4a183fb876a5..098b315752b8 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apidiagnostic_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apidiagnostic_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 armapimanagement @@ -32,10 +33,9 @@ type APIDiagnosticClient struct { } // NewAPIDiagnosticClient creates a new instance of APIDiagnosticClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIDiagnosticClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIDiagnosticClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +58,15 @@ func NewAPIDiagnosticClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates a new Diagnostic for an API or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. -// parameters - Create parameters. -// options - APIDiagnosticClientCreateOrUpdateOptions contains the optional parameters for the APIDiagnosticClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - APIDiagnosticClientCreateOrUpdateOptions contains the optional parameters for the APIDiagnosticClient.CreateOrUpdate +// method. func (client *APIDiagnosticClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, parameters DiagnosticContract, options *APIDiagnosticClientCreateOrUpdateOptions) (APIDiagnosticClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, diagnosticID, parameters, options) if err != nil { @@ -109,7 +110,7 @@ func (client *APIDiagnosticClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -132,14 +133,15 @@ func (client *APIDiagnosticClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes the specified Diagnostic from an API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - APIDiagnosticClientDeleteOptions contains the optional parameters for the APIDiagnosticClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APIDiagnosticClientDeleteOptions contains the optional parameters for the APIDiagnosticClient.Delete method. func (client *APIDiagnosticClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, ifMatch string, options *APIDiagnosticClientDeleteOptions) (APIDiagnosticClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, diagnosticID, ifMatch, options) if err != nil { @@ -183,7 +185,7 @@ func (client *APIDiagnosticClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -192,12 +194,13 @@ func (client *APIDiagnosticClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the details of the Diagnostic for an API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. -// options - APIDiagnosticClientGetOptions contains the optional parameters for the APIDiagnosticClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. +// - options - APIDiagnosticClientGetOptions contains the optional parameters for the APIDiagnosticClient.Get method. func (client *APIDiagnosticClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, options *APIDiagnosticClientGetOptions) (APIDiagnosticClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, diagnosticID, options) if err != nil { @@ -241,7 +244,7 @@ func (client *APIDiagnosticClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,13 +263,14 @@ func (client *APIDiagnosticClient) getHandleResponse(resp *http.Response) (APIDi } // GetEntityTag - Gets the entity state (Etag) version of the Diagnostic for an API specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. -// options - APIDiagnosticClientGetEntityTagOptions contains the optional parameters for the APIDiagnosticClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. +// - options - APIDiagnosticClientGetEntityTagOptions contains the optional parameters for the APIDiagnosticClient.GetEntityTag +// method. func (client *APIDiagnosticClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, options *APIDiagnosticClientGetEntityTagOptions) (APIDiagnosticClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, diagnosticID, options) if err != nil { @@ -310,7 +314,7 @@ func (client *APIDiagnosticClient) getEntityTagCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -327,13 +331,13 @@ func (client *APIDiagnosticClient) getEntityTagHandleResponse(resp *http.Respons } // NewListByServicePager - Lists all diagnostics of an API. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// options - APIDiagnosticClientListByServiceOptions contains the optional parameters for the APIDiagnosticClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - APIDiagnosticClientListByServiceOptions contains the optional parameters for the APIDiagnosticClient.NewListByServicePager +// method. func (client *APIDiagnosticClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, options *APIDiagnosticClientListByServiceOptions) *runtime.Pager[APIDiagnosticClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[APIDiagnosticClientListByServiceResponse]{ More: func(page APIDiagnosticClientListByServiceResponse) bool { @@ -395,7 +399,7 @@ func (client *APIDiagnosticClient) listByServiceCreateRequest(ctx context.Contex if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -412,15 +416,16 @@ func (client *APIDiagnosticClient) listByServiceHandleResponse(resp *http.Respon // Update - Updates the details of the Diagnostic for an API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Diagnostic Update parameters. -// options - APIDiagnosticClientUpdateOptions contains the optional parameters for the APIDiagnosticClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Diagnostic Update parameters. +// - options - APIDiagnosticClientUpdateOptions contains the optional parameters for the APIDiagnosticClient.Update method. func (client *APIDiagnosticClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, diagnosticID string, ifMatch string, parameters DiagnosticContract, options *APIDiagnosticClientUpdateOptions) (APIDiagnosticClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, diagnosticID, ifMatch, parameters, options) if err != nil { @@ -464,7 +469,7 @@ func (client *APIDiagnosticClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiexport_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiexport_client.go similarity index 82% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiexport_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apiexport_client.go index 17346a9eb1be..fb7a648c2721 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiexport_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiexport_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 armapimanagement @@ -31,10 +32,9 @@ type APIExportClient struct { } // NewAPIExportClient creates a new instance of APIExportClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIExportClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIExportClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +58,15 @@ func NewAPIExportClient(subscriptionID string, credential azcore.TokenCredential // Get - Gets the details of the API specified by its identifier in the format specified to the Storage Blob with SAS Key // valid for 5 minutes. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// formatParam - Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. -// export - Query parameter required to export the API details. -// options - APIExportClientGetOptions contains the optional parameters for the APIExportClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - formatParam - Format in which to export the Api Details to the Storage Blob with Sas Key valid for 5 minutes. +// - export - Query parameter required to export the API details. +// - options - APIExportClientGetOptions contains the optional parameters for the APIExportClient.Get method. func (client *APIExportClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, formatParam ExportFormat, export ExportAPI, options *APIExportClientGetOptions) (APIExportClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, formatParam, export, options) if err != nil { @@ -107,7 +108,7 @@ func (client *APIExportClient) getCreateRequest(ctx context.Context, resourceGro reqQP := req.Raw().URL.Query() reqQP.Set("format", string(formatParam)) reqQP.Set("export", string(export)) - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiissue_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiissue_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiissue_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apiissue_client.go index 1bef589aa9ce..c445768b7662 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiissue_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiissue_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 armapimanagement @@ -32,10 +33,9 @@ type APIIssueClient struct { } // NewAPIIssueClient creates a new instance of APIIssueClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIIssueClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIIssueClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewAPIIssueClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates a new Issue for an API or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// parameters - Create parameters. -// options - APIIssueClientCreateOrUpdateOptions contains the optional parameters for the APIIssueClient.CreateOrUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - APIIssueClientCreateOrUpdateOptions contains the optional parameters for the APIIssueClient.CreateOrUpdate method. func (client *APIIssueClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, parameters IssueContract, options *APIIssueClientCreateOrUpdateOptions) (APIIssueClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, parameters, options) if err != nil { @@ -108,7 +109,7 @@ func (client *APIIssueClient) createOrUpdateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -131,14 +132,15 @@ func (client *APIIssueClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes the specified Issue from an API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - APIIssueClientDeleteOptions contains the optional parameters for the APIIssueClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APIIssueClientDeleteOptions contains the optional parameters for the APIIssueClient.Delete method. func (client *APIIssueClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, ifMatch string, options *APIIssueClientDeleteOptions) (APIIssueClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, ifMatch, options) if err != nil { @@ -182,7 +184,7 @@ func (client *APIIssueClient) deleteCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -191,12 +193,13 @@ func (client *APIIssueClient) deleteCreateRequest(ctx context.Context, resourceG // Get - Gets the details of the Issue for an API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// options - APIIssueClientGetOptions contains the optional parameters for the APIIssueClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - options - APIIssueClientGetOptions contains the optional parameters for the APIIssueClient.Get method. func (client *APIIssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, options *APIIssueClientGetOptions) (APIIssueClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, options) if err != nil { @@ -243,7 +246,7 @@ func (client *APIIssueClient) getCreateRequest(ctx context.Context, resourceGrou if options != nil && options.ExpandCommentsAttachments != nil { reqQP.Set("expandCommentsAttachments", strconv.FormatBool(*options.ExpandCommentsAttachments)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,12 +265,13 @@ func (client *APIIssueClient) getHandleResponse(resp *http.Response) (APIIssueCl } // GetEntityTag - Gets the entity state (Etag) version of the Issue for an API specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// options - APIIssueClientGetEntityTagOptions contains the optional parameters for the APIIssueClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - options - APIIssueClientGetEntityTagOptions contains the optional parameters for the APIIssueClient.GetEntityTag method. func (client *APIIssueClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, options *APIIssueClientGetEntityTagOptions) (APIIssueClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, options) if err != nil { @@ -311,7 +315,7 @@ func (client *APIIssueClient) getEntityTagCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,12 +332,13 @@ func (client *APIIssueClient) getEntityTagHandleResponse(resp *http.Response) (A } // NewListByServicePager - Lists all issues associated with the specified API. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// options - APIIssueClientListByServiceOptions contains the optional parameters for the APIIssueClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - APIIssueClientListByServiceOptions contains the optional parameters for the APIIssueClient.NewListByServicePager +// method. func (client *APIIssueClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, options *APIIssueClientListByServiceOptions) *runtime.Pager[APIIssueClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[APIIssueClientListByServiceResponse]{ More: func(page APIIssueClientListByServiceResponse) bool { @@ -398,7 +403,7 @@ func (client *APIIssueClient) listByServiceCreateRequest(ctx context.Context, re if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -415,15 +420,16 @@ func (client *APIIssueClient) listByServiceHandleResponse(resp *http.Response) ( // Update - Updates an existing issue for an API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - APIIssueClientUpdateOptions contains the optional parameters for the APIIssueClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - APIIssueClientUpdateOptions contains the optional parameters for the APIIssueClient.Update method. func (client *APIIssueClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, ifMatch string, parameters IssueUpdateContract, options *APIIssueClientUpdateOptions) (APIIssueClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, ifMatch, parameters, options) if err != nil { @@ -467,7 +473,7 @@ func (client *APIIssueClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiissueattachment_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiissueattachment_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiissueattachment_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apiissueattachment_client.go index 41a562a5fd97..74636d10650b 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiissueattachment_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiissueattachment_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 armapimanagement @@ -32,10 +33,9 @@ type APIIssueAttachmentClient struct { } // NewAPIIssueAttachmentClient creates a new instance of APIIssueAttachmentClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIIssueAttachmentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIIssueAttachmentClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,15 +58,16 @@ func NewAPIIssueAttachmentClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Creates a new Attachment for the Issue in an API or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue. -// parameters - Create parameters. -// options - APIIssueAttachmentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueAttachmentClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue. +// - parameters - Create parameters. +// - options - APIIssueAttachmentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueAttachmentClient.CreateOrUpdate +// method. func (client *APIIssueAttachmentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, attachmentID string, parameters IssueAttachmentContract, options *APIIssueAttachmentClientCreateOrUpdateOptions) (APIIssueAttachmentClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, attachmentID, parameters, options) if err != nil { @@ -114,7 +115,7 @@ func (client *APIIssueAttachmentClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -137,16 +138,17 @@ func (client *APIIssueAttachmentClient) createOrUpdateHandleResponse(resp *http. // Delete - Deletes the specified comment from an Issue. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - APIIssueAttachmentClientDeleteOptions contains the optional parameters for the APIIssueAttachmentClient.Delete -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APIIssueAttachmentClientDeleteOptions contains the optional parameters for the APIIssueAttachmentClient.Delete +// method. func (client *APIIssueAttachmentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, attachmentID string, ifMatch string, options *APIIssueAttachmentClientDeleteOptions) (APIIssueAttachmentClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, attachmentID, ifMatch, options) if err != nil { @@ -194,7 +196,7 @@ func (client *APIIssueAttachmentClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -203,13 +205,14 @@ func (client *APIIssueAttachmentClient) deleteCreateRequest(ctx context.Context, // Get - Gets the details of the issue Attachment for an API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue. -// options - APIIssueAttachmentClientGetOptions contains the optional parameters for the APIIssueAttachmentClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue. +// - options - APIIssueAttachmentClientGetOptions contains the optional parameters for the APIIssueAttachmentClient.Get method. func (client *APIIssueAttachmentClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, attachmentID string, options *APIIssueAttachmentClientGetOptions) (APIIssueAttachmentClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, attachmentID, options) if err != nil { @@ -257,7 +260,7 @@ func (client *APIIssueAttachmentClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -276,14 +279,15 @@ func (client *APIIssueAttachmentClient) getHandleResponse(resp *http.Response) ( } // GetEntityTag - Gets the entity state (Etag) version of the issue Attachment for an API specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue. -// options - APIIssueAttachmentClientGetEntityTagOptions contains the optional parameters for the APIIssueAttachmentClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - attachmentID - Attachment identifier within an Issue. Must be unique in the current Issue. +// - options - APIIssueAttachmentClientGetEntityTagOptions contains the optional parameters for the APIIssueAttachmentClient.GetEntityTag +// method. func (client *APIIssueAttachmentClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, attachmentID string, options *APIIssueAttachmentClientGetEntityTagOptions) (APIIssueAttachmentClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, attachmentID, options) if err != nil { @@ -331,7 +335,7 @@ func (client *APIIssueAttachmentClient) getEntityTagCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -348,14 +352,14 @@ func (client *APIIssueAttachmentClient) getEntityTagHandleResponse(resp *http.Re } // NewListByServicePager - Lists all attachments for the Issue associated with the specified API. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// options - APIIssueAttachmentClientListByServiceOptions contains the optional parameters for the APIIssueAttachmentClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - options - APIIssueAttachmentClientListByServiceOptions contains the optional parameters for the APIIssueAttachmentClient.NewListByServicePager +// method. func (client *APIIssueAttachmentClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, issueID string, options *APIIssueAttachmentClientListByServiceOptions) *runtime.Pager[APIIssueAttachmentClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[APIIssueAttachmentClientListByServiceResponse]{ More: func(page APIIssueAttachmentClientListByServiceResponse) bool { @@ -421,7 +425,7 @@ func (client *APIIssueAttachmentClient) listByServiceCreateRequest(ctx context.C if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiissuecomment_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiissuecomment_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiissuecomment_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apiissuecomment_client.go index 08d993ba34a1..aa1ccecfa61a 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiissuecomment_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiissuecomment_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 armapimanagement @@ -32,10 +33,9 @@ type APIIssueCommentClient struct { } // NewAPIIssueCommentClient creates a new instance of APIIssueCommentClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIIssueCommentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIIssueCommentClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,15 +58,16 @@ func NewAPIIssueCommentClient(subscriptionID string, credential azcore.TokenCred // CreateOrUpdate - Creates a new Comment for the Issue in an API or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// commentID - Comment identifier within an Issue. Must be unique in the current Issue. -// parameters - Create parameters. -// options - APIIssueCommentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueCommentClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - commentID - Comment identifier within an Issue. Must be unique in the current Issue. +// - parameters - Create parameters. +// - options - APIIssueCommentClientCreateOrUpdateOptions contains the optional parameters for the APIIssueCommentClient.CreateOrUpdate +// method. func (client *APIIssueCommentClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, commentID string, parameters IssueCommentContract, options *APIIssueCommentClientCreateOrUpdateOptions) (APIIssueCommentClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, commentID, parameters, options) if err != nil { @@ -114,7 +115,7 @@ func (client *APIIssueCommentClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -137,15 +138,16 @@ func (client *APIIssueCommentClient) createOrUpdateHandleResponse(resp *http.Res // Delete - Deletes the specified comment from an Issue. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// commentID - Comment identifier within an Issue. Must be unique in the current Issue. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - APIIssueCommentClientDeleteOptions contains the optional parameters for the APIIssueCommentClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - commentID - Comment identifier within an Issue. Must be unique in the current Issue. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APIIssueCommentClientDeleteOptions contains the optional parameters for the APIIssueCommentClient.Delete method. func (client *APIIssueCommentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, commentID string, ifMatch string, options *APIIssueCommentClientDeleteOptions) (APIIssueCommentClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, commentID, ifMatch, options) if err != nil { @@ -193,7 +195,7 @@ func (client *APIIssueCommentClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -202,13 +204,14 @@ func (client *APIIssueCommentClient) deleteCreateRequest(ctx context.Context, re // Get - Gets the details of the issue Comment for an API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// commentID - Comment identifier within an Issue. Must be unique in the current Issue. -// options - APIIssueCommentClientGetOptions contains the optional parameters for the APIIssueCommentClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - commentID - Comment identifier within an Issue. Must be unique in the current Issue. +// - options - APIIssueCommentClientGetOptions contains the optional parameters for the APIIssueCommentClient.Get method. func (client *APIIssueCommentClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, commentID string, options *APIIssueCommentClientGetOptions) (APIIssueCommentClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, commentID, options) if err != nil { @@ -256,7 +259,7 @@ func (client *APIIssueCommentClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -275,14 +278,15 @@ func (client *APIIssueCommentClient) getHandleResponse(resp *http.Response) (API } // GetEntityTag - Gets the entity state (Etag) version of the issue Comment for an API specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// commentID - Comment identifier within an Issue. Must be unique in the current Issue. -// options - APIIssueCommentClientGetEntityTagOptions contains the optional parameters for the APIIssueCommentClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - commentID - Comment identifier within an Issue. Must be unique in the current Issue. +// - options - APIIssueCommentClientGetEntityTagOptions contains the optional parameters for the APIIssueCommentClient.GetEntityTag +// method. func (client *APIIssueCommentClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, issueID string, commentID string, options *APIIssueCommentClientGetEntityTagOptions) (APIIssueCommentClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, issueID, commentID, options) if err != nil { @@ -330,7 +334,7 @@ func (client *APIIssueCommentClient) getEntityTagCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -347,14 +351,14 @@ func (client *APIIssueCommentClient) getEntityTagHandleResponse(resp *http.Respo } // NewListByServicePager - Lists all comments for the Issue associated with the specified API. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// options - APIIssueCommentClientListByServiceOptions contains the optional parameters for the APIIssueCommentClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - options - APIIssueCommentClientListByServiceOptions contains the optional parameters for the APIIssueCommentClient.NewListByServicePager +// method. func (client *APIIssueCommentClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, issueID string, options *APIIssueCommentClientListByServiceOptions) *runtime.Pager[APIIssueCommentClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[APIIssueCommentClientListByServiceResponse]{ More: func(page APIIssueCommentClientListByServiceResponse) bool { @@ -420,7 +424,7 @@ func (client *APIIssueCommentClient) listByServiceCreateRequest(ctx context.Cont if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimapis_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimapis_live_test.go deleted file mode 100644 index db189ec8b063..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimapis_live_test.go +++ /dev/null @@ -1,493 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimapisTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - operationId string - apiId string - attachmentId string - commentId string - diagnosticId string - issueId string - releaseId string - schemaId string - serviceName string - tagDescriptionId string - tagId string - tagOperationId string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimapisTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.operationId = testutil.GenerateAlphaNumericID(testsuite.T(), "operationi", 6) - testsuite.apiId = testutil.GenerateAlphaNumericID(testsuite.T(), "apiid", 6) - testsuite.attachmentId = testutil.GenerateAlphaNumericID(testsuite.T(), "attachment", 6) - testsuite.commentId = testutil.GenerateAlphaNumericID(testsuite.T(), "commentid", 6) - testsuite.diagnosticId = testutil.GenerateAlphaNumericID(testsuite.T(), "diagnostic", 6) - testsuite.issueId = testutil.GenerateAlphaNumericID(testsuite.T(), "issueid", 6) - testsuite.releaseId = testutil.GenerateAlphaNumericID(testsuite.T(), "releaseid", 6) - testsuite.schemaId = testutil.GenerateAlphaNumericID(testsuite.T(), "schemaid", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicenam", 6) - testsuite.tagDescriptionId = testutil.GenerateAlphaNumericID(testsuite.T(), "tagdescrip", 6) - testsuite.tagId = testutil.GenerateAlphaNumericID(testsuite.T(), "tagid", 6) - testsuite.tagOperationId = testutil.GenerateAlphaNumericID(testsuite.T(), "tagoperation", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimapisTestSuite) TearDownSuite() { - testsuite.Cleanup() - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimapisTestSuite(t *testing.T) { - suite.Run(t, new(ApimapisTestSuite)) -} - -func (testsuite *ApimapisTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step Api_CreateOrUpdate - fmt.Println("Call operation: Api_CreateOrUpdate") - aPIClient, err := armapimanagement.NewAPIClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - aPIClientCreateOrUpdateResponsePoller, err := aPIClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, armapimanagement.APICreateOrUpdateParameter{ - Properties: &armapimanagement.APICreateOrUpdateProperties{ - Path: to.Ptr("petstore"), - Format: to.Ptr(armapimanagement.ContentFormatOpenapiLink), - Value: to.Ptr("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml"), - }, - }, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, aPIClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step ApiOperation_CreateOrUpdate - fmt.Println("Call operation: ApiOperation_CreateOrUpdate") - aPIOperationClient, err := armapimanagement.NewAPIOperationClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = aPIOperationClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, armapimanagement.OperationContract{ - Properties: &armapimanagement.OperationContractProperties{ - TemplateParameters: []*armapimanagement.ParameterContract{ - { - Name: to.Ptr("uid"), - Type: to.Ptr("string"), - Description: to.Ptr("user id"), - }}, - Method: to.Ptr("GET"), - DisplayName: to.Ptr("example operation"), - URLTemplate: to.Ptr("/operation/customers/{uid}"), - }, - }, &armapimanagement.APIOperationClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/apis -func (testsuite *ApimapisTestSuite) TestApi() { - var err error - // From step Api_GetEntityTag - fmt.Println("Call operation: Api_GetEntityTag") - aPIClient, err := armapimanagement.NewAPIClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = aPIClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, nil) - testsuite.Require().NoError(err) - - // From step Api_ListByService - fmt.Println("Call operation: Api_ListByService") - aPIClientNewListByServicePager := aPIClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.APIClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - Tags: nil, - ExpandAPIVersionSet: nil, - }) - for aPIClientNewListByServicePager.More() { - _, err := aPIClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Api_ListByTags - fmt.Println("Call operation: Api_ListByTags") - aPIClientNewListByTagsPager := aPIClient.NewListByTagsPager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.APIClientListByTagsOptions{Filter: nil, - Top: nil, - Skip: nil, - IncludeNotTaggedApis: nil, - }) - for aPIClientNewListByTagsPager.More() { - _, err := aPIClientNewListByTagsPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Api_Get - fmt.Println("Call operation: Api_Get") - _, err = aPIClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, nil) - testsuite.Require().NoError(err) - - // From step Api_Update - fmt.Println("Call operation: Api_Update") - _, err = aPIClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, "*", armapimanagement.APIUpdateContract{ - Properties: &armapimanagement.APIContractUpdateProperties{ - Path: to.Ptr("newecho"), - DisplayName: to.Ptr("Echo API New"), - ServiceURL: to.Ptr("http://echoapi.cloudapp.net/api2"), - }, - }, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/apis/tags -func (testsuite *ApimapisTestSuite) TestTag() { - var err error - // From step Tag_CreateOrUpdate - fmt.Println("Call operation: Tag_CreateOrUpdate") - tagClient, err := armapimanagement.NewTagClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = tagClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.tagId, armapimanagement.TagCreateUpdateParameters{ - Properties: &armapimanagement.TagContractProperties{ - DisplayName: to.Ptr("tag2"), - }, - }, &armapimanagement.TagClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step Tag_AssignToApi - fmt.Println("Call operation: Tag_AssignToApi") - _, err = tagClient.AssignToAPI(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.tagId, nil) - testsuite.Require().NoError(err) - - // From step Tag_GetEntityStateByApi - fmt.Println("Call operation: Tag_GetEntityStateByApi") - _, err = tagClient.GetEntityStateByAPI(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.tagId, nil) - testsuite.Require().NoError(err) - - // From step Tag_GetByApi - fmt.Println("Call operation: Tag_GetByApi") - _, err = tagClient.GetByAPI(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.tagId, nil) - testsuite.Require().NoError(err) - - // From step Tag_Delete - fmt.Println("Call operation: Tag_Delete") - _, err = tagClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.tagId, "*", nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/apis/releases -func (testsuite *ApimapisTestSuite) TestApirelease() { - var err error - // From step ApiRelease_CreateOrUpdate - fmt.Println("Call operation: ApiRelease_CreateOrUpdate") - aPIReleaseClient, err := armapimanagement.NewAPIReleaseClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = aPIReleaseClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.releaseId, armapimanagement.APIReleaseContract{ - Properties: &armapimanagement.APIReleaseContractProperties{ - APIID: to.Ptr("/subscriptions/" + testsuite.subscriptionId + "/resourceGroups/" + testsuite.resourceGroupName + "/providers/Microsoft.ApiManagement/service/" + testsuite.serviceName + "/apis/" + testsuite.apiId), - Notes: to.Ptr("yahooagain"), - }, - }, &armapimanagement.APIReleaseClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step ApiRelease_GetEntityTag - fmt.Println("Call operation: ApiRelease_GetEntityTag") - _, err = aPIReleaseClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.releaseId, nil) - testsuite.Require().NoError(err) - - // From step ApiRelease_ListByService - fmt.Println("Call operation: ApiRelease_ListByService") - aPIReleaseClientNewListByServicePager := aPIReleaseClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, &armapimanagement.APIReleaseClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for aPIReleaseClientNewListByServicePager.More() { - _, err := aPIReleaseClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step ApiRelease_Get - fmt.Println("Call operation: ApiRelease_Get") - _, err = aPIReleaseClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.releaseId, nil) - testsuite.Require().NoError(err) - - // From step ApiRelease_Update - fmt.Println("Call operation: ApiRelease_Update") - _, err = aPIReleaseClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.releaseId, "*", armapimanagement.APIReleaseContract{ - Properties: &armapimanagement.APIReleaseContractProperties{ - APIID: to.Ptr("/subscriptions/" + testsuite.subscriptionId + "/resourceGroups/" + testsuite.resourceGroupName + "/providers/Microsoft.ApiManagement/service/" + testsuite.serviceName + "/apis/" + testsuite.apiId), - Notes: to.Ptr("yahooagain"), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step ApiRelease_Delete - fmt.Println("Call operation: ApiRelease_Delete") - _, err = aPIReleaseClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.releaseId, "*", nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/apis/policies -func (testsuite *ApimapisTestSuite) TestApipolicy() { - var err error - // From step ApiPolicy_CreateOrUpdate - fmt.Println("Call operation: ApiPolicy_CreateOrUpdate") - aPIPolicyClient, err := armapimanagement.NewAPIPolicyClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = aPIPolicyClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, armapimanagement.PolicyIDNamePolicy, armapimanagement.PolicyContract{ - Properties: &armapimanagement.PolicyContractProperties{ - Value: to.Ptr(" "), - Format: to.Ptr(armapimanagement.PolicyContentFormatXML), - }, - }, &armapimanagement.APIPolicyClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")}) - testsuite.Require().NoError(err) - - // From step ApiPolicy_GetEntityTag - fmt.Println("Call operation: ApiPolicy_GetEntityTag") - _, err = aPIPolicyClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, armapimanagement.PolicyIDNamePolicy, nil) - testsuite.Require().NoError(err) - - // From step ApiPolicy_ListByApi - fmt.Println("Call operation: ApiPolicy_ListByApi") - _, err = aPIPolicyClient.ListByAPI(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, nil) - testsuite.Require().NoError(err) - - // From step ApiPolicy_Get - fmt.Println("Call operation: ApiPolicy_Get") - _, err = aPIPolicyClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, armapimanagement.PolicyIDNamePolicy, &armapimanagement.APIPolicyClientGetOptions{Format: nil}) - testsuite.Require().NoError(err) - - // From step ApiPolicy_Delete - fmt.Println("Call operation: ApiPolicy_Delete") - _, err = aPIPolicyClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, armapimanagement.PolicyIDNamePolicy, "*", nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/apis/schemas -func (testsuite *ApimapisTestSuite) TestApischema() { - var err error - // From step ApiSchema_CreateOrUpdate - fmt.Println("Call operation: ApiSchema_CreateOrUpdate") - aPISchemaClient, err := armapimanagement.NewAPISchemaClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - aPISchemaClientCreateOrUpdateResponsePoller, err := aPISchemaClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.schemaId, armapimanagement.SchemaContract{ - Properties: &armapimanagement.SchemaContractProperties{ - ContentType: to.Ptr("application/vnd.ms-azure-apim.xsd+xml"), - Document: &armapimanagement.SchemaDocumentProperties{ - Value: to.Ptr("\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"), - }, - }, - }, &armapimanagement.APISchemaClientBeginCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, aPISchemaClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step ApiSchema_GetEntityTag - fmt.Println("Call operation: ApiSchema_GetEntityTag") - _, err = aPISchemaClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.schemaId, nil) - testsuite.Require().NoError(err) - - // From step ApiSchema_ListByApi - fmt.Println("Call operation: ApiSchema_ListByApi") - aPISchemaClientNewListByAPIPager := aPISchemaClient.NewListByAPIPager(testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, &armapimanagement.APISchemaClientListByAPIOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for aPISchemaClientNewListByAPIPager.More() { - _, err := aPISchemaClientNewListByAPIPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step ApiSchema_Get - fmt.Println("Call operation: ApiSchema_Get") - _, err = aPISchemaClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.schemaId, nil) - testsuite.Require().NoError(err) - - // From step ApiSchema_Delete - fmt.Println("Call operation: ApiSchema_Delete") - _, err = aPISchemaClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.schemaId, "*", &armapimanagement.APISchemaClientDeleteOptions{Force: nil}) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/apis/operations -func (testsuite *ApimapisTestSuite) TestApioperation() { - var err error - // From step ApiOperation_GetEntityTag - fmt.Println("Call operation: ApiOperation_GetEntityTag") - aPIOperationClient, err := armapimanagement.NewAPIOperationClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = aPIOperationClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, nil) - testsuite.Require().NoError(err) - - // From step ApiOperation_ListByApi - fmt.Println("Call operation: ApiOperation_ListByApi") - aPIOperationClientNewListByAPIPager := aPIOperationClient.NewListByAPIPager(testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, &armapimanagement.APIOperationClientListByAPIOptions{Filter: nil, - Top: nil, - Skip: nil, - Tags: nil, - }) - for aPIOperationClientNewListByAPIPager.More() { - _, err := aPIOperationClientNewListByAPIPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step ApiOperation_Get - fmt.Println("Call operation: ApiOperation_Get") - _, err = aPIOperationClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, nil) - testsuite.Require().NoError(err) - - // From step ApiOperation_Update - fmt.Println("Call operation: ApiOperation_Update") - _, err = aPIOperationClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, "*", armapimanagement.OperationUpdateContract{ - Properties: &armapimanagement.OperationUpdateContractProperties{ - Description: to.Ptr("update description"), - }, - }, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/apis/operations/tags -func (testsuite *ApimapisTestSuite) TestOperationstag() { - var err error - // From step Tag_CreateOrUpdate - fmt.Println("Call operation: Tag_CreateOrUpdate") - tagClient, err := armapimanagement.NewTagClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = tagClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.tagOperationId, armapimanagement.TagCreateUpdateParameters{ - Properties: &armapimanagement.TagContractProperties{ - DisplayName: to.Ptr("tagoperation1"), - }, - }, &armapimanagement.TagClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step Tag_AssignToOperation - fmt.Println("Call operation: Tag_AssignToOperation") - _, err = tagClient.AssignToOperation(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, testsuite.tagOperationId, nil) - testsuite.Require().NoError(err) - - // From step Tag_GetEntityStateByOperation - fmt.Println("Call operation: Tag_GetEntityStateByOperation") - _, err = tagClient.GetEntityStateByOperation(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, testsuite.tagOperationId, nil) - testsuite.Require().NoError(err) - - // From step Tag_GetByOperation - fmt.Println("Call operation: Tag_GetByOperation") - _, err = tagClient.GetByOperation(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, testsuite.tagOperationId, nil) - testsuite.Require().NoError(err) - - // From step Tag_Delete - fmt.Println("Call operation: Tag_Delete") - _, err = tagClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.tagOperationId, "*", nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/apis/operations/policies -func (testsuite *ApimapisTestSuite) TestApioperationpolicy() { - var err error - // From step ApiOperationPolicy_CreateOrUpdate - fmt.Println("Call operation: ApiOperationPolicy_CreateOrUpdate") - aPIOperationPolicyClient, err := armapimanagement.NewAPIOperationPolicyClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = aPIOperationPolicyClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, armapimanagement.PolicyIDNamePolicy, armapimanagement.PolicyContract{ - Properties: &armapimanagement.PolicyContractProperties{ - Value: to.Ptr(" "), - Format: to.Ptr(armapimanagement.PolicyContentFormatXML), - }, - }, &armapimanagement.APIOperationPolicyClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")}) - testsuite.Require().NoError(err) - - // From step ApiOperationPolicy_GetEntityTag - fmt.Println("Call operation: ApiOperationPolicy_GetEntityTag") - _, err = aPIOperationPolicyClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, armapimanagement.PolicyIDNamePolicy, nil) - testsuite.Require().NoError(err) - - // From step ApiOperationPolicy_ListByOperation - fmt.Println("Call operation: ApiOperationPolicy_ListByOperation") - _, err = aPIOperationPolicyClient.ListByOperation(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, nil) - testsuite.Require().NoError(err) - - // From step ApiOperationPolicy_Get - fmt.Println("Call operation: ApiOperationPolicy_Get") - _, err = aPIOperationPolicyClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, armapimanagement.PolicyIDNamePolicy, &armapimanagement.APIOperationPolicyClientGetOptions{Format: nil}) - testsuite.Require().NoError(err) - - // From step ApiOperationPolicy_Delete - fmt.Println("Call operation: ApiOperationPolicy_Delete") - _, err = aPIOperationPolicyClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, armapimanagement.PolicyIDNamePolicy, "*", nil) - testsuite.Require().NoError(err) -} - -func (testsuite *ApimapisTestSuite) Cleanup() { - var err error - // From step ApiOperation_Delete - fmt.Println("Call operation: ApiOperation_Delete") - aPIOperationClient, err := armapimanagement.NewAPIOperationClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = aPIOperationClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, testsuite.operationId, "*", nil) - testsuite.Require().NoError(err) - - // From step Api_Delete - fmt.Println("Call operation: Api_Delete") - aPIClient, err := armapimanagement.NewAPIClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = aPIClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, "*", &armapimanagement.APIClientDeleteOptions{DeleteRevisions: nil}) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimapiversionsets_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimapiversionsets_live_test.go deleted file mode 100644 index 4299b7f2fd66..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimapiversionsets_live_test.go +++ /dev/null @@ -1,142 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimapiversionsetsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - serviceName string - versionSetId string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimapiversionsetsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "serviceapiversionsets", 6) - testsuite.versionSetId = testutil.GenerateAlphaNumericID(testsuite.T(), "versionset", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimapiversionsetsTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimapiversionsetsTestSuite(t *testing.T) { - suite.Run(t, new(ApimapiversionsetsTestSuite)) -} - -func (testsuite *ApimapiversionsetsTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/apiVersionSets -func (testsuite *ApimapiversionsetsTestSuite) TestApiversionset() { - var err error - // From step ApiVersionSet_CreateOrUpdate - fmt.Println("Call operation: ApiVersionSet_CreateOrUpdate") - aPIVersionSetClient, err := armapimanagement.NewAPIVersionSetClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = aPIVersionSetClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.versionSetId, armapimanagement.APIVersionSetContract{ - Properties: &armapimanagement.APIVersionSetContractProperties{ - DisplayName: to.Ptr("api set 1"), - VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeSegment), - Description: to.Ptr("Version configuration"), - }, - }, &armapimanagement.APIVersionSetClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step ApiVersionSet_GetEntityTag - fmt.Println("Call operation: ApiVersionSet_GetEntityTag") - _, err = aPIVersionSetClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.versionSetId, nil) - testsuite.Require().NoError(err) - - // From step ApiVersionSet_ListByService - fmt.Println("Call operation: ApiVersionSet_ListByService") - aPIVersionSetClientNewListByServicePager := aPIVersionSetClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.APIVersionSetClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for aPIVersionSetClientNewListByServicePager.More() { - _, err := aPIVersionSetClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step ApiVersionSet_Get - fmt.Println("Call operation: ApiVersionSet_Get") - _, err = aPIVersionSetClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.versionSetId, nil) - testsuite.Require().NoError(err) - - // From step ApiVersionSet_Update - fmt.Println("Call operation: ApiVersionSet_Update") - _, err = aPIVersionSetClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.versionSetId, "*", armapimanagement.APIVersionSetUpdateParameters{ - Properties: &armapimanagement.APIVersionSetUpdateParametersProperties{ - Description: to.Ptr("Version configuration"), - DisplayName: to.Ptr("api set 1"), - VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeSegment), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step ApiVersionSet_Delete - fmt.Println("Call operation: ApiVersionSet_Delete") - _, err = aPIVersionSetClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.versionSetId, "*", nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimauthorizationservers_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimauthorizationservers_live_test.go deleted file mode 100644 index 4152c8668190..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimauthorizationservers_live_test.go +++ /dev/null @@ -1,160 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimauthorizationserversTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - authsid string - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimauthorizationserversTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.authsid = testutil.GenerateAlphaNumericID(testsuite.T(), "authsid", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "serviceauth", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimauthorizationserversTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimauthorizationserversTestSuite(t *testing.T) { - suite.Run(t, new(ApimauthorizationserversTestSuite)) -} - -func (testsuite *ApimauthorizationserversTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/authorizationServers -func (testsuite *ApimauthorizationserversTestSuite) TestAuthorizationserver() { - var err error - // From step AuthorizationServer_CreateOrUpdate - fmt.Println("Call operation: AuthorizationServer_CreateOrUpdate") - authorizationServerClient, err := armapimanagement.NewAuthorizationServerClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = authorizationServerClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.authsid, armapimanagement.AuthorizationServerContract{ - Properties: &armapimanagement.AuthorizationServerContractProperties{ - Description: to.Ptr("test server"), - AuthorizationMethods: []*armapimanagement.AuthorizationMethod{ - to.Ptr(armapimanagement.AuthorizationMethodGET)}, - BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethod{ - to.Ptr(armapimanagement.BearerTokenSendingMethodAuthorizationHeader)}, - DefaultScope: to.Ptr("read write"), - ResourceOwnerPassword: to.Ptr("pwd"), - ResourceOwnerUsername: to.Ptr("un"), - SupportState: to.Ptr(true), - TokenEndpoint: to.Ptr("https://www.contoso.com/oauth2/token"), - AuthorizationEndpoint: to.Ptr("https://www.contoso.com/oauth2/auth"), - ClientID: to.Ptr("1"), - ClientRegistrationEndpoint: to.Ptr("https://www.contoso.com/apps"), - ClientSecret: to.Ptr("2"), - DisplayName: to.Ptr("test2"), - GrantTypes: []*armapimanagement.GrantType{ - to.Ptr(armapimanagement.GrantTypeAuthorizationCode), - to.Ptr(armapimanagement.GrantTypeImplicit)}, - }, - }, &armapimanagement.AuthorizationServerClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step AuthorizationServer_GetEntityTag - fmt.Println("Call operation: AuthorizationServer_GetEntityTag") - _, err = authorizationServerClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.authsid, nil) - testsuite.Require().NoError(err) - - // From step AuthorizationServer_ListByService - authorizationServerClientNewListByServicePager := authorizationServerClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.AuthorizationServerClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for authorizationServerClientNewListByServicePager.More() { - _, err := authorizationServerClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step AuthorizationServer_Get - fmt.Println("Call operation: AuthorizationServer_Get") - _, err = authorizationServerClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.authsid, nil) - testsuite.Require().NoError(err) - - // From step AuthorizationServer_Update - fmt.Println("Call operation: AuthorizationServer_Update") - _, err = authorizationServerClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.authsid, "*", armapimanagement.AuthorizationServerUpdateContract{ - Properties: &armapimanagement.AuthorizationServerUpdateContractProperties{ - ClientID: to.Ptr("update"), - ClientSecret: to.Ptr("updated"), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step AuthorizationServer_ListSecrets - fmt.Println("Call operation: AuthorizationServer_ListSecrets") - _, err = authorizationServerClient.ListSecrets(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.authsid, nil) - testsuite.Require().NoError(err) - - // From step AuthorizationServer_Delete - fmt.Println("Call operation: AuthorizationServer_Delete") - _, err = authorizationServerClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.authsid, "*", nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimcaches_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimcaches_live_test.go deleted file mode 100644 index 4448ec40fecb..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimcaches_live_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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimcachesTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - cacheId string - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimcachesTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.cacheId = testutil.GenerateAlphaNumericID(testsuite.T(), "cacheid", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicecache", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimcachesTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimcachesTestSuite(t *testing.T) { - suite.Run(t, new(ApimcachesTestSuite)) -} - -func (testsuite *ApimcachesTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/caches -func (testsuite *ApimcachesTestSuite) TestCache() { - var err error - // From step Cache_CreateOrUpdate - fmt.Println("Call operation: Cache_CreateOrUpdate") - cacheClient, err := armapimanagement.NewCacheClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = cacheClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.cacheId, armapimanagement.CacheContract{ - Properties: &armapimanagement.CacheContractProperties{ - ConnectionString: to.Ptr("apim.redis.cache.windows.net:6380,password=xc,ssl=True,abortConnect=False"), - UseFromLocation: to.Ptr("default"), - Description: to.Ptr("Redis cache instances in West India"), - ResourceID: to.Ptr("https://management.azure.com/subscriptions/" + testsuite.subscriptionId + "/resourceGroups/" + testsuite.resourceGroupName + "/providers/Microsoft.Cache/redis/" + testsuite.serviceName), - }, - }, &armapimanagement.CacheClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step Cache_GetEntityTag - fmt.Println("Call operation: Cache_GetEntityTag") - _, err = cacheClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.cacheId, nil) - testsuite.Require().NoError(err) - - // From step Cache_Get - fmt.Println("Call operation: Cache_Get") - _, err = cacheClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.cacheId, nil) - testsuite.Require().NoError(err) - - // From step Cache_ListByService - fmt.Println("Call operation: Cache_ListByService") - cacheClientNewListByServicePager := cacheClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.CacheClientListByServiceOptions{Top: nil, - Skip: nil, - }) - for cacheClientNewListByServicePager.More() { - _, err := cacheClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Cache_Update - fmt.Println("Call operation: Cache_Update") - _, err = cacheClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.cacheId, "*", armapimanagement.CacheUpdateParameters{ - Properties: &armapimanagement.CacheUpdateProperties{ - Description: to.Ptr("update cache description"), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Cache_Delete - fmt.Println("Call operation: Cache_Delete") - _, err = cacheClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.cacheId, "*", nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimdeployment_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimdeployment_live_test.go deleted file mode 100644 index bf53b51d1a7f..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimdeployment_live_test.go +++ /dev/null @@ -1,194 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimdeploymentTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimdeploymentTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicedeploy", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name -} - -func (testsuite *ApimdeploymentTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimdeploymentTestSuite(t *testing.T) { - suite.Run(t, new(ApimdeploymentTestSuite)) -} - -// Microsoft.ApiManagement/service -func (testsuite *ApimdeploymentTestSuite) TestApimanagementservice() { - var err error - // From step ApiManagementService_CheckNameAvailability - fmt.Println("Call operation: ApiManagementService_CheckNameAvailability") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = serviceClient.CheckNameAvailability(testsuite.ctx, armapimanagement.ServiceCheckNameAvailabilityParameters{ - Name: to.Ptr("apimService1"), - }, nil) - testsuite.Require().NoError(err) - - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step ApiManagementService_List - fmt.Println("Call operation: ApiManagementService_List") - serviceClientNewListPager := serviceClient.NewListPager(nil) - for serviceClientNewListPager.More() { - _, err := serviceClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step ApiManagementService_ListByResourceGroup - fmt.Println("Call operation: ApiManagementService_ListByResourceGroup") - serviceClientNewListByResourceGroupPager := serviceClient.NewListByResourceGroupPager(testsuite.resourceGroupName, nil) - for serviceClientNewListByResourceGroupPager.More() { - _, err := serviceClientNewListByResourceGroupPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step ApiManagementService_Get - fmt.Println("Call operation: ApiManagementService_Get") - _, err = serviceClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, nil) - testsuite.Require().NoError(err) - - // From step ApiManagementService_Update - fmt.Println("Call operation: ApiManagementService_Update") - serviceClientUpdateResponsePoller, err := serviceClient.BeginUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceUpdateParameters{ - Properties: &armapimanagement.ServiceUpdateProperties{ - CustomProperties: map[string]*string{ - "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("false"), - }, - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step ApiManagementService_GetDomainOwnershipIdentifier - fmt.Println("Call operation: ApiManagementService_GetDomainOwnershipIdentifier") - _, err = serviceClient.GetDomainOwnershipIdentifier(testsuite.ctx, nil) - testsuite.Require().NoError(err) - - // From step ApiManagementService_GetSsoToken - fmt.Println("Call operation: ApiManagementService_GetSsoToken") - _, err = serviceClient.GetSsoToken(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, nil) - testsuite.Require().NoError(err) - - // From step ApiManagementServiceSkus_ListAvailableServiceSkus - fmt.Println("Call operation: ApiManagementServiceSkus_ListAvailableServiceSkus") - serviceSKUsClient, err := armapimanagement.NewServiceSKUsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceSKUsClientNewListAvailableServiceSKUsPager := serviceSKUsClient.NewListAvailableServiceSKUsPager(testsuite.resourceGroupName, testsuite.serviceName, nil) - for serviceSKUsClientNewListAvailableServiceSKUsPager.More() { - _, err := serviceSKUsClientNewListAvailableServiceSKUsPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step ApiManagementService_Delete - fmt.Println("Call operation: ApiManagementService_Delete") - serviceClientDeleteResponsePoller, err := serviceClient.BeginDelete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientDeleteResponsePoller) - testsuite.Require().NoError(err) - - // From step DeletedServices_ListBySubscription - fmt.Println("Call operation: DeletedServices_ListBySubscription") - deletedServicesClient, err := armapimanagement.NewDeletedServicesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - deletedServicesClientNewListBySubscriptionPager := deletedServicesClient.NewListBySubscriptionPager(nil) - for deletedServicesClientNewListBySubscriptionPager.More() { - _, err := deletedServicesClientNewListBySubscriptionPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step DeletedServices_GetByName - fmt.Println("Call operation: DeletedServices_GetByName") - _, err = deletedServicesClient.GetByName(testsuite.ctx, testsuite.serviceName, testsuite.location, nil) - testsuite.Require().NoError(err) - - // From step DeletedServices_Purge - fmt.Println("Call operation: DeletedServices_Purge") - deletedServicesClientPurgeResponsePoller, err := deletedServicesClient.BeginPurge(testsuite.ctx, testsuite.serviceName, testsuite.location, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, deletedServicesClientPurgeResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/operations -func (testsuite *ApimdeploymentTestSuite) TestApimanagementoperations() { - var err error - // From step ApiManagementOperations_List - fmt.Println("Call operation: ApiManagementOperations_List") - operationsClient, err := armapimanagement.NewOperationsClient(testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - operationsClientNewListPager := operationsClient.NewListPager(nil) - for operationsClientNewListPager.More() { - _, err := operationsClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimgateways_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimgateways_live_test.go deleted file mode 100644 index 6b23534f14cb..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimgateways_live_test.go +++ /dev/null @@ -1,195 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "time" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimgatewaysTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - gatewayId string - hcId string - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimgatewaysTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.gatewayId = testutil.GenerateAlphaNumericID(testsuite.T(), "gatewayid", 6) - testsuite.hcId = testutil.GenerateAlphaNumericID(testsuite.T(), "hcid", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicegateway", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimgatewaysTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimgatewaysTestSuite(t *testing.T) { - suite.Run(t, new(ApimgatewaysTestSuite)) -} - -func (testsuite *ApimgatewaysTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypePremium), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/gateways -func (testsuite *ApimgatewaysTestSuite) TestGateway() { - var err error - // From step Gateway_CreateOrUpdate - fmt.Println("Call operation: Gateway_CreateOrUpdate") - gatewayClient, err := armapimanagement.NewGatewayClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = gatewayClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.gatewayId, armapimanagement.GatewayContract{ - Properties: &armapimanagement.GatewayContractProperties{ - Description: to.Ptr("my gateway 1"), - LocationData: &armapimanagement.ResourceLocationDataContract{ - Name: to.Ptr("my location"), - }, - }, - }, &armapimanagement.GatewayClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step Gateway_GetEntityTag - fmt.Println("Call operation: Gateway_GetEntityTag") - _, err = gatewayClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.gatewayId, nil) - testsuite.Require().NoError(err) - - // From step Gateway_ListByService - fmt.Println("Call operation: Gateway_ListByService") - gatewayClientNewListByServicePager := gatewayClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.GatewayClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for gatewayClientNewListByServicePager.More() { - _, err := gatewayClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Gateway_Get - fmt.Println("Call operation: Gateway_Get") - _, err = gatewayClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.gatewayId, nil) - testsuite.Require().NoError(err) - - // From step Gateway_Update - fmt.Println("Call operation: Gateway_Update") - _, err = gatewayClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.gatewayId, "*", armapimanagement.GatewayContract{ - Properties: &armapimanagement.GatewayContractProperties{ - Description: to.Ptr("my gateway 1"), - LocationData: &armapimanagement.ResourceLocationDataContract{ - Name: to.Ptr("my location"), - }, - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Gateway_ListKeys - fmt.Println("Call operation: Gateway_ListKeys") - _, err = gatewayClient.ListKeys(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.gatewayId, nil) - testsuite.Require().NoError(err) - - // From step Gateway_RegenerateKey - fmt.Println("Call operation: Gateway_RegenerateKey") - _, err = gatewayClient.RegenerateKey(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.gatewayId, armapimanagement.GatewayKeyRegenerationRequestContract{ - KeyType: to.Ptr(armapimanagement.KeyTypePrimary), - }, nil) - testsuite.Require().NoError(err) - - // From step Gateway_GenerateToken - fmt.Println("Call operation: Gateway_GenerateToken") - _, err = gatewayClient.GenerateToken(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.gatewayId, armapimanagement.GatewayTokenRequestContract{ - Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-21T00:44:24.2845269Z"); return t }()), - KeyType: to.Ptr(armapimanagement.KeyTypePrimary), - }, nil) - testsuite.Require().NoError(err) - - // From step Gateway_Delete - fmt.Println("Call operation: Gateway_Delete") - _, err = gatewayClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.gatewayId, "*", nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/outboundNetworkDependenciesEndpoints -func (testsuite *ApimgatewaysTestSuite) TestOutboundnetworkdependenciesendpoints() { - var err error - // From step OutboundNetworkDependenciesEndpoints_ListByService - fmt.Println("Call operation: OutboundNetworkDependenciesEndpoints_ListByService") - outboundNetworkDependenciesEndpointsClient, err := armapimanagement.NewOutboundNetworkDependenciesEndpointsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = outboundNetworkDependenciesEndpointsClient.ListByService(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/networkstatus -func (testsuite *ApimgatewaysTestSuite) TestNetworkstatus() { - var err error - // From step NetworkStatus_ListByLocation - fmt.Println("Call operation: NetworkStatus_ListByLocation") - networkStatusClient, err := armapimanagement.NewNetworkStatusClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = networkStatusClient.ListByLocation(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.location, nil) - testsuite.Require().NoError(err) - - // From step NetworkStatus_ListByService - fmt.Println("Call operation: NetworkStatus_ListByService") - _, err = networkStatusClient.ListByService(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimgroups_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimgroups_live_test.go deleted file mode 100644 index fd70803c756b..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimgroups_live_test.go +++ /dev/null @@ -1,138 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimgroupsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - groupId string - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimgroupsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.groupId = testutil.GenerateAlphaNumericID(testsuite.T(), "groupid", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicegroup", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimgroupsTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimgroupsTestSuite(t *testing.T) { - suite.Run(t, new(ApimgroupsTestSuite)) -} - -func (testsuite *ApimgroupsTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/groups -func (testsuite *ApimgroupsTestSuite) TestGroup() { - var err error - // From step Group_CreateOrUpdate - fmt.Println("Call operation: Group_CreateOrUpdate") - groupClient, err := armapimanagement.NewGroupClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = groupClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.groupId, armapimanagement.GroupCreateParameters{ - Properties: &armapimanagement.GroupCreateParametersProperties{ - DisplayName: to.Ptr("temp group"), - }, - }, &armapimanagement.GroupClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step Group_GetEntityTag - fmt.Println("Call operation: Group_GetEntityTag") - _, err = groupClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.groupId, nil) - testsuite.Require().NoError(err) - - // From step Group_ListByService - fmt.Println("Call operation: Group_ListByService") - groupClientNewListByServicePager := groupClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.GroupClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for groupClientNewListByServicePager.More() { - _, err := groupClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Group_Get - fmt.Println("Call operation: Group_Get") - _, err = groupClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.groupId, nil) - testsuite.Require().NoError(err) - - // From step Group_Update - fmt.Println("Call operation: Group_Update") - _, err = groupClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.groupId, "*", armapimanagement.GroupUpdateParameters{ - Properties: &armapimanagement.GroupUpdateParametersProperties{ - DisplayName: to.Ptr("temp group"), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Group_Delete - fmt.Println("Call operation: Group_Delete") - _, err = groupClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.groupId, "*", nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimidentityprovider_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimidentityprovider_live_test.go deleted file mode 100644 index b7ac57553d4c..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimidentityprovider_live_test.go +++ /dev/null @@ -1,148 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimidentityproviderTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - serviceName string - azureClientId string - azureClientSecret string - azureTenantId string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimidentityproviderTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "serviceidentity", 6) - testsuite.azureClientId = testutil.GetEnv("AZURE_CLIENT_ID", "00000000-0000-0000-0000-000000000000") - testsuite.azureClientSecret = testutil.GetEnv("AZURE_CLIENT_SECRET", "000000000000") - testsuite.azureTenantId = testutil.GetEnv("AZURE_TENANT_ID", "00000000-0000-0000-0000-000000000000") - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimidentityproviderTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimidentityproviderTestSuite(t *testing.T) { - suite.Run(t, new(ApimidentityproviderTestSuite)) -} - -func (testsuite *ApimidentityproviderTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/identityProviders -func (testsuite *ApimidentityproviderTestSuite) TestIdentityprovider() { - var err error - // From step IdentityProvider_CreateOrUpdate - fmt.Println("Call operation: IdentityProvider_CreateOrUpdate") - identityProviderClient, err := armapimanagement.NewIdentityProviderClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = identityProviderClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.IdentityProviderTypeAAD, armapimanagement.IdentityProviderCreateContract{ - Properties: &armapimanagement.IdentityProviderCreateContractProperties{ - AllowedTenants: []*string{ - to.Ptr(testsuite.azureTenantId)}, - ClientID: to.Ptr(testsuite.azureClientId), - ClientSecret: to.Ptr(testsuite.azureClientSecret), - }, - }, &armapimanagement.IdentityProviderClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step IdentityProvider_GetEntityTag - fmt.Println("Call operation: IdentityProvider_GetEntityTag") - _, err = identityProviderClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.IdentityProviderTypeAAD, nil) - testsuite.Require().NoError(err) - - // From step IdentityProvider_ListByService - fmt.Println("Call operation: IdentityProvider_ListByService") - identityProviderClientNewListByServicePager := identityProviderClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, nil) - for identityProviderClientNewListByServicePager.More() { - _, err := identityProviderClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step IdentityProvider_Get - fmt.Println("Call operation: IdentityProvider_Get") - _, err = identityProviderClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.IdentityProviderTypeAAD, nil) - testsuite.Require().NoError(err) - - // From step IdentityProvider_Update - fmt.Println("Call operation: IdentityProvider_Update") - _, err = identityProviderClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.IdentityProviderTypeAAD, "*", armapimanagement.IdentityProviderUpdateParameters{ - Properties: &armapimanagement.IdentityProviderUpdateProperties{ - ClientID: to.Ptr(testsuite.azureClientId), - ClientSecret: to.Ptr(testsuite.azureClientSecret), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step IdentityProvider_ListSecrets - fmt.Println("Call operation: IdentityProvider_ListSecrets") - _, err = identityProviderClient.ListSecrets(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.IdentityProviderTypeAAD, nil) - testsuite.Require().NoError(err) - - // From step IdentityProvider_Delete - fmt.Println("Call operation: IdentityProvider_Delete") - _, err = identityProviderClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.IdentityProviderTypeAAD, "*", nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimnamedvalues_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimnamedvalues_live_test.go deleted file mode 100644 index 719650e62e62..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimnamedvalues_live_test.go +++ /dev/null @@ -1,158 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimnamedvaluesTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - namedValueId string - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimnamedvaluesTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.namedValueId = testutil.GenerateAlphaNumericID(testsuite.T(), "namedvalue", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicenamed", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimnamedvaluesTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimnamedvaluesTestSuite(t *testing.T) { - suite.Run(t, new(ApimnamedvaluesTestSuite)) -} - -func (testsuite *ApimnamedvaluesTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/namedValues -func (testsuite *ApimnamedvaluesTestSuite) TestNamedvalue() { - var err error - // From step NamedValue_CreateOrUpdate - fmt.Println("Call operation: NamedValue_CreateOrUpdate") - namedValueClient, err := armapimanagement.NewNamedValueClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - namedValueClientCreateOrUpdateResponsePoller, err := namedValueClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.namedValueId, armapimanagement.NamedValueCreateContract{ - Properties: &armapimanagement.NamedValueCreateContractProperties{ - Secret: to.Ptr(false), - Tags: []*string{ - to.Ptr("foo"), - to.Ptr("bar")}, - DisplayName: to.Ptr("prop3name"), - Value: to.Ptr("propValue"), - }, - }, &armapimanagement.NamedValueClientBeginCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namedValueClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step NamedValue_GetEntityTag - fmt.Println("Call operation: NamedValue_GetEntityTag") - _, err = namedValueClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.namedValueId, nil) - testsuite.Require().NoError(err) - - // From step NamedValue_ListByService - fmt.Println("Call operation: NamedValue_ListByService") - namedValueClientNewListByServicePager := namedValueClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.NamedValueClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - IsKeyVaultRefreshFailed: nil, - }) - for namedValueClientNewListByServicePager.More() { - _, err := namedValueClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step NamedValue_Get - fmt.Println("Call operation: NamedValue_Get") - _, err = namedValueClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.namedValueId, nil) - testsuite.Require().NoError(err) - - // From step NamedValue_Update - fmt.Println("Call operation: NamedValue_Update") - namedValueClientUpdateResponsePoller, err := namedValueClient.BeginUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.namedValueId, "*", armapimanagement.NamedValueUpdateParameters{ - Properties: &armapimanagement.NamedValueUpdateParameterProperties{ - Secret: to.Ptr(false), - Tags: []*string{ - to.Ptr("foo"), - to.Ptr("bar2")}, - DisplayName: to.Ptr("prop3name"), - Value: to.Ptr("propValue"), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, namedValueClientUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step NamedValue_ListValue - fmt.Println("Call operation: NamedValue_ListValue") - _, err = namedValueClient.ListValue(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.namedValueId, nil) - testsuite.Require().NoError(err) - - // From step NamedValue_Delete - fmt.Println("Call operation: NamedValue_Delete") - _, err = namedValueClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.namedValueId, "*", nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimnotifications_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimnotifications_live_test.go deleted file mode 100644 index 5a2088633013..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimnotifications_live_test.go +++ /dev/null @@ -1,144 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimnotificationsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - email string - serviceName string - userId string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimnotificationsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.email = testutil.GenerateAlphaNumericID(testsuite.T(), "email", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicenotifi", 6) - testsuite.userId = testutil.GenerateAlphaNumericID(testsuite.T(), "userid", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimnotificationsTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimnotificationsTestSuite(t *testing.T) { - suite.Run(t, new(ApimnotificationsTestSuite)) -} - -func (testsuite *ApimnotificationsTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step Notification_CreateOrUpdate - fmt.Println("Call operation: Notification_CreateOrUpdate") - notificationClient, err := armapimanagement.NewNotificationClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = notificationClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.NotificationNameRequestPublisherNotificationMessage, &armapimanagement.NotificationClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/notifications -func (testsuite *ApimnotificationsTestSuite) TestNotification() { - var err error - // From step Notification_ListByService - fmt.Println("Call operation: Notification_ListByService") - notificationClient, err := armapimanagement.NewNotificationClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - notificationClientNewListByServicePager := notificationClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.NotificationClientListByServiceOptions{Top: nil, - Skip: nil, - }) - for notificationClientNewListByServicePager.More() { - _, err := notificationClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Notification_Get - fmt.Println("Call operation: Notification_Get") - _, err = notificationClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.NotificationNameRequestPublisherNotificationMessage, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/notifications/recipientUsers -func (testsuite *ApimnotificationsTestSuite) TestNotificationrecipientemail() { - var err error - // From step NotificationRecipientEmail_CreateOrUpdate - fmt.Println("Call operation: NotificationRecipientEmail_CreateOrUpdate") - notificationRecipientEmailClient, err := armapimanagement.NewNotificationRecipientEmailClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = notificationRecipientEmailClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.NotificationNameRequestPublisherNotificationMessage, testsuite.email, nil) - testsuite.Require().NoError(err) - - // From step NotificationRecipientEmail_CheckEntityExists - fmt.Println("Call operation: NotificationRecipientEmail_CheckEntityExists") - _, err = notificationRecipientEmailClient.CheckEntityExists(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.NotificationNameRequestPublisherNotificationMessage, testsuite.email, nil) - testsuite.Require().NoError(err) - - // From step NotificationRecipientEmail_ListByNotification - fmt.Println("Call operation: NotificationRecipientEmail_ListByNotification") - _, err = notificationRecipientEmailClient.ListByNotification(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.NotificationNameRequestPublisherNotificationMessage, nil) - testsuite.Require().NoError(err) - - // From step NotificationRecipientEmail_Delete - fmt.Println("Call operation: NotificationRecipientEmail_Delete") - _, err = notificationRecipientEmailClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.NotificationNameRequestPublisherNotificationMessage, testsuite.email, nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimopenidconnectproviders_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimopenidconnectproviders_live_test.go deleted file mode 100644 index 28ae93845c2d..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimopenidconnectproviders_live_test.go +++ /dev/null @@ -1,146 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimopenidconnectprovidersTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - opid string - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimopenidconnectprovidersTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.opid = testutil.GenerateAlphaNumericID(testsuite.T(), "opid", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "serviceopenid", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimopenidconnectprovidersTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimopenidconnectprovidersTestSuite(t *testing.T) { - suite.Run(t, new(ApimopenidconnectprovidersTestSuite)) -} - -func (testsuite *ApimopenidconnectprovidersTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/openidConnectProviders -func (testsuite *ApimopenidconnectprovidersTestSuite) TestOpenidconnectprovider() { - var err error - // From step OpenIdConnectProvider_CreateOrUpdate - fmt.Println("Call operation: OpenIdConnectProvider_CreateOrUpdate") - openIDConnectProviderClient, err := armapimanagement.NewOpenIDConnectProviderClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = openIDConnectProviderClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.opid, armapimanagement.OpenidConnectProviderContract{ - Properties: &armapimanagement.OpenidConnectProviderContractProperties{ - ClientID: to.Ptr("oidprovidertemplate3"), - DisplayName: to.Ptr("templateoidprovider3"), - MetadataEndpoint: to.Ptr("https://oidprovider-template3.net"), - ClientSecret: to.Ptr("x"), - }, - }, &armapimanagement.OpenIDConnectProviderClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step OpenIdConnectProvider_GetEntityTag - fmt.Println("Call operation: OpenIdConnectProvider_GetEntityTag") - _, err = openIDConnectProviderClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.opid, nil) - testsuite.Require().NoError(err) - - // From step OpenIdConnectProvider_ListByService - fmt.Println("Call operation: OpenIdConnectProvider_ListByService") - openIDConnectProviderClientNewListByServicePager := openIDConnectProviderClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.OpenIDConnectProviderClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for openIDConnectProviderClientNewListByServicePager.More() { - _, err := openIDConnectProviderClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step OpenIdConnectProvider_Get - fmt.Println("Call operation: OpenIdConnectProvider_Get") - _, err = openIDConnectProviderClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.opid, nil) - testsuite.Require().NoError(err) - - // From step OpenIdConnectProvider_Update - fmt.Println("Call operation: OpenIdConnectProvider_Update") - _, err = openIDConnectProviderClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.opid, "*", armapimanagement.OpenidConnectProviderUpdateContract{ - Properties: &armapimanagement.OpenidConnectProviderUpdateContractProperties{ - ClientSecret: to.Ptr("updatedsecret"), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step OpenIdConnectProvider_ListSecrets - fmt.Println("Call operation: OpenIdConnectProvider_ListSecrets") - _, err = openIDConnectProviderClient.ListSecrets(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.opid, nil) - testsuite.Require().NoError(err) - - // From step OpenIdConnectProvider_Delete - fmt.Println("Call operation: OpenIdConnectProvider_Delete") - _, err = openIDConnectProviderClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.opid, "*", nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimpolicies_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimpolicies_live_test.go deleted file mode 100644 index dfb4ccc47d30..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimpolicies_live_test.go +++ /dev/null @@ -1,132 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimpoliciesTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimpoliciesTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicepolicy", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimpoliciesTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimpoliciesTestSuite(t *testing.T) { - suite.Run(t, new(ApimpoliciesTestSuite)) -} - -func (testsuite *ApimpoliciesTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/policies -func (testsuite *ApimpoliciesTestSuite) TestPolicy() { - var err error - // From step Policy_CreateOrUpdate - fmt.Println("Call operation: Policy_CreateOrUpdate") - policyClient, err := armapimanagement.NewPolicyClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = policyClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.PolicyIDNamePolicy, armapimanagement.PolicyContract{ - Properties: &armapimanagement.PolicyContractProperties{ - Value: to.Ptr("\r\n \r\n \r\n \r\n \r\n \r\n"), - Format: to.Ptr(armapimanagement.PolicyContentFormatXML), - }, - }, &armapimanagement.PolicyClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step Policy_GetEntityTag - fmt.Println("Call operation: Policy_GetEntityTag") - _, err = policyClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.PolicyIDNamePolicy, nil) - testsuite.Require().NoError(err) - - // From step Policy_Get - fmt.Println("Call operation: Policy_Get") - _, err = policyClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.PolicyIDNamePolicy, &armapimanagement.PolicyClientGetOptions{Format: nil}) - testsuite.Require().NoError(err) - - // From step Policy_ListByService - fmt.Println("Call operation: Policy_ListByService") - _, err = policyClient.ListByService(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, nil) - testsuite.Require().NoError(err) - - // From step Policy_Delete - fmt.Println("Call operation: Policy_Delete") - _, err = policyClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.PolicyIDNamePolicy, "*", nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/policyDescriptions -func (testsuite *ApimpoliciesTestSuite) TestPolicydescription() { - var err error - // From step PolicyDescription_ListByService - fmt.Println("Call operation: PolicyDescription_ListByService") - policyDescriptionClient, err := armapimanagement.NewPolicyDescriptionClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = policyDescriptionClient.ListByService(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.PolicyDescriptionClientListByServiceOptions{Scope: to.Ptr(armapimanagement.PolicyScopeContractAPI)}) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimportalrevisions_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimportalrevisions_live_test.go deleted file mode 100644 index 4af116a09e6e..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimportalrevisions_live_test.go +++ /dev/null @@ -1,138 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimportalrevisionsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - portalRevisionId string - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimportalrevisionsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.portalRevisionId = testutil.GenerateAlphaNumericID(testsuite.T(), "portalrevi", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicerevision", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimportalrevisionsTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimportalrevisionsTestSuite(t *testing.T) { - suite.Run(t, new(ApimportalrevisionsTestSuite)) -} - -func (testsuite *ApimportalrevisionsTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/portalRevisions -func (testsuite *ApimportalrevisionsTestSuite) TestPortalrevision() { - var err error - // From step PortalRevision_CreateOrUpdate - fmt.Println("Call operation: PortalRevision_CreateOrUpdate") - portalRevisionClient, err := armapimanagement.NewPortalRevisionClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - portalRevisionClientCreateOrUpdateResponsePoller, err := portalRevisionClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.portalRevisionId, armapimanagement.PortalRevisionContract{ - Properties: &armapimanagement.PortalRevisionContractProperties{ - Description: to.Ptr("portal revision 1"), - IsCurrent: to.Ptr(true), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, portalRevisionClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step PortalRevision_GetEntityTag - fmt.Println("Call operation: PortalRevision_GetEntityTag") - _, err = portalRevisionClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.portalRevisionId, nil) - testsuite.Require().NoError(err) - - // From step PortalRevision_ListByService - fmt.Println("Call operation: PortalRevision_ListByService") - portalRevisionClientNewListByServicePager := portalRevisionClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.PortalRevisionClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for portalRevisionClientNewListByServicePager.More() { - _, err := portalRevisionClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step PortalRevision_Get - fmt.Println("Call operation: PortalRevision_Get") - _, err = portalRevisionClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.portalRevisionId, nil) - testsuite.Require().NoError(err) - - // From step PortalRevision_Update - fmt.Println("Call operation: PortalRevision_Update") - portalRevisionClientUpdateResponsePoller, err := portalRevisionClient.BeginUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.portalRevisionId, "*", armapimanagement.PortalRevisionContract{ - Properties: &armapimanagement.PortalRevisionContractProperties{ - Description: to.Ptr("portal revision update"), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, portalRevisionClientUpdateResponsePoller) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimportalsettings_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimportalsettings_live_test.go deleted file mode 100644 index 24bf498988cb..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimportalsettings_live_test.go +++ /dev/null @@ -1,174 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimportalsettingsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimportalsettingsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicesetting", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimportalsettingsTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimportalsettingsTestSuite(t *testing.T) { - suite.Run(t, new(ApimportalsettingsTestSuite)) -} - -func (testsuite *ApimportalsettingsTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/portalsettings -func (testsuite *ApimportalsettingsTestSuite) TestPortalsettings() { - var err error - // From step PortalSettings_ListByService - fmt.Println("Call operation: PortalSettings_ListByService") - portalSettingsClient, err := armapimanagement.NewPortalSettingsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = portalSettingsClient.ListByService(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/portalsettings/signin -func (testsuite *ApimportalsettingsTestSuite) TestSigninsettings() { - var err error - // From step SignInSettings_CreateOrUpdate - fmt.Println("Call operation: SignInSettings_CreateOrUpdate") - signInSettingsClient, err := armapimanagement.NewSignInSettingsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = signInSettingsClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.PortalSigninSettings{ - Properties: &armapimanagement.PortalSigninSettingProperties{ - Enabled: to.Ptr(true), - }, - }, &armapimanagement.SignInSettingsClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")}) - testsuite.Require().NoError(err) - - // From step SignInSettings_GetEntityTag - fmt.Println("Call operation: SignInSettings_GetEntityTag") - _, err = signInSettingsClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, nil) - testsuite.Require().NoError(err) - - // From step SignInSettings_Get - fmt.Println("Call operation: SignInSettings_Get") - _, err = signInSettingsClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, nil) - testsuite.Require().NoError(err) - - // From step SignInSettings_Update - fmt.Println("Call operation: SignInSettings_Update") - _, err = signInSettingsClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, "*", armapimanagement.PortalSigninSettings{ - Properties: &armapimanagement.PortalSigninSettingProperties{ - Enabled: to.Ptr(true), - }, - }, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/portalsettings/signup -func (testsuite *ApimportalsettingsTestSuite) TestSignupsettings() { - var err error - // From step SignUpSettings_CreateOrUpdate - fmt.Println("Call operation: SignUpSettings_CreateOrUpdate") - signUpSettingsClient, err := armapimanagement.NewSignUpSettingsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = signUpSettingsClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.PortalSignupSettings{ - Properties: &armapimanagement.PortalSignupSettingsProperties{ - Enabled: to.Ptr(true), - TermsOfService: &armapimanagement.TermsOfServiceProperties{ - ConsentRequired: to.Ptr(true), - Enabled: to.Ptr(true), - Text: to.Ptr("Terms of service text."), - }, - }, - }, &armapimanagement.SignUpSettingsClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")}) - testsuite.Require().NoError(err) - - // From step SignUpSettings_GetEntityTag - fmt.Println("Call operation: SignUpSettings_GetEntityTag") - _, err = signUpSettingsClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, nil) - testsuite.Require().NoError(err) - - // From step SignUpSettings_Get - fmt.Println("Call operation: SignUpSettings_Get") - _, err = signUpSettingsClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, nil) - testsuite.Require().NoError(err) - - // From step SignUpSettings_Update - fmt.Println("Call operation: SignUpSettings_Update") - _, err = signUpSettingsClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, "*", armapimanagement.PortalSignupSettings{ - Properties: &armapimanagement.PortalSignupSettingsProperties{ - Enabled: to.Ptr(true), - TermsOfService: &armapimanagement.TermsOfServiceProperties{ - ConsentRequired: to.Ptr(true), - Enabled: to.Ptr(true), - Text: to.Ptr("Terms of service text."), - }, - }, - }, nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimprivatelink_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimprivatelink_live_test.go deleted file mode 100644 index 66f5f6876813..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimprivatelink_live_test.go +++ /dev/null @@ -1,283 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources" - "github.com/stretchr/testify/suite" -) - -type ApimprivatelinkTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - apimId string - privateEndpointConnectionName string - serviceName string - virtualNetworksName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimprivatelinkTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.privateEndpointConnectionName = testutil.GenerateAlphaNumericID(testsuite.T(), "apimprivateendpoint", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "serviceprivate", 6) - testsuite.virtualNetworksName = testutil.GenerateAlphaNumericID(testsuite.T(), "apimvnet", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimprivatelinkTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimprivatelinkTestSuite(t *testing.T) { - suite.Run(t, new(ApimprivatelinkTestSuite)) -} - -func (testsuite *ApimprivatelinkTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - var serviceClientCreateOrUpdateResponse *armapimanagement.ServiceClientCreateOrUpdateResponse - serviceClientCreateOrUpdateResponse, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - testsuite.apimId = *serviceClientCreateOrUpdateResponse.ID - - // From step PrivateEndpoint_Create - template := map[string]interface{}{ - "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", - "contentVersion": "1.0.0.0", - "parameters": map[string]interface{}{ - "apimId": map[string]interface{}{ - "type": "string", - "defaultValue": "$(apimId)", - }, - "location": map[string]interface{}{ - "type": "string", - "defaultValue": "$(location)", - }, - "privateEndpointConnectionName": map[string]interface{}{ - "type": "string", - "defaultValue": "$(privateEndpointConnectionName)", - }, - "virtualNetworksName": map[string]interface{}{ - "type": "string", - "defaultValue": "$(virtualNetworksName)", - }, - }, - "resources": []interface{}{ - map[string]interface{}{ - "name": "[parameters('virtualNetworksName')]", - "type": "Microsoft.Network/virtualNetworks", - "apiVersion": "2020-11-01", - "location": "[parameters('location')]", - "properties": map[string]interface{}{ - "addressSpace": map[string]interface{}{ - "addressPrefixes": []interface{}{ - "10.0.0.0/16", - }, - }, - "enableDdosProtection": false, - "subnets": []interface{}{ - map[string]interface{}{ - "name": "default", - "properties": map[string]interface{}{ - "addressPrefix": "10.0.0.0/24", - "delegations": []interface{}{}, - "privateEndpointNetworkPolicies": "Disabled", - "privateLinkServiceNetworkPolicies": "Enabled", - }, - }, - }, - "virtualNetworkPeerings": []interface{}{}, - }, - }, - map[string]interface{}{ - "name": "[concat(parameters('privateEndpointConnectionName'), '-nic')]", - "type": "Microsoft.Network/networkInterfaces", - "apiVersion": "2020-11-01", - "dependsOn": []interface{}{ - "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworksName'), 'default')]", - }, - "location": "[parameters('location')]", - "properties": map[string]interface{}{ - "dnsSettings": map[string]interface{}{ - "dnsServers": []interface{}{}, - }, - "enableIPForwarding": false, - "ipConfigurations": []interface{}{ - map[string]interface{}{ - "name": "privateEndpointIpConfig", - "properties": map[string]interface{}{ - "primary": true, - "privateIPAddress": "10.0.0.4", - "privateIPAddressVersion": "IPv4", - "privateIPAllocationMethod": "Dynamic", - "subnet": map[string]interface{}{ - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworksName'), 'default')]", - }, - }, - }, - }, - }, - }, - map[string]interface{}{ - "name": "[parameters('privateEndpointConnectionName')]", - "type": "Microsoft.Network/privateEndpoints", - "apiVersion": "2020-11-01", - "dependsOn": []interface{}{ - "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworksName'), 'default')]", - }, - "location": "[parameters('location')]", - "properties": map[string]interface{}{ - "customDnsConfigs": []interface{}{}, - "manualPrivateLinkServiceConnections": []interface{}{}, - "privateLinkServiceConnections": []interface{}{ - map[string]interface{}{ - "name": "[parameters('privateEndpointConnectionName')]", - "properties": map[string]interface{}{ - "groupIds": []interface{}{ - "Gateway", - }, - "privateLinkServiceConnectionState": map[string]interface{}{ - "description": "Auto-Approved", - "actionsRequired": "None", - "status": "Approved", - }, - "privateLinkServiceId": "[parameters('apimId')]", - }, - }, - }, - "subnet": map[string]interface{}{ - "id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', parameters('virtualNetworksName'), 'default')]", - }, - }, - }, - map[string]interface{}{ - "name": "[concat(parameters('virtualNetworksName'), '/default')]", - "type": "Microsoft.Network/virtualNetworks/subnets", - "apiVersion": "2020-11-01", - "dependsOn": []interface{}{ - "[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworksName'))]", - }, - "properties": map[string]interface{}{ - "addressPrefix": "10.0.0.0/24", - "delegations": []interface{}{}, - "privateEndpointNetworkPolicies": "Disabled", - "privateLinkServiceNetworkPolicies": "Enabled", - }, - }, - }, - "variables": map[string]interface{}{}, - } - params := map[string]interface{}{ - "apimId": map[string]interface{}{"value": testsuite.apimId}, - "location": map[string]interface{}{"value": testsuite.location}, - "privateEndpointConnectionName": map[string]interface{}{"value": testsuite.privateEndpointConnectionName}, - "virtualNetworksName": map[string]interface{}{"value": testsuite.virtualNetworksName}, - } - deployment := armresources.Deployment{ - Properties: &armresources.DeploymentProperties{ - Template: template, - Parameters: params, - Mode: to.Ptr(armresources.DeploymentModeIncremental), - }, - } - _, err = testutil.CreateDeployment(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName, "PrivateEndpoint_Create", &deployment) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/privateEndpointConnections -func (testsuite *ApimprivatelinkTestSuite) TestPrivateendpointconnection() { - var err error - // From step PrivateEndpointConnection_CreateOrUpdate - fmt.Println("Call operation: PrivateEndpointConnection_CreateOrUpdate") - privateEndpointConnectionClient, err := armapimanagement.NewPrivateEndpointConnectionClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - privateEndpointConnectionClientCreateOrUpdateResponsePoller, err := privateEndpointConnectionClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.privateEndpointConnectionName, armapimanagement.PrivateEndpointConnectionRequest{ - ID: to.Ptr("/subscriptions/" + testsuite.subscriptionId + "/resourceGroups/" + testsuite.resourceGroupName + "/providers/Microsoft.ApiManagement/service/" + testsuite.serviceName + "/privateEndpointConnections/" + testsuite.privateEndpointConnectionName), - Properties: &armapimanagement.PrivateEndpointConnectionRequestProperties{ - PrivateLinkServiceConnectionState: &armapimanagement.PrivateLinkServiceConnectionState{ - Description: to.Ptr("The Private Endpoint Connection is approved."), - Status: to.Ptr(armapimanagement.PrivateEndpointServiceConnectionStatusRejected), - }, - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, privateEndpointConnectionClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step PrivateEndpointConnection_ListByService - fmt.Println("Call operation: PrivateEndpointConnection_ListByService") - privateEndpointConnectionClientNewListByServicePager := privateEndpointConnectionClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, nil) - for privateEndpointConnectionClientNewListByServicePager.More() { - _, err := privateEndpointConnectionClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step PrivateEndpointConnection_ListPrivateLinkResources - fmt.Println("Call operation: PrivateEndpointConnection_ListPrivateLinkResources") - _, err = privateEndpointConnectionClient.ListPrivateLinkResources(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, nil) - testsuite.Require().NoError(err) - - // From step PrivateEndpointConnection_GetByName - fmt.Println("Call operation: PrivateEndpointConnection_GetByName") - _, err = privateEndpointConnectionClient.GetByName(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.privateEndpointConnectionName, nil) - testsuite.Require().NoError(err) - - // From step PrivateEndpointConnection_Delete - fmt.Println("Call operation: PrivateEndpointConnection_Delete") - privateEndpointConnectionClientDeleteResponsePoller, err := privateEndpointConnectionClient.BeginDelete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.privateEndpointConnectionName, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, privateEndpointConnectionClientDeleteResponsePoller) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimproducts_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimproducts_live_test.go deleted file mode 100644 index 175ee9ab7544..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimproducts_live_test.go +++ /dev/null @@ -1,359 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimproductsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - apiId string - groupId string - productId string - serviceName string - tagId string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimproductsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.apiId = testutil.GenerateAlphaNumericID(testsuite.T(), "productapiid", 6) - testsuite.groupId = testutil.GenerateAlphaNumericID(testsuite.T(), "productgroupid", 6) - testsuite.productId = testutil.GenerateAlphaNumericID(testsuite.T(), "productid", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "serviceproduct", 6) - testsuite.tagId = testutil.GenerateAlphaNumericID(testsuite.T(), "producttagid", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimproductsTestSuite) TearDownSuite() { - testsuite.Cleanup() - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimproductsTestSuite(t *testing.T) { - suite.Run(t, new(ApimproductsTestSuite)) -} - -func (testsuite *ApimproductsTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step Product_CreateOrUpdate - fmt.Println("Call operation: Product_CreateOrUpdate") - productClient, err := armapimanagement.NewProductClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = productClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, armapimanagement.ProductContract{ - Properties: &armapimanagement.ProductContractProperties{ - DisplayName: to.Ptr("Test Template ProductName 4"), - }, - }, &armapimanagement.ProductClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/products -func (testsuite *ApimproductsTestSuite) TestProduct() { - var err error - // From step Product_GetEntityTag - fmt.Println("Call operation: Product_GetEntityTag") - productClient, err := armapimanagement.NewProductClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = productClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, nil) - testsuite.Require().NoError(err) - - // From step Product_ListByService - fmt.Println("Call operation: Product_ListByService") - productClientNewListByServicePager := productClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.ProductClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - ExpandGroups: nil, - Tags: nil, - }) - for productClientNewListByServicePager.More() { - _, err := productClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Product_Get - fmt.Println("Call operation: Product_Get") - _, err = productClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, nil) - testsuite.Require().NoError(err) - - // From step Product_ListByTags - fmt.Println("Call operation: Product_ListByTags") - productClientNewListByTagsPager := productClient.NewListByTagsPager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.ProductClientListByTagsOptions{Filter: nil, - Top: nil, - Skip: nil, - IncludeNotTaggedProducts: nil, - }) - for productClientNewListByTagsPager.More() { - _, err := productClientNewListByTagsPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Product_Update - fmt.Println("Call operation: Product_Update") - _, err = productClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, "*", armapimanagement.ProductUpdateParameters{ - Properties: &armapimanagement.ProductUpdateProperties{ - DisplayName: to.Ptr("Test Template ProductName 4"), - }, - }, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/products/apis -func (testsuite *ApimproductsTestSuite) TestProductapi() { - var err error - // From step Api_CreateOrUpdate - fmt.Println("Call operation: Api_CreateOrUpdate") - aPIClient, err := armapimanagement.NewAPIClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - aPIClientCreateOrUpdateResponsePoller, err := aPIClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.apiId, armapimanagement.APICreateOrUpdateParameter{ - Properties: &armapimanagement.APICreateOrUpdateProperties{ - Path: to.Ptr("petstore"), - Format: to.Ptr(armapimanagement.ContentFormatOpenapiLink), - Value: to.Ptr("https://raw.githubusercontent.com/OAI/OpenAPI-Specification/master/examples/v3.0/petstore.yaml"), - }, - }, &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, aPIClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step ProductApi_CreateOrUpdate - fmt.Println("Call operation: ProductApi_CreateOrUpdate") - productAPIClient, err := armapimanagement.NewProductAPIClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = productAPIClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, testsuite.apiId, nil) - testsuite.Require().NoError(err) - - // From step ProductApi_CheckEntityExists - fmt.Println("Call operation: ProductApi_CheckEntityExists") - _, err = productAPIClient.CheckEntityExists(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, testsuite.apiId, nil) - testsuite.Require().NoError(err) - - // From step ProductApi_ListByProduct - fmt.Println("Call operation: ProductApi_ListByProduct") - productAPIClientNewListByProductPager := productAPIClient.NewListByProductPager(testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, &armapimanagement.ProductAPIClientListByProductOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for productAPIClientNewListByProductPager.More() { - _, err := productAPIClientNewListByProductPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step ProductApi_Delete - fmt.Println("Call operation: ProductApi_Delete") - _, err = productAPIClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, testsuite.apiId, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/products/groups -func (testsuite *ApimproductsTestSuite) TestProductgroup() { - var err error - // From step Group_CreateOrUpdate - fmt.Println("Call operation: Group_CreateOrUpdate") - groupClient, err := armapimanagement.NewGroupClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = groupClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.groupId, armapimanagement.GroupCreateParameters{ - Properties: &armapimanagement.GroupCreateParametersProperties{ - DisplayName: to.Ptr(testsuite.groupId), - }, - }, &armapimanagement.GroupClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step ProductGroup_CreateOrUpdate - fmt.Println("Call operation: ProductGroup_CreateOrUpdate") - productGroupClient, err := armapimanagement.NewProductGroupClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = productGroupClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, testsuite.groupId, nil) - testsuite.Require().NoError(err) - - // From step ProductGroup_CheckEntityExists - fmt.Println("Call operation: ProductGroup_CheckEntityExists") - _, err = productGroupClient.CheckEntityExists(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, testsuite.groupId, nil) - testsuite.Require().NoError(err) - - // From step ProductGroup_ListByProduct - fmt.Println("Call operation: ProductGroup_ListByProduct") - productGroupClientNewListByProductPager := productGroupClient.NewListByProductPager(testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, &armapimanagement.ProductGroupClientListByProductOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for productGroupClientNewListByProductPager.More() { - _, err := productGroupClientNewListByProductPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step ProductGroup_Delete - fmt.Println("Call operation: ProductGroup_Delete") - _, err = productGroupClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, testsuite.groupId, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/products/policies -func (testsuite *ApimproductsTestSuite) TestProductpolicy() { - var err error - // From step ProductPolicy_CreateOrUpdate - fmt.Println("Call operation: ProductPolicy_CreateOrUpdate") - productPolicyClient, err := armapimanagement.NewProductPolicyClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = productPolicyClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, armapimanagement.PolicyIDNamePolicy, armapimanagement.PolicyContract{ - Properties: &armapimanagement.PolicyContractProperties{ - Format: to.Ptr(armapimanagement.PolicyContentFormatXML), - }, - }, &armapimanagement.ProductPolicyClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step ProductPolicy_GetEntityTag - fmt.Println("Call operation: ProductPolicy_GetEntityTag") - _, err = productPolicyClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, armapimanagement.PolicyIDNamePolicy, nil) - testsuite.Require().NoError(err) - - // From step ProductPolicy_ListByProduct - fmt.Println("Call operation: ProductPolicy_ListByProduct") - _, err = productPolicyClient.ListByProduct(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, nil) - testsuite.Require().NoError(err) - - // From step ProductPolicy_Get - fmt.Println("Call operation: ProductPolicy_Get") - _, err = productPolicyClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, armapimanagement.PolicyIDNamePolicy, &armapimanagement.ProductPolicyClientGetOptions{Format: nil}) - testsuite.Require().NoError(err) - - // From step ProductPolicy_Delete - fmt.Println("Call operation: ProductPolicy_Delete") - _, err = productPolicyClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, armapimanagement.PolicyIDNamePolicy, "*", nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/products/tags -func (testsuite *ApimproductsTestSuite) TestProducttag() { - var err error - // From step Tag_CreateOrUpdate - fmt.Println("Call operation: Tag_CreateOrUpdate") - tagClient, err := armapimanagement.NewTagClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = tagClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.tagId, armapimanagement.TagCreateUpdateParameters{ - Properties: &armapimanagement.TagContractProperties{ - DisplayName: to.Ptr(testsuite.tagId), - }, - }, &armapimanagement.TagClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step Tag_AssignToProduct - fmt.Println("Call operation: Tag_AssignToProduct") - _, err = tagClient.AssignToProduct(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, testsuite.tagId, nil) - testsuite.Require().NoError(err) - - // From step Tag_GetEntityStateByProduct - fmt.Println("Call operation: Tag_GetEntityStateByProduct") - _, err = tagClient.GetEntityStateByProduct(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, testsuite.tagId, nil) - testsuite.Require().NoError(err) - - // From step Tag_GetByProduct - fmt.Println("Call operation: Tag_GetByProduct") - _, err = tagClient.GetByProduct(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, testsuite.tagId, nil) - testsuite.Require().NoError(err) - - // From step Tag_ListByProduct - fmt.Println("Call operation: Tag_ListByProduct") - tagClientNewListByProductPager := tagClient.NewListByProductPager(testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, &armapimanagement.TagClientListByProductOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for tagClientNewListByProductPager.More() { - _, err := tagClientNewListByProductPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Tag_DetachFromProduct - fmt.Println("Call operation: Tag_DetachFromProduct") - _, err = tagClient.DetachFromProduct(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, testsuite.tagId, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/products/subscriptions -func (testsuite *ApimproductsTestSuite) TestProductsubscriptions() { - var err error - // From step ProductSubscriptions_List - fmt.Println("Call operation: ProductSubscriptions_List") - productSubscriptionsClient, err := armapimanagement.NewProductSubscriptionsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - productSubscriptionsClientNewListPager := productSubscriptionsClient.NewListPager(testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, &armapimanagement.ProductSubscriptionsClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for productSubscriptionsClientNewListPager.More() { - _, err := productSubscriptionsClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } -} - -func (testsuite *ApimproductsTestSuite) Cleanup() { - var err error - // From step Product_Delete - fmt.Println("Call operation: Product_Delete") - productClient, err := armapimanagement.NewProductClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = productClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, "*", &armapimanagement.ProductClientDeleteOptions{DeleteSubscriptions: to.Ptr(true)}) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimreports_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimreports_live_test.go deleted file mode 100644 index b7d4574af1f9..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimreports_live_test.go +++ /dev/null @@ -1,189 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimreportsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimreportsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicereports", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimreportsTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimreportsTestSuite(t *testing.T) { - suite.Run(t, new(ApimreportsTestSuite)) -} - -func (testsuite *ApimreportsTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/reports -func (testsuite *ApimreportsTestSuite) TestReports() { - var err error - // From step Reports_ListByApi - fmt.Println("Call operation: Reports_ListByApi") - reportsClient, err := armapimanagement.NewReportsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - reportsClientNewListByAPIPager := reportsClient.NewListByAPIPager(testsuite.resourceGroupName, testsuite.serviceName, "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListByAPIOptions{Top: nil, - Skip: nil, - Orderby: nil, - }) - for reportsClientNewListByAPIPager.More() { - _, err := reportsClientNewListByAPIPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Reports_ListByGeo - fmt.Println("Call operation: Reports_ListByGeo") - reportsClientNewListByGeoPager := reportsClient.NewListByGeoPager(testsuite.resourceGroupName, testsuite.serviceName, "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListByGeoOptions{Top: nil, - Skip: nil, - }) - for reportsClientNewListByGeoPager.More() { - _, err := reportsClientNewListByGeoPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Reports_ListByOperation - fmt.Println("Call operation: Reports_ListByOperation") - reportsClientNewListByOperationPager := reportsClient.NewListByOperationPager(testsuite.resourceGroupName, testsuite.serviceName, "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListByOperationOptions{Top: nil, - Skip: nil, - Orderby: nil, - }) - for reportsClientNewListByOperationPager.More() { - _, err := reportsClientNewListByOperationPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Reports_ListByProduct - fmt.Println("Call operation: Reports_ListByProduct") - reportsClientNewListByProductPager := reportsClient.NewListByProductPager(testsuite.resourceGroupName, testsuite.serviceName, "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListByProductOptions{Top: nil, - Skip: nil, - Orderby: nil, - }) - for reportsClientNewListByProductPager.More() { - _, err := reportsClientNewListByProductPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Reports_ListBySubscription - fmt.Println("Call operation: Reports_ListBySubscription") - reportsClientNewListBySubscriptionPager := reportsClient.NewListBySubscriptionPager(testsuite.resourceGroupName, testsuite.serviceName, "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListBySubscriptionOptions{Top: nil, - Skip: nil, - Orderby: nil, - }) - for reportsClientNewListBySubscriptionPager.More() { - _, err := reportsClientNewListBySubscriptionPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Reports_ListByTime - fmt.Println("Call operation: Reports_ListByTime") - reportsClientNewListByTimePager := reportsClient.NewListByTimePager(testsuite.resourceGroupName, testsuite.serviceName, "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", "PT15M", &armapimanagement.ReportsClientListByTimeOptions{Top: nil, - Skip: nil, - Orderby: nil, - }) - for reportsClientNewListByTimePager.More() { - _, err := reportsClientNewListByTimePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Reports_ListByUser - fmt.Println("Call operation: Reports_ListByUser") - reportsClientNewListByUserPager := reportsClient.NewListByUserPager(testsuite.resourceGroupName, testsuite.serviceName, "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", &armapimanagement.ReportsClientListByUserOptions{Top: nil, - Skip: nil, - Orderby: nil, - }) - for reportsClientNewListByUserPager.More() { - _, err := reportsClientNewListByUserPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } -} - -// Microsoft.ApiManagement/service/regions -func (testsuite *ApimreportsTestSuite) TestRegion() { - var err error - // From step Region_ListByService - fmt.Println("Call operation: Region_ListByService") - regionClient, err := armapimanagement.NewRegionClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - regionClientNewListByServicePager := regionClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, nil) - for regionClientNewListByServicePager.More() { - _, err := regionClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimschema_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimschema_live_test.go deleted file mode 100644 index 7b44c4edf0a1..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimschema_live_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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimschemaTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - schemaId string - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimschemaTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.schemaId = testutil.GenerateAlphaNumericID(testsuite.T(), "globalschemaid", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "serviceschema", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimschemaTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimschemaTestSuite(t *testing.T) { - suite.Run(t, new(ApimschemaTestSuite)) -} - -func (testsuite *ApimschemaTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/schemas -func (testsuite *ApimschemaTestSuite) TestGlobalschema() { - var err error - // From step GlobalSchema_CreateOrUpdate - fmt.Println("Call operation: GlobalSchema_CreateOrUpdate") - globalSchemaClient, err := armapimanagement.NewGlobalSchemaClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - globalSchemaClientCreateOrUpdateResponsePoller, err := globalSchemaClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.schemaId, armapimanagement.GlobalSchemaContract{ - Properties: &armapimanagement.GlobalSchemaContractProperties{ - SchemaType: to.Ptr(armapimanagement.SchemaTypeXML), - Description: to.Ptr("sample schema description"), - Value: "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", - }, - }, &armapimanagement.GlobalSchemaClientBeginCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, globalSchemaClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step GlobalSchema_GetEntityTag - fmt.Println("Call operation: GlobalSchema_GetEntityTag") - _, err = globalSchemaClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.schemaId, nil) - testsuite.Require().NoError(err) - - // From step GlobalSchema_ListByService - fmt.Println("Call operation: GlobalSchema_ListByService") - globalSchemaClientNewListByServicePager := globalSchemaClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.GlobalSchemaClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for globalSchemaClientNewListByServicePager.More() { - _, err := globalSchemaClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step GlobalSchema_Get - fmt.Println("Call operation: GlobalSchema_Get") - _, err = globalSchemaClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.schemaId, nil) - testsuite.Require().NoError(err) - - // From step GlobalSchema_Delete - fmt.Println("Call operation: GlobalSchema_Delete") - _, err = globalSchemaClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.schemaId, "*", nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimsubscriptions_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimsubscriptions_live_test.go deleted file mode 100644 index 584d303d86c3..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimsubscriptions_live_test.go +++ /dev/null @@ -1,209 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimsubscriptionsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - productId string - serviceName string - sid string - subproductId string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimsubscriptionsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.productId = testutil.GenerateAlphaNumericID(testsuite.T(), "subproductid", 6) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicesub", 6) - testsuite.sid = testutil.GenerateAlphaNumericID(testsuite.T(), "sid", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimsubscriptionsTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimsubscriptionsTestSuite(t *testing.T) { - suite.Run(t, new(ApimsubscriptionsTestSuite)) -} - -func (testsuite *ApimsubscriptionsTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step Product_CreateOrUpdate - fmt.Println("Call operation: Product_CreateOrUpdate") - productClient, err := armapimanagement.NewProductClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - productClientCreateOrUpdateResponse, err := productClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.productId, armapimanagement.ProductContract{ - Properties: &armapimanagement.ProductContractProperties{ - DisplayName: to.Ptr("Test Template ProductName 4"), - }, - }, &armapimanagement.ProductClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - testsuite.subproductId = *productClientCreateOrUpdateResponse.ID -} - -// Microsoft.ApiManagement/service/subscriptions -func (testsuite *ApimsubscriptionsTestSuite) TestSubscription() { - var err error - // From step Subscription_CreateOrUpdate - fmt.Println("Call operation: Subscription_CreateOrUpdate") - subscriptionClient, err := armapimanagement.NewSubscriptionClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = subscriptionClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.sid, armapimanagement.SubscriptionCreateParameters{ - Properties: &armapimanagement.SubscriptionCreateParameterProperties{ - DisplayName: to.Ptr(testsuite.sid), - Scope: to.Ptr(testsuite.subproductId), - }, - }, &armapimanagement.SubscriptionClientCreateOrUpdateOptions{Notify: nil, - IfMatch: nil, - AppType: nil, - }) - testsuite.Require().NoError(err) - - // From step Subscription_GetEntityTag - fmt.Println("Call operation: Subscription_GetEntityTag") - _, err = subscriptionClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.sid, nil) - testsuite.Require().NoError(err) - - // From step Subscription_List - fmt.Println("Call operation: Subscription_List") - subscriptionClientNewListPager := subscriptionClient.NewListPager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.SubscriptionClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for subscriptionClientNewListPager.More() { - _, err := subscriptionClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Subscription_Get - fmt.Println("Call operation: Subscription_Get") - _, err = subscriptionClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.sid, nil) - testsuite.Require().NoError(err) - - // From step Subscription_Update - fmt.Println("Call operation: Subscription_Update") - _, err = subscriptionClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.sid, "*", armapimanagement.SubscriptionUpdateParameters{ - Properties: &armapimanagement.SubscriptionUpdateParameterProperties{ - DisplayName: to.Ptr(testsuite.sid), - }, - }, &armapimanagement.SubscriptionClientUpdateOptions{Notify: nil, - AppType: nil, - }) - testsuite.Require().NoError(err) - - // From step Subscription_RegeneratePrimaryKey - fmt.Println("Call operation: Subscription_RegeneratePrimaryKey") - _, err = subscriptionClient.RegeneratePrimaryKey(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.sid, nil) - testsuite.Require().NoError(err) - - // From step Subscription_RegenerateSecondaryKey - fmt.Println("Call operation: Subscription_RegenerateSecondaryKey") - _, err = subscriptionClient.RegenerateSecondaryKey(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.sid, nil) - testsuite.Require().NoError(err) - - // From step Subscription_ListSecrets - fmt.Println("Call operation: Subscription_ListSecrets") - _, err = subscriptionClient.ListSecrets(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.sid, nil) - testsuite.Require().NoError(err) - - // From step Subscription_Delete - fmt.Println("Call operation: Subscription_Delete") - _, err = subscriptionClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.sid, "*", nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/skus -func (testsuite *ApimsubscriptionsTestSuite) TestApimanagementskus() { - var err error - // From step ApiManagementSkus_List - fmt.Println("Call operation: ApiManagementSkus_List") - sKUsClient, err := armapimanagement.NewSKUsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - sKUsClientNewListPager := sKUsClient.NewListPager(nil) - for sKUsClientNewListPager.More() { - _, err := sKUsClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } -} - -// Microsoft.ApiManagement/service/settings -func (testsuite *ApimsubscriptionsTestSuite) TestTenantsettings() { - var err error - // From step TenantSettings_ListByService - fmt.Println("Call operation: TenantSettings_ListByService") - tenantSettingsClient, err := armapimanagement.NewTenantSettingsClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - tenantSettingsClientNewListByServicePager := tenantSettingsClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.TenantSettingsClientListByServiceOptions{Filter: nil}) - for tenantSettingsClientNewListByServicePager.More() { - _, err := tenantSettingsClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step TenantSettings_Get - fmt.Println("Call operation: TenantSettings_Get") - _, err = tenantSettingsClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.SettingsTypeNamePublic, nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimtags_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimtags_live_test.go deleted file mode 100644 index 73bc096d886e..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimtags_live_test.go +++ /dev/null @@ -1,139 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimtagsTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - serviceName string - tagId string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimtagsTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicetags", 6) - testsuite.tagId = testutil.GenerateAlphaNumericID(testsuite.T(), "tagsid", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimtagsTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimtagsTestSuite(t *testing.T) { - suite.Run(t, new(ApimtagsTestSuite)) -} - -func (testsuite *ApimtagsTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/tags -func (testsuite *ApimtagsTestSuite) TestTags() { - var err error - // From step Tag_CreateOrUpdate - fmt.Println("Call operation: Tag_CreateOrUpdate") - tagClient, err := armapimanagement.NewTagClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = tagClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.tagId, armapimanagement.TagCreateUpdateParameters{ - Properties: &armapimanagement.TagContractProperties{ - DisplayName: to.Ptr(testsuite.tagId), - }, - }, &armapimanagement.TagClientCreateOrUpdateOptions{IfMatch: nil}) - testsuite.Require().NoError(err) - - // From step Tag_ListByService - fmt.Println("Call operation: Tag_ListByService") - tagClientNewListByServicePager := tagClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.TagClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - Scope: nil, - }) - for tagClientNewListByServicePager.More() { - _, err := tagClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step Tag_GetEntityState - fmt.Println("Call operation: Tag_GetEntityState") - _, err = tagClient.GetEntityState(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.tagId, nil) - testsuite.Require().NoError(err) - - // From step Tag_Get - fmt.Println("Call operation: Tag_Get") - _, err = tagClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.tagId, nil) - testsuite.Require().NoError(err) - - // From step Tag_Update - fmt.Println("Call operation: Tag_Update") - _, err = tagClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.tagId, "*", armapimanagement.TagCreateUpdateParameters{ - Properties: &armapimanagement.TagContractProperties{ - DisplayName: to.Ptr("update_" + testsuite.tagId), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step Tag_Delete - fmt.Println("Call operation: Tag_Delete") - _, err = tagClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.tagId, "*", nil) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimtenant_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimtenant_live_test.go deleted file mode 100644 index e618bd9af926..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimtenant_live_test.go +++ /dev/null @@ -1,205 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimtenantTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - serviceName string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimtenantTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "servicetenant", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimtenantTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimtenantTestSuite(t *testing.T) { - suite.Run(t, new(ApimtenantTestSuite)) -} - -func (testsuite *ApimtenantTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) - - // From step TenantAccess_Create - fmt.Println("Call operation: TenantAccess_Create") - tenantAccessClient, err := armapimanagement.NewTenantAccessClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = tenantAccessClient.Create(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.AccessIDNameAccess, "*", armapimanagement.AccessInformationCreateParameters{ - Properties: &armapimanagement.AccessInformationCreateParameterProperties{ - Enabled: to.Ptr(true), - }, - }, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/tenant -func (testsuite *ApimtenantTestSuite) TestTenantaccess() { - var err error - // From step TenantAccess_GetEntityTag - fmt.Println("Call operation: TenantAccess_GetEntityTag") - tenantAccessClient, err := armapimanagement.NewTenantAccessClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = tenantAccessClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.AccessIDNameAccess, nil) - testsuite.Require().NoError(err) - - // From step TenantAccess_ListByService - fmt.Println("Call operation: TenantAccess_ListByService") - tenantAccessClientNewListByServicePager := tenantAccessClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.TenantAccessClientListByServiceOptions{Filter: nil}) - for tenantAccessClientNewListByServicePager.More() { - _, err := tenantAccessClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step TenantAccess_Get - fmt.Println("Call operation: TenantAccess_Get") - _, err = tenantAccessClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.AccessIDNameAccess, nil) - testsuite.Require().NoError(err) - - // From step TenantAccess_Update - fmt.Println("Call operation: TenantAccess_Update") - _, err = tenantAccessClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.AccessIDNameAccess, "*", armapimanagement.AccessInformationUpdateParameters{ - Properties: &armapimanagement.AccessInformationUpdateParameterProperties{ - Enabled: to.Ptr(true), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step TenantAccess_RegenerateSecondaryKey - fmt.Println("Call operation: TenantAccess_RegenerateSecondaryKey") - _, err = tenantAccessClient.RegenerateSecondaryKey(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.AccessIDNameAccess, nil) - testsuite.Require().NoError(err) - - // From step TenantAccess_ListSecrets - fmt.Println("Call operation: TenantAccess_ListSecrets") - _, err = tenantAccessClient.ListSecrets(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.AccessIDNameAccess, nil) - testsuite.Require().NoError(err) - - // From step TenantAccess_RegeneratePrimaryKey - fmt.Println("Call operation: TenantAccess_RegeneratePrimaryKey") - _, err = tenantAccessClient.RegeneratePrimaryKey(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.AccessIDNameAccess, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/tenant/git -func (testsuite *ApimtenantTestSuite) TestTenantaccessgit() { - var err error - // From step TenantAccessGit_RegeneratePrimaryKey - fmt.Println("Call operation: TenantAccessGit_RegeneratePrimaryKey") - tenantAccessGitClient, err := armapimanagement.NewTenantAccessGitClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = tenantAccessGitClient.RegeneratePrimaryKey(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.AccessIDNameAccess, nil) - testsuite.Require().NoError(err) - - // From step TenantAccessGit_RegenerateSecondaryKey - fmt.Println("Call operation: TenantAccessGit_RegenerateSecondaryKey") - _, err = tenantAccessGitClient.RegenerateSecondaryKey(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.AccessIDNameAccess, nil) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/tenant/configuration -func (testsuite *ApimtenantTestSuite) TestTenantconfiguration() { - var err error - // From step TenantConfiguration_Save - fmt.Println("Call operation: TenantConfiguration_Save") - tenantConfigurationClient, err := armapimanagement.NewTenantConfigurationClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - tenantConfigurationClientSaveResponsePoller, err := tenantConfigurationClient.BeginSave(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ConfigurationIDNameConfiguration, armapimanagement.SaveConfigurationParameter{ - Properties: &armapimanagement.SaveConfigurationParameterProperties{ - Branch: to.Ptr("master"), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, tenantConfigurationClientSaveResponsePoller) - testsuite.Require().NoError(err) - - // From step TenantConfiguration_GetSyncState - fmt.Println("Call operation: TenantConfiguration_GetSyncState") - _, err = tenantConfigurationClient.GetSyncState(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ConfigurationIDNameConfiguration, nil) - testsuite.Require().NoError(err) - - // From step TenantConfiguration_Validate - fmt.Println("Call operation: TenantConfiguration_Validate") - tenantConfigurationClientValidateResponsePoller, err := tenantConfigurationClient.BeginValidate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ConfigurationIDNameConfiguration, armapimanagement.DeployConfigurationParameters{ - Properties: &armapimanagement.DeployConfigurationParameterProperties{ - Branch: to.Ptr("master"), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, tenantConfigurationClientValidateResponsePoller) - testsuite.Require().NoError(err) - - // From step TenantConfiguration_Deploy - fmt.Println("Call operation: TenantConfiguration_Deploy") - tenantConfigurationClientDeployResponsePoller, err := tenantConfigurationClient.BeginDeploy(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ConfigurationIDNameConfiguration, armapimanagement.DeployConfigurationParameters{ - Properties: &armapimanagement.DeployConfigurationParameterProperties{ - Branch: to.Ptr("master"), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, tenantConfigurationClientDeployResponsePoller) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apimusers_live_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/apimusers_live_test.go deleted file mode 100644 index 90c88f0c5c76..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/apimusers_live_test.go +++ /dev/null @@ -1,200 +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 armapimanagement_test - -import ( - "context" - "fmt" - "testing" - - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal/testutil" - "github.com/stretchr/testify/suite" -) - -type ApimusersTestSuite struct { - suite.Suite - - ctx context.Context - cred azcore.TokenCredential - options *arm.ClientOptions - serviceName string - userId string - location string - resourceGroupName string - subscriptionId string -} - -func (testsuite *ApimusersTestSuite) SetupSuite() { - testutil.StartRecording(testsuite.T(), "sdk/resourcemanager/apimanagement/armapimanagement/testdata") - testsuite.ctx = context.Background() - testsuite.cred, testsuite.options = testutil.GetCredAndClientOptions(testsuite.T()) - testsuite.serviceName = testutil.GenerateAlphaNumericID(testsuite.T(), "serviceuser", 6) - testsuite.userId = testutil.GenerateAlphaNumericID(testsuite.T(), "userid", 6) - testsuite.location = testutil.GetEnv("LOCATION", "westus") - testsuite.resourceGroupName = testutil.GetEnv("RESOURCE_GROUP_NAME", "scenarioTestTempGroup") - testsuite.subscriptionId = testutil.GetEnv("AZURE_SUBSCRIPTION_ID", "00000000-0000-0000-0000-000000000000") - - resourceGroup, _, err := testutil.CreateResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.location) - testsuite.Require().NoError(err) - testsuite.resourceGroupName = *resourceGroup.Name - testsuite.Prepare() -} - -func (testsuite *ApimusersTestSuite) TearDownSuite() { - _, err := testutil.DeleteResourceGroup(testsuite.ctx, testsuite.subscriptionId, testsuite.cred, testsuite.options, testsuite.resourceGroupName) - testsuite.Require().NoError(err) - testutil.StopRecording(testsuite.T()) -} - -func TestApimusersTestSuite(t *testing.T) { - suite.Run(t, new(ApimusersTestSuite)) -} - -func (testsuite *ApimusersTestSuite) Prepare() { - var err error - // From step ApiManagementService_CreateOrUpdate - fmt.Println("Call operation: ApiManagementService_CreateOrUpdate") - serviceClient, err := armapimanagement.NewServiceClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - serviceClientCreateOrUpdateResponsePoller, err := serviceClient.BeginCreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "Name": to.Ptr("Contoso"), - "Test": to.Ptr("User"), - }, - Location: to.Ptr(testsuite.location), - Properties: &armapimanagement.ServiceProperties{ - PublisherEmail: to.Ptr("foo@contoso.com"), - PublisherName: to.Ptr("foo"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypeStandard), - Capacity: to.Ptr[int32](1), - }, - }, nil) - testsuite.Require().NoError(err) - _, err = testutil.PollForTest(testsuite.ctx, serviceClientCreateOrUpdateResponsePoller) - testsuite.Require().NoError(err) -} - -// Microsoft.ApiManagement/service/users -func (testsuite *ApimusersTestSuite) TestUser() { - var err error - // From step User_CreateOrUpdate - fmt.Println("Call operation: User_CreateOrUpdate") - userClient, err := armapimanagement.NewUserClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = userClient.CreateOrUpdate(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.userId, armapimanagement.UserCreateParameters{ - Properties: &armapimanagement.UserCreateParameterProperties{ - Confirmation: to.Ptr(armapimanagement.ConfirmationSignup), - Email: to.Ptr("foobar@outlook.com"), - FirstName: to.Ptr("foo"), - LastName: to.Ptr("bar"), - }, - }, &armapimanagement.UserClientCreateOrUpdateOptions{Notify: nil, - IfMatch: nil, - }) - testsuite.Require().NoError(err) - - // From step User_GetEntityTag - fmt.Println("Call operation: User_GetEntityTag") - _, err = userClient.GetEntityTag(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.userId, nil) - testsuite.Require().NoError(err) - - // From step User_ListByService - fmt.Println("Call operation: User_ListByService") - userClientNewListByServicePager := userClient.NewListByServicePager(testsuite.resourceGroupName, testsuite.serviceName, &armapimanagement.UserClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - ExpandGroups: nil, - }) - for userClientNewListByServicePager.More() { - _, err := userClientNewListByServicePager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step User_Get - fmt.Println("Call operation: User_Get") - _, err = userClient.Get(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.userId, nil) - testsuite.Require().NoError(err) - - // From step User_Update - fmt.Println("Call operation: User_Update") - _, err = userClient.Update(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.userId, "*", armapimanagement.UserUpdateParameters{ - Properties: &armapimanagement.UserUpdateParametersProperties{ - Email: to.Ptr("foobar@outlook.com"), - FirstName: to.Ptr("foo"), - LastName: to.Ptr("bar"), - }, - }, nil) - testsuite.Require().NoError(err) - - // From step User_GenerateSsoUrl - fmt.Println("Call operation: User_GenerateSsoUrl") - _, err = userClient.GenerateSsoURL(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.userId, nil) - testsuite.Require().NoError(err) - - // From step UserGroup_List - fmt.Println("Call operation: UserGroup_List") - userGroupClient, err := armapimanagement.NewUserGroupClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - userGroupClientNewListPager := userGroupClient.NewListPager(testsuite.resourceGroupName, testsuite.serviceName, testsuite.userId, &armapimanagement.UserGroupClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for userGroupClientNewListPager.More() { - _, err := userGroupClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step UserSubscription_List - fmt.Println("Call operation: UserSubscription_List") - userSubscriptionClient, err := armapimanagement.NewUserSubscriptionClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - userSubscriptionClientNewListPager := userSubscriptionClient.NewListPager(testsuite.resourceGroupName, testsuite.serviceName, testsuite.userId, &armapimanagement.UserSubscriptionClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for userSubscriptionClientNewListPager.More() { - _, err := userSubscriptionClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step UserIdentities_List - fmt.Println("Call operation: UserIdentities_List") - userIdentitiesClient, err := armapimanagement.NewUserIdentitiesClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - userIdentitiesClientNewListPager := userIdentitiesClient.NewListPager(testsuite.resourceGroupName, testsuite.serviceName, testsuite.userId, nil) - for userIdentitiesClientNewListPager.More() { - _, err := userIdentitiesClientNewListPager.NextPage(testsuite.ctx) - testsuite.Require().NoError(err) - break - } - - // From step UserConfirmationPassword_Send - fmt.Println("Call operation: UserConfirmationPassword_Send") - userConfirmationPasswordClient, err := armapimanagement.NewUserConfirmationPasswordClient(testsuite.subscriptionId, testsuite.cred, testsuite.options) - testsuite.Require().NoError(err) - _, err = userConfirmationPasswordClient.Send(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.userId, &armapimanagement.UserConfirmationPasswordClientSendOptions{AppType: nil}) - testsuite.Require().NoError(err) - - // From step User_Delete - fmt.Println("Call operation: User_Delete") - _, err = userClient.Delete(testsuite.ctx, testsuite.resourceGroupName, testsuite.serviceName, testsuite.userId, "*", &armapimanagement.UserClientDeleteOptions{DeleteSubscriptions: nil, - Notify: nil, - AppType: nil, - }) - testsuite.Require().NoError(err) -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apioperation_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apioperation_client.go similarity index 81% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apioperation_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apioperation_client.go index 3acf23ef03a8..949823a019fb 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apioperation_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apioperation_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 armapimanagement @@ -32,10 +33,9 @@ type APIOperationClient struct { } // NewAPIOperationClient creates a new instance of APIOperationClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIOperationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIOperationClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,15 +58,16 @@ func NewAPIOperationClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Creates a new operation in the API or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// parameters - Create parameters. -// options - APIOperationClientCreateOrUpdateOptions contains the optional parameters for the APIOperationClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - APIOperationClientCreateOrUpdateOptions contains the optional parameters for the APIOperationClient.CreateOrUpdate +// method. func (client *APIOperationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, parameters OperationContract, options *APIOperationClientCreateOrUpdateOptions) (APIOperationClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, parameters, options) if err != nil { @@ -110,7 +111,7 @@ func (client *APIOperationClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -133,15 +134,16 @@ func (client *APIOperationClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Deletes the specified operation in the API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - APIOperationClientDeleteOptions contains the optional parameters for the APIOperationClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APIOperationClientDeleteOptions contains the optional parameters for the APIOperationClient.Delete method. func (client *APIOperationClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, ifMatch string, options *APIOperationClientDeleteOptions) (APIOperationClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, ifMatch, options) if err != nil { @@ -185,7 +187,7 @@ func (client *APIOperationClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -194,13 +196,14 @@ func (client *APIOperationClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the details of the API Operation specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// options - APIOperationClientGetOptions contains the optional parameters for the APIOperationClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - options - APIOperationClientGetOptions contains the optional parameters for the APIOperationClient.Get method. func (client *APIOperationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, options *APIOperationClientGetOptions) (APIOperationClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, options) if err != nil { @@ -244,7 +247,7 @@ func (client *APIOperationClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -263,14 +266,15 @@ func (client *APIOperationClient) getHandleResponse(resp *http.Response) (APIOpe } // GetEntityTag - Gets the entity state (Etag) version of the API operation specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// options - APIOperationClientGetEntityTagOptions contains the optional parameters for the APIOperationClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - options - APIOperationClientGetEntityTagOptions contains the optional parameters for the APIOperationClient.GetEntityTag +// method. func (client *APIOperationClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, options *APIOperationClientGetEntityTagOptions) (APIOperationClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, options) if err != nil { @@ -314,7 +318,7 @@ func (client *APIOperationClient) getEntityTagCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -331,13 +335,14 @@ func (client *APIOperationClient) getEntityTagHandleResponse(resp *http.Response } // NewListByAPIPager - Lists a collection of the operations for the specified API. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// options - APIOperationClientListByAPIOptions contains the optional parameters for the APIOperationClient.ListByAPI method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - APIOperationClientListByAPIOptions contains the optional parameters for the APIOperationClient.NewListByAPIPager +// method. func (client *APIOperationClient) NewListByAPIPager(resourceGroupName string, serviceName string, apiID string, options *APIOperationClientListByAPIOptions) *runtime.Pager[APIOperationClientListByAPIResponse] { return runtime.NewPager(runtime.PagingHandler[APIOperationClientListByAPIResponse]{ More: func(page APIOperationClientListByAPIResponse) bool { @@ -402,7 +407,7 @@ func (client *APIOperationClient) listByAPICreateRequest(ctx context.Context, re if options != nil && options.Tags != nil { reqQP.Set("tags", *options.Tags) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -419,16 +424,17 @@ func (client *APIOperationClient) listByAPIHandleResponse(resp *http.Response) ( // Update - Updates the details of the operation in the API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - API Operation Update parameters. -// options - APIOperationClientUpdateOptions contains the optional parameters for the APIOperationClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - API Operation Update parameters. +// - options - APIOperationClientUpdateOptions contains the optional parameters for the APIOperationClient.Update method. func (client *APIOperationClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, ifMatch string, parameters OperationUpdateContract, options *APIOperationClientUpdateOptions) (APIOperationClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, ifMatch, parameters, options) if err != nil { @@ -472,7 +478,7 @@ func (client *APIOperationClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apioperationpolicy_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apioperationpolicy_client.go similarity index 81% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apioperationpolicy_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apioperationpolicy_client.go index 0acebc5be5d4..4f8a896cf7cb 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apioperationpolicy_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apioperationpolicy_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 armapimanagement @@ -31,10 +32,9 @@ type APIOperationPolicyClient struct { } // NewAPIOperationPolicyClient creates a new instance of APIOperationPolicyClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIOperationPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIOperationPolicyClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,16 +57,17 @@ func NewAPIOperationPolicyClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Creates or updates policy configuration for the API Operation level. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// policyID - The identifier of the Policy. -// parameters - The policy contents to apply. -// options - APIOperationPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIOperationPolicyClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - parameters - The policy contents to apply. +// - options - APIOperationPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIOperationPolicyClient.CreateOrUpdate +// method. func (client *APIOperationPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, policyID PolicyIDName, parameters PolicyContract, options *APIOperationPolicyClientCreateOrUpdateOptions) (APIOperationPolicyClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, policyID, parameters, options) if err != nil { @@ -114,7 +115,7 @@ func (client *APIOperationPolicyClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -137,17 +138,18 @@ func (client *APIOperationPolicyClient) createOrUpdateHandleResponse(resp *http. // Delete - Deletes the policy configuration at the Api Operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// policyID - The identifier of the Policy. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - APIOperationPolicyClientDeleteOptions contains the optional parameters for the APIOperationPolicyClient.Delete -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APIOperationPolicyClientDeleteOptions contains the optional parameters for the APIOperationPolicyClient.Delete +// method. func (client *APIOperationPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, policyID PolicyIDName, ifMatch string, options *APIOperationPolicyClientDeleteOptions) (APIOperationPolicyClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, policyID, ifMatch, options) if err != nil { @@ -195,7 +197,7 @@ func (client *APIOperationPolicyClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -204,14 +206,15 @@ func (client *APIOperationPolicyClient) deleteCreateRequest(ctx context.Context, // Get - Get the policy configuration at the API Operation level. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// policyID - The identifier of the Policy. -// options - APIOperationPolicyClientGetOptions contains the optional parameters for the APIOperationPolicyClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - options - APIOperationPolicyClientGetOptions contains the optional parameters for the APIOperationPolicyClient.Get method. func (client *APIOperationPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, policyID PolicyIDName, options *APIOperationPolicyClientGetOptions) (APIOperationPolicyClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, policyID, options) if err != nil { @@ -262,7 +265,7 @@ func (client *APIOperationPolicyClient) getCreateRequest(ctx context.Context, re if options != nil && options.Format != nil { reqQP.Set("format", string(*options.Format)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -281,15 +284,16 @@ func (client *APIOperationPolicyClient) getHandleResponse(resp *http.Response) ( } // GetEntityTag - Gets the entity state (Etag) version of the API operation policy specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// policyID - The identifier of the Policy. -// options - APIOperationPolicyClientGetEntityTagOptions contains the optional parameters for the APIOperationPolicyClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - options - APIOperationPolicyClientGetEntityTagOptions contains the optional parameters for the APIOperationPolicyClient.GetEntityTag +// method. func (client *APIOperationPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, policyID PolicyIDName, options *APIOperationPolicyClientGetEntityTagOptions) (APIOperationPolicyClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, policyID, options) if err != nil { @@ -337,7 +341,7 @@ func (client *APIOperationPolicyClient) getEntityTagCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -355,14 +359,15 @@ func (client *APIOperationPolicyClient) getEntityTagHandleResponse(resp *http.Re // ListByOperation - Get the list of policy configuration at the API Operation level. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// options - APIOperationPolicyClientListByOperationOptions contains the optional parameters for the APIOperationPolicyClient.ListByOperation -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - options - APIOperationPolicyClientListByOperationOptions contains the optional parameters for the APIOperationPolicyClient.ListByOperation +// method. func (client *APIOperationPolicyClient) ListByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, options *APIOperationPolicyClientListByOperationOptions) (APIOperationPolicyClientListByOperationResponse, error) { req, err := client.listByOperationCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, options) if err != nil { @@ -406,7 +411,7 @@ func (client *APIOperationPolicyClient) listByOperationCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apipolicy_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apipolicy_client.go similarity index 82% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apipolicy_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apipolicy_client.go index 42d157542488..2981bff1c7d1 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apipolicy_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apipolicy_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 armapimanagement @@ -31,10 +32,9 @@ type APIPolicyClient struct { } // NewAPIPolicyClient creates a new instance of APIPolicyClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIPolicyClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,15 +57,16 @@ func NewAPIPolicyClient(subscriptionID string, credential azcore.TokenCredential // CreateOrUpdate - Creates or updates policy configuration for the API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// policyID - The identifier of the Policy. -// parameters - The policy contents to apply. -// options - APIPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIPolicyClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - policyID - The identifier of the Policy. +// - parameters - The policy contents to apply. +// - options - APIPolicyClientCreateOrUpdateOptions contains the optional parameters for the APIPolicyClient.CreateOrUpdate +// method. func (client *APIPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, policyID PolicyIDName, parameters PolicyContract, options *APIPolicyClientCreateOrUpdateOptions) (APIPolicyClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, policyID, parameters, options) if err != nil { @@ -109,7 +110,7 @@ func (client *APIPolicyClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -132,15 +133,16 @@ func (client *APIPolicyClient) createOrUpdateHandleResponse(resp *http.Response) // Delete - Deletes the policy configuration at the Api. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// policyID - The identifier of the Policy. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - APIPolicyClientDeleteOptions contains the optional parameters for the APIPolicyClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - policyID - The identifier of the Policy. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APIPolicyClientDeleteOptions contains the optional parameters for the APIPolicyClient.Delete method. func (client *APIPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, policyID PolicyIDName, ifMatch string, options *APIPolicyClientDeleteOptions) (APIPolicyClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, policyID, ifMatch, options) if err != nil { @@ -184,7 +186,7 @@ func (client *APIPolicyClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -193,13 +195,14 @@ func (client *APIPolicyClient) deleteCreateRequest(ctx context.Context, resource // Get - Get the policy configuration at the API level. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// policyID - The identifier of the Policy. -// options - APIPolicyClientGetOptions contains the optional parameters for the APIPolicyClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - policyID - The identifier of the Policy. +// - options - APIPolicyClientGetOptions contains the optional parameters for the APIPolicyClient.Get method. func (client *APIPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, policyID PolicyIDName, options *APIPolicyClientGetOptions) (APIPolicyClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, policyID, options) if err != nil { @@ -246,7 +249,7 @@ func (client *APIPolicyClient) getCreateRequest(ctx context.Context, resourceGro if options != nil && options.Format != nil { reqQP.Set("format", string(*options.Format)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json, application/vnd.ms-azure-apim.policy+xml, application/vnd.ms-azure-apim.policy.raw+xml"} return req, nil @@ -265,13 +268,14 @@ func (client *APIPolicyClient) getHandleResponse(resp *http.Response) (APIPolicy } // GetEntityTag - Gets the entity state (Etag) version of the API policy specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// policyID - The identifier of the Policy. -// options - APIPolicyClientGetEntityTagOptions contains the optional parameters for the APIPolicyClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - policyID - The identifier of the Policy. +// - options - APIPolicyClientGetEntityTagOptions contains the optional parameters for the APIPolicyClient.GetEntityTag method. func (client *APIPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, policyID PolicyIDName, options *APIPolicyClientGetEntityTagOptions) (APIPolicyClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, policyID, options) if err != nil { @@ -315,7 +319,7 @@ func (client *APIPolicyClient) getEntityTagCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -333,12 +337,13 @@ func (client *APIPolicyClient) getEntityTagHandleResponse(resp *http.Response) ( // ListByAPI - Get the policy configuration at the API level. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// options - APIPolicyClientListByAPIOptions contains the optional parameters for the APIPolicyClient.ListByAPI method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - APIPolicyClientListByAPIOptions contains the optional parameters for the APIPolicyClient.ListByAPI method. func (client *APIPolicyClient) ListByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIPolicyClientListByAPIOptions) (APIPolicyClientListByAPIResponse, error) { req, err := client.listByAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, options) if err != nil { @@ -378,7 +383,7 @@ func (client *APIPolicyClient) listByAPICreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiproduct_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiproduct_client.go similarity index 86% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiproduct_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apiproduct_client.go index 52c2da0d7bbf..9a7e0f4b9ca5 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiproduct_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiproduct_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 armapimanagement @@ -32,10 +33,9 @@ type APIProductClient struct { } // NewAPIProductClient creates a new instance of APIProductClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIProductClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIProductClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewAPIProductClient(subscriptionID string, credential azcore.TokenCredentia } // NewListByApisPager - Lists all Products, which the API is part of. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// options - APIProductClientListByApisOptions contains the optional parameters for the APIProductClient.ListByApis method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - APIProductClientListByApisOptions contains the optional parameters for the APIProductClient.NewListByApisPager +// method. func (client *APIProductClient) NewListByApisPager(resourceGroupName string, serviceName string, apiID string, options *APIProductClientListByApisOptions) *runtime.Pager[APIProductClientListByApisResponse] { return runtime.NewPager(runtime.PagingHandler[APIProductClientListByApisResponse]{ More: func(page APIProductClientListByApisResponse) bool { @@ -124,7 +125,7 @@ func (client *APIProductClient) listByApisCreateRequest(ctx context.Context, res if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apirelease_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apirelease_client.go similarity index 83% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apirelease_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apirelease_client.go index 2f22d87d1211..ff908037ed91 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apirelease_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apirelease_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 armapimanagement @@ -32,10 +33,9 @@ type APIReleaseClient struct { } // NewAPIReleaseClient creates a new instance of APIReleaseClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIReleaseClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIReleaseClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +58,15 @@ func NewAPIReleaseClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates a new Release for the API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// releaseID - Release identifier within an API. Must be unique in the current API Management service instance. -// parameters - Create parameters. -// options - APIReleaseClientCreateOrUpdateOptions contains the optional parameters for the APIReleaseClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - releaseID - Release identifier within an API. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - APIReleaseClientCreateOrUpdateOptions contains the optional parameters for the APIReleaseClient.CreateOrUpdate +// method. func (client *APIReleaseClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, parameters APIReleaseContract, options *APIReleaseClientCreateOrUpdateOptions) (APIReleaseClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, releaseID, parameters, options) if err != nil { @@ -109,7 +110,7 @@ func (client *APIReleaseClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -132,14 +133,15 @@ func (client *APIReleaseClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes the specified release in the API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// releaseID - Release identifier within an API. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - APIReleaseClientDeleteOptions contains the optional parameters for the APIReleaseClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - releaseID - Release identifier within an API. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APIReleaseClientDeleteOptions contains the optional parameters for the APIReleaseClient.Delete method. func (client *APIReleaseClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, ifMatch string, options *APIReleaseClientDeleteOptions) (APIReleaseClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, releaseID, ifMatch, options) if err != nil { @@ -183,7 +185,7 @@ func (client *APIReleaseClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -192,12 +194,13 @@ func (client *APIReleaseClient) deleteCreateRequest(ctx context.Context, resourc // Get - Returns the details of an API release. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// releaseID - Release identifier within an API. Must be unique in the current API Management service instance. -// options - APIReleaseClientGetOptions contains the optional parameters for the APIReleaseClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - releaseID - Release identifier within an API. Must be unique in the current API Management service instance. +// - options - APIReleaseClientGetOptions contains the optional parameters for the APIReleaseClient.Get method. func (client *APIReleaseClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, options *APIReleaseClientGetOptions) (APIReleaseClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, releaseID, options) if err != nil { @@ -241,7 +244,7 @@ func (client *APIReleaseClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -260,12 +263,13 @@ func (client *APIReleaseClient) getHandleResponse(resp *http.Response) (APIRelea } // GetEntityTag - Returns the etag of an API release. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// releaseID - Release identifier within an API. Must be unique in the current API Management service instance. -// options - APIReleaseClientGetEntityTagOptions contains the optional parameters for the APIReleaseClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - releaseID - Release identifier within an API. Must be unique in the current API Management service instance. +// - options - APIReleaseClientGetEntityTagOptions contains the optional parameters for the APIReleaseClient.GetEntityTag method. func (client *APIReleaseClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, options *APIReleaseClientGetEntityTagOptions) (APIReleaseClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, releaseID, options) if err != nil { @@ -309,7 +313,7 @@ func (client *APIReleaseClient) getEntityTagCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -328,13 +332,13 @@ func (client *APIReleaseClient) getEntityTagHandleResponse(resp *http.Response) // NewListByServicePager - Lists all releases of an API. An API release is created when making an API Revision current. Releases // are also used to rollback to previous revisions. Results will be paged and can be constrained by // the $top and $skip parameters. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// options - APIReleaseClientListByServiceOptions contains the optional parameters for the APIReleaseClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - APIReleaseClientListByServiceOptions contains the optional parameters for the APIReleaseClient.NewListByServicePager +// method. func (client *APIReleaseClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, options *APIReleaseClientListByServiceOptions) *runtime.Pager[APIReleaseClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[APIReleaseClientListByServiceResponse]{ More: func(page APIReleaseClientListByServiceResponse) bool { @@ -396,7 +400,7 @@ func (client *APIReleaseClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -413,15 +417,16 @@ func (client *APIReleaseClient) listByServiceHandleResponse(resp *http.Response) // Update - Updates the details of the release of the API specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// releaseID - Release identifier within an API. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - API Release Update parameters. -// options - APIReleaseClientUpdateOptions contains the optional parameters for the APIReleaseClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - releaseID - Release identifier within an API. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - API Release Update parameters. +// - options - APIReleaseClientUpdateOptions contains the optional parameters for the APIReleaseClient.Update method. func (client *APIReleaseClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, releaseID string, ifMatch string, parameters APIReleaseContract, options *APIReleaseClientUpdateOptions) (APIReleaseClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, releaseID, ifMatch, parameters, options) if err != nil { @@ -465,7 +470,7 @@ func (client *APIReleaseClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apirevision_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apirevision_client.go similarity index 86% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apirevision_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apirevision_client.go index 1cd8bffb9e57..20b3b308f0a4 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apirevision_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apirevision_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 armapimanagement @@ -32,10 +33,9 @@ type APIRevisionClient struct { } // NewAPIRevisionClient creates a new instance of APIRevisionClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIRevisionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIRevisionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,13 @@ func NewAPIRevisionClient(subscriptionID string, credential azcore.TokenCredenti } // NewListByServicePager - Lists all revisions of an API. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API identifier. Must be unique in the current API Management service instance. -// options - APIRevisionClientListByServiceOptions contains the optional parameters for the APIRevisionClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - APIRevisionClientListByServiceOptions contains the optional parameters for the APIRevisionClient.NewListByServicePager +// method. func (client *APIRevisionClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, options *APIRevisionClientListByServiceOptions) *runtime.Pager[APIRevisionClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[APIRevisionClientListByServiceResponse]{ More: func(page APIRevisionClientListByServiceResponse) bool { @@ -125,7 +125,7 @@ func (client *APIRevisionClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apischema_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apischema_client.go similarity index 82% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apischema_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apischema_client.go index c716f7787005..d487b173f14a 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apischema_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apischema_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 armapimanagement @@ -32,10 +33,9 @@ type APISchemaClient struct { } // NewAPISchemaClient creates a new instance of APISchemaClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPISchemaClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APISchemaClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,15 +58,16 @@ func NewAPISchemaClient(subscriptionID string, credential azcore.TokenCredential // BeginCreateOrUpdate - Creates or updates schema configuration for the API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// schemaID - Schema id identifier. Must be unique in the current API Management service instance. -// parameters - The schema contents to apply. -// options - APISchemaClientBeginCreateOrUpdateOptions contains the optional parameters for the APISchemaClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - schemaID - Schema id identifier. Must be unique in the current API Management service instance. +// - parameters - The schema contents to apply. +// - options - APISchemaClientBeginCreateOrUpdateOptions contains the optional parameters for the APISchemaClient.BeginCreateOrUpdate +// method. func (client *APISchemaClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, parameters SchemaContract, options *APISchemaClientBeginCreateOrUpdateOptions) (*runtime.Poller[APISchemaClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, apiID, schemaID, parameters, options) @@ -83,7 +84,8 @@ func (client *APISchemaClient) BeginCreateOrUpdate(ctx context.Context, resource // CreateOrUpdate - Creates or updates schema configuration for the API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *APISchemaClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, parameters SchemaContract, options *APISchemaClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, schemaID, parameters, options) if err != nil { @@ -127,7 +129,7 @@ func (client *APISchemaClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -138,15 +140,16 @@ func (client *APISchemaClient) createOrUpdateCreateRequest(ctx context.Context, // Delete - Deletes the schema configuration at the Api. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// schemaID - Schema id identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - APISchemaClientDeleteOptions contains the optional parameters for the APISchemaClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - schemaID - Schema id identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APISchemaClientDeleteOptions contains the optional parameters for the APISchemaClient.Delete method. func (client *APISchemaClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, ifMatch string, options *APISchemaClientDeleteOptions) (APISchemaClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, schemaID, ifMatch, options) if err != nil { @@ -193,7 +196,7 @@ func (client *APISchemaClient) deleteCreateRequest(ctx context.Context, resource if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -202,13 +205,14 @@ func (client *APISchemaClient) deleteCreateRequest(ctx context.Context, resource // Get - Get the schema configuration at the API level. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// schemaID - Schema id identifier. Must be unique in the current API Management service instance. -// options - APISchemaClientGetOptions contains the optional parameters for the APISchemaClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - schemaID - Schema id identifier. Must be unique in the current API Management service instance. +// - options - APISchemaClientGetOptions contains the optional parameters for the APISchemaClient.Get method. func (client *APISchemaClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, options *APISchemaClientGetOptions) (APISchemaClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, schemaID, options) if err != nil { @@ -252,7 +256,7 @@ func (client *APISchemaClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,13 +275,14 @@ func (client *APISchemaClient) getHandleResponse(resp *http.Response) (APISchema } // GetEntityTag - Gets the entity state (Etag) version of the schema specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// schemaID - Schema id identifier. Must be unique in the current API Management service instance. -// options - APISchemaClientGetEntityTagOptions contains the optional parameters for the APISchemaClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - schemaID - Schema id identifier. Must be unique in the current API Management service instance. +// - options - APISchemaClientGetEntityTagOptions contains the optional parameters for the APISchemaClient.GetEntityTag method. func (client *APISchemaClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, schemaID string, options *APISchemaClientGetEntityTagOptions) (APISchemaClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, schemaID, options) if err != nil { @@ -321,7 +326,7 @@ func (client *APISchemaClient) getEntityTagCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -338,13 +343,13 @@ func (client *APISchemaClient) getEntityTagHandleResponse(resp *http.Response) ( } // NewListByAPIPager - Get the schema configuration at the API level. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// options - APISchemaClientListByAPIOptions contains the optional parameters for the APISchemaClient.ListByAPI method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - APISchemaClientListByAPIOptions contains the optional parameters for the APISchemaClient.NewListByAPIPager method. func (client *APISchemaClient) NewListByAPIPager(resourceGroupName string, serviceName string, apiID string, options *APISchemaClientListByAPIOptions) *runtime.Pager[APISchemaClientListByAPIResponse] { return runtime.NewPager(runtime.PagingHandler[APISchemaClientListByAPIResponse]{ More: func(page APISchemaClientListByAPIResponse) bool { @@ -406,7 +411,7 @@ func (client *APISchemaClient) listByAPICreateRequest(ctx context.Context, resou if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apitagdescription_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apitagdescription_client.go similarity index 81% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apitagdescription_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apitagdescription_client.go index 2ac8a6e54b3d..427f14fa8450 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apitagdescription_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apitagdescription_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 armapimanagement @@ -32,10 +33,9 @@ type APITagDescriptionClient struct { } // NewAPITagDescriptionClient creates a new instance of APITagDescriptionClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPITagDescriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APITagDescriptionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,16 +58,17 @@ func NewAPITagDescriptionClient(subscriptionID string, credential azcore.TokenCr // CreateOrUpdate - Create/Update tag description in scope of the Api. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// tagDescriptionID - Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API -// and Tag names. -// parameters - Create parameters. -// options - APITagDescriptionClientCreateOrUpdateOptions contains the optional parameters for the APITagDescriptionClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - tagDescriptionID - Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API +// and Tag names. +// - parameters - Create parameters. +// - options - APITagDescriptionClientCreateOrUpdateOptions contains the optional parameters for the APITagDescriptionClient.CreateOrUpdate +// method. func (client *APITagDescriptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagDescriptionID string, parameters TagDescriptionCreateParameters, options *APITagDescriptionClientCreateOrUpdateOptions) (APITagDescriptionClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, tagDescriptionID, parameters, options) if err != nil { @@ -111,7 +112,7 @@ func (client *APITagDescriptionClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -134,17 +135,18 @@ func (client *APITagDescriptionClient) createOrUpdateHandleResponse(resp *http.R // Delete - Delete tag description for the Api. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// tagDescriptionID - Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API -// and Tag names. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - APITagDescriptionClientDeleteOptions contains the optional parameters for the APITagDescriptionClient.Delete -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - tagDescriptionID - Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API +// and Tag names. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APITagDescriptionClientDeleteOptions contains the optional parameters for the APITagDescriptionClient.Delete +// method. func (client *APITagDescriptionClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagDescriptionID string, ifMatch string, options *APITagDescriptionClientDeleteOptions) (APITagDescriptionClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, tagDescriptionID, ifMatch, options) if err != nil { @@ -188,7 +190,7 @@ func (client *APITagDescriptionClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -197,14 +199,15 @@ func (client *APITagDescriptionClient) deleteCreateRequest(ctx context.Context, // Get - Get Tag description in scope of API // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// tagDescriptionID - Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API -// and Tag names. -// options - APITagDescriptionClientGetOptions contains the optional parameters for the APITagDescriptionClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - tagDescriptionID - Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API +// and Tag names. +// - options - APITagDescriptionClientGetOptions contains the optional parameters for the APITagDescriptionClient.Get method. func (client *APITagDescriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagDescriptionID string, options *APITagDescriptionClientGetOptions) (APITagDescriptionClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, tagDescriptionID, options) if err != nil { @@ -248,7 +251,7 @@ func (client *APITagDescriptionClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -267,15 +270,16 @@ func (client *APITagDescriptionClient) getHandleResponse(resp *http.Response) (A } // GetEntityTag - Gets the entity state version of the tag specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// tagDescriptionID - Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API -// and Tag names. -// options - APITagDescriptionClientGetEntityTagOptions contains the optional parameters for the APITagDescriptionClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - tagDescriptionID - Tag description identifier. Used when creating tagDescription for API/Tag association. Based on API +// and Tag names. +// - options - APITagDescriptionClientGetEntityTagOptions contains the optional parameters for the APITagDescriptionClient.GetEntityTag +// method. func (client *APITagDescriptionClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagDescriptionID string, options *APITagDescriptionClientGetEntityTagOptions) (APITagDescriptionClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, tagDescriptionID, options) if err != nil { @@ -319,7 +323,7 @@ func (client *APITagDescriptionClient) getEntityTagCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -337,14 +341,14 @@ func (client *APITagDescriptionClient) getEntityTagHandleResponse(resp *http.Res // NewListByServicePager - Lists all Tags descriptions in scope of API. Model similar to swagger - tagDescription is defined // on API level but tag may be assigned to the Operations -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// options - APITagDescriptionClientListByServiceOptions contains the optional parameters for the APITagDescriptionClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - APITagDescriptionClientListByServiceOptions contains the optional parameters for the APITagDescriptionClient.NewListByServicePager +// method. func (client *APITagDescriptionClient) NewListByServicePager(resourceGroupName string, serviceName string, apiID string, options *APITagDescriptionClientListByServiceOptions) *runtime.Pager[APITagDescriptionClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[APITagDescriptionClientListByServiceResponse]{ More: func(page APITagDescriptionClientListByServiceResponse) bool { @@ -406,7 +410,7 @@ func (client *APITagDescriptionClient) listByServiceCreateRequest(ctx context.Co if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiversionset_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiversionset_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiversionset_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/apiversionset_client.go index d0c9af0d4126..f10b98ac5a7a 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_apiversionset_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiversionset_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 armapimanagement @@ -32,10 +33,9 @@ type APIVersionSetClient struct { } // NewAPIVersionSetClient creates a new instance of APIVersionSetClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAPIVersionSetClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIVersionSetClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewAPIVersionSetClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates or Updates a Api Version Set. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. -// parameters - Create or update parameters. -// options - APIVersionSetClientCreateOrUpdateOptions contains the optional parameters for the APIVersionSetClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. +// - parameters - Create or update parameters. +// - options - APIVersionSetClientCreateOrUpdateOptions contains the optional parameters for the APIVersionSetClient.CreateOrUpdate +// method. func (client *APIVersionSetClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, parameters APIVersionSetContract, options *APIVersionSetClientCreateOrUpdateOptions) (APIVersionSetClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, versionSetID, parameters, options) if err != nil { @@ -104,7 +105,7 @@ func (client *APIVersionSetClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -127,13 +128,14 @@ func (client *APIVersionSetClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes specific Api Version Set. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - APIVersionSetClientDeleteOptions contains the optional parameters for the APIVersionSetClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APIVersionSetClientDeleteOptions contains the optional parameters for the APIVersionSetClient.Delete method. func (client *APIVersionSetClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, ifMatch string, options *APIVersionSetClientDeleteOptions) (APIVersionSetClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, versionSetID, ifMatch, options) if err != nil { @@ -173,7 +175,7 @@ func (client *APIVersionSetClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -182,11 +184,12 @@ func (client *APIVersionSetClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the details of the Api Version Set specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. -// options - APIVersionSetClientGetOptions contains the optional parameters for the APIVersionSetClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. +// - options - APIVersionSetClientGetOptions contains the optional parameters for the APIVersionSetClient.Get method. func (client *APIVersionSetClient) Get(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, options *APIVersionSetClientGetOptions) (APIVersionSetClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, versionSetID, options) if err != nil { @@ -226,7 +229,7 @@ func (client *APIVersionSetClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -245,12 +248,13 @@ func (client *APIVersionSetClient) getHandleResponse(resp *http.Response) (APIVe } // GetEntityTag - Gets the entity state (Etag) version of the Api Version Set specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. -// options - APIVersionSetClientGetEntityTagOptions contains the optional parameters for the APIVersionSetClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. +// - options - APIVersionSetClientGetEntityTagOptions contains the optional parameters for the APIVersionSetClient.GetEntityTag +// method. func (client *APIVersionSetClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, options *APIVersionSetClientGetEntityTagOptions) (APIVersionSetClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, versionSetID, options) if err != nil { @@ -290,7 +294,7 @@ func (client *APIVersionSetClient) getEntityTagCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,12 +311,12 @@ func (client *APIVersionSetClient) getEntityTagHandleResponse(resp *http.Respons } // NewListByServicePager - Lists a collection of API Version Sets in the specified service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - APIVersionSetClientListByServiceOptions contains the optional parameters for the APIVersionSetClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - APIVersionSetClientListByServiceOptions contains the optional parameters for the APIVersionSetClient.NewListByServicePager +// method. func (client *APIVersionSetClient) NewListByServicePager(resourceGroupName string, serviceName string, options *APIVersionSetClientListByServiceOptions) *runtime.Pager[APIVersionSetClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[APIVersionSetClientListByServiceResponse]{ More: func(page APIVersionSetClientListByServiceResponse) bool { @@ -370,7 +374,7 @@ func (client *APIVersionSetClient) listByServiceCreateRequest(ctx context.Contex if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -387,14 +391,15 @@ func (client *APIVersionSetClient) listByServiceHandleResponse(resp *http.Respon // Update - Updates the details of the Api VersionSet specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - APIVersionSetClientUpdateOptions contains the optional parameters for the APIVersionSetClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - versionSetID - Api Version Set identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - APIVersionSetClientUpdateOptions contains the optional parameters for the APIVersionSetClient.Update method. func (client *APIVersionSetClient) Update(ctx context.Context, resourceGroupName string, serviceName string, versionSetID string, ifMatch string, parameters APIVersionSetUpdateParameters, options *APIVersionSetClientUpdateOptions) (APIVersionSetClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, versionSetID, ifMatch, parameters, options) if err != nil { @@ -434,7 +439,7 @@ func (client *APIVersionSetClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiwiki_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiwiki_client.go new file mode 100644 index 000000000000..8a3a3b926e24 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiwiki_client.go @@ -0,0 +1,377 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +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" +) + +// APIWikiClient contains the methods for the APIWiki group. +// Don't use this type directly, use NewAPIWikiClient() instead. +type APIWikiClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewAPIWikiClient creates a new instance of APIWikiClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAPIWikiClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIWikiClient, 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 := &APIWikiClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates a new Wiki for an API or updates an existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - APIWikiClientCreateOrUpdateOptions contains the optional parameters for the APIWikiClient.CreateOrUpdate method. +func (client *APIWikiClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, parameters WikiContract, options *APIWikiClientCreateOrUpdateOptions) (APIWikiClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, parameters, options) + if err != nil { + return APIWikiClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return APIWikiClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return APIWikiClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *APIWikiClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, parameters WikiContract, options *APIWikiClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *APIWikiClient) createOrUpdateHandleResponse(resp *http.Response) (APIWikiClientCreateOrUpdateResponse, error) { + result := APIWikiClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiContract); err != nil { + return APIWikiClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the specified Wiki from an API. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - APIWikiClientDeleteOptions contains the optional parameters for the APIWikiClient.Delete method. +func (client *APIWikiClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, options *APIWikiClientDeleteOptions) (APIWikiClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, ifMatch, options) + if err != nil { + return APIWikiClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return APIWikiClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return APIWikiClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return APIWikiClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *APIWikiClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, options *APIWikiClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the Wiki for an API specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - APIWikiClientGetOptions contains the optional parameters for the APIWikiClient.Get method. +func (client *APIWikiClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIWikiClientGetOptions) (APIWikiClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, options) + if err != nil { + return APIWikiClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return APIWikiClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIWikiClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *APIWikiClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIWikiClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *APIWikiClient) getHandleResponse(resp *http.Response) (APIWikiClientGetResponse, error) { + result := APIWikiClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiContract); err != nil { + return APIWikiClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of the Wiki for an API specified by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - APIWikiClientGetEntityTagOptions contains the optional parameters for the APIWikiClient.GetEntityTag method. +func (client *APIWikiClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIWikiClientGetEntityTagOptions) (APIWikiClientGetEntityTagResponse, error) { + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, options) + if err != nil { + return APIWikiClientGetEntityTagResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return APIWikiClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIWikiClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + } + return client.getEntityTagHandleResponse(resp) +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *APIWikiClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIWikiClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *APIWikiClient) getEntityTagHandleResponse(resp *http.Response) (APIWikiClientGetEntityTagResponse, error) { + result := APIWikiClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// Update - Updates the details of the Wiki for an API specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Wiki Update parameters. +// - options - APIWikiClientUpdateOptions contains the optional parameters for the APIWikiClient.Update method. +func (client *APIWikiClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, parameters WikiUpdateContract, options *APIWikiClientUpdateOptions) (APIWikiClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, ifMatch, parameters, options) + if err != nil { + return APIWikiClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return APIWikiClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIWikiClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *APIWikiClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, ifMatch string, parameters WikiUpdateContract, options *APIWikiClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateHandleResponse handles the Update response. +func (client *APIWikiClient) updateHandleResponse(resp *http.Response) (APIWikiClientUpdateResponse, error) { + result := APIWikiClientUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiContract); err != nil { + return APIWikiClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/apiwikis_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/apiwikis_client.go new file mode 100644 index 000000000000..fd87a8439254 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/apiwikis_client.go @@ -0,0 +1,130 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +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" +) + +// APIWikisClient contains the methods for the APIWikis group. +// Don't use this type directly, use NewAPIWikisClient() instead. +type APIWikisClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewAPIWikisClient creates a new instance of APIWikisClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAPIWikisClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*APIWikisClient, 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 := &APIWikisClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Gets the wikis for an API specified by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - APIWikisClientListOptions contains the optional parameters for the APIWikisClient.NewListPager method. +func (client *APIWikisClient) NewListPager(resourceGroupName string, serviceName string, apiID string, options *APIWikisClientListOptions) *runtime.Pager[APIWikisClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[APIWikisClientListResponse]{ + More: func(page APIWikisClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *APIWikisClientListResponse) (APIWikisClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, apiID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return APIWikisClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return APIWikisClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return APIWikisClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *APIWikisClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *APIWikisClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/wikis" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *APIWikisClient) listHandleResponse(resp *http.Response) (APIWikisClientListResponse, error) { + result := APIWikisClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.WikiCollection); err != nil { + return APIWikisClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorization_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorization_client.go new file mode 100644 index 000000000000..7c64388304af --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorization_client.go @@ -0,0 +1,416 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// AuthorizationClient contains the methods for the Authorization group. +// Don't use this type directly, use NewAuthorizationClient() instead. +type AuthorizationClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewAuthorizationClient creates a new instance of AuthorizationClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAuthorizationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizationClient, 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 := &AuthorizationClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// ConfirmConsentCode - Confirm valid consent code to suppress Authorizations anti-phishing page. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - parameters - Create parameters. +// - options - AuthorizationClientConfirmConsentCodeOptions contains the optional parameters for the AuthorizationClient.ConfirmConsentCode +// method. +func (client *AuthorizationClient) ConfirmConsentCode(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, parameters AuthorizationConfirmConsentCodeRequestContract, options *AuthorizationClientConfirmConsentCodeOptions) (AuthorizationClientConfirmConsentCodeResponse, error) { + req, err := client.confirmConsentCodeCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, parameters, options) + if err != nil { + return AuthorizationClientConfirmConsentCodeResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationClientConfirmConsentCodeResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AuthorizationClientConfirmConsentCodeResponse{}, runtime.NewResponseError(resp) + } + return client.confirmConsentCodeHandleResponse(resp) +} + +// confirmConsentCodeCreateRequest creates the ConfirmConsentCode request. +func (client *AuthorizationClient) confirmConsentCodeCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, parameters AuthorizationConfirmConsentCodeRequestContract, options *AuthorizationClientConfirmConsentCodeOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/confirmConsentCode" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// confirmConsentCodeHandleResponse handles the ConfirmConsentCode response. +func (client *AuthorizationClient) confirmConsentCodeHandleResponse(resp *http.Response) (AuthorizationClientConfirmConsentCodeResponse, error) { + result := AuthorizationClientConfirmConsentCodeResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + return result, nil +} + +// CreateOrUpdate - Creates or updates authorization. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - parameters - Create parameters. +// - options - AuthorizationClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationClient.CreateOrUpdate +// method. +func (client *AuthorizationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, parameters AuthorizationContract, options *AuthorizationClientCreateOrUpdateOptions) (AuthorizationClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, parameters, options) + if err != nil { + return AuthorizationClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return AuthorizationClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AuthorizationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, parameters AuthorizationContract, options *AuthorizationClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *AuthorizationClient) createOrUpdateHandleResponse(resp *http.Response) (AuthorizationClientCreateOrUpdateResponse, error) { + result := AuthorizationClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationContract); err != nil { + return AuthorizationClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes specific Authorization from the Authorization provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - AuthorizationClientDeleteOptions contains the optional parameters for the AuthorizationClient.Delete method. +func (client *AuthorizationClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, ifMatch string, options *AuthorizationClientDeleteOptions) (AuthorizationClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, ifMatch, options) + if err != nil { + return AuthorizationClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return AuthorizationClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return AuthorizationClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AuthorizationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, ifMatch string, options *AuthorizationClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the authorization specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - options - AuthorizationClientGetOptions contains the optional parameters for the AuthorizationClient.Get method. +func (client *AuthorizationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, options *AuthorizationClientGetOptions) (AuthorizationClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, options) + if err != nil { + return AuthorizationClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AuthorizationClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AuthorizationClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, options *AuthorizationClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AuthorizationClient) getHandleResponse(resp *http.Response) (AuthorizationClientGetResponse, error) { + result := AuthorizationClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationContract); err != nil { + return AuthorizationClientGetResponse{}, err + } + return result, nil +} + +// NewListByAuthorizationProviderPager - Lists a collection of authorization providers defined within a authorization provider. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - options - AuthorizationClientListByAuthorizationProviderOptions contains the optional parameters for the AuthorizationClient.NewListByAuthorizationProviderPager +// method. +func (client *AuthorizationClient) NewListByAuthorizationProviderPager(resourceGroupName string, serviceName string, authorizationProviderID string, options *AuthorizationClientListByAuthorizationProviderOptions) *runtime.Pager[AuthorizationClientListByAuthorizationProviderResponse] { + return runtime.NewPager(runtime.PagingHandler[AuthorizationClientListByAuthorizationProviderResponse]{ + More: func(page AuthorizationClientListByAuthorizationProviderResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AuthorizationClientListByAuthorizationProviderResponse) (AuthorizationClientListByAuthorizationProviderResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByAuthorizationProviderCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AuthorizationClientListByAuthorizationProviderResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationClientListByAuthorizationProviderResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AuthorizationClientListByAuthorizationProviderResponse{}, runtime.NewResponseError(resp) + } + return client.listByAuthorizationProviderHandleResponse(resp) + }, + }) +} + +// listByAuthorizationProviderCreateRequest creates the ListByAuthorizationProvider request. +func (client *AuthorizationClient) listByAuthorizationProviderCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, options *AuthorizationClientListByAuthorizationProviderOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByAuthorizationProviderHandleResponse handles the ListByAuthorizationProvider response. +func (client *AuthorizationClient) listByAuthorizationProviderHandleResponse(resp *http.Response) (AuthorizationClientListByAuthorizationProviderResponse, error) { + result := AuthorizationClientListByAuthorizationProviderResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationCollection); err != nil { + return AuthorizationClientListByAuthorizationProviderResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationaccesspolicy_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationaccesspolicy_client.go new file mode 100644 index 000000000000..a52c23ad4e37 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationaccesspolicy_client.go @@ -0,0 +1,369 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// AuthorizationAccessPolicyClient contains the methods for the AuthorizationAccessPolicy group. +// Don't use this type directly, use NewAuthorizationAccessPolicyClient() instead. +type AuthorizationAccessPolicyClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewAuthorizationAccessPolicyClient creates a new instance of AuthorizationAccessPolicyClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAuthorizationAccessPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizationAccessPolicyClient, 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 := &AuthorizationAccessPolicyClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates Authorization Access Policy. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - authorizationAccessPolicyID - Identifier of the authorization access policy. +// - parameters - Create parameters. +// - options - AuthorizationAccessPolicyClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationAccessPolicyClient.CreateOrUpdate +// method. +func (client *AuthorizationAccessPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, authorizationAccessPolicyID string, parameters AuthorizationAccessPolicyContract, options *AuthorizationAccessPolicyClientCreateOrUpdateOptions) (AuthorizationAccessPolicyClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, authorizationAccessPolicyID, parameters, options) + if err != nil { + return AuthorizationAccessPolicyClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationAccessPolicyClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return AuthorizationAccessPolicyClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AuthorizationAccessPolicyClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, authorizationAccessPolicyID string, parameters AuthorizationAccessPolicyContract, options *AuthorizationAccessPolicyClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/accessPolicies/{authorizationAccessPolicyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if authorizationAccessPolicyID == "" { + return nil, errors.New("parameter authorizationAccessPolicyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationAccessPolicyId}", url.PathEscape(authorizationAccessPolicyID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *AuthorizationAccessPolicyClient) createOrUpdateHandleResponse(resp *http.Response) (AuthorizationAccessPolicyClientCreateOrUpdateResponse, error) { + result := AuthorizationAccessPolicyClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationAccessPolicyContract); err != nil { + return AuthorizationAccessPolicyClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes specific access policy from the Authorization. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - authorizationAccessPolicyID - Identifier of the authorization access policy. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - AuthorizationAccessPolicyClientDeleteOptions contains the optional parameters for the AuthorizationAccessPolicyClient.Delete +// method. +func (client *AuthorizationAccessPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, authorizationAccessPolicyID string, ifMatch string, options *AuthorizationAccessPolicyClientDeleteOptions) (AuthorizationAccessPolicyClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, authorizationAccessPolicyID, ifMatch, options) + if err != nil { + return AuthorizationAccessPolicyClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationAccessPolicyClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return AuthorizationAccessPolicyClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return AuthorizationAccessPolicyClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AuthorizationAccessPolicyClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, authorizationAccessPolicyID string, ifMatch string, options *AuthorizationAccessPolicyClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/accessPolicies/{authorizationAccessPolicyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if authorizationAccessPolicyID == "" { + return nil, errors.New("parameter authorizationAccessPolicyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationAccessPolicyId}", url.PathEscape(authorizationAccessPolicyID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the authorization access policy specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - authorizationAccessPolicyID - Identifier of the authorization access policy. +// - options - AuthorizationAccessPolicyClientGetOptions contains the optional parameters for the AuthorizationAccessPolicyClient.Get +// method. +func (client *AuthorizationAccessPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, authorizationAccessPolicyID string, options *AuthorizationAccessPolicyClientGetOptions) (AuthorizationAccessPolicyClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, authorizationAccessPolicyID, options) + if err != nil { + return AuthorizationAccessPolicyClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationAccessPolicyClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AuthorizationAccessPolicyClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AuthorizationAccessPolicyClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, authorizationAccessPolicyID string, options *AuthorizationAccessPolicyClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/accessPolicies/{authorizationAccessPolicyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if authorizationAccessPolicyID == "" { + return nil, errors.New("parameter authorizationAccessPolicyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationAccessPolicyId}", url.PathEscape(authorizationAccessPolicyID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AuthorizationAccessPolicyClient) getHandleResponse(resp *http.Response) (AuthorizationAccessPolicyClientGetResponse, error) { + result := AuthorizationAccessPolicyClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationAccessPolicyContract); err != nil { + return AuthorizationAccessPolicyClientGetResponse{}, err + } + return result, nil +} + +// NewListByAuthorizationPager - Lists a collection of authorization access policy defined within a authorization. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - options - AuthorizationAccessPolicyClientListByAuthorizationOptions contains the optional parameters for the AuthorizationAccessPolicyClient.NewListByAuthorizationPager +// method. +func (client *AuthorizationAccessPolicyClient) NewListByAuthorizationPager(resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, options *AuthorizationAccessPolicyClientListByAuthorizationOptions) *runtime.Pager[AuthorizationAccessPolicyClientListByAuthorizationResponse] { + return runtime.NewPager(runtime.PagingHandler[AuthorizationAccessPolicyClientListByAuthorizationResponse]{ + More: func(page AuthorizationAccessPolicyClientListByAuthorizationResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AuthorizationAccessPolicyClientListByAuthorizationResponse) (AuthorizationAccessPolicyClientListByAuthorizationResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByAuthorizationCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AuthorizationAccessPolicyClientListByAuthorizationResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationAccessPolicyClientListByAuthorizationResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AuthorizationAccessPolicyClientListByAuthorizationResponse{}, runtime.NewResponseError(resp) + } + return client.listByAuthorizationHandleResponse(resp) + }, + }) +} + +// listByAuthorizationCreateRequest creates the ListByAuthorization request. +func (client *AuthorizationAccessPolicyClient) listByAuthorizationCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, options *AuthorizationAccessPolicyClientListByAuthorizationOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/accessPolicies" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByAuthorizationHandleResponse handles the ListByAuthorization response. +func (client *AuthorizationAccessPolicyClient) listByAuthorizationHandleResponse(resp *http.Response) (AuthorizationAccessPolicyClientListByAuthorizationResponse, error) { + result := AuthorizationAccessPolicyClientListByAuthorizationResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationAccessPolicyCollection); err != nil { + return AuthorizationAccessPolicyClientListByAuthorizationResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationloginlinks_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationloginlinks_client.go new file mode 100644 index 000000000000..644a09c9d216 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationloginlinks_client.go @@ -0,0 +1,128 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +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" +) + +// AuthorizationLoginLinksClient contains the methods for the AuthorizationLoginLinks group. +// Don't use this type directly, use NewAuthorizationLoginLinksClient() instead. +type AuthorizationLoginLinksClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewAuthorizationLoginLinksClient creates a new instance of AuthorizationLoginLinksClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAuthorizationLoginLinksClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizationLoginLinksClient, 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 := &AuthorizationLoginLinksClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// Post - Gets authorization login links. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - authorizationID - Identifier of the authorization. +// - parameters - Create parameters. +// - options - AuthorizationLoginLinksClientPostOptions contains the optional parameters for the AuthorizationLoginLinksClient.Post +// method. +func (client *AuthorizationLoginLinksClient) Post(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, parameters AuthorizationLoginRequestContract, options *AuthorizationLoginLinksClientPostOptions) (AuthorizationLoginLinksClientPostResponse, error) { + req, err := client.postCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, authorizationID, parameters, options) + if err != nil { + return AuthorizationLoginLinksClientPostResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationLoginLinksClientPostResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AuthorizationLoginLinksClientPostResponse{}, runtime.NewResponseError(resp) + } + return client.postHandleResponse(resp) +} + +// postCreateRequest creates the Post request. +func (client *AuthorizationLoginLinksClient) postCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, authorizationID string, parameters AuthorizationLoginRequestContract, options *AuthorizationLoginLinksClientPostOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}/authorizations/{authorizationId}/getLoginLinks" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if authorizationID == "" { + return nil, errors.New("parameter authorizationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationId}", url.PathEscape(authorizationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// postHandleResponse handles the Post response. +func (client *AuthorizationLoginLinksClient) postHandleResponse(resp *http.Response) (AuthorizationLoginLinksClientPostResponse, error) { + result := AuthorizationLoginLinksClientPostResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationLoginResponseContract); err != nil { + return AuthorizationLoginLinksClientPostResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/authorizationprovider_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationprovider_client.go new file mode 100644 index 000000000000..30e49412f75b --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationprovider_client.go @@ -0,0 +1,329 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// AuthorizationProviderClient contains the methods for the AuthorizationProvider group. +// Don't use this type directly, use NewAuthorizationProviderClient() instead. +type AuthorizationProviderClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewAuthorizationProviderClient creates a new instance of AuthorizationProviderClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewAuthorizationProviderClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizationProviderClient, 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 := &AuthorizationProviderClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates authorization provider. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - parameters - Create parameters. +// - options - AuthorizationProviderClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationProviderClient.CreateOrUpdate +// method. +func (client *AuthorizationProviderClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, parameters AuthorizationProviderContract, options *AuthorizationProviderClientCreateOrUpdateOptions) (AuthorizationProviderClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, parameters, options) + if err != nil { + return AuthorizationProviderClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationProviderClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return AuthorizationProviderClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *AuthorizationProviderClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, parameters AuthorizationProviderContract, options *AuthorizationProviderClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *AuthorizationProviderClient) createOrUpdateHandleResponse(resp *http.Response) (AuthorizationProviderClientCreateOrUpdateResponse, error) { + result := AuthorizationProviderClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationProviderContract); err != nil { + return AuthorizationProviderClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes specific authorization provider from the API Management service instance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - AuthorizationProviderClientDeleteOptions contains the optional parameters for the AuthorizationProviderClient.Delete +// method. +func (client *AuthorizationProviderClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, ifMatch string, options *AuthorizationProviderClientDeleteOptions) (AuthorizationProviderClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, ifMatch, options) + if err != nil { + return AuthorizationProviderClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationProviderClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return AuthorizationProviderClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return AuthorizationProviderClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *AuthorizationProviderClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, ifMatch string, options *AuthorizationProviderClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the authorization provider specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authorizationProviderID - Identifier of the authorization provider. +// - options - AuthorizationProviderClientGetOptions contains the optional parameters for the AuthorizationProviderClient.Get +// method. +func (client *AuthorizationProviderClient) Get(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, options *AuthorizationProviderClientGetOptions) (AuthorizationProviderClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, authorizationProviderID, options) + if err != nil { + return AuthorizationProviderClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationProviderClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AuthorizationProviderClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *AuthorizationProviderClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, authorizationProviderID string, options *AuthorizationProviderClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders/{authorizationProviderId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if authorizationProviderID == "" { + return nil, errors.New("parameter authorizationProviderID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{authorizationProviderId}", url.PathEscape(authorizationProviderID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *AuthorizationProviderClient) getHandleResponse(resp *http.Response) (AuthorizationProviderClientGetResponse, error) { + result := AuthorizationProviderClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationProviderContract); err != nil { + return AuthorizationProviderClientGetResponse{}, err + } + return result, nil +} + +// NewListByServicePager - Lists a collection of authorization providers defined within a service instance. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - AuthorizationProviderClientListByServiceOptions contains the optional parameters for the AuthorizationProviderClient.NewListByServicePager +// method. +func (client *AuthorizationProviderClient) NewListByServicePager(resourceGroupName string, serviceName string, options *AuthorizationProviderClientListByServiceOptions) *runtime.Pager[AuthorizationProviderClientListByServiceResponse] { + return runtime.NewPager(runtime.PagingHandler[AuthorizationProviderClientListByServiceResponse]{ + More: func(page AuthorizationProviderClientListByServiceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *AuthorizationProviderClientListByServiceResponse) (AuthorizationProviderClientListByServiceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return AuthorizationProviderClientListByServiceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AuthorizationProviderClientListByServiceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AuthorizationProviderClientListByServiceResponse{}, runtime.NewResponseError(resp) + } + return client.listByServiceHandleResponse(resp) + }, + }) +} + +// listByServiceCreateRequest creates the ListByService request. +func (client *AuthorizationProviderClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *AuthorizationProviderClientListByServiceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/authorizationProviders" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServiceHandleResponse handles the ListByService response. +func (client *AuthorizationProviderClient) listByServiceHandleResponse(resp *http.Response) (AuthorizationProviderClientListByServiceResponse, error) { + result := AuthorizationProviderClientListByServiceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AuthorizationProviderCollection); err != nil { + return AuthorizationProviderClientListByServiceResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_authorizationserver_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationserver_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_authorizationserver_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/authorizationserver_client.go index 06c4798641c8..ffa8362b5dca 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_authorizationserver_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/authorizationserver_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 armapimanagement @@ -32,10 +33,9 @@ type AuthorizationServerClient struct { } // NewAuthorizationServerClient creates a new instance of AuthorizationServerClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewAuthorizationServerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AuthorizationServerClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewAuthorizationServerClient(subscriptionID string, credential azcore.Token // CreateOrUpdate - Creates new authorization server or updates an existing authorization server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// authsid - Identifier of the authorization server. -// parameters - Create or update parameters. -// options - AuthorizationServerClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationServerClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authsid - Identifier of the authorization server. +// - parameters - Create or update parameters. +// - options - AuthorizationServerClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationServerClient.CreateOrUpdate +// method. func (client *AuthorizationServerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, authsid string, parameters AuthorizationServerContract, options *AuthorizationServerClientCreateOrUpdateOptions) (AuthorizationServerClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, authsid, parameters, options) if err != nil { @@ -104,7 +105,7 @@ func (client *AuthorizationServerClient) createOrUpdateCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -127,14 +128,15 @@ func (client *AuthorizationServerClient) createOrUpdateHandleResponse(resp *http // Delete - Deletes specific authorization server instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// authsid - Identifier of the authorization server. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - AuthorizationServerClientDeleteOptions contains the optional parameters for the AuthorizationServerClient.Delete -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authsid - Identifier of the authorization server. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - AuthorizationServerClientDeleteOptions contains the optional parameters for the AuthorizationServerClient.Delete +// method. func (client *AuthorizationServerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, authsid string, ifMatch string, options *AuthorizationServerClientDeleteOptions) (AuthorizationServerClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, authsid, ifMatch, options) if err != nil { @@ -174,7 +176,7 @@ func (client *AuthorizationServerClient) deleteCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -183,11 +185,12 @@ func (client *AuthorizationServerClient) deleteCreateRequest(ctx context.Context // Get - Gets the details of the authorization server specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// authsid - Identifier of the authorization server. -// options - AuthorizationServerClientGetOptions contains the optional parameters for the AuthorizationServerClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authsid - Identifier of the authorization server. +// - options - AuthorizationServerClientGetOptions contains the optional parameters for the AuthorizationServerClient.Get method. func (client *AuthorizationServerClient) Get(ctx context.Context, resourceGroupName string, serviceName string, authsid string, options *AuthorizationServerClientGetOptions) (AuthorizationServerClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, authsid, options) if err != nil { @@ -227,7 +230,7 @@ func (client *AuthorizationServerClient) getCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,12 +249,13 @@ func (client *AuthorizationServerClient) getHandleResponse(resp *http.Response) } // GetEntityTag - Gets the entity state (Etag) version of the authorizationServer specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// authsid - Identifier of the authorization server. -// options - AuthorizationServerClientGetEntityTagOptions contains the optional parameters for the AuthorizationServerClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authsid - Identifier of the authorization server. +// - options - AuthorizationServerClientGetEntityTagOptions contains the optional parameters for the AuthorizationServerClient.GetEntityTag +// method. func (client *AuthorizationServerClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, authsid string, options *AuthorizationServerClientGetEntityTagOptions) (AuthorizationServerClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, authsid, options) if err != nil { @@ -291,7 +295,7 @@ func (client *AuthorizationServerClient) getEntityTagCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -308,12 +312,12 @@ func (client *AuthorizationServerClient) getEntityTagHandleResponse(resp *http.R } // NewListByServicePager - Lists a collection of authorization servers defined within a service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - AuthorizationServerClientListByServiceOptions contains the optional parameters for the AuthorizationServerClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - AuthorizationServerClientListByServiceOptions contains the optional parameters for the AuthorizationServerClient.NewListByServicePager +// method. func (client *AuthorizationServerClient) NewListByServicePager(resourceGroupName string, serviceName string, options *AuthorizationServerClientListByServiceOptions) *runtime.Pager[AuthorizationServerClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[AuthorizationServerClientListByServiceResponse]{ More: func(page AuthorizationServerClientListByServiceResponse) bool { @@ -371,7 +375,7 @@ func (client *AuthorizationServerClient) listByServiceCreateRequest(ctx context. if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -388,12 +392,13 @@ func (client *AuthorizationServerClient) listByServiceHandleResponse(resp *http. // ListSecrets - Gets the client secret details of the authorization server. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// authsid - Identifier of the authorization server. -// options - AuthorizationServerClientListSecretsOptions contains the optional parameters for the AuthorizationServerClient.ListSecrets -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authsid - Identifier of the authorization server. +// - options - AuthorizationServerClientListSecretsOptions contains the optional parameters for the AuthorizationServerClient.ListSecrets +// method. func (client *AuthorizationServerClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, authsid string, options *AuthorizationServerClientListSecretsOptions) (AuthorizationServerClientListSecretsResponse, error) { req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, serviceName, authsid, options) if err != nil { @@ -433,7 +438,7 @@ func (client *AuthorizationServerClient) listSecretsCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -453,15 +458,16 @@ func (client *AuthorizationServerClient) listSecretsHandleResponse(resp *http.Re // Update - Updates the details of the authorization server specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// authsid - Identifier of the authorization server. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - OAuth2 Server settings Update parameters. -// options - AuthorizationServerClientUpdateOptions contains the optional parameters for the AuthorizationServerClient.Update -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - authsid - Identifier of the authorization server. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - OAuth2 Server settings Update parameters. +// - options - AuthorizationServerClientUpdateOptions contains the optional parameters for the AuthorizationServerClient.Update +// method. func (client *AuthorizationServerClient) Update(ctx context.Context, resourceGroupName string, serviceName string, authsid string, ifMatch string, parameters AuthorizationServerUpdateContract, options *AuthorizationServerClientUpdateOptions) (AuthorizationServerClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, authsid, ifMatch, parameters, options) if err != nil { @@ -501,7 +507,7 @@ func (client *AuthorizationServerClient) updateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/autorest.md b/sdk/resourcemanager/apimanagement/armapimanagement/autorest.md index 125e1b32eb22..ec884857a740 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/autorest.md +++ b/sdk/resourcemanager/apimanagement/armapimanagement/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c767823fdfd9d5e96bad245e3ea4d14d94a716bb/specification/apimanagement/resource-manager/readme.go.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/apimanagement/resource-manager/readme.md +- /mnt/vss/_work/1/s/azure-rest-api-specs/specification/apimanagement/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/apimanagement/armapimanagement/zz_generated_backend_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/backend_client.go similarity index 83% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_backend_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/backend_client.go index bf05759dd05e..032a36424606 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_backend_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/backend_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 armapimanagement @@ -32,10 +33,9 @@ type BackendClient struct { } // NewBackendClient creates a new instance of BackendClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewBackendClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*BackendClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewBackendClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or Updates a backend. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. -// parameters - Create parameters. -// options - BackendClientCreateOrUpdateOptions contains the optional parameters for the BackendClient.CreateOrUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - BackendClientCreateOrUpdateOptions contains the optional parameters for the BackendClient.CreateOrUpdate method. func (client *BackendClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, backendID string, parameters BackendContract, options *BackendClientCreateOrUpdateOptions) (BackendClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, backendID, parameters, options) if err != nil { @@ -103,7 +104,7 @@ func (client *BackendClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -126,13 +127,14 @@ func (client *BackendClient) createOrUpdateHandleResponse(resp *http.Response) ( // Delete - Deletes the specified backend. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - BackendClientDeleteOptions contains the optional parameters for the BackendClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - BackendClientDeleteOptions contains the optional parameters for the BackendClient.Delete method. func (client *BackendClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, backendID string, ifMatch string, options *BackendClientDeleteOptions) (BackendClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, backendID, ifMatch, options) if err != nil { @@ -172,7 +174,7 @@ func (client *BackendClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -181,11 +183,12 @@ func (client *BackendClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets the details of the backend specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. -// options - BackendClientGetOptions contains the optional parameters for the BackendClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. +// - options - BackendClientGetOptions contains the optional parameters for the BackendClient.Get method. func (client *BackendClient) Get(ctx context.Context, resourceGroupName string, serviceName string, backendID string, options *BackendClientGetOptions) (BackendClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, backendID, options) if err != nil { @@ -225,7 +228,7 @@ func (client *BackendClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,11 +247,12 @@ func (client *BackendClient) getHandleResponse(resp *http.Response) (BackendClie } // GetEntityTag - Gets the entity state (Etag) version of the backend specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. -// options - BackendClientGetEntityTagOptions contains the optional parameters for the BackendClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. +// - options - BackendClientGetEntityTagOptions contains the optional parameters for the BackendClient.GetEntityTag method. func (client *BackendClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, backendID string, options *BackendClientGetEntityTagOptions) (BackendClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, backendID, options) if err != nil { @@ -288,7 +292,7 @@ func (client *BackendClient) getEntityTagCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,11 +309,12 @@ func (client *BackendClient) getEntityTagHandleResponse(resp *http.Response) (Ba } // NewListByServicePager - Lists a collection of backends in the specified service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - BackendClientListByServiceOptions contains the optional parameters for the BackendClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - BackendClientListByServiceOptions contains the optional parameters for the BackendClient.NewListByServicePager +// method. func (client *BackendClient) NewListByServicePager(resourceGroupName string, serviceName string, options *BackendClientListByServiceOptions) *runtime.Pager[BackendClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[BackendClientListByServiceResponse]{ More: func(page BackendClientListByServiceResponse) bool { @@ -367,7 +372,7 @@ func (client *BackendClient) listByServiceCreateRequest(ctx context.Context, res if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -382,14 +387,15 @@ func (client *BackendClient) listByServiceHandleResponse(resp *http.Response) (B return result, nil } -// Reconnect - Notifies the APIM proxy to create a new connection to the backend after the specified timeout. If no timeout -// was specified, timeout of 2 minutes is used. +// Reconnect - Notifies the API Management gateway to create a new connection to the backend after the specified timeout. +// If no timeout was specified, timeout of 2 minutes is used. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. -// options - BackendClientReconnectOptions contains the optional parameters for the BackendClient.Reconnect method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. +// - options - BackendClientReconnectOptions contains the optional parameters for the BackendClient.Reconnect method. func (client *BackendClient) Reconnect(ctx context.Context, resourceGroupName string, serviceName string, backendID string, options *BackendClientReconnectOptions) (BackendClientReconnectResponse, error) { req, err := client.reconnectCreateRequest(ctx, resourceGroupName, serviceName, backendID, options) if err != nil { @@ -429,7 +435,7 @@ func (client *BackendClient) reconnectCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -440,14 +446,15 @@ func (client *BackendClient) reconnectCreateRequest(ctx context.Context, resourc // Update - Updates an existing backend. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - BackendClientUpdateOptions contains the optional parameters for the BackendClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - backendID - Identifier of the Backend entity. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - BackendClientUpdateOptions contains the optional parameters for the BackendClient.Update method. func (client *BackendClient) Update(ctx context.Context, resourceGroupName string, serviceName string, backendID string, ifMatch string, parameters BackendUpdateParameters, options *BackendClientUpdateOptions) (BackendClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, backendID, ifMatch, parameters, options) if err != nil { @@ -487,7 +494,7 @@ func (client *BackendClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_cache_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/cache_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_cache_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/cache_client.go index 57093fddb94d..ed74ac359c31 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_cache_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/cache_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 armapimanagement @@ -32,10 +33,9 @@ type CacheClient struct { } // NewCacheClient creates a new instance of CacheClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewCacheClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CacheClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewCacheClient(subscriptionID string, credential azcore.TokenCredential, op // CreateOrUpdate - Creates or updates an External Cache to be used in Api Management instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). -// parameters - Create or Update parameters. -// options - CacheClientCreateOrUpdateOptions contains the optional parameters for the CacheClient.CreateOrUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). +// - parameters - Create or Update parameters. +// - options - CacheClientCreateOrUpdateOptions contains the optional parameters for the CacheClient.CreateOrUpdate method. func (client *CacheClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, parameters CacheContract, options *CacheClientCreateOrUpdateOptions) (CacheClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, cacheID, parameters, options) if err != nil { @@ -103,7 +104,7 @@ func (client *CacheClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -126,13 +127,14 @@ func (client *CacheClient) createOrUpdateHandleResponse(resp *http.Response) (Ca // Delete - Deletes specific Cache. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - CacheClientDeleteOptions contains the optional parameters for the CacheClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - CacheClientDeleteOptions contains the optional parameters for the CacheClient.Delete method. func (client *CacheClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, ifMatch string, options *CacheClientDeleteOptions) (CacheClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, cacheID, ifMatch, options) if err != nil { @@ -172,7 +174,7 @@ func (client *CacheClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -181,11 +183,12 @@ func (client *CacheClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Gets the details of the Cache specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). -// options - CacheClientGetOptions contains the optional parameters for the CacheClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). +// - options - CacheClientGetOptions contains the optional parameters for the CacheClient.Get method. func (client *CacheClient) Get(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, options *CacheClientGetOptions) (CacheClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, cacheID, options) if err != nil { @@ -225,7 +228,7 @@ func (client *CacheClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,11 +247,12 @@ func (client *CacheClient) getHandleResponse(resp *http.Response) (CacheClientGe } // GetEntityTag - Gets the entity state (Etag) version of the Cache specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). -// options - CacheClientGetEntityTagOptions contains the optional parameters for the CacheClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). +// - options - CacheClientGetEntityTagOptions contains the optional parameters for the CacheClient.GetEntityTag method. func (client *CacheClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, options *CacheClientGetEntityTagOptions) (CacheClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, cacheID, options) if err != nil { @@ -288,7 +292,7 @@ func (client *CacheClient) getEntityTagCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,11 +309,11 @@ func (client *CacheClient) getEntityTagHandleResponse(resp *http.Response) (Cach } // NewListByServicePager - Lists a collection of all external Caches in the specified service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - CacheClientListByServiceOptions contains the optional parameters for the CacheClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - CacheClientListByServiceOptions contains the optional parameters for the CacheClient.NewListByServicePager method. func (client *CacheClient) NewListByServicePager(resourceGroupName string, serviceName string, options *CacheClientListByServiceOptions) *runtime.Pager[CacheClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[CacheClientListByServiceResponse]{ More: func(page CacheClientListByServiceResponse) bool { @@ -364,7 +368,7 @@ func (client *CacheClient) listByServiceCreateRequest(ctx context.Context, resou if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -381,14 +385,15 @@ func (client *CacheClient) listByServiceHandleResponse(resp *http.Response) (Cac // Update - Updates the details of the cache specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - CacheClientUpdateOptions contains the optional parameters for the CacheClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - cacheID - Identifier of the Cache entity. Cache identifier (should be either 'default' or valid Azure region identifier). +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - CacheClientUpdateOptions contains the optional parameters for the CacheClient.Update method. func (client *CacheClient) Update(ctx context.Context, resourceGroupName string, serviceName string, cacheID string, ifMatch string, parameters CacheUpdateParameters, options *CacheClientUpdateOptions) (CacheClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, cacheID, ifMatch, parameters, options) if err != nil { @@ -428,7 +433,7 @@ func (client *CacheClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_certificate_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/certificate_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_certificate_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/certificate_client.go index f8f18697e0fb..54bef7c71b6d 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_certificate_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/certificate_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 armapimanagement @@ -32,10 +33,9 @@ type CertificateClient struct { } // NewCertificateClient creates a new instance of CertificateClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewCertificateClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*CertificateClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewCertificateClient(subscriptionID string, credential azcore.TokenCredenti // CreateOrUpdate - Creates or updates the certificate being used for authentication with the backend. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. -// parameters - Create or Update parameters. -// options - CertificateClientCreateOrUpdateOptions contains the optional parameters for the CertificateClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. +// - parameters - Create or Update parameters. +// - options - CertificateClientCreateOrUpdateOptions contains the optional parameters for the CertificateClient.CreateOrUpdate +// method. func (client *CertificateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, parameters CertificateCreateOrUpdateParameters, options *CertificateClientCreateOrUpdateOptions) (CertificateClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, certificateID, parameters, options) if err != nil { @@ -104,7 +105,7 @@ func (client *CertificateClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -127,13 +128,14 @@ func (client *CertificateClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Deletes specific certificate. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - CertificateClientDeleteOptions contains the optional parameters for the CertificateClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - CertificateClientDeleteOptions contains the optional parameters for the CertificateClient.Delete method. func (client *CertificateClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, ifMatch string, options *CertificateClientDeleteOptions) (CertificateClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, certificateID, ifMatch, options) if err != nil { @@ -173,7 +175,7 @@ func (client *CertificateClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -182,11 +184,12 @@ func (client *CertificateClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets the details of the certificate specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. -// options - CertificateClientGetOptions contains the optional parameters for the CertificateClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. +// - options - CertificateClientGetOptions contains the optional parameters for the CertificateClient.Get method. func (client *CertificateClient) Get(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, options *CertificateClientGetOptions) (CertificateClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, certificateID, options) if err != nil { @@ -226,7 +229,7 @@ func (client *CertificateClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -245,12 +248,13 @@ func (client *CertificateClient) getHandleResponse(resp *http.Response) (Certifi } // GetEntityTag - Gets the entity state (Etag) version of the certificate specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. -// options - CertificateClientGetEntityTagOptions contains the optional parameters for the CertificateClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. +// - options - CertificateClientGetEntityTagOptions contains the optional parameters for the CertificateClient.GetEntityTag +// method. func (client *CertificateClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, options *CertificateClientGetEntityTagOptions) (CertificateClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, certificateID, options) if err != nil { @@ -290,7 +294,7 @@ func (client *CertificateClient) getEntityTagCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -307,12 +311,12 @@ func (client *CertificateClient) getEntityTagHandleResponse(resp *http.Response) } // NewListByServicePager - Lists a collection of all certificates in the specified service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - CertificateClientListByServiceOptions contains the optional parameters for the CertificateClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - CertificateClientListByServiceOptions contains the optional parameters for the CertificateClient.NewListByServicePager +// method. func (client *CertificateClient) NewListByServicePager(resourceGroupName string, serviceName string, options *CertificateClientListByServiceOptions) *runtime.Pager[CertificateClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[CertificateClientListByServiceResponse]{ More: func(page CertificateClientListByServiceResponse) bool { @@ -373,7 +377,7 @@ func (client *CertificateClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.IsKeyVaultRefreshFailed != nil { reqQP.Set("isKeyVaultRefreshFailed", strconv.FormatBool(*options.IsKeyVaultRefreshFailed)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -390,12 +394,13 @@ func (client *CertificateClient) listByServiceHandleResponse(resp *http.Response // RefreshSecret - From KeyVault, Refresh the certificate being used for authentication with the backend. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. -// options - CertificateClientRefreshSecretOptions contains the optional parameters for the CertificateClient.RefreshSecret -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. +// - options - CertificateClientRefreshSecretOptions contains the optional parameters for the CertificateClient.RefreshSecret +// method. func (client *CertificateClient) RefreshSecret(ctx context.Context, resourceGroupName string, serviceName string, certificateID string, options *CertificateClientRefreshSecretOptions) (CertificateClientRefreshSecretResponse, error) { req, err := client.refreshSecretCreateRequest(ctx, resourceGroupName, serviceName, certificateID, options) if err != nil { @@ -435,7 +440,7 @@ func (client *CertificateClient) refreshSecretCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/client.go index 09023a70c258..b823f192740a 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/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 armapimanagement @@ -31,10 +32,9 @@ type Client struct { } // NewClient creates a new instance of Client with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - 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{} @@ -58,12 +58,13 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // BeginPerformConnectivityCheckAsync - Performs a connectivity check between the API Management service and a given destination, // and returns metrics for the connection, as well as errors encountered while trying to establish it. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// connectivityCheckRequestParams - Connectivity Check request parameters. -// options - ClientBeginPerformConnectivityCheckAsyncOptions contains the optional parameters for the Client.BeginPerformConnectivityCheckAsync -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - connectivityCheckRequestParams - Connectivity Check request parameters. +// - options - ClientBeginPerformConnectivityCheckAsyncOptions contains the optional parameters for the Client.BeginPerformConnectivityCheckAsync +// method. func (client *Client) BeginPerformConnectivityCheckAsync(ctx context.Context, resourceGroupName string, serviceName string, connectivityCheckRequestParams ConnectivityCheckRequest, options *ClientBeginPerformConnectivityCheckAsyncOptions) (*runtime.Poller[ClientPerformConnectivityCheckAsyncResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.performConnectivityCheckAsync(ctx, resourceGroupName, serviceName, connectivityCheckRequestParams, options) @@ -81,7 +82,8 @@ func (client *Client) BeginPerformConnectivityCheckAsync(ctx context.Context, re // PerformConnectivityCheckAsync - Performs a connectivity check between the API Management service and a given destination, // and returns metrics for the connection, as well as errors encountered while trying to establish it. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *Client) performConnectivityCheckAsync(ctx context.Context, resourceGroupName string, serviceName string, connectivityCheckRequestParams ConnectivityCheckRequest, options *ClientBeginPerformConnectivityCheckAsyncOptions) (*http.Response, error) { req, err := client.performConnectivityCheckAsyncCreateRequest(ctx, resourceGroupName, serviceName, connectivityCheckRequestParams, options) if err != nil { @@ -117,7 +119,7 @@ func (client *Client) performConnectivityCheckAsyncCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, connectivityCheckRequestParams) diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_constants.go b/sdk/resourcemanager/apimanagement/armapimanagement/constants.go similarity index 90% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_constants.go rename to sdk/resourcemanager/apimanagement/armapimanagement/constants.go index 413d26f48f24..4a0a78dfc8f5 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_constants.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/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 armapimanagement const ( moduleName = "armapimanagement" - moduleVersion = "v1.0.0" + moduleVersion = "v2.0.0" ) // APIManagementSKUCapacityScaleType - The scale type applicable to the sku. @@ -88,8 +89,11 @@ func PossibleAPITypeValues() []APIType { type APIVersionSetContractDetailsVersioningScheme string const ( - APIVersionSetContractDetailsVersioningSchemeHeader APIVersionSetContractDetailsVersioningScheme = "Header" - APIVersionSetContractDetailsVersioningSchemeQuery APIVersionSetContractDetailsVersioningScheme = "Query" + // APIVersionSetContractDetailsVersioningSchemeHeader - The API Version is passed in a HTTP header. + APIVersionSetContractDetailsVersioningSchemeHeader APIVersionSetContractDetailsVersioningScheme = "Header" + // APIVersionSetContractDetailsVersioningSchemeQuery - The API Version is passed in a query parameter. + APIVersionSetContractDetailsVersioningSchemeQuery APIVersionSetContractDetailsVersioningScheme = "Query" + // APIVersionSetContractDetailsVersioningSchemeSegment - The API Version is passed in a path segment. APIVersionSetContractDetailsVersioningSchemeSegment APIVersionSetContractDetailsVersioningScheme = "Segment" ) @@ -212,6 +216,26 @@ func PossibleAsyncOperationStatusValues() []AsyncOperationStatus { } } +// AsyncResolverStatus - Status of an async resolver. +type AsyncResolverStatus string + +const ( + AsyncResolverStatusStarted AsyncResolverStatus = "Started" + AsyncResolverStatusInProgress AsyncResolverStatus = "InProgress" + AsyncResolverStatusSucceeded AsyncResolverStatus = "Succeeded" + AsyncResolverStatusFailed AsyncResolverStatus = "Failed" +) + +// PossibleAsyncResolverStatusValues returns the possible values for the AsyncResolverStatus const type. +func PossibleAsyncResolverStatusValues() []AsyncResolverStatus { + return []AsyncResolverStatus{ + AsyncResolverStatusStarted, + AsyncResolverStatusInProgress, + AsyncResolverStatusSucceeded, + AsyncResolverStatusFailed, + } +} + type AuthorizationMethod string const ( @@ -239,6 +263,21 @@ func PossibleAuthorizationMethodValues() []AuthorizationMethod { } } +// AuthorizationType - Authorization type options +type AuthorizationType string + +const ( + // AuthorizationTypeOAuth2 - OAuth2 authorization type + AuthorizationTypeOAuth2 AuthorizationType = "OAuth2" +) + +// PossibleAuthorizationTypeValues returns the possible values for the AuthorizationType const type. +func PossibleAuthorizationTypeValues() []AuthorizationType { + return []AuthorizationType{ + AuthorizationTypeOAuth2, + } +} + // BackendProtocol - Backend communication protocol. type BackendProtocol string @@ -814,6 +853,24 @@ func PossibleNameAvailabilityReasonValues() []NameAvailabilityReason { } } +// NatGatewayState - Property can be used to enable NAT Gateway for this API Management service. +type NatGatewayState string + +const ( + // NatGatewayStateDisabled - Nat Gateway is disabled for the service. + NatGatewayStateDisabled NatGatewayState = "Disabled" + // NatGatewayStateEnabled - Nat Gateway is enabled for the service. + NatGatewayStateEnabled NatGatewayState = "Enabled" +) + +// PossibleNatGatewayStateValues returns the possible values for the NatGatewayState const type. +func PossibleNatGatewayStateValues() []NatGatewayState { + return []NatGatewayState{ + NatGatewayStateDisabled, + NatGatewayStateEnabled, + } +} + type NotificationName string const ( @@ -852,6 +909,24 @@ func PossibleNotificationNameValues() []NotificationName { } } +// OAuth2GrantType - OAuth2 grant type options +type OAuth2GrantType string + +const ( + // OAuth2GrantTypeAuthorizationCode - Authorization Code grant + OAuth2GrantTypeAuthorizationCode OAuth2GrantType = "AuthorizationCode" + // OAuth2GrantTypeClientCredentials - Client Credential grant + OAuth2GrantTypeClientCredentials OAuth2GrantType = "ClientCredentials" +) + +// PossibleOAuth2GrantTypeValues returns the possible values for the OAuth2GrantType const type. +func PossibleOAuth2GrantTypeValues() []OAuth2GrantType { + return []OAuth2GrantType{ + OAuth2GrantTypeAuthorizationCode, + OAuth2GrantTypeClientCredentials, + } +} + // OperationNameFormat - The format of the Operation Name for Application Insights telemetries. Default is Name. type OperationNameFormat string @@ -918,12 +993,12 @@ type PolicyContentFormat string const ( // PolicyContentFormatRawxml - The contents are inline and Content type is a non XML encoded policy document. PolicyContentFormatRawxml PolicyContentFormat = "rawxml" - // PolicyContentFormatRawxmlLink - The policy document is not Xml encoded and is hosted on a http endpoint accessible from + // PolicyContentFormatRawxmlLink - The policy document is not XML encoded and is hosted on a HTTP endpoint accessible from // the API Management service. PolicyContentFormatRawxmlLink PolicyContentFormat = "rawxml-link" // PolicyContentFormatXML - The contents are inline and Content type is an XML document. PolicyContentFormatXML PolicyContentFormat = "xml" - // PolicyContentFormatXMLLink - The policy XML document is hosted on a http endpoint accessible from the API Management service. + // PolicyContentFormatXMLLink - The policy XML document is hosted on a HTTP endpoint accessible from the API Management service. PolicyContentFormatXMLLink PolicyContentFormat = "xml-link" ) @@ -954,6 +1029,23 @@ func PossiblePolicyExportFormatValues() []PolicyExportFormat { } } +type PolicyFragmentContentFormat string + +const ( + // PolicyFragmentContentFormatRawxml - The contents are inline and Content type is a non XML encoded policy document. + PolicyFragmentContentFormatRawxml PolicyFragmentContentFormat = "rawxml" + // PolicyFragmentContentFormatXML - The contents are inline and Content type is an XML document. + PolicyFragmentContentFormatXML PolicyFragmentContentFormat = "xml" +) + +// PossiblePolicyFragmentContentFormatValues returns the possible values for the PolicyFragmentContentFormat const type. +func PossiblePolicyFragmentContentFormatValues() []PolicyFragmentContentFormat { + return []PolicyFragmentContentFormat{ + PolicyFragmentContentFormatRawxml, + PolicyFragmentContentFormatXML, + } +} + type PolicyIDName string const ( @@ -1012,6 +1104,27 @@ func PossiblePortalRevisionStatusValues() []PortalRevisionStatus { } } +// PortalSettingsCspMode - The mode of the developer portal Content Security Policy (CSP). +type PortalSettingsCspMode string + +const ( + // PortalSettingsCspModeDisabled - The browser will not apply the origin restrictions. + PortalSettingsCspModeDisabled PortalSettingsCspMode = "disabled" + // PortalSettingsCspModeEnabled - The browser will block requests not matching allowed origins. + PortalSettingsCspModeEnabled PortalSettingsCspMode = "enabled" + // PortalSettingsCspModeReportOnly - The browser will report requests not matching allowed origins without blocking them. + PortalSettingsCspModeReportOnly PortalSettingsCspMode = "reportOnly" +) + +// PossiblePortalSettingsCspModeValues returns the possible values for the PortalSettingsCspMode const type. +func PossiblePortalSettingsCspModeValues() []PortalSettingsCspMode { + return []PortalSettingsCspMode{ + PortalSettingsCspModeDisabled, + PortalSettingsCspModeEnabled, + PortalSettingsCspModeReportOnly, + } +} + // PreferredIPVersion - The IP version to be used. Only IPv4 is supported for now. type PreferredIPVersion string @@ -1191,7 +1304,7 @@ type SchemaType string const ( // SchemaTypeJSON - Json schema type. SchemaTypeJSON SchemaType = "json" - // SchemaTypeXML - Xml schema type. + // SchemaTypeXML - XML schema type. SchemaTypeXML SchemaType = "xml" ) @@ -1355,6 +1468,25 @@ func PossibleTemplateNameValues() []TemplateName { } } +// TranslateRequiredQueryParametersConduct - Strategy of translating required query parameters to template ones. By default +// has value 'template'. Possible values: 'template', 'query' +type TranslateRequiredQueryParametersConduct string + +const ( + // TranslateRequiredQueryParametersConductQuery - Leaves required query parameters as they are (no translation done). + TranslateRequiredQueryParametersConductQuery TranslateRequiredQueryParametersConduct = "query" + // TranslateRequiredQueryParametersConductTemplate - Translates required query parameters to template ones. Is a default value + TranslateRequiredQueryParametersConductTemplate TranslateRequiredQueryParametersConduct = "template" +) + +// PossibleTranslateRequiredQueryParametersConductValues returns the possible values for the TranslateRequiredQueryParametersConduct const type. +func PossibleTranslateRequiredQueryParametersConductValues() []TranslateRequiredQueryParametersConduct { + return []TranslateRequiredQueryParametersConduct{ + TranslateRequiredQueryParametersConductQuery, + TranslateRequiredQueryParametersConductTemplate, + } +} + // UserState - Account state. Specifies whether the user is active or not. Blocked users are unable to sign into the developer // portal or call any APIs of subscribed products. Default state is Active. type UserState string diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_contentitem_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/contentitem_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_contentitem_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/contentitem_client.go index 455cab342f7d..1a156a74923a 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_contentitem_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/contentitem_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 armapimanagement @@ -31,10 +32,9 @@ type ContentItemClient struct { } // NewContentItemClient creates a new instance of ContentItemClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewContentItemClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContentItemClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,15 +57,17 @@ func NewContentItemClient(subscriptionID string, credential azcore.TokenCredenti // CreateOrUpdate - Creates a new developer portal's content item specified by the provided content type. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// contentTypeID - Content type identifier. -// contentItemID - Content item identifier. -// options - ContentItemClientCreateOrUpdateOptions contains the optional parameters for the ContentItemClient.CreateOrUpdate -// method. -func (client *ContentItemClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, options *ContentItemClientCreateOrUpdateOptions) (ContentItemClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, contentItemID, options) +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - contentTypeID - Content type identifier. +// - contentItemID - Content item identifier. +// - parameters - Create or update parameters. +// - options - ContentItemClientCreateOrUpdateOptions contains the optional parameters for the ContentItemClient.CreateOrUpdate +// method. +func (client *ContentItemClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, parameters ContentItemContract, options *ContentItemClientCreateOrUpdateOptions) (ContentItemClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, contentItemID, parameters, options) if err != nil { return ContentItemClientCreateOrUpdateResponse{}, err } @@ -80,7 +82,7 @@ func (client *ContentItemClient) CreateOrUpdate(ctx context.Context, resourceGro } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ContentItemClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, options *ContentItemClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ContentItemClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, parameters ContentItemContract, options *ContentItemClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}/contentItems/{contentItemId}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -107,13 +109,13 @@ func (client *ContentItemClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil + return req, runtime.MarshalAsJSON(req, parameters) } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -130,14 +132,15 @@ func (client *ContentItemClient) createOrUpdateHandleResponse(resp *http.Respons // Delete - Removes the specified developer portal's content item. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// contentTypeID - Content type identifier. -// contentItemID - Content item identifier. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - ContentItemClientDeleteOptions contains the optional parameters for the ContentItemClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - contentTypeID - Content type identifier. +// - contentItemID - Content item identifier. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - ContentItemClientDeleteOptions contains the optional parameters for the ContentItemClient.Delete method. func (client *ContentItemClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, ifMatch string, options *ContentItemClientDeleteOptions) (ContentItemClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, contentItemID, ifMatch, options) if err != nil { @@ -181,7 +184,7 @@ func (client *ContentItemClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -190,12 +193,13 @@ func (client *ContentItemClient) deleteCreateRequest(ctx context.Context, resour // Get - Returns the developer portal's content item specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// contentTypeID - Content type identifier. -// contentItemID - Content item identifier. -// options - ContentItemClientGetOptions contains the optional parameters for the ContentItemClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - contentTypeID - Content type identifier. +// - contentItemID - Content item identifier. +// - options - ContentItemClientGetOptions contains the optional parameters for the ContentItemClient.Get method. func (client *ContentItemClient) Get(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, options *ContentItemClientGetOptions) (ContentItemClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, contentItemID, options) if err != nil { @@ -239,7 +243,7 @@ func (client *ContentItemClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -258,13 +262,14 @@ func (client *ContentItemClient) getHandleResponse(resp *http.Response) (Content } // GetEntityTag - Returns the entity state (ETag) version of the developer portal's content item specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// contentTypeID - Content type identifier. -// contentItemID - Content item identifier. -// options - ContentItemClientGetEntityTagOptions contains the optional parameters for the ContentItemClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - contentTypeID - Content type identifier. +// - contentItemID - Content item identifier. +// - options - ContentItemClientGetEntityTagOptions contains the optional parameters for the ContentItemClient.GetEntityTag +// method. func (client *ContentItemClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, contentItemID string, options *ContentItemClientGetEntityTagOptions) (ContentItemClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, contentItemID, options) if err != nil { @@ -308,7 +313,7 @@ func (client *ContentItemClient) getEntityTagCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -325,13 +330,13 @@ func (client *ContentItemClient) getEntityTagHandleResponse(resp *http.Response) } // NewListByServicePager - Lists developer portal's content items specified by the provided content type. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// contentTypeID - Content type identifier. -// options - ContentItemClientListByServiceOptions contains the optional parameters for the ContentItemClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - contentTypeID - Content type identifier. +// - options - ContentItemClientListByServiceOptions contains the optional parameters for the ContentItemClient.NewListByServicePager +// method. func (client *ContentItemClient) NewListByServicePager(resourceGroupName string, serviceName string, contentTypeID string, options *ContentItemClientListByServiceOptions) *runtime.Pager[ContentItemClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[ContentItemClientListByServiceResponse]{ More: func(page ContentItemClientListByServiceResponse) bool { @@ -384,7 +389,7 @@ func (client *ContentItemClient) listByServiceCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_contenttype_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/contenttype_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_contenttype_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/contenttype_client.go index 5af4090f5800..eb22642888bc 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_contenttype_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/contenttype_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 armapimanagement @@ -31,10 +32,9 @@ type ContentTypeClient struct { } // NewContentTypeClient creates a new instance of ContentTypeClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewContentTypeClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ContentTypeClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -59,14 +59,16 @@ func NewContentTypeClient(subscriptionID string, credential azcore.TokenCredenti // validation rules, and constraints. Custom content types' identifiers need to start with the c- // prefix. Built-in content types can't be modified. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// contentTypeID - Content type identifier. -// options - ContentTypeClientCreateOrUpdateOptions contains the optional parameters for the ContentTypeClient.CreateOrUpdate -// method. -func (client *ContentTypeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, options *ContentTypeClientCreateOrUpdateOptions) (ContentTypeClientCreateOrUpdateResponse, error) { - req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, options) +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - contentTypeID - Content type identifier. +// - parameters - Create or update parameters. +// - options - ContentTypeClientCreateOrUpdateOptions contains the optional parameters for the ContentTypeClient.CreateOrUpdate +// method. +func (client *ContentTypeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, parameters ContentTypeContract, options *ContentTypeClientCreateOrUpdateOptions) (ContentTypeClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, parameters, options) if err != nil { return ContentTypeClientCreateOrUpdateResponse{}, err } @@ -81,7 +83,7 @@ func (client *ContentTypeClient) CreateOrUpdate(ctx context.Context, resourceGro } // createOrUpdateCreateRequest creates the CreateOrUpdate request. -func (client *ContentTypeClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, options *ContentTypeClientCreateOrUpdateOptions) (*policy.Request, error) { +func (client *ContentTypeClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, parameters ContentTypeContract, options *ContentTypeClientCreateOrUpdateOptions) (*policy.Request, error) { urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/contentTypes/{contentTypeId}" if resourceGroupName == "" { return nil, errors.New("parameter resourceGroupName cannot be empty") @@ -104,13 +106,13 @@ func (client *ContentTypeClient) createOrUpdateCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} } req.Raw().Header["Accept"] = []string{"application/json"} - return req, nil + return req, runtime.MarshalAsJSON(req, parameters) } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -129,13 +131,14 @@ func (client *ContentTypeClient) createOrUpdateHandleResponse(resp *http.Respons // rules, and constraints. Built-in content types (with identifiers starting with the // c- prefix) can't be removed. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// contentTypeID - Content type identifier. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - ContentTypeClientDeleteOptions contains the optional parameters for the ContentTypeClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - contentTypeID - Content type identifier. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - ContentTypeClientDeleteOptions contains the optional parameters for the ContentTypeClient.Delete method. func (client *ContentTypeClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, ifMatch string, options *ContentTypeClientDeleteOptions) (ContentTypeClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, ifMatch, options) if err != nil { @@ -175,7 +178,7 @@ func (client *ContentTypeClient) deleteCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -185,11 +188,12 @@ func (client *ContentTypeClient) deleteCreateRequest(ctx context.Context, resour // Get - Gets the details of the developer portal's content type. Content types describe content items' properties, validation // rules, and constraints. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// contentTypeID - Content type identifier. -// options - ContentTypeClientGetOptions contains the optional parameters for the ContentTypeClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - contentTypeID - Content type identifier. +// - options - ContentTypeClientGetOptions contains the optional parameters for the ContentTypeClient.Get method. func (client *ContentTypeClient) Get(ctx context.Context, resourceGroupName string, serviceName string, contentTypeID string, options *ContentTypeClientGetOptions) (ContentTypeClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, contentTypeID, options) if err != nil { @@ -229,7 +233,7 @@ func (client *ContentTypeClient) getCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,12 +253,12 @@ func (client *ContentTypeClient) getHandleResponse(resp *http.Response) (Content // NewListByServicePager - Lists the developer portal's content types. Content types describe content items' properties, validation // rules, and constraints. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - ContentTypeClientListByServiceOptions contains the optional parameters for the ContentTypeClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - ContentTypeClientListByServiceOptions contains the optional parameters for the ContentTypeClient.NewListByServicePager +// method. func (client *ContentTypeClient) NewListByServicePager(resourceGroupName string, serviceName string, options *ContentTypeClientListByServiceOptions) *runtime.Pager[ContentTypeClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[ContentTypeClientListByServiceResponse]{ More: func(page ContentTypeClientListByServiceResponse) bool { @@ -303,7 +307,7 @@ func (client *ContentTypeClient) listByServiceCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_delegationsettings_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/delegationsettings_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_delegationsettings_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/delegationsettings_client.go index 7b27da0f6d2b..a73eab625e95 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_delegationsettings_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/delegationsettings_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 armapimanagement @@ -31,10 +32,9 @@ type DelegationSettingsClient struct { } // NewDelegationSettingsClient creates a new instance of DelegationSettingsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDelegationSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DelegationSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewDelegationSettingsClient(subscriptionID string, credential azcore.TokenC // CreateOrUpdate - Create or Update Delegation settings. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// parameters - Create or update parameters. -// options - DelegationSettingsClientCreateOrUpdateOptions contains the optional parameters for the DelegationSettingsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - parameters - Create or update parameters. +// - options - DelegationSettingsClientCreateOrUpdateOptions contains the optional parameters for the DelegationSettingsClient.CreateOrUpdate +// method. func (client *DelegationSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalDelegationSettings, options *DelegationSettingsClientCreateOrUpdateOptions) (DelegationSettingsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { @@ -98,7 +99,7 @@ func (client *DelegationSettingsClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -118,10 +119,11 @@ func (client *DelegationSettingsClient) createOrUpdateHandleResponse(resp *http. // Get - Get Delegation Settings for the Portal. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - DelegationSettingsClientGetOptions contains the optional parameters for the DelegationSettingsClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - DelegationSettingsClientGetOptions contains the optional parameters for the DelegationSettingsClient.Get method. func (client *DelegationSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *DelegationSettingsClientGetOptions) (DelegationSettingsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -157,7 +159,7 @@ func (client *DelegationSettingsClient) getCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -176,11 +178,12 @@ func (client *DelegationSettingsClient) getHandleResponse(resp *http.Response) ( } // GetEntityTag - Gets the entity state (Etag) version of the DelegationSettings. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - DelegationSettingsClientGetEntityTagOptions contains the optional parameters for the DelegationSettingsClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - DelegationSettingsClientGetEntityTagOptions contains the optional parameters for the DelegationSettingsClient.GetEntityTag +// method. func (client *DelegationSettingsClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, options *DelegationSettingsClientGetEntityTagOptions) (DelegationSettingsClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -216,7 +219,7 @@ func (client *DelegationSettingsClient) getEntityTagCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,11 +237,12 @@ func (client *DelegationSettingsClient) getEntityTagHandleResponse(resp *http.Re // ListSecrets - Gets the secret validation key of the DelegationSettings. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - DelegationSettingsClientListSecretsOptions contains the optional parameters for the DelegationSettingsClient.ListSecrets -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - DelegationSettingsClientListSecretsOptions contains the optional parameters for the DelegationSettingsClient.ListSecrets +// method. func (client *DelegationSettingsClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, options *DelegationSettingsClientListSecretsOptions) (DelegationSettingsClientListSecretsResponse, error) { req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -274,7 +278,7 @@ func (client *DelegationSettingsClient) listSecretsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -291,14 +295,15 @@ func (client *DelegationSettingsClient) listSecretsHandleResponse(resp *http.Res // Update - Update Delegation settings. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update Delegation settings. -// options - DelegationSettingsClientUpdateOptions contains the optional parameters for the DelegationSettingsClient.Update -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update Delegation settings. +// - options - DelegationSettingsClientUpdateOptions contains the optional parameters for the DelegationSettingsClient.Update +// method. func (client *DelegationSettingsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, ifMatch string, parameters PortalDelegationSettings, options *DelegationSettingsClientUpdateOptions) (DelegationSettingsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, ifMatch, parameters, options) if err != nil { @@ -334,7 +339,7 @@ func (client *DelegationSettingsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_deletedservices_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/deletedservices_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_deletedservices_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/deletedservices_client.go index be0360a0d9bd..f88d0f23aa42 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_deletedservices_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/deletedservices_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 armapimanagement @@ -31,10 +32,9 @@ type DeletedServicesClient struct { } // NewDeletedServicesClient creates a new instance of DeletedServicesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDeletedServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DeletedServicesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewDeletedServicesClient(subscriptionID string, credential azcore.TokenCred // GetByName - Get soft-deleted Api Management Service by name. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// serviceName - The name of the API Management service. -// location - The location of the deleted API Management service. -// options - DeletedServicesClientGetByNameOptions contains the optional parameters for the DeletedServicesClient.GetByName -// method. +// +// Generated from API version 2022-08-01 +// - serviceName - The name of the API Management service. +// - location - The location of the deleted API Management service. +// - options - DeletedServicesClientGetByNameOptions contains the optional parameters for the DeletedServicesClient.GetByName +// method. func (client *DeletedServicesClient) GetByName(ctx context.Context, serviceName string, location string, options *DeletedServicesClientGetByNameOptions) (DeletedServicesClientGetByNameResponse, error) { req, err := client.getByNameCreateRequest(ctx, serviceName, location, options) if err != nil { @@ -97,7 +98,7 @@ func (client *DeletedServicesClient) getByNameCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -113,10 +114,10 @@ func (client *DeletedServicesClient) getByNameHandleResponse(resp *http.Response } // NewListBySubscriptionPager - Lists all soft-deleted services available for undelete for the given subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// options - DeletedServicesClientListBySubscriptionOptions contains the optional parameters for the DeletedServicesClient.ListBySubscription -// method. +// +// Generated from API version 2022-08-01 +// - options - DeletedServicesClientListBySubscriptionOptions contains the optional parameters for the DeletedServicesClient.NewListBySubscriptionPager +// method. func (client *DeletedServicesClient) NewListBySubscriptionPager(options *DeletedServicesClientListBySubscriptionOptions) *runtime.Pager[DeletedServicesClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[DeletedServicesClientListBySubscriptionResponse]{ More: func(page DeletedServicesClientListBySubscriptionResponse) bool { @@ -157,7 +158,7 @@ func (client *DeletedServicesClient) listBySubscriptionCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -174,11 +175,12 @@ func (client *DeletedServicesClient) listBySubscriptionHandleResponse(resp *http // BeginPurge - Purges Api Management Service (deletes it with no option to undelete). // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// serviceName - The name of the API Management service. -// location - The location of the deleted API Management service. -// options - DeletedServicesClientBeginPurgeOptions contains the optional parameters for the DeletedServicesClient.BeginPurge -// method. +// +// Generated from API version 2022-08-01 +// - serviceName - The name of the API Management service. +// - location - The location of the deleted API Management service. +// - options - DeletedServicesClientBeginPurgeOptions contains the optional parameters for the DeletedServicesClient.BeginPurge +// method. func (client *DeletedServicesClient) BeginPurge(ctx context.Context, serviceName string, location string, options *DeletedServicesClientBeginPurgeOptions) (*runtime.Poller[DeletedServicesClientPurgeResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.purge(ctx, serviceName, location, options) @@ -195,7 +197,8 @@ func (client *DeletedServicesClient) BeginPurge(ctx context.Context, serviceName // Purge - Purges Api Management Service (deletes it with no option to undelete). // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *DeletedServicesClient) purge(ctx context.Context, serviceName string, location string, options *DeletedServicesClientBeginPurgeOptions) (*http.Response, error) { req, err := client.purgeCreateRequest(ctx, serviceName, location, options) if err != nil { @@ -231,7 +234,7 @@ func (client *DeletedServicesClient) purgeCreateRequest(ctx context.Context, ser return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_diagnostic_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/diagnostic_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_diagnostic_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/diagnostic_client.go index 94fd43423127..2f48d121f3fc 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_diagnostic_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/diagnostic_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 armapimanagement @@ -32,10 +33,9 @@ type DiagnosticClient struct { } // NewDiagnosticClient creates a new instance of DiagnosticClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewDiagnosticClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DiagnosticClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewDiagnosticClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Creates a new Diagnostic or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. -// parameters - Create parameters. -// options - DiagnosticClientCreateOrUpdateOptions contains the optional parameters for the DiagnosticClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - DiagnosticClientCreateOrUpdateOptions contains the optional parameters for the DiagnosticClient.CreateOrUpdate +// method. func (client *DiagnosticClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, parameters DiagnosticContract, options *DiagnosticClientCreateOrUpdateOptions) (DiagnosticClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, diagnosticID, parameters, options) if err != nil { @@ -104,7 +105,7 @@ func (client *DiagnosticClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -127,13 +128,14 @@ func (client *DiagnosticClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes the specified Diagnostic. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - DiagnosticClientDeleteOptions contains the optional parameters for the DiagnosticClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - DiagnosticClientDeleteOptions contains the optional parameters for the DiagnosticClient.Delete method. func (client *DiagnosticClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, ifMatch string, options *DiagnosticClientDeleteOptions) (DiagnosticClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, diagnosticID, ifMatch, options) if err != nil { @@ -173,7 +175,7 @@ func (client *DiagnosticClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -182,11 +184,12 @@ func (client *DiagnosticClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the details of the Diagnostic specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. -// options - DiagnosticClientGetOptions contains the optional parameters for the DiagnosticClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. +// - options - DiagnosticClientGetOptions contains the optional parameters for the DiagnosticClient.Get method. func (client *DiagnosticClient) Get(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, options *DiagnosticClientGetOptions) (DiagnosticClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, diagnosticID, options) if err != nil { @@ -226,7 +229,7 @@ func (client *DiagnosticClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -245,11 +248,12 @@ func (client *DiagnosticClient) getHandleResponse(resp *http.Response) (Diagnost } // GetEntityTag - Gets the entity state (Etag) version of the Diagnostic specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. -// options - DiagnosticClientGetEntityTagOptions contains the optional parameters for the DiagnosticClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. +// - options - DiagnosticClientGetEntityTagOptions contains the optional parameters for the DiagnosticClient.GetEntityTag method. func (client *DiagnosticClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, options *DiagnosticClientGetEntityTagOptions) (DiagnosticClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, diagnosticID, options) if err != nil { @@ -289,7 +293,7 @@ func (client *DiagnosticClient) getEntityTagCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,12 +310,12 @@ func (client *DiagnosticClient) getEntityTagHandleResponse(resp *http.Response) } // NewListByServicePager - Lists all diagnostics of the API Management service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - DiagnosticClientListByServiceOptions contains the optional parameters for the DiagnosticClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - DiagnosticClientListByServiceOptions contains the optional parameters for the DiagnosticClient.NewListByServicePager +// method. func (client *DiagnosticClient) NewListByServicePager(resourceGroupName string, serviceName string, options *DiagnosticClientListByServiceOptions) *runtime.Pager[DiagnosticClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[DiagnosticClientListByServiceResponse]{ More: func(page DiagnosticClientListByServiceResponse) bool { @@ -369,7 +373,7 @@ func (client *DiagnosticClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -386,14 +390,15 @@ func (client *DiagnosticClient) listByServiceHandleResponse(resp *http.Response) // Update - Updates the details of the Diagnostic specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Diagnostic Update parameters. -// options - DiagnosticClientUpdateOptions contains the optional parameters for the DiagnosticClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - diagnosticID - Diagnostic identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Diagnostic Update parameters. +// - options - DiagnosticClientUpdateOptions contains the optional parameters for the DiagnosticClient.Update method. func (client *DiagnosticClient) Update(ctx context.Context, resourceGroupName string, serviceName string, diagnosticID string, ifMatch string, parameters DiagnosticContract, options *DiagnosticClientUpdateOptions) (DiagnosticClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, diagnosticID, ifMatch, parameters, options) if err != nil { @@ -433,7 +438,7 @@ func (client *DiagnosticClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/documentation_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/documentation_client.go new file mode 100644 index 000000000000..ddf5f86d98c3 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/documentation_client.go @@ -0,0 +1,449 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +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" +) + +// DocumentationClient contains the methods for the Documentation group. +// Don't use this type directly, use NewDocumentationClient() instead. +type DocumentationClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewDocumentationClient creates a new instance of DocumentationClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewDocumentationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DocumentationClient, 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 := &DocumentationClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates a new Documentation or updates an existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - documentationID - Documentation identifier. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - DocumentationClientCreateOrUpdateOptions contains the optional parameters for the DocumentationClient.CreateOrUpdate +// method. +func (client *DocumentationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, parameters DocumentationContract, options *DocumentationClientCreateOrUpdateOptions) (DocumentationClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, documentationID, parameters, options) + if err != nil { + return DocumentationClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DocumentationClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return DocumentationClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *DocumentationClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, parameters DocumentationContract, options *DocumentationClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if documentationID == "" { + return nil, errors.New("parameter documentationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{documentationId}", url.PathEscape(documentationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *DocumentationClient) createOrUpdateHandleResponse(resp *http.Response) (DocumentationClientCreateOrUpdateResponse, error) { + result := DocumentationClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.DocumentationContract); err != nil { + return DocumentationClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the specified Documentation from an API. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - documentationID - Documentation identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - DocumentationClientDeleteOptions contains the optional parameters for the DocumentationClient.Delete method. +func (client *DocumentationClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, ifMatch string, options *DocumentationClientDeleteOptions) (DocumentationClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, documentationID, ifMatch, options) + if err != nil { + return DocumentationClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DocumentationClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return DocumentationClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return DocumentationClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *DocumentationClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, ifMatch string, options *DocumentationClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if documentationID == "" { + return nil, errors.New("parameter documentationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{documentationId}", url.PathEscape(documentationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the Documentation specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - documentationID - Documentation identifier. Must be unique in the current API Management service instance. +// - options - DocumentationClientGetOptions contains the optional parameters for the DocumentationClient.Get method. +func (client *DocumentationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, options *DocumentationClientGetOptions) (DocumentationClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, documentationID, options) + if err != nil { + return DocumentationClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DocumentationClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DocumentationClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *DocumentationClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, options *DocumentationClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if documentationID == "" { + return nil, errors.New("parameter documentationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{documentationId}", url.PathEscape(documentationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *DocumentationClient) getHandleResponse(resp *http.Response) (DocumentationClientGetResponse, error) { + result := DocumentationClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.DocumentationContract); err != nil { + return DocumentationClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of the Documentation by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - documentationID - Documentation identifier. Must be unique in the current API Management service instance. +// - options - DocumentationClientGetEntityTagOptions contains the optional parameters for the DocumentationClient.GetEntityTag +// method. +func (client *DocumentationClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, options *DocumentationClientGetEntityTagOptions) (DocumentationClientGetEntityTagResponse, error) { + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, documentationID, options) + if err != nil { + return DocumentationClientGetEntityTagResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DocumentationClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DocumentationClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + } + return client.getEntityTagHandleResponse(resp) +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *DocumentationClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, options *DocumentationClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if documentationID == "" { + return nil, errors.New("parameter documentationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{documentationId}", url.PathEscape(documentationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *DocumentationClient) getEntityTagHandleResponse(resp *http.Response) (DocumentationClientGetEntityTagResponse, error) { + result := DocumentationClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// NewListByServicePager - Lists all Documentations of the API Management service instance. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - DocumentationClientListByServiceOptions contains the optional parameters for the DocumentationClient.NewListByServicePager +// method. +func (client *DocumentationClient) NewListByServicePager(resourceGroupName string, serviceName string, options *DocumentationClientListByServiceOptions) *runtime.Pager[DocumentationClientListByServiceResponse] { + return runtime.NewPager(runtime.PagingHandler[DocumentationClientListByServiceResponse]{ + More: func(page DocumentationClientListByServiceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *DocumentationClientListByServiceResponse) (DocumentationClientListByServiceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DocumentationClientListByServiceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DocumentationClientListByServiceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DocumentationClientListByServiceResponse{}, runtime.NewResponseError(resp) + } + return client.listByServiceHandleResponse(resp) + }, + }) +} + +// listByServiceCreateRequest creates the ListByService request. +func (client *DocumentationClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *DocumentationClientListByServiceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServiceHandleResponse handles the ListByService response. +func (client *DocumentationClient) listByServiceHandleResponse(resp *http.Response) (DocumentationClientListByServiceResponse, error) { + result := DocumentationClientListByServiceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.DocumentationCollection); err != nil { + return DocumentationClientListByServiceResponse{}, err + } + return result, nil +} + +// Update - Updates the details of the Documentation for an API specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - documentationID - Documentation identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Documentation Update parameters. +// - options - DocumentationClientUpdateOptions contains the optional parameters for the DocumentationClient.Update method. +func (client *DocumentationClient) Update(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, ifMatch string, parameters DocumentationUpdateContract, options *DocumentationClientUpdateOptions) (DocumentationClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, documentationID, ifMatch, parameters, options) + if err != nil { + return DocumentationClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DocumentationClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DocumentationClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *DocumentationClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, documentationID string, ifMatch string, parameters DocumentationUpdateContract, options *DocumentationClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/documentations/{documentationId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if documentationID == "" { + return nil, errors.New("parameter documentationID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{documentationId}", url.PathEscape(documentationID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateHandleResponse handles the Update response. +func (client *DocumentationClient) updateHandleResponse(resp *http.Response) (DocumentationClientUpdateResponse, error) { + result := DocumentationClientUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.DocumentationContract); err != nil { + return DocumentationClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_emailtemplate_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/emailtemplate_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_emailtemplate_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/emailtemplate_client.go index 0ad3c703b311..7911767ac1a3 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_emailtemplate_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/emailtemplate_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 armapimanagement @@ -32,10 +33,9 @@ type EmailTemplateClient struct { } // NewEmailTemplateClient creates a new instance of EmailTemplateClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewEmailTemplateClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*EmailTemplateClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewEmailTemplateClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Updates an Email Template. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// templateName - Email Template Name Identifier. -// parameters - Email Template update parameters. -// options - EmailTemplateClientCreateOrUpdateOptions contains the optional parameters for the EmailTemplateClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - templateName - Email Template Name Identifier. +// - parameters - Email Template update parameters. +// - options - EmailTemplateClientCreateOrUpdateOptions contains the optional parameters for the EmailTemplateClient.CreateOrUpdate +// method. func (client *EmailTemplateClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, parameters EmailTemplateUpdateParameters, options *EmailTemplateClientCreateOrUpdateOptions) (EmailTemplateClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, templateName, parameters, options) if err != nil { @@ -104,7 +105,7 @@ func (client *EmailTemplateClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -124,13 +125,14 @@ func (client *EmailTemplateClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Reset the Email Template to default template provided by the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// templateName - Email Template Name Identifier. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - EmailTemplateClientDeleteOptions contains the optional parameters for the EmailTemplateClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - templateName - Email Template Name Identifier. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - EmailTemplateClientDeleteOptions contains the optional parameters for the EmailTemplateClient.Delete method. func (client *EmailTemplateClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, ifMatch string, options *EmailTemplateClientDeleteOptions) (EmailTemplateClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, templateName, ifMatch, options) if err != nil { @@ -170,7 +172,7 @@ func (client *EmailTemplateClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -179,11 +181,12 @@ func (client *EmailTemplateClient) deleteCreateRequest(ctx context.Context, reso // Get - Gets the details of the email template specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// templateName - Email Template Name Identifier. -// options - EmailTemplateClientGetOptions contains the optional parameters for the EmailTemplateClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - templateName - Email Template Name Identifier. +// - options - EmailTemplateClientGetOptions contains the optional parameters for the EmailTemplateClient.Get method. func (client *EmailTemplateClient) Get(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, options *EmailTemplateClientGetOptions) (EmailTemplateClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, templateName, options) if err != nil { @@ -223,7 +226,7 @@ func (client *EmailTemplateClient) getCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -242,12 +245,13 @@ func (client *EmailTemplateClient) getHandleResponse(resp *http.Response) (Email } // GetEntityTag - Gets the entity state (Etag) version of the email template specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// templateName - Email Template Name Identifier. -// options - EmailTemplateClientGetEntityTagOptions contains the optional parameters for the EmailTemplateClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - templateName - Email Template Name Identifier. +// - options - EmailTemplateClientGetEntityTagOptions contains the optional parameters for the EmailTemplateClient.GetEntityTag +// method. func (client *EmailTemplateClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, options *EmailTemplateClientGetEntityTagOptions) (EmailTemplateClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, templateName, options) if err != nil { @@ -287,7 +291,7 @@ func (client *EmailTemplateClient) getEntityTagCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -304,12 +308,12 @@ func (client *EmailTemplateClient) getEntityTagHandleResponse(resp *http.Respons } // NewListByServicePager - Gets all email templates -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - EmailTemplateClientListByServiceOptions contains the optional parameters for the EmailTemplateClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - EmailTemplateClientListByServiceOptions contains the optional parameters for the EmailTemplateClient.NewListByServicePager +// method. func (client *EmailTemplateClient) NewListByServicePager(resourceGroupName string, serviceName string, options *EmailTemplateClientListByServiceOptions) *runtime.Pager[EmailTemplateClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[EmailTemplateClientListByServiceResponse]{ More: func(page EmailTemplateClientListByServiceResponse) bool { @@ -367,7 +371,7 @@ func (client *EmailTemplateClient) listByServiceCreateRequest(ctx context.Contex if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,14 +388,15 @@ func (client *EmailTemplateClient) listByServiceHandleResponse(resp *http.Respon // Update - Updates API Management email template // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// templateName - Email Template Name Identifier. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - EmailTemplateClientUpdateOptions contains the optional parameters for the EmailTemplateClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - templateName - Email Template Name Identifier. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - EmailTemplateClientUpdateOptions contains the optional parameters for the EmailTemplateClient.Update method. func (client *EmailTemplateClient) Update(ctx context.Context, resourceGroupName string, serviceName string, templateName TemplateName, ifMatch string, parameters EmailTemplateUpdateParameters, options *EmailTemplateClientUpdateOptions) (EmailTemplateClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, templateName, ifMatch, parameters, options) if err != nil { @@ -431,7 +436,7 @@ func (client *EmailTemplateClient) updateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_gateway_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/gateway_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_gateway_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/gateway_client.go index 810e2a3af6b5..c7d3522fc60f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_gateway_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/gateway_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 armapimanagement @@ -32,10 +33,9 @@ type GatewayClient struct { } // NewGatewayClient creates a new instance of GatewayClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewGatewayClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewGatewayClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or updates a Gateway to be used in Api Management instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// options - GatewayClientCreateOrUpdateOptions contains the optional parameters for the GatewayClient.CreateOrUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - options - GatewayClientCreateOrUpdateOptions contains the optional parameters for the GatewayClient.CreateOrUpdate method. func (client *GatewayClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayContract, options *GatewayClientCreateOrUpdateOptions) (GatewayClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, parameters, options) if err != nil { @@ -103,7 +104,7 @@ func (client *GatewayClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -126,14 +127,15 @@ func (client *GatewayClient) createOrUpdateHandleResponse(resp *http.Response) ( // Delete - Deletes specific Gateway. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - GatewayClientDeleteOptions contains the optional parameters for the GatewayClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - GatewayClientDeleteOptions contains the optional parameters for the GatewayClient.Delete method. func (client *GatewayClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, ifMatch string, options *GatewayClientDeleteOptions) (GatewayClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, ifMatch, options) if err != nil { @@ -173,7 +175,7 @@ func (client *GatewayClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -182,12 +184,13 @@ func (client *GatewayClient) deleteCreateRequest(ctx context.Context, resourceGr // GenerateToken - Gets the Shared Access Authorization Token for the gateway. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// options - GatewayClientGenerateTokenOptions contains the optional parameters for the GatewayClient.GenerateToken method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - options - GatewayClientGenerateTokenOptions contains the optional parameters for the GatewayClient.GenerateToken method. func (client *GatewayClient) GenerateToken(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayTokenRequestContract, options *GatewayClientGenerateTokenOptions) (GatewayClientGenerateTokenResponse, error) { req, err := client.generateTokenCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, parameters, options) if err != nil { @@ -227,7 +230,7 @@ func (client *GatewayClient) generateTokenCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -244,12 +247,13 @@ func (client *GatewayClient) generateTokenHandleResponse(resp *http.Response) (G // Get - Gets the details of the Gateway specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// options - GatewayClientGetOptions contains the optional parameters for the GatewayClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - options - GatewayClientGetOptions contains the optional parameters for the GatewayClient.Get method. func (client *GatewayClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, options *GatewayClientGetOptions) (GatewayClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, options) if err != nil { @@ -289,7 +293,7 @@ func (client *GatewayClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -308,12 +312,13 @@ func (client *GatewayClient) getHandleResponse(resp *http.Response) (GatewayClie } // GetEntityTag - Gets the entity state (Etag) version of the Gateway specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// options - GatewayClientGetEntityTagOptions contains the optional parameters for the GatewayClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - options - GatewayClientGetEntityTagOptions contains the optional parameters for the GatewayClient.GetEntityTag method. func (client *GatewayClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, options *GatewayClientGetEntityTagOptions) (GatewayClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, options) if err != nil { @@ -353,7 +358,7 @@ func (client *GatewayClient) getEntityTagCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -370,11 +375,12 @@ func (client *GatewayClient) getEntityTagHandleResponse(resp *http.Response) (Ga } // NewListByServicePager - Lists a collection of gateways registered with service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - GatewayClientListByServiceOptions contains the optional parameters for the GatewayClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - GatewayClientListByServiceOptions contains the optional parameters for the GatewayClient.NewListByServicePager +// method. func (client *GatewayClient) NewListByServicePager(resourceGroupName string, serviceName string, options *GatewayClientListByServiceOptions) *runtime.Pager[GatewayClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[GatewayClientListByServiceResponse]{ More: func(page GatewayClientListByServiceResponse) bool { @@ -432,7 +438,7 @@ func (client *GatewayClient) listByServiceCreateRequest(ctx context.Context, res if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -449,12 +455,13 @@ func (client *GatewayClient) listByServiceHandleResponse(resp *http.Response) (G // ListKeys - Retrieves gateway keys. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// options - GatewayClientListKeysOptions contains the optional parameters for the GatewayClient.ListKeys method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - options - GatewayClientListKeysOptions contains the optional parameters for the GatewayClient.ListKeys method. func (client *GatewayClient) ListKeys(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, options *GatewayClientListKeysOptions) (GatewayClientListKeysResponse, error) { req, err := client.listKeysCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, options) if err != nil { @@ -494,7 +501,7 @@ func (client *GatewayClient) listKeysCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -514,12 +521,13 @@ func (client *GatewayClient) listKeysHandleResponse(resp *http.Response) (Gatewa // RegenerateKey - Regenerates specified gateway key invalidating any tokens created with it. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// options - GatewayClientRegenerateKeyOptions contains the optional parameters for the GatewayClient.RegenerateKey method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - options - GatewayClientRegenerateKeyOptions contains the optional parameters for the GatewayClient.RegenerateKey method. func (client *GatewayClient) RegenerateKey(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, parameters GatewayKeyRegenerationRequestContract, options *GatewayClientRegenerateKeyOptions) (GatewayClientRegenerateKeyResponse, error) { req, err := client.regenerateKeyCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, parameters, options) if err != nil { @@ -559,7 +567,7 @@ func (client *GatewayClient) regenerateKeyCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -567,14 +575,15 @@ func (client *GatewayClient) regenerateKeyCreateRequest(ctx context.Context, res // Update - Updates the details of the gateway specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - GatewayClientUpdateOptions contains the optional parameters for the GatewayClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - GatewayClientUpdateOptions contains the optional parameters for the GatewayClient.Update method. func (client *GatewayClient) Update(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, ifMatch string, parameters GatewayContract, options *GatewayClientUpdateOptions) (GatewayClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, ifMatch, parameters, options) if err != nil { @@ -614,7 +623,7 @@ func (client *GatewayClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_gatewayapi_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/gatewayapi_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_gatewayapi_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/gatewayapi_client.go index f80878d524dd..10460078f8af 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_gatewayapi_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/gatewayapi_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 armapimanagement @@ -32,10 +33,9 @@ type GatewayAPIClient struct { } // NewGatewayAPIClient creates a new instance of GatewayAPIClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewGatewayAPIClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayAPIClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +58,15 @@ func NewGatewayAPIClient(subscriptionID string, credential azcore.TokenCredentia // CreateOrUpdate - Adds an API to the specified Gateway. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// apiID - API identifier. Must be unique in the current API Management service instance. -// options - GatewayAPIClientCreateOrUpdateOptions contains the optional parameters for the GatewayAPIClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - GatewayAPIClientCreateOrUpdateOptions contains the optional parameters for the GatewayAPIClient.CreateOrUpdate +// method. func (client *GatewayAPIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiID string, options *GatewayAPIClientCreateOrUpdateOptions) (GatewayAPIClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, apiID, options) if err != nil { @@ -109,7 +110,7 @@ func (client *GatewayAPIClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -129,13 +130,14 @@ func (client *GatewayAPIClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes the specified API from the specified Gateway. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// apiID - API identifier. Must be unique in the current API Management service instance. -// options - GatewayAPIClientDeleteOptions contains the optional parameters for the GatewayAPIClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - GatewayAPIClientDeleteOptions contains the optional parameters for the GatewayAPIClient.Delete method. func (client *GatewayAPIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiID string, options *GatewayAPIClientDeleteOptions) (GatewayAPIClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, apiID, options) if err != nil { @@ -179,20 +181,21 @@ func (client *GatewayAPIClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // GetEntityTag - Checks that API entity specified by identifier is associated with the Gateway entity. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// apiID - API identifier. Must be unique in the current API Management service instance. -// options - GatewayAPIClientGetEntityTagOptions contains the optional parameters for the GatewayAPIClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - apiID - API identifier. Must be unique in the current API Management service instance. +// - options - GatewayAPIClientGetEntityTagOptions contains the optional parameters for the GatewayAPIClient.GetEntityTag method. func (client *GatewayAPIClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, apiID string, options *GatewayAPIClientGetEntityTagOptions) (GatewayAPIClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, apiID, options) if err != nil { @@ -236,7 +239,7 @@ func (client *GatewayAPIClient) getEntityTagCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -253,14 +256,14 @@ func (client *GatewayAPIClient) getEntityTagHandleResponse(resp *http.Response) } // NewListByServicePager - Lists a collection of the APIs associated with a gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// options - GatewayAPIClientListByServiceOptions contains the optional parameters for the GatewayAPIClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - options - GatewayAPIClientListByServiceOptions contains the optional parameters for the GatewayAPIClient.NewListByServicePager +// method. func (client *GatewayAPIClient) NewListByServicePager(resourceGroupName string, serviceName string, gatewayID string, options *GatewayAPIClientListByServiceOptions) *runtime.Pager[GatewayAPIClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[GatewayAPIClientListByServiceResponse]{ More: func(page GatewayAPIClientListByServiceResponse) bool { @@ -322,7 +325,7 @@ func (client *GatewayAPIClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_gatewaycertificateauthority_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/gatewaycertificateauthority_client.go similarity index 83% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_gatewaycertificateauthority_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/gatewaycertificateauthority_client.go index df3d81a1ef87..3541b9205392 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_gatewaycertificateauthority_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/gatewaycertificateauthority_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 armapimanagement @@ -32,10 +33,9 @@ type GatewayCertificateAuthorityClient struct { } // NewGatewayCertificateAuthorityClient creates a new instance of GatewayCertificateAuthorityClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewGatewayCertificateAuthorityClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayCertificateAuthorityClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +58,15 @@ func NewGatewayCertificateAuthorityClient(subscriptionID string, credential azco // CreateOrUpdate - Assign Certificate entity to Gateway entity as Certificate Authority. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. -// options - GatewayCertificateAuthorityClientCreateOrUpdateOptions contains the optional parameters for the GatewayCertificateAuthorityClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. +// - options - GatewayCertificateAuthorityClientCreateOrUpdateOptions contains the optional parameters for the GatewayCertificateAuthorityClient.CreateOrUpdate +// method. func (client *GatewayCertificateAuthorityClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, certificateID string, parameters GatewayCertificateAuthorityContract, options *GatewayCertificateAuthorityClientCreateOrUpdateOptions) (GatewayCertificateAuthorityClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, certificateID, parameters, options) if err != nil { @@ -109,7 +110,7 @@ func (client *GatewayCertificateAuthorityClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -132,16 +133,17 @@ func (client *GatewayCertificateAuthorityClient) createOrUpdateHandleResponse(re // Delete - Remove relationship between Certificate Authority and Gateway entity. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - GatewayCertificateAuthorityClientDeleteOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Delete -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - GatewayCertificateAuthorityClientDeleteOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Delete +// method. func (client *GatewayCertificateAuthorityClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, certificateID string, ifMatch string, options *GatewayCertificateAuthorityClientDeleteOptions) (GatewayCertificateAuthorityClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, certificateID, ifMatch, options) if err != nil { @@ -185,7 +187,7 @@ func (client *GatewayCertificateAuthorityClient) deleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -194,14 +196,15 @@ func (client *GatewayCertificateAuthorityClient) deleteCreateRequest(ctx context // Get - Get assigned Gateway Certificate Authority details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. -// options - GatewayCertificateAuthorityClientGetOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Get -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. +// - options - GatewayCertificateAuthorityClientGetOptions contains the optional parameters for the GatewayCertificateAuthorityClient.Get +// method. func (client *GatewayCertificateAuthorityClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, certificateID string, options *GatewayCertificateAuthorityClientGetOptions) (GatewayCertificateAuthorityClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, certificateID, options) if err != nil { @@ -245,7 +248,7 @@ func (client *GatewayCertificateAuthorityClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,14 +267,15 @@ func (client *GatewayCertificateAuthorityClient) getHandleResponse(resp *http.Re } // GetEntityTag - Checks if Certificate entity is assigned to Gateway entity as Certificate Authority. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. -// options - GatewayCertificateAuthorityClientGetEntityTagOptions contains the optional parameters for the GatewayCertificateAuthorityClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - certificateID - Identifier of the certificate entity. Must be unique in the current API Management service instance. +// - options - GatewayCertificateAuthorityClientGetEntityTagOptions contains the optional parameters for the GatewayCertificateAuthorityClient.GetEntityTag +// method. func (client *GatewayCertificateAuthorityClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, certificateID string, options *GatewayCertificateAuthorityClientGetEntityTagOptions) (GatewayCertificateAuthorityClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, certificateID, options) if err != nil { @@ -315,7 +319,7 @@ func (client *GatewayCertificateAuthorityClient) getEntityTagCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,14 +336,14 @@ func (client *GatewayCertificateAuthorityClient) getEntityTagHandleResponse(resp } // NewListByServicePager - Lists the collection of Certificate Authorities for the specified Gateway entity. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// options - GatewayCertificateAuthorityClientListByServiceOptions contains the optional parameters for the GatewayCertificateAuthorityClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - options - GatewayCertificateAuthorityClientListByServiceOptions contains the optional parameters for the GatewayCertificateAuthorityClient.NewListByServicePager +// method. func (client *GatewayCertificateAuthorityClient) NewListByServicePager(resourceGroupName string, serviceName string, gatewayID string, options *GatewayCertificateAuthorityClientListByServiceOptions) *runtime.Pager[GatewayCertificateAuthorityClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[GatewayCertificateAuthorityClientListByServiceResponse]{ More: func(page GatewayCertificateAuthorityClientListByServiceResponse) bool { @@ -401,7 +405,7 @@ func (client *GatewayCertificateAuthorityClient) listByServiceCreateRequest(ctx if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_gatewayhostnameconfiguration_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/gatewayhostnameconfiguration_client.go similarity index 83% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_gatewayhostnameconfiguration_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/gatewayhostnameconfiguration_client.go index b873a2fb84f6..968e276e53a2 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_gatewayhostnameconfiguration_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/gatewayhostnameconfiguration_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 armapimanagement @@ -32,10 +33,9 @@ type GatewayHostnameConfigurationClient struct { } // NewGatewayHostnameConfigurationClient creates a new instance of GatewayHostnameConfigurationClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewGatewayHostnameConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GatewayHostnameConfigurationClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +58,15 @@ func NewGatewayHostnameConfigurationClient(subscriptionID string, credential azc // CreateOrUpdate - Creates of updates hostname configuration for a Gateway. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// hcID - Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. -// options - GatewayHostnameConfigurationClientCreateOrUpdateOptions contains the optional parameters for the GatewayHostnameConfigurationClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - hcID - Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. +// - options - GatewayHostnameConfigurationClientCreateOrUpdateOptions contains the optional parameters for the GatewayHostnameConfigurationClient.CreateOrUpdate +// method. func (client *GatewayHostnameConfigurationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string, parameters GatewayHostnameConfigurationContract, options *GatewayHostnameConfigurationClientCreateOrUpdateOptions) (GatewayHostnameConfigurationClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, hcID, parameters, options) if err != nil { @@ -109,7 +110,7 @@ func (client *GatewayHostnameConfigurationClient) createOrUpdateCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -132,16 +133,17 @@ func (client *GatewayHostnameConfigurationClient) createOrUpdateHandleResponse(r // Delete - Deletes the specified hostname configuration from the specified Gateway. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// hcID - Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - GatewayHostnameConfigurationClientDeleteOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Delete -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - hcID - Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - GatewayHostnameConfigurationClientDeleteOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Delete +// method. func (client *GatewayHostnameConfigurationClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string, ifMatch string, options *GatewayHostnameConfigurationClientDeleteOptions) (GatewayHostnameConfigurationClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, hcID, ifMatch, options) if err != nil { @@ -185,7 +187,7 @@ func (client *GatewayHostnameConfigurationClient) deleteCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -194,14 +196,15 @@ func (client *GatewayHostnameConfigurationClient) deleteCreateRequest(ctx contex // Get - Get details of a hostname configuration // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// hcID - Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. -// options - GatewayHostnameConfigurationClientGetOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Get -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - hcID - Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. +// - options - GatewayHostnameConfigurationClientGetOptions contains the optional parameters for the GatewayHostnameConfigurationClient.Get +// method. func (client *GatewayHostnameConfigurationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string, options *GatewayHostnameConfigurationClientGetOptions) (GatewayHostnameConfigurationClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, hcID, options) if err != nil { @@ -245,7 +248,7 @@ func (client *GatewayHostnameConfigurationClient) getCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -264,14 +267,15 @@ func (client *GatewayHostnameConfigurationClient) getHandleResponse(resp *http.R } // GetEntityTag - Checks that hostname configuration entity specified by identifier exists for specified Gateway entity. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// hcID - Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. -// options - GatewayHostnameConfigurationClientGetEntityTagOptions contains the optional parameters for the GatewayHostnameConfigurationClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - hcID - Gateway hostname configuration identifier. Must be unique in the scope of parent Gateway entity. +// - options - GatewayHostnameConfigurationClientGetEntityTagOptions contains the optional parameters for the GatewayHostnameConfigurationClient.GetEntityTag +// method. func (client *GatewayHostnameConfigurationClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, gatewayID string, hcID string, options *GatewayHostnameConfigurationClientGetEntityTagOptions) (GatewayHostnameConfigurationClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, gatewayID, hcID, options) if err != nil { @@ -315,7 +319,7 @@ func (client *GatewayHostnameConfigurationClient) getEntityTagCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -332,14 +336,14 @@ func (client *GatewayHostnameConfigurationClient) getEntityTagHandleResponse(res } // NewListByServicePager - Lists the collection of hostname configurations for the specified gateway. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value -// 'managed' -// options - GatewayHostnameConfigurationClientListByServiceOptions contains the optional parameters for the GatewayHostnameConfigurationClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - gatewayID - Gateway entity identifier. Must be unique in the current API Management service instance. Must not have value +// 'managed' +// - options - GatewayHostnameConfigurationClientListByServiceOptions contains the optional parameters for the GatewayHostnameConfigurationClient.NewListByServicePager +// method. func (client *GatewayHostnameConfigurationClient) NewListByServicePager(resourceGroupName string, serviceName string, gatewayID string, options *GatewayHostnameConfigurationClientListByServiceOptions) *runtime.Pager[GatewayHostnameConfigurationClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[GatewayHostnameConfigurationClientListByServiceResponse]{ More: func(page GatewayHostnameConfigurationClientListByServiceResponse) bool { @@ -401,7 +405,7 @@ func (client *GatewayHostnameConfigurationClient) listByServiceCreateRequest(ctx if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_globalschema_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/globalschema_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_globalschema_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/globalschema_client.go index 944856be018f..1d3164121857 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_globalschema_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/globalschema_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 armapimanagement @@ -32,10 +33,9 @@ type GlobalSchemaClient struct { } // NewGlobalSchemaClient creates a new instance of GlobalSchemaClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewGlobalSchemaClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GlobalSchemaClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewGlobalSchemaClient(subscriptionID string, credential azcore.TokenCredent // BeginCreateOrUpdate - Creates new or updates existing specified Schema of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// schemaID - Schema id identifier. Must be unique in the current API Management service instance. -// parameters - Create or update parameters. -// options - GlobalSchemaClientBeginCreateOrUpdateOptions contains the optional parameters for the GlobalSchemaClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - schemaID - Schema id identifier. Must be unique in the current API Management service instance. +// - parameters - Create or update parameters. +// - options - GlobalSchemaClientBeginCreateOrUpdateOptions contains the optional parameters for the GlobalSchemaClient.BeginCreateOrUpdate +// method. func (client *GlobalSchemaClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, parameters GlobalSchemaContract, options *GlobalSchemaClientBeginCreateOrUpdateOptions) (*runtime.Poller[GlobalSchemaClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, schemaID, parameters, options) @@ -81,7 +82,8 @@ func (client *GlobalSchemaClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates new or updates existing specified Schema of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *GlobalSchemaClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, parameters GlobalSchemaContract, options *GlobalSchemaClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, schemaID, parameters, options) if err != nil { @@ -121,7 +123,7 @@ func (client *GlobalSchemaClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -132,13 +134,14 @@ func (client *GlobalSchemaClient) createOrUpdateCreateRequest(ctx context.Contex // Delete - Deletes specific Schema. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// schemaID - Schema id identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - GlobalSchemaClientDeleteOptions contains the optional parameters for the GlobalSchemaClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - schemaID - Schema id identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - GlobalSchemaClientDeleteOptions contains the optional parameters for the GlobalSchemaClient.Delete method. func (client *GlobalSchemaClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, ifMatch string, options *GlobalSchemaClientDeleteOptions) (GlobalSchemaClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, schemaID, ifMatch, options) if err != nil { @@ -178,7 +181,7 @@ func (client *GlobalSchemaClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -187,11 +190,12 @@ func (client *GlobalSchemaClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the details of the Schema specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// schemaID - Schema id identifier. Must be unique in the current API Management service instance. -// options - GlobalSchemaClientGetOptions contains the optional parameters for the GlobalSchemaClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - schemaID - Schema id identifier. Must be unique in the current API Management service instance. +// - options - GlobalSchemaClientGetOptions contains the optional parameters for the GlobalSchemaClient.Get method. func (client *GlobalSchemaClient) Get(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, options *GlobalSchemaClientGetOptions) (GlobalSchemaClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, schemaID, options) if err != nil { @@ -231,7 +235,7 @@ func (client *GlobalSchemaClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,12 +254,13 @@ func (client *GlobalSchemaClient) getHandleResponse(resp *http.Response) (Global } // GetEntityTag - Gets the entity state (Etag) version of the Schema specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// schemaID - Schema id identifier. Must be unique in the current API Management service instance. -// options - GlobalSchemaClientGetEntityTagOptions contains the optional parameters for the GlobalSchemaClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - schemaID - Schema id identifier. Must be unique in the current API Management service instance. +// - options - GlobalSchemaClientGetEntityTagOptions contains the optional parameters for the GlobalSchemaClient.GetEntityTag +// method. func (client *GlobalSchemaClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, schemaID string, options *GlobalSchemaClientGetEntityTagOptions) (GlobalSchemaClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, schemaID, options) if err != nil { @@ -295,7 +300,7 @@ func (client *GlobalSchemaClient) getEntityTagCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -312,12 +317,12 @@ func (client *GlobalSchemaClient) getEntityTagHandleResponse(resp *http.Response } // NewListByServicePager - Lists a collection of schemas registered with service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - GlobalSchemaClientListByServiceOptions contains the optional parameters for the GlobalSchemaClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - GlobalSchemaClientListByServiceOptions contains the optional parameters for the GlobalSchemaClient.NewListByServicePager +// method. func (client *GlobalSchemaClient) NewListByServicePager(resourceGroupName string, serviceName string, options *GlobalSchemaClientListByServiceOptions) *runtime.Pager[GlobalSchemaClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[GlobalSchemaClientListByServiceResponse]{ More: func(page GlobalSchemaClientListByServiceResponse) bool { @@ -375,7 +380,7 @@ func (client *GlobalSchemaClient) listByServiceCreateRequest(ctx context.Context if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/go.mod b/sdk/resourcemanager/apimanagement/armapimanagement/go.mod index 96a984102d6e..c8179f6ae67c 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/go.mod +++ b/sdk/resourcemanager/apimanagement/armapimanagement/go.mod @@ -1,29 +1,13 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement/v2 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.1 - github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 - github.com/stretchr/testify v1.7.0 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 require ( github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/dnaeon/go-vcr v1.1.0 // indirect - github.com/golang-jwt/jwt v3.2.1+incompatible // indirect - github.com/google/uuid v1.1.1 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 // indirect golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 // indirect - golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e // indirect golang.org/x/text v0.3.7 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/go.sum b/sdk/resourcemanager/apimanagement/armapimanagement/go.sum index 07096d31831b..fcd024b572be 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/go.sum +++ b/sdk/resourcemanager/apimanagement/armapimanagement/go.sum @@ -1,50 +1,15 @@ github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0 h1:Ut0ZGdOwJDw0npYEg+TLlPls3Pq6JiZaP2/aGKir7Zw= github.com/Azure/azure-sdk-for-go/sdk/azcore v1.1.0/go.mod h1:uGG2W01BaETf0Ozp+QxxKJdMBNRWPdstHG0Fmdwn1/U= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0 h1:Yoicul8bnVdQrhDMTHxdEckRGX01XvwXDHUT9zYZ3k0= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.0.0/go.mod h1:+6sju8gk8FRmSajX3Oz4G5Gm7P+mbqE9FVaXXFYTkCM= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0 h1:jp0dGvZ7ZK0mgqnTSClMxa5xuRL7NZgHameVYF6BurY= github.com/Azure/azure-sdk-for-go/sdk/internal v1.0.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.1 h1:BZOe7ExNYNGmapT91ZUrxtMYsqVljMxTHEnwjOdG7pk= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.1/go.mod h1:TSPEzbGHEgqFa3kUn09SpCrfKNbj7+mMulU/72Vg84E= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0 h1:ECsQtyERDVz3NP3kvDOTLvbQhqWp/x9EsGKtb4ogUr8= -github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.0.0/go.mod h1:s1tW/At+xHqjNFvWU4G0c0Qv33KOhvbGNj0RCTQDV8s= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= -github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= -github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= -github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= -github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= -github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= -github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= -github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/modocache/gover v0.0.0-20171022184752-b58185e213c5/go.mod h1:caMODM3PzxT8aQXRPkAt8xlV/e7d7w8GM5g0fa5F0D8= -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= -github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= -github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88 h1:Tgea0cVUD0ivh5ADBX4WwuI12DUd2to3nCYe2eayMIw= -golang.org/x/crypto v0.0.0-20220511200225-c6db032c6c88/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA= golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= -golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM= -golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= -gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolver_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolver_client.go new file mode 100644 index 000000000000..a9a9b6ae69a3 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolver_client.go @@ -0,0 +1,497 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// GraphQLAPIResolverClient contains the methods for the GraphQLAPIResolver group. +// Don't use this type directly, use NewGraphQLAPIResolverClient() instead. +type GraphQLAPIResolverClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewGraphQLAPIResolverClient creates a new instance of GraphQLAPIResolverClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewGraphQLAPIResolverClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GraphQLAPIResolverClient, 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 := &GraphQLAPIResolverClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates a new resolver in the GraphQL API or updates an existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - GraphQLAPIResolverClientCreateOrUpdateOptions contains the optional parameters for the GraphQLAPIResolverClient.CreateOrUpdate +// method. +func (client *GraphQLAPIResolverClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, parameters ResolverContract, options *GraphQLAPIResolverClientCreateOrUpdateOptions) (GraphQLAPIResolverClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, parameters, options) + if err != nil { + return GraphQLAPIResolverClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphQLAPIResolverClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return GraphQLAPIResolverClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GraphQLAPIResolverClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, parameters ResolverContract, options *GraphQLAPIResolverClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *GraphQLAPIResolverClient) createOrUpdateHandleResponse(resp *http.Response) (GraphQLAPIResolverClientCreateOrUpdateResponse, error) { + result := GraphQLAPIResolverClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.ResolverContract); err != nil { + return GraphQLAPIResolverClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the specified resolver in the GraphQL API. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - GraphQLAPIResolverClientDeleteOptions contains the optional parameters for the GraphQLAPIResolverClient.Delete +// method. +func (client *GraphQLAPIResolverClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, ifMatch string, options *GraphQLAPIResolverClientDeleteOptions) (GraphQLAPIResolverClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, ifMatch, options) + if err != nil { + return GraphQLAPIResolverClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphQLAPIResolverClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return GraphQLAPIResolverClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return GraphQLAPIResolverClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *GraphQLAPIResolverClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, ifMatch string, options *GraphQLAPIResolverClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the GraphQL API Resolver specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - options - GraphQLAPIResolverClientGetOptions contains the optional parameters for the GraphQLAPIResolverClient.Get method. +func (client *GraphQLAPIResolverClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, options *GraphQLAPIResolverClientGetOptions) (GraphQLAPIResolverClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, options) + if err != nil { + return GraphQLAPIResolverClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphQLAPIResolverClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GraphQLAPIResolverClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *GraphQLAPIResolverClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, options *GraphQLAPIResolverClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GraphQLAPIResolverClient) getHandleResponse(resp *http.Response) (GraphQLAPIResolverClientGetResponse, error) { + result := GraphQLAPIResolverClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.ResolverContract); err != nil { + return GraphQLAPIResolverClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of the GraphQL API resolver specified by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - options - GraphQLAPIResolverClientGetEntityTagOptions contains the optional parameters for the GraphQLAPIResolverClient.GetEntityTag +// method. +func (client *GraphQLAPIResolverClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, options *GraphQLAPIResolverClientGetEntityTagOptions) (GraphQLAPIResolverClientGetEntityTagResponse, error) { + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, options) + if err != nil { + return GraphQLAPIResolverClientGetEntityTagResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphQLAPIResolverClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GraphQLAPIResolverClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + } + return client.getEntityTagHandleResponse(resp) +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *GraphQLAPIResolverClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, options *GraphQLAPIResolverClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *GraphQLAPIResolverClient) getEntityTagHandleResponse(resp *http.Response) (GraphQLAPIResolverClientGetEntityTagResponse, error) { + result := GraphQLAPIResolverClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// NewListByAPIPager - Lists a collection of the resolvers for the specified GraphQL API. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - GraphQLAPIResolverClientListByAPIOptions contains the optional parameters for the GraphQLAPIResolverClient.NewListByAPIPager +// method. +func (client *GraphQLAPIResolverClient) NewListByAPIPager(resourceGroupName string, serviceName string, apiID string, options *GraphQLAPIResolverClientListByAPIOptions) *runtime.Pager[GraphQLAPIResolverClientListByAPIResponse] { + return runtime.NewPager(runtime.PagingHandler[GraphQLAPIResolverClientListByAPIResponse]{ + More: func(page GraphQLAPIResolverClientListByAPIResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GraphQLAPIResolverClientListByAPIResponse) (GraphQLAPIResolverClientListByAPIResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GraphQLAPIResolverClientListByAPIResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphQLAPIResolverClientListByAPIResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GraphQLAPIResolverClientListByAPIResponse{}, runtime.NewResponseError(resp) + } + return client.listByAPIHandleResponse(resp) + }, + }) +} + +// listByAPICreateRequest creates the ListByAPI request. +func (client *GraphQLAPIResolverClient) listByAPICreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, options *GraphQLAPIResolverClientListByAPIOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByAPIHandleResponse handles the ListByAPI response. +func (client *GraphQLAPIResolverClient) listByAPIHandleResponse(resp *http.Response) (GraphQLAPIResolverClientListByAPIResponse, error) { + result := GraphQLAPIResolverClientListByAPIResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResolverCollection); err != nil { + return GraphQLAPIResolverClientListByAPIResponse{}, err + } + return result, nil +} + +// Update - Updates the details of the resolver in the GraphQL API specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - GraphQL API Resolver Update parameters. +// - options - GraphQLAPIResolverClientUpdateOptions contains the optional parameters for the GraphQLAPIResolverClient.Update +// method. +func (client *GraphQLAPIResolverClient) Update(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, ifMatch string, parameters ResolverUpdateContract, options *GraphQLAPIResolverClientUpdateOptions) (GraphQLAPIResolverClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, ifMatch, parameters, options) + if err != nil { + return GraphQLAPIResolverClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphQLAPIResolverClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GraphQLAPIResolverClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *GraphQLAPIResolverClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, ifMatch string, parameters ResolverUpdateContract, options *GraphQLAPIResolverClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateHandleResponse handles the Update response. +func (client *GraphQLAPIResolverClient) updateHandleResponse(resp *http.Response) (GraphQLAPIResolverClientUpdateResponse, error) { + result := GraphQLAPIResolverClientUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.ResolverContract); err != nil { + return GraphQLAPIResolverClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolverpolicy_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolverpolicy_client.go new file mode 100644 index 000000000000..4d7e6c5e1c7b --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/graphqlapiresolverpolicy_client.go @@ -0,0 +1,440 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +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" +) + +// GraphQLAPIResolverPolicyClient contains the methods for the GraphQLAPIResolverPolicy group. +// Don't use this type directly, use NewGraphQLAPIResolverPolicyClient() instead. +type GraphQLAPIResolverPolicyClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewGraphQLAPIResolverPolicyClient creates a new instance of GraphQLAPIResolverPolicyClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewGraphQLAPIResolverPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GraphQLAPIResolverPolicyClient, 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 := &GraphQLAPIResolverPolicyClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates or updates policy configuration for the GraphQL API Resolver level. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - parameters - The policy contents to apply. +// - options - GraphQLAPIResolverPolicyClientCreateOrUpdateOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.CreateOrUpdate +// method. +func (client *GraphQLAPIResolverPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, parameters PolicyContract, options *GraphQLAPIResolverPolicyClientCreateOrUpdateOptions) (GraphQLAPIResolverPolicyClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, policyID, parameters, options) + if err != nil { + return GraphQLAPIResolverPolicyClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphQLAPIResolverPolicyClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return GraphQLAPIResolverPolicyClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *GraphQLAPIResolverPolicyClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, parameters PolicyContract, options *GraphQLAPIResolverPolicyClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies/{policyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if policyID == "" { + return nil, errors.New("parameter policyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyId}", url.PathEscape(string(policyID))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *GraphQLAPIResolverPolicyClient) createOrUpdateHandleResponse(resp *http.Response) (GraphQLAPIResolverPolicyClientCreateOrUpdateResponse, error) { + result := GraphQLAPIResolverPolicyClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.PolicyContract); err != nil { + return GraphQLAPIResolverPolicyClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the policy configuration at the GraphQL Api Resolver. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - GraphQLAPIResolverPolicyClientDeleteOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.Delete +// method. +func (client *GraphQLAPIResolverPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, ifMatch string, options *GraphQLAPIResolverPolicyClientDeleteOptions) (GraphQLAPIResolverPolicyClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, policyID, ifMatch, options) + if err != nil { + return GraphQLAPIResolverPolicyClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphQLAPIResolverPolicyClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return GraphQLAPIResolverPolicyClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return GraphQLAPIResolverPolicyClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *GraphQLAPIResolverPolicyClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, ifMatch string, options *GraphQLAPIResolverPolicyClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies/{policyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if policyID == "" { + return nil, errors.New("parameter policyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyId}", url.PathEscape(string(policyID))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Get the policy configuration at the GraphQL API Resolver level. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - options - GraphQLAPIResolverPolicyClientGetOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.Get +// method. +func (client *GraphQLAPIResolverPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, options *GraphQLAPIResolverPolicyClientGetOptions) (GraphQLAPIResolverPolicyClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, policyID, options) + if err != nil { + return GraphQLAPIResolverPolicyClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphQLAPIResolverPolicyClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GraphQLAPIResolverPolicyClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *GraphQLAPIResolverPolicyClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, options *GraphQLAPIResolverPolicyClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies/{policyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if policyID == "" { + return nil, errors.New("parameter policyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyId}", url.PathEscape(string(policyID))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + if options != nil && options.Format != nil { + reqQP.Set("format", string(*options.Format)) + } + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *GraphQLAPIResolverPolicyClient) getHandleResponse(resp *http.Response) (GraphQLAPIResolverPolicyClientGetResponse, error) { + result := GraphQLAPIResolverPolicyClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.PolicyContract); err != nil { + return GraphQLAPIResolverPolicyClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of the GraphQL API resolver policy specified by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - options - GraphQLAPIResolverPolicyClientGetEntityTagOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.GetEntityTag +// method. +func (client *GraphQLAPIResolverPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, options *GraphQLAPIResolverPolicyClientGetEntityTagOptions) (GraphQLAPIResolverPolicyClientGetEntityTagResponse, error) { + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, policyID, options) + if err != nil { + return GraphQLAPIResolverPolicyClientGetEntityTagResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphQLAPIResolverPolicyClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GraphQLAPIResolverPolicyClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + } + return client.getEntityTagHandleResponse(resp) +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *GraphQLAPIResolverPolicyClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, policyID PolicyIDName, options *GraphQLAPIResolverPolicyClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies/{policyId}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if policyID == "" { + return nil, errors.New("parameter policyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{policyId}", url.PathEscape(string(policyID))) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *GraphQLAPIResolverPolicyClient) getEntityTagHandleResponse(resp *http.Response) (GraphQLAPIResolverPolicyClientGetEntityTagResponse, error) { + result := GraphQLAPIResolverPolicyClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// NewListByResolverPager - Get the list of policy configuration at the GraphQL API Resolver level. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - resolverID - Resolver identifier within a GraphQL API. Must be unique in the current API Management service instance. +// - options - GraphQLAPIResolverPolicyClientListByResolverOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.NewListByResolverPager +// method. +func (client *GraphQLAPIResolverPolicyClient) NewListByResolverPager(resourceGroupName string, serviceName string, apiID string, resolverID string, options *GraphQLAPIResolverPolicyClientListByResolverOptions) *runtime.Pager[GraphQLAPIResolverPolicyClientListByResolverResponse] { + return runtime.NewPager(runtime.PagingHandler[GraphQLAPIResolverPolicyClientListByResolverResponse]{ + More: func(page GraphQLAPIResolverPolicyClientListByResolverResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *GraphQLAPIResolverPolicyClientListByResolverResponse) (GraphQLAPIResolverPolicyClientListByResolverResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByResolverCreateRequest(ctx, resourceGroupName, serviceName, apiID, resolverID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return GraphQLAPIResolverPolicyClientListByResolverResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return GraphQLAPIResolverPolicyClientListByResolverResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return GraphQLAPIResolverPolicyClientListByResolverResponse{}, runtime.NewResponseError(resp) + } + return client.listByResolverHandleResponse(resp) + }, + }) +} + +// listByResolverCreateRequest creates the ListByResolver request. +func (client *GraphQLAPIResolverPolicyClient) listByResolverCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, apiID string, resolverID string, options *GraphQLAPIResolverPolicyClientListByResolverOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/apis/{apiId}/resolvers/{resolverId}/policies" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if apiID == "" { + return nil, errors.New("parameter apiID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{apiId}", url.PathEscape(apiID)) + if resolverID == "" { + return nil, errors.New("parameter resolverID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resolverId}", url.PathEscape(resolverID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByResolverHandleResponse handles the ListByResolver response. +func (client *GraphQLAPIResolverPolicyClient) listByResolverHandleResponse(resp *http.Response) (GraphQLAPIResolverPolicyClientListByResolverResponse, error) { + result := GraphQLAPIResolverPolicyClientListByResolverResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PolicyCollection); err != nil { + return GraphQLAPIResolverPolicyClientListByResolverResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_group_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/group_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_group_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/group_client.go index 24fc19d29aba..41b6281ff237 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_group_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/group_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 armapimanagement @@ -32,10 +33,9 @@ type GroupClient struct { } // NewGroupClient creates a new instance of GroupClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewGroupClient(subscriptionID string, credential azcore.TokenCredential, op // CreateOrUpdate - Creates or Updates a group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// groupID - Group identifier. Must be unique in the current API Management service instance. -// parameters - Create parameters. -// options - GroupClientCreateOrUpdateOptions contains the optional parameters for the GroupClient.CreateOrUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - groupID - Group identifier. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - GroupClientCreateOrUpdateOptions contains the optional parameters for the GroupClient.CreateOrUpdate method. func (client *GroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, groupID string, parameters GroupCreateParameters, options *GroupClientCreateOrUpdateOptions) (GroupClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, groupID, parameters, options) if err != nil { @@ -103,7 +104,7 @@ func (client *GroupClient) createOrUpdateCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -126,13 +127,14 @@ func (client *GroupClient) createOrUpdateHandleResponse(resp *http.Response) (Gr // Delete - Deletes specific group of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// groupID - Group identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - GroupClientDeleteOptions contains the optional parameters for the GroupClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - groupID - Group identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - GroupClientDeleteOptions contains the optional parameters for the GroupClient.Delete method. func (client *GroupClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, ifMatch string, options *GroupClientDeleteOptions) (GroupClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, groupID, ifMatch, options) if err != nil { @@ -172,7 +174,7 @@ func (client *GroupClient) deleteCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -181,11 +183,12 @@ func (client *GroupClient) deleteCreateRequest(ctx context.Context, resourceGrou // Get - Gets the details of the group specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// groupID - Group identifier. Must be unique in the current API Management service instance. -// options - GroupClientGetOptions contains the optional parameters for the GroupClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - groupID - Group identifier. Must be unique in the current API Management service instance. +// - options - GroupClientGetOptions contains the optional parameters for the GroupClient.Get method. func (client *GroupClient) Get(ctx context.Context, resourceGroupName string, serviceName string, groupID string, options *GroupClientGetOptions) (GroupClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, groupID, options) if err != nil { @@ -225,7 +228,7 @@ func (client *GroupClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,11 +247,12 @@ func (client *GroupClient) getHandleResponse(resp *http.Response) (GroupClientGe } // GetEntityTag - Gets the entity state (Etag) version of the group specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// groupID - Group identifier. Must be unique in the current API Management service instance. -// options - GroupClientGetEntityTagOptions contains the optional parameters for the GroupClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - groupID - Group identifier. Must be unique in the current API Management service instance. +// - options - GroupClientGetEntityTagOptions contains the optional parameters for the GroupClient.GetEntityTag method. func (client *GroupClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, groupID string, options *GroupClientGetEntityTagOptions) (GroupClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, groupID, options) if err != nil { @@ -288,7 +292,7 @@ func (client *GroupClient) getEntityTagCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,11 +309,11 @@ func (client *GroupClient) getEntityTagHandleResponse(resp *http.Response) (Grou } // NewListByServicePager - Lists a collection of groups defined within a service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - GroupClientListByServiceOptions contains the optional parameters for the GroupClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - GroupClientListByServiceOptions contains the optional parameters for the GroupClient.NewListByServicePager method. func (client *GroupClient) NewListByServicePager(resourceGroupName string, serviceName string, options *GroupClientListByServiceOptions) *runtime.Pager[GroupClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[GroupClientListByServiceResponse]{ More: func(page GroupClientListByServiceResponse) bool { @@ -367,7 +371,7 @@ func (client *GroupClient) listByServiceCreateRequest(ctx context.Context, resou if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,14 +388,15 @@ func (client *GroupClient) listByServiceHandleResponse(resp *http.Response) (Gro // Update - Updates the details of the group specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// groupID - Group identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - GroupClientUpdateOptions contains the optional parameters for the GroupClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - groupID - Group identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - GroupClientUpdateOptions contains the optional parameters for the GroupClient.Update method. func (client *GroupClient) Update(ctx context.Context, resourceGroupName string, serviceName string, groupID string, ifMatch string, parameters GroupUpdateParameters, options *GroupClientUpdateOptions) (GroupClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, groupID, ifMatch, parameters, options) if err != nil { @@ -431,7 +436,7 @@ func (client *GroupClient) updateCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_groupuser_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/groupuser_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_groupuser_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/groupuser_client.go index 3edeb26b6f01..7c48dea00168 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_groupuser_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/groupuser_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 armapimanagement @@ -32,10 +33,9 @@ type GroupUserClient struct { } // NewGroupUserClient creates a new instance of GroupUserClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewGroupUserClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*GroupUserClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ func NewGroupUserClient(subscriptionID string, credential azcore.TokenCredential } // CheckEntityExists - Checks that user entity specified by identifier is associated with the group entity. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// groupID - Group identifier. Must be unique in the current API Management service instance. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - GroupUserClientCheckEntityExistsOptions contains the optional parameters for the GroupUserClient.CheckEntityExists -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - groupID - Group identifier. Must be unique in the current API Management service instance. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - GroupUserClientCheckEntityExistsOptions contains the optional parameters for the GroupUserClient.CheckEntityExists +// method. func (client *GroupUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string, options *GroupUserClientCheckEntityExistsOptions) (GroupUserClientCheckEntityExistsResponse, error) { req, err := client.checkEntityExistsCreateRequest(ctx, resourceGroupName, serviceName, groupID, userID, options) if err != nil { @@ -107,7 +108,7 @@ func (client *GroupUserClient) checkEntityExistsCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,12 +116,13 @@ func (client *GroupUserClient) checkEntityExistsCreateRequest(ctx context.Contex // Create - Add existing user to existing group // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// groupID - Group identifier. Must be unique in the current API Management service instance. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - GroupUserClientCreateOptions contains the optional parameters for the GroupUserClient.Create method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - groupID - Group identifier. Must be unique in the current API Management service instance. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - GroupUserClientCreateOptions contains the optional parameters for the GroupUserClient.Create method. func (client *GroupUserClient) Create(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string, options *GroupUserClientCreateOptions) (GroupUserClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, serviceName, groupID, userID, options) if err != nil { @@ -164,7 +166,7 @@ func (client *GroupUserClient) createCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,12 +183,13 @@ func (client *GroupUserClient) createHandleResponse(resp *http.Response) (GroupU // Delete - Remove existing user from existing group. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// groupID - Group identifier. Must be unique in the current API Management service instance. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - GroupUserClientDeleteOptions contains the optional parameters for the GroupUserClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - groupID - Group identifier. Must be unique in the current API Management service instance. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - GroupUserClientDeleteOptions contains the optional parameters for the GroupUserClient.Delete method. func (client *GroupUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, groupID string, userID string, options *GroupUserClientDeleteOptions) (GroupUserClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, groupID, userID, options) if err != nil { @@ -230,19 +233,19 @@ func (client *GroupUserClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListPager - Lists a collection of user entities associated with the group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// groupID - Group identifier. Must be unique in the current API Management service instance. -// options - GroupUserClientListOptions contains the optional parameters for the GroupUserClient.List method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - groupID - Group identifier. Must be unique in the current API Management service instance. +// - options - GroupUserClientListOptions contains the optional parameters for the GroupUserClient.NewListPager method. func (client *GroupUserClient) NewListPager(resourceGroupName string, serviceName string, groupID string, options *GroupUserClientListOptions) *runtime.Pager[GroupUserClientListResponse] { return runtime.NewPager(runtime.PagingHandler[GroupUserClientListResponse]{ More: func(page GroupUserClientListResponse) bool { @@ -304,7 +307,7 @@ func (client *GroupUserClient) listCreateRequest(ctx context.Context, resourceGr if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_identityprovider_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/identityprovider_client.go similarity index 86% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_identityprovider_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/identityprovider_client.go index 4dbc0c5c760c..d2cc03134fa5 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_identityprovider_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/identityprovider_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 armapimanagement @@ -31,10 +32,9 @@ type IdentityProviderClient struct { } // NewIdentityProviderClient creates a new instance of IdentityProviderClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewIdentityProviderClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IdentityProviderClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ func NewIdentityProviderClient(subscriptionID string, credential azcore.TokenCre // CreateOrUpdate - Creates or Updates the IdentityProvider configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// identityProviderName - Identity Provider Type identifier. -// parameters - Create parameters. -// options - IdentityProviderClientCreateOrUpdateOptions contains the optional parameters for the IdentityProviderClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - identityProviderName - Identity Provider Type identifier. +// - parameters - Create parameters. +// - options - IdentityProviderClientCreateOrUpdateOptions contains the optional parameters for the IdentityProviderClient.CreateOrUpdate +// method. func (client *IdentityProviderClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, parameters IdentityProviderCreateContract, options *IdentityProviderClientCreateOrUpdateOptions) (IdentityProviderClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, identityProviderName, parameters, options) if err != nil { @@ -103,7 +104,7 @@ func (client *IdentityProviderClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -126,13 +127,14 @@ func (client *IdentityProviderClient) createOrUpdateHandleResponse(resp *http.Re // Delete - Deletes the specified identity provider configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// identityProviderName - Identity Provider Type identifier. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - IdentityProviderClientDeleteOptions contains the optional parameters for the IdentityProviderClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - identityProviderName - Identity Provider Type identifier. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - IdentityProviderClientDeleteOptions contains the optional parameters for the IdentityProviderClient.Delete method. func (client *IdentityProviderClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, ifMatch string, options *IdentityProviderClientDeleteOptions) (IdentityProviderClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, identityProviderName, ifMatch, options) if err != nil { @@ -172,7 +174,7 @@ func (client *IdentityProviderClient) deleteCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -181,11 +183,12 @@ func (client *IdentityProviderClient) deleteCreateRequest(ctx context.Context, r // Get - Gets the configuration details of the identity Provider configured in specified service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// identityProviderName - Identity Provider Type identifier. -// options - IdentityProviderClientGetOptions contains the optional parameters for the IdentityProviderClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - identityProviderName - Identity Provider Type identifier. +// - options - IdentityProviderClientGetOptions contains the optional parameters for the IdentityProviderClient.Get method. func (client *IdentityProviderClient) Get(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, options *IdentityProviderClientGetOptions) (IdentityProviderClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, identityProviderName, options) if err != nil { @@ -225,7 +228,7 @@ func (client *IdentityProviderClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,12 +247,13 @@ func (client *IdentityProviderClient) getHandleResponse(resp *http.Response) (Id } // GetEntityTag - Gets the entity state (Etag) version of the identityProvider specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// identityProviderName - Identity Provider Type identifier. -// options - IdentityProviderClientGetEntityTagOptions contains the optional parameters for the IdentityProviderClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - identityProviderName - Identity Provider Type identifier. +// - options - IdentityProviderClientGetEntityTagOptions contains the optional parameters for the IdentityProviderClient.GetEntityTag +// method. func (client *IdentityProviderClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, options *IdentityProviderClientGetEntityTagOptions) (IdentityProviderClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, identityProviderName, options) if err != nil { @@ -289,7 +293,7 @@ func (client *IdentityProviderClient) getEntityTagCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -306,12 +310,12 @@ func (client *IdentityProviderClient) getEntityTagHandleResponse(resp *http.Resp } // NewListByServicePager - Lists a collection of Identity Provider configured in the specified service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - IdentityProviderClientListByServiceOptions contains the optional parameters for the IdentityProviderClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - IdentityProviderClientListByServiceOptions contains the optional parameters for the IdentityProviderClient.NewListByServicePager +// method. func (client *IdentityProviderClient) NewListByServicePager(resourceGroupName string, serviceName string, options *IdentityProviderClientListByServiceOptions) *runtime.Pager[IdentityProviderClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[IdentityProviderClientListByServiceResponse]{ More: func(page IdentityProviderClientListByServiceResponse) bool { @@ -360,7 +364,7 @@ func (client *IdentityProviderClient) listByServiceCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -377,12 +381,13 @@ func (client *IdentityProviderClient) listByServiceHandleResponse(resp *http.Res // ListSecrets - Gets the client secret details of the Identity Provider. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// identityProviderName - Identity Provider Type identifier. -// options - IdentityProviderClientListSecretsOptions contains the optional parameters for the IdentityProviderClient.ListSecrets -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - identityProviderName - Identity Provider Type identifier. +// - options - IdentityProviderClientListSecretsOptions contains the optional parameters for the IdentityProviderClient.ListSecrets +// method. func (client *IdentityProviderClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, options *IdentityProviderClientListSecretsOptions) (IdentityProviderClientListSecretsResponse, error) { req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, serviceName, identityProviderName, options) if err != nil { @@ -422,7 +427,7 @@ func (client *IdentityProviderClient) listSecretsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -442,14 +447,15 @@ func (client *IdentityProviderClient) listSecretsHandleResponse(resp *http.Respo // Update - Updates an existing IdentityProvider configuration. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// identityProviderName - Identity Provider Type identifier. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - IdentityProviderClientUpdateOptions contains the optional parameters for the IdentityProviderClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - identityProviderName - Identity Provider Type identifier. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - IdentityProviderClientUpdateOptions contains the optional parameters for the IdentityProviderClient.Update method. func (client *IdentityProviderClient) Update(ctx context.Context, resourceGroupName string, serviceName string, identityProviderName IdentityProviderType, ifMatch string, parameters IdentityProviderUpdateParameters, options *IdentityProviderClientUpdateOptions) (IdentityProviderClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, identityProviderName, ifMatch, parameters, options) if err != nil { @@ -489,7 +495,7 @@ func (client *IdentityProviderClient) updateCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_issue_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/issue_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_issue_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/issue_client.go index aa912d1ee741..eba3cacc1c8b 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_issue_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/issue_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 armapimanagement @@ -32,10 +33,9 @@ type IssueClient struct { } // NewIssueClient creates a new instance of IssueClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewIssueClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IssueClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,11 +58,12 @@ func NewIssueClient(subscriptionID string, credential azcore.TokenCredential, op // Get - Gets API Management issue details // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// issueID - Issue identifier. Must be unique in the current API Management service instance. -// options - IssueClientGetOptions contains the optional parameters for the IssueClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - issueID - Issue identifier. Must be unique in the current API Management service instance. +// - options - IssueClientGetOptions contains the optional parameters for the IssueClient.Get method. func (client *IssueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, issueID string, options *IssueClientGetOptions) (IssueClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, issueID, options) if err != nil { @@ -102,7 +103,7 @@ func (client *IssueClient) getCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -121,11 +122,11 @@ func (client *IssueClient) getHandleResponse(resp *http.Response) (IssueClientGe } // NewListByServicePager - Lists a collection of issues in the specified service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - IssueClientListByServiceOptions contains the optional parameters for the IssueClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - IssueClientListByServiceOptions contains the optional parameters for the IssueClient.NewListByServicePager method. func (client *IssueClient) NewListByServicePager(resourceGroupName string, serviceName string, options *IssueClientListByServiceOptions) *runtime.Pager[IssueClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[IssueClientListByServiceResponse]{ More: func(page IssueClientListByServiceResponse) bool { @@ -183,7 +184,7 @@ func (client *IssueClient) listByServiceCreateRequest(ctx context.Context, resou if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_logger_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/logger_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_logger_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/logger_client.go index 5f31f7bfd1a6..e96f559af166 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_logger_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/logger_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 armapimanagement @@ -32,10 +33,9 @@ type LoggerClient struct { } // NewLoggerClient creates a new instance of LoggerClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewLoggerClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*LoggerClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewLoggerClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrUpdate - Creates or Updates a logger. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// loggerID - Logger identifier. Must be unique in the API Management service instance. -// parameters - Create parameters. -// options - LoggerClientCreateOrUpdateOptions contains the optional parameters for the LoggerClient.CreateOrUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - loggerID - Logger identifier. Must be unique in the API Management service instance. +// - parameters - Create parameters. +// - options - LoggerClientCreateOrUpdateOptions contains the optional parameters for the LoggerClient.CreateOrUpdate method. func (client *LoggerClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, parameters LoggerContract, options *LoggerClientCreateOrUpdateOptions) (LoggerClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, loggerID, parameters, options) if err != nil { @@ -103,7 +104,7 @@ func (client *LoggerClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -126,13 +127,14 @@ func (client *LoggerClient) createOrUpdateHandleResponse(resp *http.Response) (L // Delete - Deletes the specified logger. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// loggerID - Logger identifier. Must be unique in the API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - LoggerClientDeleteOptions contains the optional parameters for the LoggerClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - loggerID - Logger identifier. Must be unique in the API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - LoggerClientDeleteOptions contains the optional parameters for the LoggerClient.Delete method. func (client *LoggerClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, ifMatch string, options *LoggerClientDeleteOptions) (LoggerClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, loggerID, ifMatch, options) if err != nil { @@ -172,7 +174,7 @@ func (client *LoggerClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -181,11 +183,12 @@ func (client *LoggerClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Gets the details of the logger specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// loggerID - Logger identifier. Must be unique in the API Management service instance. -// options - LoggerClientGetOptions contains the optional parameters for the LoggerClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - loggerID - Logger identifier. Must be unique in the API Management service instance. +// - options - LoggerClientGetOptions contains the optional parameters for the LoggerClient.Get method. func (client *LoggerClient) Get(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, options *LoggerClientGetOptions) (LoggerClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, loggerID, options) if err != nil { @@ -225,7 +228,7 @@ func (client *LoggerClient) getCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,11 +247,12 @@ func (client *LoggerClient) getHandleResponse(resp *http.Response) (LoggerClient } // GetEntityTag - Gets the entity state (Etag) version of the logger specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// loggerID - Logger identifier. Must be unique in the API Management service instance. -// options - LoggerClientGetEntityTagOptions contains the optional parameters for the LoggerClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - loggerID - Logger identifier. Must be unique in the API Management service instance. +// - options - LoggerClientGetEntityTagOptions contains the optional parameters for the LoggerClient.GetEntityTag method. func (client *LoggerClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, options *LoggerClientGetEntityTagOptions) (LoggerClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, loggerID, options) if err != nil { @@ -288,7 +292,7 @@ func (client *LoggerClient) getEntityTagCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -305,11 +309,12 @@ func (client *LoggerClient) getEntityTagHandleResponse(resp *http.Response) (Log } // NewListByServicePager - Lists a collection of loggers in the specified service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - LoggerClientListByServiceOptions contains the optional parameters for the LoggerClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - LoggerClientListByServiceOptions contains the optional parameters for the LoggerClient.NewListByServicePager +// method. func (client *LoggerClient) NewListByServicePager(resourceGroupName string, serviceName string, options *LoggerClientListByServiceOptions) *runtime.Pager[LoggerClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[LoggerClientListByServiceResponse]{ More: func(page LoggerClientListByServiceResponse) bool { @@ -367,7 +372,7 @@ func (client *LoggerClient) listByServiceCreateRequest(ctx context.Context, reso if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -384,14 +389,15 @@ func (client *LoggerClient) listByServiceHandleResponse(resp *http.Response) (Lo // Update - Updates an existing logger. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// loggerID - Logger identifier. Must be unique in the API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - LoggerClientUpdateOptions contains the optional parameters for the LoggerClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - loggerID - Logger identifier. Must be unique in the API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - LoggerClientUpdateOptions contains the optional parameters for the LoggerClient.Update method. func (client *LoggerClient) Update(ctx context.Context, resourceGroupName string, serviceName string, loggerID string, ifMatch string, parameters LoggerUpdateContract, options *LoggerClientUpdateOptions) (LoggerClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, loggerID, ifMatch, parameters, options) if err != nil { @@ -431,7 +437,7 @@ func (client *LoggerClient) updateCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_models.go b/sdk/resourcemanager/apimanagement/armapimanagement/models.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_models.go rename to sdk/resourcemanager/apimanagement/armapimanagement/models.go index d4eecb92cd76..d2cadf851b60 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_models.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/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 armapimanagement @@ -34,7 +35,7 @@ type APIClientGetOptions struct { // placeholder for future optional parameters } -// APIClientListByServiceOptions contains the optional parameters for the APIClient.ListByService method. +// APIClientListByServiceOptions contains the optional parameters for the APIClient.NewListByServicePager method. type APIClientListByServiceOptions struct { // Include full ApiVersionSet resource in response ExpandAPIVersionSet *bool @@ -55,7 +56,7 @@ type APIClientListByServiceOptions struct { Top *int32 } -// APIClientListByTagsOptions contains the optional parameters for the APIClient.ListByTags method. +// APIClientListByTagsOptions contains the optional parameters for the APIClient.NewListByTagsPager method. type APIClientListByTagsOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -329,6 +330,10 @@ type APICreateOrUpdateProperties struct { // A URL to the Terms of Service for the API. MUST be in the format of a URL. TermsOfServiceURL *string `json:"termsOfServiceUrl,omitempty"` + // Strategy of translating required query parameters to template ones. By default has value 'template'. Possible values: 'template', + // 'query' + TranslateRequiredQueryParametersConduct *TranslateRequiredQueryParametersConduct `json:"translateRequiredQueryParameters,omitempty"` + // Content value when Importing an API. Value *string `json:"value,omitempty"` @@ -369,7 +374,8 @@ type APIDiagnosticClientGetOptions struct { // placeholder for future optional parameters } -// APIDiagnosticClientListByServiceOptions contains the optional parameters for the APIDiagnosticClient.ListByService method. +// APIDiagnosticClientListByServiceOptions contains the optional parameters for the APIDiagnosticClient.NewListByServicePager +// method. type APIDiagnosticClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -480,7 +486,7 @@ type APIIssueAttachmentClientGetOptions struct { // placeholder for future optional parameters } -// APIIssueAttachmentClientListByServiceOptions contains the optional parameters for the APIIssueAttachmentClient.ListByService +// APIIssueAttachmentClientListByServiceOptions contains the optional parameters for the APIIssueAttachmentClient.NewListByServicePager // method. type APIIssueAttachmentClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | @@ -516,7 +522,7 @@ type APIIssueClientGetOptions struct { ExpandCommentsAttachments *bool } -// APIIssueClientListByServiceOptions contains the optional parameters for the APIIssueClient.ListByService method. +// APIIssueClientListByServiceOptions contains the optional parameters for the APIIssueClient.NewListByServicePager method. type APIIssueClientListByServiceOptions struct { // Expand the comment attachments. ExpandCommentsAttachments *bool @@ -559,7 +565,7 @@ type APIIssueCommentClientGetOptions struct { // placeholder for future optional parameters } -// APIIssueCommentClientListByServiceOptions contains the optional parameters for the APIIssueCommentClient.ListByService +// APIIssueCommentClientListByServiceOptions contains the optional parameters for the APIIssueCommentClient.NewListByServicePager // method. type APIIssueCommentClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | @@ -603,7 +609,7 @@ type APIOperationClientGetOptions struct { // placeholder for future optional parameters } -// APIOperationClientListByAPIOptions contains the optional parameters for the APIOperationClient.ListByAPI method. +// APIOperationClientListByAPIOptions contains the optional parameters for the APIOperationClient.NewListByAPIPager method. type APIOperationClientListByAPIOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -683,7 +689,7 @@ type APIPolicyClientListByAPIOptions struct { // placeholder for future optional parameters } -// APIProductClientListByApisOptions contains the optional parameters for the APIProductClient.ListByApis method. +// APIProductClientListByApisOptions contains the optional parameters for the APIProductClient.NewListByApisPager method. type APIProductClientListByApisOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -716,7 +722,7 @@ type APIReleaseClientGetOptions struct { // placeholder for future optional parameters } -// APIReleaseClientListByServiceOptions contains the optional parameters for the APIReleaseClient.ListByService method. +// APIReleaseClientListByServiceOptions contains the optional parameters for the APIReleaseClient.NewListByServicePager method. type APIReleaseClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -776,7 +782,8 @@ type APIReleaseContractProperties struct { UpdatedDateTime *time.Time `json:"updatedDateTime,omitempty" azure:"ro"` } -// APIRevisionClientListByServiceOptions contains the optional parameters for the APIRevisionClient.ListByService method. +// APIRevisionClientListByServiceOptions contains the optional parameters for the APIRevisionClient.NewListByServicePager +// method. type APIRevisionClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -869,7 +876,7 @@ type APISchemaClientGetOptions struct { // placeholder for future optional parameters } -// APISchemaClientListByAPIOptions contains the optional parameters for the APISchemaClient.ListByAPI method. +// APISchemaClientListByAPIOptions contains the optional parameters for the APISchemaClient.NewListByAPIPager method. type APISchemaClientListByAPIOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -904,7 +911,7 @@ type APITagDescriptionClientGetOptions struct { // placeholder for future optional parameters } -// APITagDescriptionClientListByServiceOptions contains the optional parameters for the APITagDescriptionClient.ListByService +// APITagDescriptionClientListByServiceOptions contains the optional parameters for the APITagDescriptionClient.NewListByServicePager // method. type APITagDescriptionClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | @@ -1016,7 +1023,8 @@ type APIVersionSetClientGetOptions struct { // placeholder for future optional parameters } -// APIVersionSetClientListByServiceOptions contains the optional parameters for the APIVersionSetClient.ListByService method. +// APIVersionSetClientListByServiceOptions contains the optional parameters for the APIVersionSetClient.NewListByServicePager +// method. type APIVersionSetClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -1134,6 +1142,37 @@ type APIVersionSetUpdateParametersProperties struct { VersioningScheme *VersioningScheme `json:"versioningScheme,omitempty"` } +// APIWikiClientCreateOrUpdateOptions contains the optional parameters for the APIWikiClient.CreateOrUpdate method. +type APIWikiClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// APIWikiClientDeleteOptions contains the optional parameters for the APIWikiClient.Delete method. +type APIWikiClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// APIWikiClientGetEntityTagOptions contains the optional parameters for the APIWikiClient.GetEntityTag method. +type APIWikiClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// APIWikiClientGetOptions contains the optional parameters for the APIWikiClient.Get method. +type APIWikiClientGetOptions struct { + // placeholder for future optional parameters +} + +// APIWikiClientUpdateOptions contains the optional parameters for the APIWikiClient.Update method. +type APIWikiClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// APIWikisClientListOptions contains the optional parameters for the APIWikisClient.NewListPager method. +type APIWikisClientListOptions struct { + // placeholder for future optional parameters +} + // AccessInformationCollection - Paged AccessInformation list representation. type AccessInformationCollection struct { // Total record count number across all pages. @@ -1238,6 +1277,9 @@ type AdditionalLocation struct { // in this additional location. DisableGateway *bool `json:"disableGateway,omitempty"` + // Property can be used to enable NAT Gateway for this API Management service. + NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` + // Public Standard SKU IP V4 based IP address to be associated with Virtual Network deployed service in the location. Supported // only for Premium SKU being deployed in Virtual Network. PublicIPAddressID *string `json:"publicIpAddressId,omitempty"` @@ -1251,6 +1293,10 @@ type AdditionalLocation struct { // READ-ONLY; Gateway URL of the API Management service in the Region. GatewayRegionalURL *string `json:"gatewayRegionalUrl,omitempty" azure:"ro"` + // READ-ONLY; Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium + // SKU on stv2 platform. + OutboundPublicIPAddresses []*string `json:"outboundPublicIPAddresses,omitempty" azure:"ro"` + // READ-ONLY; Compute Platform Version running the service. PlatformVersion *PlatformVersion `json:"platformVersion,omitempty" azure:"ro"` @@ -1311,8 +1357,281 @@ type AuthenticationSettingsContract struct { // OAuth2 Authentication settings OAuth2 *OAuth2AuthenticationSettingsContract `json:"oAuth2,omitempty"` + // Collection of OAuth2 authentication settings included into this API. + OAuth2AuthenticationSettings []*OAuth2AuthenticationSettingsContract `json:"oAuth2AuthenticationSettings,omitempty"` + // OpenID Connect Authentication Settings Openid *OpenIDAuthenticationSettingsContract `json:"openid,omitempty"` + + // Collection of Open ID Connect authentication settings included into this API. + OpenidAuthenticationSettings []*OpenIDAuthenticationSettingsContract `json:"openidAuthenticationSettings,omitempty"` +} + +// AuthorizationAccessPolicyClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationAccessPolicyClient.CreateOrUpdate +// method. +type AuthorizationAccessPolicyClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// AuthorizationAccessPolicyClientDeleteOptions contains the optional parameters for the AuthorizationAccessPolicyClient.Delete +// method. +type AuthorizationAccessPolicyClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationAccessPolicyClientGetOptions contains the optional parameters for the AuthorizationAccessPolicyClient.Get +// method. +type AuthorizationAccessPolicyClientGetOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationAccessPolicyClientListByAuthorizationOptions contains the optional parameters for the AuthorizationAccessPolicyClient.NewListByAuthorizationPager +// method. +type AuthorizationAccessPolicyClientListByAuthorizationOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + // Number of records to skip. + Skip *int32 + // Number of records to return. + Top *int32 +} + +// AuthorizationAccessPolicyCollection - Paged Authorization Access Policy list representation. +type AuthorizationAccessPolicyCollection struct { + // Total record count number across all pages. + Count *int64 `json:"count,omitempty"` + + // Next page link if any. + NextLink *string `json:"nextLink,omitempty"` + + // Page values. + Value []*AuthorizationAccessPolicyContract `json:"value,omitempty"` +} + +// AuthorizationAccessPolicyContract - Authorization access policy contract. +type AuthorizationAccessPolicyContract struct { + // Properties of the Authorization Contract. + Properties *AuthorizationAccessPolicyContractProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// AuthorizationAccessPolicyContractProperties - Authorization Access Policy details. +type AuthorizationAccessPolicyContractProperties struct { + // The Object Id + ObjectID *string `json:"objectId,omitempty"` + + // The Tenant Id + TenantID *string `json:"tenantId,omitempty"` +} + +// AuthorizationClientConfirmConsentCodeOptions contains the optional parameters for the AuthorizationClient.ConfirmConsentCode +// method. +type AuthorizationClientConfirmConsentCodeOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationClient.CreateOrUpdate method. +type AuthorizationClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// AuthorizationClientDeleteOptions contains the optional parameters for the AuthorizationClient.Delete method. +type AuthorizationClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationClientGetOptions contains the optional parameters for the AuthorizationClient.Get method. +type AuthorizationClientGetOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationClientListByAuthorizationProviderOptions contains the optional parameters for the AuthorizationClient.NewListByAuthorizationProviderPager +// method. +type AuthorizationClientListByAuthorizationProviderOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + // Number of records to skip. + Skip *int32 + // Number of records to return. + Top *int32 +} + +// AuthorizationCollection - Paged Authorization list representation. +type AuthorizationCollection struct { + // Total record count number across all pages. + Count *int64 `json:"count,omitempty"` + + // Next page link if any. + NextLink *string `json:"nextLink,omitempty"` + + // Page values. + Value []*AuthorizationContract `json:"value,omitempty"` +} + +// AuthorizationConfirmConsentCodeRequestContract - Authorization confirm consent code request contract. +type AuthorizationConfirmConsentCodeRequestContract struct { + // The consent code from the authorization server after authorizing and consenting. + ConsentCode *string `json:"consentCode,omitempty"` +} + +// AuthorizationContract - Authorization contract. +type AuthorizationContract struct { + // Properties of the Authorization Contract. + Properties *AuthorizationContractProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// AuthorizationContractProperties - Authorization details. +type AuthorizationContractProperties struct { + // Authorization type options + AuthorizationType *AuthorizationType `json:"authorizationType,omitempty"` + + // Authorization error details. + Error *AuthorizationError `json:"error,omitempty"` + + // OAuth2 grant type options + OAuth2GrantType *OAuth2GrantType `json:"oauth2grantType,omitempty"` + + // Authorization parameters + Parameters map[string]*string `json:"parameters,omitempty"` + + // Status of the Authorization + Status *string `json:"status,omitempty"` +} + +// AuthorizationError - Authorization error details. +type AuthorizationError struct { + // Error code + Code *string `json:"code,omitempty"` + + // Error message + Message *string `json:"message,omitempty"` +} + +// AuthorizationLoginLinksClientPostOptions contains the optional parameters for the AuthorizationLoginLinksClient.Post method. +type AuthorizationLoginLinksClientPostOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationLoginRequestContract - Authorization login request contract. +type AuthorizationLoginRequestContract struct { + // The redirect URL after login has completed. + PostLoginRedirectURL *string `json:"postLoginRedirectUrl,omitempty"` +} + +// AuthorizationLoginResponseContract - Authorization login response contract. +type AuthorizationLoginResponseContract struct { + // The login link + LoginLink *string `json:"loginLink,omitempty"` +} + +// AuthorizationProviderClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationProviderClient.CreateOrUpdate +// method. +type AuthorizationProviderClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// AuthorizationProviderClientDeleteOptions contains the optional parameters for the AuthorizationProviderClient.Delete method. +type AuthorizationProviderClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationProviderClientGetOptions contains the optional parameters for the AuthorizationProviderClient.Get method. +type AuthorizationProviderClientGetOptions struct { + // placeholder for future optional parameters +} + +// AuthorizationProviderClientListByServiceOptions contains the optional parameters for the AuthorizationProviderClient.NewListByServicePager +// method. +type AuthorizationProviderClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + // Number of records to skip. + Skip *int32 + // Number of records to return. + Top *int32 +} + +// AuthorizationProviderCollection - Paged Authorization Provider list representation. +type AuthorizationProviderCollection struct { + // Next page link if any. + NextLink *string `json:"nextLink,omitempty"` + + // Page values. + Value []*AuthorizationProviderContract `json:"value,omitempty"` +} + +// AuthorizationProviderContract - Authorization Provider contract. +type AuthorizationProviderContract struct { + // Properties of the Authorization Provider Contract. + Properties *AuthorizationProviderContractProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// AuthorizationProviderContractProperties - Authorization Provider details. +type AuthorizationProviderContractProperties struct { + // Authorization Provider name. Must be 1 to 300 characters long. + DisplayName *string `json:"displayName,omitempty"` + + // Identity provider name. Must be 1 to 300 characters long. + IdentityProvider *string `json:"identityProvider,omitempty"` + + // OAuth2 settings + Oauth2 *AuthorizationProviderOAuth2Settings `json:"oauth2,omitempty"` +} + +// AuthorizationProviderOAuth2GrantTypes - Authorization Provider oauth2 grant types settings +type AuthorizationProviderOAuth2GrantTypes struct { + // OAuth2 authorization code grant parameters + AuthorizationCode map[string]*string `json:"authorizationCode,omitempty"` + + // OAuth2 client credential grant parameters + ClientCredentials map[string]*string `json:"clientCredentials,omitempty"` +} + +// AuthorizationProviderOAuth2Settings - OAuth2 settings details +type AuthorizationProviderOAuth2Settings struct { + // OAuth2 settings + GrantTypes *AuthorizationProviderOAuth2GrantTypes `json:"grantTypes,omitempty"` + + // Redirect URL to be set in the OAuth application. + RedirectURL *string `json:"redirectUrl,omitempty"` } // AuthorizationServerClientCreateOrUpdateOptions contains the optional parameters for the AuthorizationServerClient.CreateOrUpdate @@ -1338,7 +1657,7 @@ type AuthorizationServerClientGetOptions struct { // placeholder for future optional parameters } -// AuthorizationServerClientListByServiceOptions contains the optional parameters for the AuthorizationServerClient.ListByService +// AuthorizationServerClientListByServiceOptions contains the optional parameters for the AuthorizationServerClient.NewListByServicePager // method. type AuthorizationServerClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | @@ -1490,6 +1809,13 @@ type AuthorizationServerContractProperties struct { // OAuth token endpoint. Contains absolute URI to entity being referenced. TokenEndpoint *string `json:"tokenEndpoint,omitempty"` + + // If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + // value is provided. + UseInAPIDocumentation *bool `json:"useInApiDocumentation,omitempty"` + + // If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + UseInTestConsole *bool `json:"useInTestConsole,omitempty"` } // AuthorizationServerSecretsContract - OAuth Server Secrets Contract. @@ -1580,6 +1906,13 @@ type AuthorizationServerUpdateContractProperties struct { // OAuth token endpoint. Contains absolute URI to entity being referenced. TokenEndpoint *string `json:"tokenEndpoint,omitempty"` + + // If true, the authorization server will be used in the API documentation in the developer portal. False by default if no + // value is provided. + UseInAPIDocumentation *bool `json:"useInApiDocumentation,omitempty"` + + // If true, the authorization server may be used in the developer portal test console. True by default if no value is provided. + UseInTestConsole *bool `json:"useInTestConsole,omitempty"` } // BackendAuthorizationHeaderCredentials - Authorization header information. @@ -1602,10 +1935,10 @@ type BackendBaseParameters struct { // Backend Properties contract Properties *BackendProperties `json:"properties,omitempty"` - // Backend Proxy Contract Properties + // Backend gateway Contract Properties Proxy *BackendProxyContract `json:"proxy,omitempty"` - // Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or + // Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or // API Apps. ResourceID *string `json:"resourceId,omitempty"` @@ -1637,7 +1970,7 @@ type BackendClientGetOptions struct { // placeholder for future optional parameters } -// BackendClientListByServiceOptions contains the optional parameters for the BackendClient.ListByService method. +// BackendClientListByServiceOptions contains the optional parameters for the BackendClient.NewListByServicePager method. type BackendClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -1706,10 +2039,10 @@ type BackendContractProperties struct { // Backend Properties contract Properties *BackendProperties `json:"properties,omitempty"` - // Backend Proxy Contract Properties + // Backend gateway Contract Properties Proxy *BackendProxyContract `json:"proxy,omitempty"` - // Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or + // Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or // API Apps. ResourceID *string `json:"resourceId,omitempty"` @@ -1824,10 +2157,10 @@ type BackendUpdateParameterProperties struct { // Backend communication protocol. Protocol *BackendProtocol `json:"protocol,omitempty"` - // Backend Proxy Contract Properties + // Backend gateway Contract Properties Proxy *BackendProxyContract `json:"proxy,omitempty"` - // Management Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or + // Management Uri of the Resource in External System. This URL can be the Arm Resource Id of Logic Apps, Function Apps or // API Apps. ResourceID *string `json:"resourceId,omitempty"` @@ -1874,7 +2207,7 @@ type CacheClientGetOptions struct { // placeholder for future optional parameters } -// CacheClientListByServiceOptions contains the optional parameters for the CacheClient.ListByService method. +// CacheClientListByServiceOptions contains the optional parameters for the CacheClient.NewListByServicePager method. type CacheClientListByServiceOptions struct { // Number of records to skip. Skip *int32 @@ -1971,7 +2304,8 @@ type CertificateClientGetOptions struct { // placeholder for future optional parameters } -// CertificateClientListByServiceOptions contains the optional parameters for the CertificateClient.ListByService method. +// CertificateClientListByServiceOptions contains the optional parameters for the CertificateClient.NewListByServicePager +// method. type CertificateClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -2262,7 +2596,8 @@ type ContentItemClientGetOptions struct { // placeholder for future optional parameters } -// ContentItemClientListByServiceOptions contains the optional parameters for the ContentItemClient.ListByService method. +// ContentItemClientListByServiceOptions contains the optional parameters for the ContentItemClient.NewListByServicePager +// method. type ContentItemClientListByServiceOptions struct { // placeholder for future optional parameters } @@ -2279,7 +2614,7 @@ type ContentItemCollection struct { // ContentItemContract - Content type contract details. type ContentItemContract struct { // Properties of the content item. - Properties map[string]interface{} `json:"properties,omitempty"` + Properties map[string]any `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` @@ -2307,7 +2642,8 @@ type ContentTypeClientGetOptions struct { // placeholder for future optional parameters } -// ContentTypeClientListByServiceOptions contains the optional parameters for the ContentTypeClient.ListByService method. +// ContentTypeClientListByServiceOptions contains the optional parameters for the ContentTypeClient.NewListByServicePager +// method. type ContentTypeClientListByServiceOptions struct { // placeholder for future optional parameters } @@ -2347,7 +2683,7 @@ type ContentTypeContractProperties struct { Name *string `json:"name,omitempty"` // Content type schema. - Schema interface{} `json:"schema,omitempty"` + Schema any `json:"schema,omitempty"` // Content type version. Version *string `json:"version,omitempty"` @@ -2440,7 +2776,7 @@ type DeletedServicesClientGetByNameOptions struct { // placeholder for future optional parameters } -// DeletedServicesClientListBySubscriptionOptions contains the optional parameters for the DeletedServicesClient.ListBySubscription +// DeletedServicesClientListBySubscriptionOptions contains the optional parameters for the DeletedServicesClient.NewListBySubscriptionPager // method. type DeletedServicesClientListBySubscriptionOptions struct { // placeholder for future optional parameters @@ -2491,7 +2827,7 @@ type DiagnosticClientGetOptions struct { // placeholder for future optional parameters } -// DiagnosticClientListByServiceOptions contains the optional parameters for the DiagnosticClient.ListByService method. +// DiagnosticClientListByServiceOptions contains the optional parameters for the DiagnosticClient.NewListByServicePager method. type DiagnosticClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -2555,6 +2891,9 @@ type DiagnosticContractProperties struct { // Log the ClientIP. Default is false. LogClientIP *bool `json:"logClientIp,omitempty"` + // Emit custom metrics via emit-metric policy. Applicable only to Application Insights diagnostic settings. + Metrics *bool `json:"metrics,omitempty"` + // The format of the Operation Name for Application Insights telemetries. Default is Name. OperationNameFormat *OperationNameFormat `json:"operationNameFormat,omitempty"` @@ -2565,6 +2904,77 @@ type DiagnosticContractProperties struct { Verbosity *Verbosity `json:"verbosity,omitempty"` } +// DocumentationClientCreateOrUpdateOptions contains the optional parameters for the DocumentationClient.CreateOrUpdate method. +type DocumentationClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// DocumentationClientDeleteOptions contains the optional parameters for the DocumentationClient.Delete method. +type DocumentationClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DocumentationClientGetEntityTagOptions contains the optional parameters for the DocumentationClient.GetEntityTag method. +type DocumentationClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// DocumentationClientGetOptions contains the optional parameters for the DocumentationClient.Get method. +type DocumentationClientGetOptions struct { + // placeholder for future optional parameters +} + +// DocumentationClientListByServiceOptions contains the optional parameters for the DocumentationClient.NewListByServicePager +// method. +type DocumentationClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// DocumentationClientUpdateOptions contains the optional parameters for the DocumentationClient.Update method. +type DocumentationClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// DocumentationCollection - Paged Documentation list representation. +type DocumentationCollection struct { + // READ-ONLY; Next page link if any. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Page values. + Value []*DocumentationContract `json:"value,omitempty" azure:"ro"` +} + +// DocumentationContract - Markdown documentation details. +type DocumentationContract struct { + // Markdown Documentation details. + Properties *DocumentationContractProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// DocumentationContractProperties - Markdown documentation details. +type DocumentationContractProperties struct { + // Markdown documentation content. + Content *string `json:"content,omitempty"` + + // documentation title. + Title *string `json:"title,omitempty"` +} + +// DocumentationUpdateContract - Documentation update contract details. +type DocumentationUpdateContract struct { + // Markdown Documentation details. + Properties *DocumentationContractProperties `json:"properties,omitempty"` +} + // EmailTemplateClientCreateOrUpdateOptions contains the optional parameters for the EmailTemplateClient.CreateOrUpdate method. type EmailTemplateClientCreateOrUpdateOptions struct { // ETag of the Entity. Not required when creating an entity, but required when updating an entity. @@ -2586,7 +2996,8 @@ type EmailTemplateClientGetOptions struct { // placeholder for future optional parameters } -// EmailTemplateClientListByServiceOptions contains the optional parameters for the EmailTemplateClient.ListByService method. +// EmailTemplateClientListByServiceOptions contains the optional parameters for the EmailTemplateClient.NewListByServicePager +// method. type EmailTemplateClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -2750,7 +3161,7 @@ type GatewayAPIClientGetEntityTagOptions struct { // placeholder for future optional parameters } -// GatewayAPIClientListByServiceOptions contains the optional parameters for the GatewayAPIClient.ListByService method. +// GatewayAPIClientListByServiceOptions contains the optional parameters for the GatewayAPIClient.NewListByServicePager method. type GatewayAPIClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -2787,7 +3198,7 @@ type GatewayCertificateAuthorityClientGetOptions struct { // placeholder for future optional parameters } -// GatewayCertificateAuthorityClientListByServiceOptions contains the optional parameters for the GatewayCertificateAuthorityClient.ListByService +// GatewayCertificateAuthorityClientListByServiceOptions contains the optional parameters for the GatewayCertificateAuthorityClient.NewListByServicePager // method. type GatewayCertificateAuthorityClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | @@ -2856,7 +3267,7 @@ type GatewayClientGetOptions struct { // placeholder for future optional parameters } -// GatewayClientListByServiceOptions contains the optional parameters for the GatewayClient.ListByService method. +// GatewayClientListByServiceOptions contains the optional parameters for the GatewayClient.NewListByServicePager method. type GatewayClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -2946,7 +3357,7 @@ type GatewayHostnameConfigurationClientGetOptions struct { // placeholder for future optional parameters } -// GatewayHostnameConfigurationClientListByServiceOptions contains the optional parameters for the GatewayHostnameConfigurationClient.ListByService +// GatewayHostnameConfigurationClientListByServiceOptions contains the optional parameters for the GatewayHostnameConfigurationClient.NewListByServicePager // method. type GatewayHostnameConfigurationClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | @@ -3066,7 +3477,8 @@ type GlobalSchemaClientGetOptions struct { // placeholder for future optional parameters } -// GlobalSchemaClientListByServiceOptions contains the optional parameters for the GlobalSchemaClient.ListByService method. +// GlobalSchemaClientListByServiceOptions contains the optional parameters for the GlobalSchemaClient.NewListByServicePager +// method. type GlobalSchemaClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -3114,10 +3526,85 @@ type GlobalSchemaContractProperties struct { Description *string `json:"description,omitempty"` // Global Schema document object for json-based schema formats(e.g. json schema). - Document interface{} `json:"document,omitempty"` + Document any `json:"document,omitempty"` // Json-encoded string for non json-based schema. - Value interface{} `json:"value,omitempty"` + Value any `json:"value,omitempty"` +} + +// GraphQLAPIResolverClientCreateOrUpdateOptions contains the optional parameters for the GraphQLAPIResolverClient.CreateOrUpdate +// method. +type GraphQLAPIResolverClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// GraphQLAPIResolverClientDeleteOptions contains the optional parameters for the GraphQLAPIResolverClient.Delete method. +type GraphQLAPIResolverClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GraphQLAPIResolverClientGetEntityTagOptions contains the optional parameters for the GraphQLAPIResolverClient.GetEntityTag +// method. +type GraphQLAPIResolverClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// GraphQLAPIResolverClientGetOptions contains the optional parameters for the GraphQLAPIResolverClient.Get method. +type GraphQLAPIResolverClientGetOptions struct { + // placeholder for future optional parameters +} + +// GraphQLAPIResolverClientListByAPIOptions contains the optional parameters for the GraphQLAPIResolverClient.NewListByAPIPager +// method. +type GraphQLAPIResolverClientListByAPIOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | displayName | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | path | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + // Number of records to skip. + Skip *int32 + // Number of records to return. + Top *int32 +} + +// GraphQLAPIResolverClientUpdateOptions contains the optional parameters for the GraphQLAPIResolverClient.Update method. +type GraphQLAPIResolverClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// GraphQLAPIResolverPolicyClientCreateOrUpdateOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.CreateOrUpdate +// method. +type GraphQLAPIResolverPolicyClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// GraphQLAPIResolverPolicyClientDeleteOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.Delete +// method. +type GraphQLAPIResolverPolicyClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// GraphQLAPIResolverPolicyClientGetEntityTagOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.GetEntityTag +// method. +type GraphQLAPIResolverPolicyClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// GraphQLAPIResolverPolicyClientGetOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.Get method. +type GraphQLAPIResolverPolicyClientGetOptions struct { + // Policy Export Format. + Format *PolicyExportFormat +} + +// GraphQLAPIResolverPolicyClientListByResolverOptions contains the optional parameters for the GraphQLAPIResolverPolicyClient.NewListByResolverPager +// method. +type GraphQLAPIResolverPolicyClientListByResolverOptions struct { + // placeholder for future optional parameters } // GroupClientCreateOrUpdateOptions contains the optional parameters for the GroupClient.CreateOrUpdate method. @@ -3141,7 +3628,7 @@ type GroupClientGetOptions struct { // placeholder for future optional parameters } -// GroupClientListByServiceOptions contains the optional parameters for the GroupClient.ListByService method. +// GroupClientListByServiceOptions contains the optional parameters for the GroupClient.NewListByServicePager method. type GroupClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -3269,7 +3756,7 @@ type GroupUserClientDeleteOptions struct { // placeholder for future optional parameters } -// GroupUserClientListOptions contains the optional parameters for the GroupUserClient.List method. +// GroupUserClientListOptions contains the optional parameters for the GroupUserClient.NewListPager method. type GroupUserClientListOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -3330,7 +3817,7 @@ type HostnameConfiguration struct { // Specify true to setup the certificate associated with this Hostname as the Default SSL Certificate. If a client does not // send the SNI header, then this will be the certificate that will be challenged. // The property is useful if a service has multiple custom hostname enabled and it needs to decide on the default ssl certificate. - // The setting only applied to Proxy Hostname Type. + // The setting only applied to gateway Hostname Type. DefaultSSLBinding *bool `json:"defaultSslBinding,omitempty"` // Base64 Encoded certificate. @@ -3357,6 +3844,9 @@ type IdentityProviderBaseParameters struct { // OpenID Connect discovery endpoint hostname for AAD or AAD B2C. Authority *string `json:"authority,omitempty"` + // The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + ClientLibrary *string `json:"clientLibrary,omitempty"` + // Password Reset Policy Name. Only applies to AAD B2C Identity Provider. PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` @@ -3399,7 +3889,7 @@ type IdentityProviderClientGetOptions struct { // placeholder for future optional parameters } -// IdentityProviderClientListByServiceOptions contains the optional parameters for the IdentityProviderClient.ListByService +// IdentityProviderClientListByServiceOptions contains the optional parameters for the IdentityProviderClient.NewListByServicePager // method. type IdentityProviderClientListByServiceOptions struct { // placeholder for future optional parameters @@ -3443,6 +3933,9 @@ type IdentityProviderContractProperties struct { // OpenID Connect discovery endpoint hostname for AAD or AAD B2C. Authority *string `json:"authority,omitempty"` + // The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + ClientLibrary *string `json:"clientLibrary,omitempty"` + // Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is // App Secret for Facebook login, API Key for Google login, Public Key for // Microsoft. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value. @@ -3500,6 +3993,9 @@ type IdentityProviderCreateContractProperties struct { // OpenID Connect discovery endpoint hostname for AAD or AAD B2C. Authority *string `json:"authority,omitempty"` + // The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + ClientLibrary *string `json:"clientLibrary,omitempty"` + // Password Reset Policy Name. Only applies to AAD B2C Identity Provider. PasswordResetPolicyName *string `json:"passwordResetPolicyName,omitempty"` @@ -3549,6 +4045,9 @@ type IdentityProviderUpdateProperties struct { // App ID for Microsoft. ClientID *string `json:"clientId,omitempty"` + // The client library to be used in the developer portal. Only applies to AAD and AAD B2C Identity Provider. + ClientLibrary *string `json:"clientLibrary,omitempty"` + // Client secret of the Application in external Identity Provider, used to authenticate login request. For example, it is // App Secret for Facebook login, API Key for Google login, Public Key for // Microsoft. @@ -3618,7 +4117,7 @@ type IssueClientGetOptions struct { // placeholder for future optional parameters } -// IssueClientListByServiceOptions contains the optional parameters for the IssueClient.ListByService method. +// IssueClientListByServiceOptions contains the optional parameters for the IssueClient.NewListByServicePager method. type IssueClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -3818,7 +4317,7 @@ type LoggerClientGetOptions struct { // placeholder for future optional parameters } -// LoggerClientListByServiceOptions contains the optional parameters for the LoggerClient.ListByService method. +// LoggerClientListByServiceOptions contains the optional parameters for the LoggerClient.NewListByServicePager method. type LoggerClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -3943,7 +4442,7 @@ type NamedValueClientGetOptions struct { // placeholder for future optional parameters } -// NamedValueClientListByServiceOptions contains the optional parameters for the NamedValueClient.ListByService method. +// NamedValueClientListByServiceOptions contains the optional parameters for the NamedValueClient.NewListByServicePager method. type NamedValueClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -4123,7 +4622,8 @@ type NotificationClientGetOptions struct { // placeholder for future optional parameters } -// NotificationClientListByServiceOptions contains the optional parameters for the NotificationClient.ListByService method. +// NotificationClientListByServiceOptions contains the optional parameters for the NotificationClient.NewListByServicePager +// method. type NotificationClientListByServiceOptions struct { // Number of records to skip. Skip *int32 @@ -4259,7 +4759,7 @@ type OpenIDConnectProviderClientGetOptions struct { // placeholder for future optional parameters } -// OpenIDConnectProviderClientListByServiceOptions contains the optional parameters for the OpenIDConnectProviderClient.ListByService +// OpenIDConnectProviderClientListByServiceOptions contains the optional parameters for the OpenIDConnectProviderClient.NewListByServicePager // method. type OpenIDConnectProviderClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | @@ -4327,6 +4827,14 @@ type OpenidConnectProviderContractProperties struct { // User-friendly description of OpenID Connect Provider. Description *string `json:"description,omitempty"` + + // If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default if + // no value is provided. + UseInAPIDocumentation *bool `json:"useInApiDocumentation,omitempty"` + + // If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + // provided. + UseInTestConsole *bool `json:"useInTestConsole,omitempty"` } // OpenidConnectProviderUpdateContract - Parameters supplied to the Update OpenID Connect Provider operation. @@ -4351,6 +4859,14 @@ type OpenidConnectProviderUpdateContractProperties struct { // Metadata endpoint URI. MetadataEndpoint *string `json:"metadataEndpoint,omitempty"` + + // If true, the Open ID Connect provider will be used in the API documentation in the developer portal. False by default if + // no value is provided. + UseInAPIDocumentation *bool `json:"useInApiDocumentation,omitempty"` + + // If true, the Open ID Connect provider may be used in the developer portal test console. True by default if no value is + // provided. + UseInTestConsole *bool `json:"useInTestConsole,omitempty"` } // Operation - REST API operation @@ -4365,10 +4881,10 @@ type Operation struct { Origin *string `json:"origin,omitempty"` // The operation properties. - Properties interface{} `json:"properties,omitempty"` + Properties any `json:"properties,omitempty"` } -// OperationClientListByTagsOptions contains the optional parameters for the OperationClient.ListByTags method. +// OperationClientListByTagsOptions contains the optional parameters for the OperationClient.NewListByTagsPager method. type OperationClientListByTagsOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -4599,7 +5115,7 @@ type OperationUpdateContractProperties struct { URLTemplate *string `json:"urlTemplate,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 } @@ -4667,65 +5183,252 @@ type ParameterExampleContract struct { // A URL that points to the literal example ExternalValue *string `json:"externalValue,omitempty"` - // Short description for the example - Summary *string `json:"summary,omitempty"` + // Short description for the example + Summary *string `json:"summary,omitempty"` + + // Example value. May be a primitive value, or an object. + Value any `json:"value,omitempty"` +} + +// PipelineDiagnosticSettings - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. +type PipelineDiagnosticSettings struct { + // Diagnostic settings for request. + Request *HTTPMessageDiagnostic `json:"request,omitempty"` + + // Diagnostic settings for response. + Response *HTTPMessageDiagnostic `json:"response,omitempty"` +} + +// PolicyClientCreateOrUpdateOptions contains the optional parameters for the PolicyClient.CreateOrUpdate method. +type PolicyClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// PolicyClientDeleteOptions contains the optional parameters for the PolicyClient.Delete method. +type PolicyClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// PolicyClientGetEntityTagOptions contains the optional parameters for the PolicyClient.GetEntityTag method. +type PolicyClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// PolicyClientGetOptions contains the optional parameters for the PolicyClient.Get method. +type PolicyClientGetOptions struct { + // Policy Export Format. + Format *PolicyExportFormat +} + +// PolicyClientListByServiceOptions contains the optional parameters for the PolicyClient.ListByService method. +type PolicyClientListByServiceOptions struct { + // placeholder for future optional parameters +} + +// PolicyCollection - The response of the list policy operation. +type PolicyCollection struct { + // Total record count number. + Count *int64 `json:"count,omitempty"` + + // Next page link if any. + NextLink *string `json:"nextLink,omitempty"` + + // Policy Contract value. + Value []*PolicyContract `json:"value,omitempty"` +} + +// PolicyContract - Policy Contract details. +type PolicyContract struct { + // Properties of the Policy. + Properties *PolicyContractProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PolicyContractProperties - Policy contract Properties. +type PolicyContractProperties struct { + // REQUIRED; Contents of the Policy as defined by the format. + Value *string `json:"value,omitempty"` + + // Format of the policyContent. + Format *PolicyContentFormat `json:"format,omitempty"` +} + +// PolicyDescriptionClientListByServiceOptions contains the optional parameters for the PolicyDescriptionClient.ListByService +// method. +type PolicyDescriptionClientListByServiceOptions struct { + // Policy scope. + Scope *PolicyScopeContract +} + +// PolicyDescriptionCollection - Descriptions of API Management policies. +type PolicyDescriptionCollection struct { + // Total record count number. + Count *int64 `json:"count,omitempty"` + + // Descriptions of API Management policies. + Value []*PolicyDescriptionContract `json:"value,omitempty"` +} + +// PolicyDescriptionContract - Policy description details. +type PolicyDescriptionContract struct { + // Policy description contract properties. + Properties *PolicyDescriptionContractProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// PolicyDescriptionContractProperties - Policy description properties. +type PolicyDescriptionContractProperties struct { + // READ-ONLY; Policy description. + Description *string `json:"description,omitempty" azure:"ro"` + + // READ-ONLY; Binary OR value of the Snippet scope. + Scope *int64 `json:"scope,omitempty" azure:"ro"` +} + +// PolicyFragmentClientBeginCreateOrUpdateOptions contains the optional parameters for the PolicyFragmentClient.BeginCreateOrUpdate +// method. +type PolicyFragmentClientBeginCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PolicyFragmentClientDeleteOptions contains the optional parameters for the PolicyFragmentClient.Delete method. +type PolicyFragmentClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// PolicyFragmentClientGetEntityTagOptions contains the optional parameters for the PolicyFragmentClient.GetEntityTag method. +type PolicyFragmentClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// PolicyFragmentClientGetOptions contains the optional parameters for the PolicyFragmentClient.Get method. +type PolicyFragmentClientGetOptions struct { + // Policy fragment content format. + Format *PolicyFragmentContentFormat +} + +// PolicyFragmentClientListByServiceOptions contains the optional parameters for the PolicyFragmentClient.ListByService method. +type PolicyFragmentClientListByServiceOptions struct { + // | Field | Usage | Supported operators | Supported functions | + // |-------------|-------------|-------------|-------------| + // | name | filter, orderBy | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | description | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + // | value | filter | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith | + Filter *string + // OData order by query option. + Orderby *string + // Number of records to skip. + Skip *int32 + // Number of records to return. + Top *int32 +} + +// PolicyFragmentClientListReferencesOptions contains the optional parameters for the PolicyFragmentClient.ListReferences +// method. +type PolicyFragmentClientListReferencesOptions struct { + // Number of records to skip. + Skip *int32 + // Number of records to return. + Top *int32 +} + +// PolicyFragmentCollection - The response of the get policy fragments operation. +type PolicyFragmentCollection struct { + // Total record count number. + Count *int64 `json:"count,omitempty"` + + // Next page link if any. + NextLink *string `json:"nextLink,omitempty"` + + // Policy fragment contract value. + Value []*PolicyFragmentContract `json:"value,omitempty"` +} + +// PolicyFragmentContract - Policy fragment contract details. +type PolicyFragmentContract struct { + // Properties of the Policy Fragment. + Properties *PolicyFragmentContractProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` - // Example value. May be a primitive value, or an object. - Value interface{} `json:"value,omitempty"` + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` } -// PipelineDiagnosticSettings - Diagnostic settings for incoming/outgoing HTTP messages to the Gateway. -type PipelineDiagnosticSettings struct { - // Diagnostic settings for request. - Request *HTTPMessageDiagnostic `json:"request,omitempty"` +// PolicyFragmentContractProperties - Policy fragment contract properties. +type PolicyFragmentContractProperties struct { + // REQUIRED; Contents of the policy fragment. + Value *string `json:"value,omitempty"` - // Diagnostic settings for response. - Response *HTTPMessageDiagnostic `json:"response,omitempty"` -} + // Policy fragment description. + Description *string `json:"description,omitempty"` -// PolicyClientCreateOrUpdateOptions contains the optional parameters for the PolicyClient.CreateOrUpdate method. -type PolicyClientCreateOrUpdateOptions struct { - // ETag of the Entity. Not required when creating an entity, but required when updating an entity. - IfMatch *string + // Format of the policy fragment content. + Format *PolicyFragmentContentFormat `json:"format,omitempty"` } -// PolicyClientDeleteOptions contains the optional parameters for the PolicyClient.Delete method. -type PolicyClientDeleteOptions struct { +// PortalConfigClientCreateOrUpdateOptions contains the optional parameters for the PortalConfigClient.CreateOrUpdate method. +type PortalConfigClientCreateOrUpdateOptions struct { // placeholder for future optional parameters } -// PolicyClientGetEntityTagOptions contains the optional parameters for the PolicyClient.GetEntityTag method. -type PolicyClientGetEntityTagOptions struct { +// PortalConfigClientGetEntityTagOptions contains the optional parameters for the PortalConfigClient.GetEntityTag method. +type PortalConfigClientGetEntityTagOptions struct { // placeholder for future optional parameters } -// PolicyClientGetOptions contains the optional parameters for the PolicyClient.Get method. -type PolicyClientGetOptions struct { - // Policy Export Format. - Format *PolicyExportFormat +// PortalConfigClientGetOptions contains the optional parameters for the PortalConfigClient.Get method. +type PortalConfigClientGetOptions struct { + // placeholder for future optional parameters } -// PolicyClientListByServiceOptions contains the optional parameters for the PolicyClient.ListByService method. -type PolicyClientListByServiceOptions struct { +// PortalConfigClientListByServiceOptions contains the optional parameters for the PortalConfigClient.ListByService method. +type PortalConfigClientListByServiceOptions struct { // placeholder for future optional parameters } -// PolicyCollection - The response of the list policy operation. -type PolicyCollection struct { - // Total record count number. - Count *int64 `json:"count,omitempty"` +// PortalConfigClientUpdateOptions contains the optional parameters for the PortalConfigClient.Update method. +type PortalConfigClientUpdateOptions struct { + // placeholder for future optional parameters +} - // Next page link if any. - NextLink *string `json:"nextLink,omitempty"` +// PortalConfigCollection - The collection of the developer portal configurations. +type PortalConfigCollection struct { + // The developer portal configurations. + Value []*PortalConfigContract `json:"value,omitempty"` - // Policy Contract value. - Value []*PolicyContract `json:"value,omitempty"` + // READ-ONLY; Next page link if any. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// PolicyContract - Policy Contract details. -type PolicyContract struct { - // Properties of the Policy. - Properties *PolicyContractProperties `json:"properties,omitempty"` +// PortalConfigContract - The developer portal configuration contract. +type PortalConfigContract struct { + // The developer portal configuration contract properties. + Properties *PortalConfigProperties `json:"properties,omitempty"` // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty" azure:"ro"` @@ -4737,53 +5440,72 @@ type PolicyContract struct { Type *string `json:"type,omitempty" azure:"ro"` } -// PolicyContractProperties - Policy contract Properties. -type PolicyContractProperties struct { - // REQUIRED; Contents of the Policy as defined by the format. - Value *string `json:"value,omitempty"` - - // Format of the policyContent. - Format *PolicyContentFormat `json:"format,omitempty"` +// PortalConfigCorsProperties - The developer portal Cross-Origin Resource Sharing (CORS) settings. +type PortalConfigCorsProperties struct { + // Allowed origins, e.g. https://trusted.com. + AllowedOrigins []*string `json:"allowedOrigins,omitempty"` } -// PolicyDescriptionClientListByServiceOptions contains the optional parameters for the PolicyDescriptionClient.ListByService -// method. -type PolicyDescriptionClientListByServiceOptions struct { - // Policy scope. - Scope *PolicyScopeContract +// PortalConfigCspProperties - The developer portal Content Security Policy (CSP) settings. +type PortalConfigCspProperties struct { + // Allowed sources, e.g. *.trusted.com, trusted.com, https://. + AllowedSources []*string `json:"allowedSources,omitempty"` + + // The mode of the developer portal Content Security Policy (CSP). + Mode *PortalSettingsCspMode `json:"mode,omitempty"` + + // The URLs used by the browser to report CSP violations. + ReportURI []*string `json:"reportUri,omitempty"` } -// PolicyDescriptionCollection - Descriptions of APIM policies. -type PolicyDescriptionCollection struct { - // Total record count number. - Count *int64 `json:"count,omitempty"` +type PortalConfigDelegationProperties struct { + // Enable or disable delegation for user registration. + DelegateRegistration *bool `json:"delegateRegistration,omitempty"` - // Descriptions of APIM policies. - Value []*PolicyDescriptionContract `json:"value,omitempty"` + // Enable or disable delegation for product subscriptions. + DelegateSubscription *bool `json:"delegateSubscription,omitempty"` + + // A delegation endpoint URL. + DelegationURL *string `json:"delegationUrl,omitempty"` + + // A base64-encoded validation key to ensure requests originate from Azure API Management service. + ValidationKey *string `json:"validationKey,omitempty"` } -// PolicyDescriptionContract - Policy description details. -type PolicyDescriptionContract struct { - // Policy description contract properties. - Properties *PolicyDescriptionContractProperties `json:"properties,omitempty"` +// PortalConfigProperties - The developer portal configuration contract properties. +type PortalConfigProperties struct { + // The developer portal Cross-Origin Resource Sharing (CORS) settings. + Cors *PortalConfigCorsProperties `json:"cors,omitempty"` - // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} - ID *string `json:"id,omitempty" azure:"ro"` + // The developer portal Content Security Policy (CSP) settings. + Csp *PortalConfigCspProperties `json:"csp,omitempty"` - // READ-ONLY; The name of the resource - Name *string `json:"name,omitempty" azure:"ro"` + // The developer portal delegation settings. + Delegation *PortalConfigDelegationProperties `json:"delegation,omitempty"` - // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" - Type *string `json:"type,omitempty" azure:"ro"` + // Enable or disable Basic authentication method. + EnableBasicAuth *bool `json:"enableBasicAuth,omitempty"` + Signin *PortalConfigPropertiesSignin `json:"signin,omitempty"` + Signup *PortalConfigPropertiesSignup `json:"signup,omitempty"` } -// PolicyDescriptionContractProperties - Policy description properties. -type PolicyDescriptionContractProperties struct { - // READ-ONLY; Policy description. - Description *string `json:"description,omitempty" azure:"ro"` +type PortalConfigPropertiesSignin struct { + // Redirect anonymous users to the sign-in page. + Require *bool `json:"require,omitempty"` +} - // READ-ONLY; Binary OR value of the Snippet scope. - Scope *int64 `json:"scope,omitempty" azure:"ro"` +type PortalConfigPropertiesSignup struct { + // Terms of service settings. + TermsOfService *PortalConfigTermsOfServiceProperties `json:"termsOfService,omitempty"` +} + +// PortalConfigTermsOfServiceProperties - Terms of service contract properties. +type PortalConfigTermsOfServiceProperties struct { + // Ask user for consent to the terms of service. + RequireConsent *bool `json:"requireConsent,omitempty"` + + // A terms of service text. + Text *string `json:"text,omitempty"` } // PortalDelegationSettings - Delegation settings for a developer portal. @@ -4839,7 +5561,8 @@ type PortalRevisionClientGetOptions struct { // placeholder for future optional parameters } -// PortalRevisionClientListByServiceOptions contains the optional parameters for the PortalRevisionClient.ListByService method. +// PortalRevisionClientListByServiceOptions contains the optional parameters for the PortalRevisionClient.NewListByServicePager +// method. type PortalRevisionClientListByServiceOptions struct { // FIELD SUPPORTED OPERATORS SUPPORTED FUNCTIONS // |name | ge, le, eq, ne, gt, lt | substringof, contains, startswith, endswith| |description | ge, le, eq, ne, gt, lt | substringof, @@ -4906,12 +5629,12 @@ type PortalSettingsClientListByServiceOptions struct { // placeholder for future optional parameters } -// PortalSettingsCollection - Descriptions of APIM policies. +// PortalSettingsCollection - Descriptions of API Management policies. type PortalSettingsCollection struct { // Total record count number. Count *int64 `json:"count,omitempty"` - // Descriptions of APIM policies. + // Descriptions of API Management policies. Value []*PortalSettingsContract `json:"value,omitempty"` } @@ -5043,7 +5766,7 @@ type PrivateEndpointConnectionClientGetPrivateLinkResourceOptions struct { // placeholder for future optional parameters } -// PrivateEndpointConnectionClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionClient.ListByService +// PrivateEndpointConnectionClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionClient.NewListByServicePager // method. type PrivateEndpointConnectionClientListByServiceOptions struct { // placeholder for future optional parameters @@ -5164,7 +5887,7 @@ type ProductAPIClientDeleteOptions struct { // placeholder for future optional parameters } -// ProductAPIClientListByProductOptions contains the optional parameters for the ProductAPIClient.ListByProduct method. +// ProductAPIClientListByProductOptions contains the optional parameters for the ProductAPIClient.NewListByProductPager method. type ProductAPIClientListByProductOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -5202,7 +5925,7 @@ type ProductClientGetOptions struct { // placeholder for future optional parameters } -// ProductClientListByServiceOptions contains the optional parameters for the ProductClient.ListByService method. +// ProductClientListByServiceOptions contains the optional parameters for the ProductClient.NewListByServicePager method. type ProductClientListByServiceOptions struct { // When set to true, the response contains an array of groups that have visibility to the product. The default is false. ExpandGroups *bool @@ -5223,7 +5946,7 @@ type ProductClientListByServiceOptions struct { Top *int32 } -// ProductClientListByTagsOptions contains the optional parameters for the ProductClient.ListByTags method. +// ProductClientListByTagsOptions contains the optional parameters for the ProductClient.NewListByTagsPager method. type ProductClientListByTagsOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -5358,7 +6081,8 @@ type ProductGroupClientDeleteOptions struct { // placeholder for future optional parameters } -// ProductGroupClientListByProductOptions contains the optional parameters for the ProductGroupClient.ListByProduct method. +// ProductGroupClientListByProductOptions contains the optional parameters for the ProductGroupClient.NewListByProductPager +// method. type ProductGroupClientListByProductOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -5399,7 +6123,8 @@ type ProductPolicyClientListByProductOptions struct { // placeholder for future optional parameters } -// ProductSubscriptionsClientListOptions contains the optional parameters for the ProductSubscriptionsClient.List method. +// ProductSubscriptionsClientListOptions contains the optional parameters for the ProductSubscriptionsClient.NewListPager +// method. type ProductSubscriptionsClientListOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -5500,6 +6225,50 @@ type ProductUpdateProperties struct { Terms *string `json:"terms,omitempty"` } +// ProductWikiClientCreateOrUpdateOptions contains the optional parameters for the ProductWikiClient.CreateOrUpdate method. +type ProductWikiClientCreateOrUpdateOptions struct { + // ETag of the Entity. Not required when creating an entity, but required when updating an entity. + IfMatch *string +} + +// ProductWikiClientDeleteOptions contains the optional parameters for the ProductWikiClient.Delete method. +type ProductWikiClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ProductWikiClientGetEntityTagOptions contains the optional parameters for the ProductWikiClient.GetEntityTag method. +type ProductWikiClientGetEntityTagOptions struct { + // placeholder for future optional parameters +} + +// ProductWikiClientGetOptions contains the optional parameters for the ProductWikiClient.Get method. +type ProductWikiClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProductWikiClientUpdateOptions contains the optional parameters for the ProductWikiClient.Update method. +type ProductWikiClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ProductWikisClientListOptions contains the optional parameters for the ProductWikisClient.NewListPager method. +type ProductWikisClientListOptions struct { + // placeholder for future optional parameters +} + +// ProxyResource - The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a +// location +type ProxyResource struct { + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + // QuotaByCounterKeysClientListByServiceOptions contains the optional parameters for the QuotaByCounterKeysClient.ListByService // method. type QuotaByCounterKeysClientListByServiceOptions struct { @@ -5649,7 +6418,7 @@ type RecipientsContractProperties struct { Users []*string `json:"users,omitempty"` } -// RegionClientListByServiceOptions contains the optional parameters for the RegionClient.ListByService method. +// RegionClientListByServiceOptions contains the optional parameters for the RegionClient.NewListByServicePager method. type RegionClientListByServiceOptions struct { // placeholder for future optional parameters } @@ -5741,7 +6510,7 @@ type ReportRecordContract struct { // and HttpStatusCode.TooManyRequests CallCountBlocked *int32 `json:"callCountBlocked,omitempty"` - // Number of calls failed due to proxy or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and + // Number of calls failed due to gateway or backend errors. This includes calls returning HttpStatusCode.BadRequest(400) and // any Code between HttpStatusCode.InternalServerError (500) and 600 CallCountFailed *int32 `json:"callCountFailed,omitempty"` @@ -5796,7 +6565,7 @@ type ReportRecordContract struct { UserID *string `json:"userId,omitempty" azure:"ro"` } -// ReportsClientListByAPIOptions contains the optional parameters for the ReportsClient.ListByAPI method. +// ReportsClientListByAPIOptions contains the optional parameters for the ReportsClient.NewListByAPIPager method. type ReportsClientListByAPIOptions struct { // OData order by query option. Orderby *string @@ -5806,7 +6575,7 @@ type ReportsClientListByAPIOptions struct { Top *int32 } -// ReportsClientListByGeoOptions contains the optional parameters for the ReportsClient.ListByGeo method. +// ReportsClientListByGeoOptions contains the optional parameters for the ReportsClient.NewListByGeoPager method. type ReportsClientListByGeoOptions struct { // Number of records to skip. Skip *int32 @@ -5814,7 +6583,7 @@ type ReportsClientListByGeoOptions struct { Top *int32 } -// ReportsClientListByOperationOptions contains the optional parameters for the ReportsClient.ListByOperation method. +// ReportsClientListByOperationOptions contains the optional parameters for the ReportsClient.NewListByOperationPager method. type ReportsClientListByOperationOptions struct { // OData order by query option. Orderby *string @@ -5824,7 +6593,7 @@ type ReportsClientListByOperationOptions struct { Top *int32 } -// ReportsClientListByProductOptions contains the optional parameters for the ReportsClient.ListByProduct method. +// ReportsClientListByProductOptions contains the optional parameters for the ReportsClient.NewListByProductPager method. type ReportsClientListByProductOptions struct { // OData order by query option. Orderby *string @@ -5834,7 +6603,7 @@ type ReportsClientListByProductOptions struct { Top *int32 } -// ReportsClientListByRequestOptions contains the optional parameters for the ReportsClient.ListByRequest method. +// ReportsClientListByRequestOptions contains the optional parameters for the ReportsClient.NewListByRequestPager method. type ReportsClientListByRequestOptions struct { // Number of records to skip. Skip *int32 @@ -5842,7 +6611,8 @@ type ReportsClientListByRequestOptions struct { Top *int32 } -// ReportsClientListBySubscriptionOptions contains the optional parameters for the ReportsClient.ListBySubscription method. +// ReportsClientListBySubscriptionOptions contains the optional parameters for the ReportsClient.NewListBySubscriptionPager +// method. type ReportsClientListBySubscriptionOptions struct { // OData order by query option. Orderby *string @@ -5852,7 +6622,7 @@ type ReportsClientListBySubscriptionOptions struct { Top *int32 } -// ReportsClientListByTimeOptions contains the optional parameters for the ReportsClient.ListByTime method. +// ReportsClientListByTimeOptions contains the optional parameters for the ReportsClient.NewListByTimePager method. type ReportsClientListByTimeOptions struct { // OData order by query option. Orderby *string @@ -5862,7 +6632,7 @@ type ReportsClientListByTimeOptions struct { Top *int32 } -// ReportsClientListByUserOptions contains the optional parameters for the ReportsClient.ListByUser method. +// ReportsClientListByUserOptions contains the optional parameters for the ReportsClient.NewListByUserPager method. type ReportsClientListByUserOptions struct { // OData order by query option. Orderby *string @@ -5974,6 +6744,118 @@ type RequestReportRecordContract struct { UserID *string `json:"userId,omitempty" azure:"ro"` } +// ResolverCollection - Paged Resolver list representation. +type ResolverCollection struct { + // Total record count number across all pages. + Count *int64 `json:"count,omitempty"` + + // READ-ONLY; Next page link if any. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Page values. + Value []*ResolverContract `json:"value,omitempty" azure:"ro"` +} + +// ResolverContract - GraphQL API Resolver details. +type ResolverContract struct { + // Properties of the Resolver Contract. + Properties *ResolverEntityBaseContract `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ResolverEntityBaseContract - GraphQL API Resolver Entity Base Contract details. +type ResolverEntityBaseContract struct { + // Description of the resolver. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + + // Resolver Name. + DisplayName *string `json:"displayName,omitempty"` + + // Path is type/field being resolved. + Path *string `json:"path,omitempty"` +} + +// ResolverResultContract - Long Running Git Resolver Results. +type ResolverResultContract struct { + // Properties of the Resolver Contract. + Properties *ResolverResultContractProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// ResolverResultContractProperties - Resolver Result. +type ResolverResultContractProperties struct { + // Error Body Contract + Error *ErrorResponseBody `json:"error,omitempty"` + + // Resolver result identifier. + ID *string `json:"id,omitempty"` + + // Optional result info. + ResultInfo *string `json:"resultInfo,omitempty"` + + // Start time of an async resolver. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by the ISO + // 8601 standard. + Started *time.Time `json:"started,omitempty"` + + // Status of an async resolver. + Status *AsyncResolverStatus `json:"status,omitempty"` + + // Last update time of an async resolver. The date conforms to the following format: yyyy-MM-ddTHH:mm:ssZ as specified by + // the ISO 8601 standard. + Updated *time.Time `json:"updated,omitempty"` + + // READ-ONLY; This property if only provided as part of the TenantConfigurationValidate resolver. It contains the log the + // entities which will be updated/created/deleted as part of the TenantConfigurationDeploy + // resolver. + ActionLog []*ResolverResultLogItemContract `json:"actionLog,omitempty" azure:"ro"` +} + +// ResolverResultLogItemContract - Log of the entity being created, updated or deleted. +type ResolverResultLogItemContract struct { + // Action like create/update/delete. + Action *string `json:"action,omitempty"` + + // Identifier of the entity being created/updated/deleted. + ObjectKey *string `json:"objectKey,omitempty"` + + // The type of entity contract. + ObjectType *string `json:"objectType,omitempty"` +} + +// ResolverUpdateContract - GraphQL API Resolver Update Contract details. +type ResolverUpdateContract struct { + // Properties of the GraphQL API Resolver entity that can be updated. + Properties *ResolverUpdateContractProperties `json:"properties,omitempty"` +} + +// ResolverUpdateContractProperties - Resolver Update Contract Properties. +type ResolverUpdateContractProperties struct { + // Description of the resolver. May include HTML formatting tags. + Description *string `json:"description,omitempty"` + + // Resolver Name. + DisplayName *string `json:"displayName,omitempty"` + + // Path is type/field being resolved. + Path *string `json:"path,omitempty"` +} + // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -5986,6 +6868,29 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } +// ResourceCollection - A collection of resources. +type ResourceCollection struct { + // Total record count number. + Count *int64 `json:"count,omitempty"` + + // Next page link if any. + NextLink *string `json:"nextLink,omitempty"` + + // A collection of resources. + Value []*ResourceCollectionValueItem `json:"value,omitempty"` +} + +type ResourceCollectionValueItem struct { + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + // ResourceLocationDataContract - Resource location data properties. type ResourceLocationDataContract struct { // REQUIRED; A canonical name for the geographic or physical location. @@ -6183,7 +7088,7 @@ type SKUZoneDetails struct { Name []*string `json:"name,omitempty" azure:"ro"` } -// SKUsClientListOptions contains the optional parameters for the SKUsClient.List method. +// SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method. type SKUsClientListOptions struct { // placeholder for future optional parameters } @@ -6260,17 +7165,17 @@ type SchemaContractProperties struct { // - WADL Schema use application/vnd.ms-azure-apim.wadl.grammars+xml. ContentType *string `json:"contentType,omitempty"` - // Create or update Properties of the API Schema Document. + // REQUIRED; Create or update Properties of the API Schema Document. Document *SchemaDocumentProperties `json:"document,omitempty"` } // SchemaDocumentProperties - Api Schema Document Properties. type SchemaDocumentProperties struct { // Types definitions. Used for Swagger/OpenAPI v2/v3 schemas only, null otherwise. - Components interface{} `json:"components,omitempty"` + Components any `json:"components,omitempty"` // Types definitions. Used for Swagger/OpenAPI v1 schemas only, null otherwise. - Definitions interface{} `json:"definitions,omitempty"` + Definitions any `json:"definitions,omitempty"` // Json escaped string defining the document representing the Schema. Used for schemas other than Swagger/OpenAPI. Value *string `json:"value,omitempty"` @@ -6330,15 +7235,15 @@ type ServiceBaseProperties struct { // API Management service. // Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For // all the settings except Http2 the default value is True if the service was - // created on or before April 1st 2018 and False otherwise. Http2 setting's default value is False. - // You can disable any of next ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]: - // TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA, TLS - // ECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256, - // TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For example, - // Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default value - // is true for them. Note: next ciphers can't be disabled since they are required by - // Azure CloudService internal components: TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCMSHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBC - // SHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256,TLSRSAWITHAES256GCMSHA384 + // created on or before April 1, 2018 and False otherwise. Http2 setting's default value is False. + // You can disable any of the following ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]: + // TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBC + // SHA, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256, + // TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For + // example, Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default + // value is true for them. + // Note: The following ciphers can't be disabled since they are required by internal platform components: TLSAES256GCMSHA384,TLSAES128GCMSHA256,TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCM + // SHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBCSHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256 CustomProperties map[string]*string `json:"customProperties,omitempty"` // Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway @@ -6353,6 +7258,9 @@ type ServiceBaseProperties struct { // Custom hostname configuration of the API Management service. HostnameConfigurations []*HostnameConfiguration `json:"hostnameConfigurations,omitempty"` + // Property can be used to enable NAT Gateway for this API Management service. + NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` + // Email address from which the notification will be sent. NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` @@ -6398,6 +7306,10 @@ type ServiceBaseProperties struct { // READ-ONLY; Management API endpoint URL of the API Management service. ManagementAPIURL *string `json:"managementApiUrl,omitempty" azure:"ro"` + // READ-ONLY; Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium + // SKU on stv2 platform. + OutboundPublicIPAddresses []*string `json:"outboundPublicIPAddresses,omitempty" azure:"ro"` + // READ-ONLY; Compute Platform Version running the service in this location. PlatformVersion *PlatformVersion `json:"platformVersion,omitempty" azure:"ro"` @@ -6459,6 +7371,12 @@ type ServiceClientBeginDeleteOptions struct { ResumeToken string } +// ServiceClientBeginMigrateToStv2Options contains the optional parameters for the ServiceClient.BeginMigrateToStv2 method. +type ServiceClientBeginMigrateToStv2Options struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // ServiceClientBeginRestoreOptions contains the optional parameters for the ServiceClient.BeginRestore method. type ServiceClientBeginRestoreOptions struct { // Resumes the LRO from the provided token. @@ -6493,12 +7411,13 @@ type ServiceClientGetSsoTokenOptions struct { // placeholder for future optional parameters } -// ServiceClientListByResourceGroupOptions contains the optional parameters for the ServiceClient.ListByResourceGroup method. +// ServiceClientListByResourceGroupOptions contains the optional parameters for the ServiceClient.NewListByResourceGroupPager +// method. type ServiceClientListByResourceGroupOptions struct { // placeholder for future optional parameters } -// ServiceClientListOptions contains the optional parameters for the ServiceClient.List method. +// ServiceClientListOptions contains the optional parameters for the ServiceClient.NewListPager method. type ServiceClientListOptions struct { // placeholder for future optional parameters } @@ -6591,15 +7510,15 @@ type ServiceProperties struct { // API Management service. // Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For // all the settings except Http2 the default value is True if the service was - // created on or before April 1st 2018 and False otherwise. Http2 setting's default value is False. - // You can disable any of next ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]: - // TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA, TLS - // ECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256, - // TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For example, - // Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default value - // is true for them. Note: next ciphers can't be disabled since they are required by - // Azure CloudService internal components: TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCMSHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBC - // SHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256,TLSRSAWITHAES256GCMSHA384 + // created on or before April 1, 2018 and False otherwise. Http2 setting's default value is False. + // You can disable any of the following ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]: + // TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBC + // SHA, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256, + // TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For + // example, Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default + // value is true for them. + // Note: The following ciphers can't be disabled since they are required by internal platform components: TLSAES256GCMSHA384,TLSAES128GCMSHA256,TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCM + // SHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBCSHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256 CustomProperties map[string]*string `json:"customProperties,omitempty"` // Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway @@ -6614,6 +7533,9 @@ type ServiceProperties struct { // Custom hostname configuration of the API Management service. HostnameConfigurations []*HostnameConfiguration `json:"hostnameConfigurations,omitempty"` + // Property can be used to enable NAT Gateway for this API Management service. + NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` + // Email address from which the notification will be sent. NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` @@ -6659,6 +7581,10 @@ type ServiceProperties struct { // READ-ONLY; Management API endpoint URL of the API Management service. ManagementAPIURL *string `json:"managementApiUrl,omitempty" azure:"ro"` + // READ-ONLY; Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium + // SKU on stv2 platform. + OutboundPublicIPAddresses []*string `json:"outboundPublicIPAddresses,omitempty" azure:"ro"` + // READ-ONLY; Compute Platform Version running the service in this location. PlatformVersion *PlatformVersion `json:"platformVersion,omitempty" azure:"ro"` @@ -6731,7 +7657,7 @@ type ServiceSKUProperties struct { Name *SKUType `json:"name,omitempty"` } -// ServiceSKUsClientListAvailableServiceSKUsOptions contains the optional parameters for the ServiceSKUsClient.ListAvailableServiceSKUs +// ServiceSKUsClientListAvailableServiceSKUsOptions contains the optional parameters for the ServiceSKUsClient.NewListAvailableServiceSKUsPager // method. type ServiceSKUsClientListAvailableServiceSKUsOptions struct { // placeholder for future optional parameters @@ -6793,15 +7719,15 @@ type ServiceUpdateProperties struct { // API Management service. // Not specifying any of these properties on PATCH operation will reset omitted properties' values to their defaults. For // all the settings except Http2 the default value is True if the service was - // created on or before April 1st 2018 and False otherwise. Http2 setting's default value is False. - // You can disable any of next ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]: - // TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBCSHA, TLS - // ECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256, - // TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For example, - // Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default value - // is true for them. Note: next ciphers can't be disabled since they are required by - // Azure CloudService internal components: TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCMSHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBC - // SHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256,TLSRSAWITHAES256GCMSHA384 + // created on or before April 1, 2018 and False otherwise. Http2 setting's default value is False. + // You can disable any of the following ciphers by using settings Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.[cipher_name]: + // TLSECDHEECDSAWITHAES256CBCSHA, TLSECDHEECDSAWITHAES128CBC + // SHA, TLSECDHERSAWITHAES256CBCSHA, TLSECDHERSAWITHAES128CBCSHA, TLSRSAWITHAES128GCMSHA256, TLSRSAWITHAES256CBCSHA256, TLSRSAWITHAES128CBCSHA256, + // TLSRSAWITHAES256CBCSHA, TLSRSAWITHAES128CBCSHA. For + // example, Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Ciphers.TLS_RSA_WITH_AES_128_CBC_SHA256:false. The default + // value is true for them. + // Note: The following ciphers can't be disabled since they are required by internal platform components: TLSAES256GCMSHA384,TLSAES128GCMSHA256,TLSECDHEECDSAWITHAES256GCMSHA384,TLSECDHEECDSAWITHAES128GCM + // SHA256,TLSECDHERSAWITHAES256GCMSHA384,TLSECDHERSAWITHAES128GCMSHA256,TLSECDHEECDSAWITHAES256CBCSHA384,TLSECDHEECDSAWITHAES128CBCSHA256,TLSECDHERSAWITHAES256CBCSHA384,TLSECDHERSAWITHAES128CBCSHA256 CustomProperties map[string]*string `json:"customProperties,omitempty"` // Property only valid for an Api Management service deployed in multiple locations. This can be used to disable the gateway @@ -6816,6 +7742,9 @@ type ServiceUpdateProperties struct { // Custom hostname configuration of the API Management service. HostnameConfigurations []*HostnameConfiguration `json:"hostnameConfigurations,omitempty"` + // Property can be used to enable NAT Gateway for this API Management service. + NatGatewayState *NatGatewayState `json:"natGatewayState,omitempty"` + // Email address from which the notification will be sent. NotificationSenderEmail *string `json:"notificationSenderEmail,omitempty"` @@ -6867,6 +7796,10 @@ type ServiceUpdateProperties struct { // READ-ONLY; Management API endpoint URL of the API Management service. ManagementAPIURL *string `json:"managementApiUrl,omitempty" azure:"ro"` + // READ-ONLY; Outbound public IPV4 address prefixes associated with NAT Gateway deployed service. Available only for Premium + // SKU on stv2 platform. + OutboundPublicIPAddresses []*string `json:"outboundPublicIPAddresses,omitempty" azure:"ro"` + // READ-ONLY; Compute Platform Version running the service in this location. PlatformVersion *PlatformVersion `json:"platformVersion,omitempty" azure:"ro"` @@ -6964,7 +7897,7 @@ type SubscriptionClientGetOptions struct { // placeholder for future optional parameters } -// SubscriptionClientListOptions contains the optional parameters for the SubscriptionClient.List method. +// SubscriptionClientListOptions contains the optional parameters for the SubscriptionClient.NewListPager method. type SubscriptionClientListOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -7302,7 +8235,7 @@ type TagClientGetOptions struct { // placeholder for future optional parameters } -// TagClientListByAPIOptions contains the optional parameters for the TagClient.ListByAPI method. +// TagClientListByAPIOptions contains the optional parameters for the TagClient.NewListByAPIPager method. type TagClientListByAPIOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -7315,7 +8248,7 @@ type TagClientListByAPIOptions struct { Top *int32 } -// TagClientListByOperationOptions contains the optional parameters for the TagClient.ListByOperation method. +// TagClientListByOperationOptions contains the optional parameters for the TagClient.NewListByOperationPager method. type TagClientListByOperationOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -7328,7 +8261,7 @@ type TagClientListByOperationOptions struct { Top *int32 } -// TagClientListByProductOptions contains the optional parameters for the TagClient.ListByProduct method. +// TagClientListByProductOptions contains the optional parameters for the TagClient.NewListByProductPager method. type TagClientListByProductOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -7341,7 +8274,7 @@ type TagClientListByProductOptions struct { Top *int32 } -// TagClientListByServiceOptions contains the optional parameters for the TagClient.ListByService method. +// TagClientListByServiceOptions contains the optional parameters for the TagClient.NewListByServicePager method. type TagClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -7463,7 +8396,8 @@ type TagDescriptionCreateParameters struct { Properties *TagDescriptionBaseProperties `json:"properties,omitempty"` } -// TagResourceClientListByServiceOptions contains the optional parameters for the TagResourceClient.ListByService method. +// TagResourceClientListByServiceOptions contains the optional parameters for the TagResourceClient.NewListByServicePager +// method. type TagResourceClientListByServiceOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|-------------|-------------|-------------| @@ -7538,7 +8472,8 @@ type TenantAccessClientGetOptions struct { // placeholder for future optional parameters } -// TenantAccessClientListByServiceOptions contains the optional parameters for the TenantAccessClient.ListByService method. +// TenantAccessClientListByServiceOptions contains the optional parameters for the TenantAccessClient.NewListByServicePager +// method. type TenantAccessClientListByServiceOptions struct { // Not used Filter *string @@ -7654,7 +8589,8 @@ type TenantSettingsClientGetOptions struct { // placeholder for future optional parameters } -// TenantSettingsClientListByServiceOptions contains the optional parameters for the TenantSettingsClient.ListByService method. +// TenantSettingsClientListByServiceOptions contains the optional parameters for the TenantSettingsClient.NewListByServicePager +// method. type TenantSettingsClientListByServiceOptions struct { // Not used Filter *string @@ -7749,7 +8685,7 @@ type UserClientGetSharedAccessTokenOptions struct { // placeholder for future optional parameters } -// UserClientListByServiceOptions contains the optional parameters for the UserClient.ListByService method. +// UserClientListByServiceOptions contains the optional parameters for the UserClient.NewListByServicePager method. type UserClientListByServiceOptions struct { // Detailed Group in response. ExpandGroups *bool @@ -7888,7 +8824,7 @@ type UserEntityBaseParameters struct { State *UserState `json:"state,omitempty"` } -// UserGroupClientListOptions contains the optional parameters for the UserGroupClient.List method. +// UserGroupClientListOptions contains the optional parameters for the UserGroupClient.NewListPager method. type UserGroupClientListOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|------------------------|-----------------------------------| @@ -7902,7 +8838,7 @@ type UserGroupClientListOptions struct { Top *int32 } -// UserIdentitiesClientListOptions contains the optional parameters for the UserIdentitiesClient.List method. +// UserIdentitiesClientListOptions contains the optional parameters for the UserIdentitiesClient.NewListPager method. type UserIdentitiesClientListOptions struct { // placeholder for future optional parameters } @@ -7941,7 +8877,7 @@ type UserSubscriptionClientGetOptions struct { // placeholder for future optional parameters } -// UserSubscriptionClientListOptions contains the optional parameters for the UserSubscriptionClient.List method. +// UserSubscriptionClientListOptions contains the optional parameters for the UserSubscriptionClient.NewListPager method. type UserSubscriptionClientListOptions struct { // | Field | Usage | Supported operators | Supported functions | // |-------------|------------------------|-----------------------------------| @@ -8024,6 +8960,48 @@ type VirtualNetworkConfiguration struct { Vnetid *string `json:"vnetid,omitempty" azure:"ro"` } +// WikiCollection - Paged Wiki list representation. +type WikiCollection struct { + // READ-ONLY; Next page link if any. + NextLink *string `json:"nextLink,omitempty" azure:"ro"` + + // READ-ONLY; Page values. + Value []*WikiContract `json:"value,omitempty" azure:"ro"` +} + +// WikiContract - Wiki properties +type WikiContract struct { + // Wiki details. + Properties *WikiContractProperties `json:"properties,omitempty"` + + // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty" azure:"ro"` + + // READ-ONLY; The name of the resource + Name *string `json:"name,omitempty" azure:"ro"` + + // READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty" azure:"ro"` +} + +// WikiContractProperties - Wiki contract details +type WikiContractProperties struct { + // Collection wiki documents included into this wiki. + Documents []*WikiDocumentationContract `json:"documents,omitempty"` +} + +// WikiDocumentationContract - Wiki documentation details. +type WikiDocumentationContract struct { + // Documentation Identifier + DocumentationID *string `json:"documentationId,omitempty"` +} + +// WikiUpdateContract - Wiki update contract details. +type WikiUpdateContract struct { + // Wiki details. + Properties *WikiContractProperties `json:"properties,omitempty"` +} + // X509CertificateName - Properties of server X509Names. type X509CertificateName struct { // Thumbprint for the Issuer of the Certificate. diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/models_serde.go b/sdk/resourcemanager/apimanagement/armapimanagement/models_serde.go new file mode 100644 index 000000000000..94606d0d9bc4 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/models_serde.go @@ -0,0 +1,15398 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +import ( + "encoding/json" + "fmt" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type APICollection. +func (a APICollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", a.Count) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APICollection. +func (a *APICollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &a.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APIContactInformation. +func (a APIContactInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "email", a.Email) + populate(objectMap, "name", a.Name) + populate(objectMap, "url", a.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIContactInformation. +func (a *APIContactInformation) UnmarshalJSON(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 "email": + err = unpopulate(val, "Email", &a.Email) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &a.URL) + 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 APIContract. +func (a APIContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIContract. +func (a *APIContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APIContractProperties. +func (a APIContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiRevision", a.APIRevision) + populate(objectMap, "apiRevisionDescription", a.APIRevisionDescription) + populate(objectMap, "type", a.APIType) + populate(objectMap, "apiVersion", a.APIVersion) + populate(objectMap, "apiVersionDescription", a.APIVersionDescription) + populate(objectMap, "apiVersionSet", a.APIVersionSet) + populate(objectMap, "apiVersionSetId", a.APIVersionSetID) + populate(objectMap, "authenticationSettings", a.AuthenticationSettings) + populate(objectMap, "contact", a.Contact) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "isCurrent", a.IsCurrent) + populate(objectMap, "isOnline", a.IsOnline) + populate(objectMap, "license", a.License) + populate(objectMap, "path", a.Path) + populate(objectMap, "protocols", a.Protocols) + populate(objectMap, "serviceUrl", a.ServiceURL) + populate(objectMap, "sourceApiId", a.SourceAPIID) + populate(objectMap, "subscriptionKeyParameterNames", a.SubscriptionKeyParameterNames) + populate(objectMap, "subscriptionRequired", a.SubscriptionRequired) + populate(objectMap, "termsOfServiceUrl", a.TermsOfServiceURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIContractProperties. +func (a *APIContractProperties) UnmarshalJSON(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 "apiRevision": + err = unpopulate(val, "APIRevision", &a.APIRevision) + delete(rawMsg, key) + case "apiRevisionDescription": + err = unpopulate(val, "APIRevisionDescription", &a.APIRevisionDescription) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "APIType", &a.APIType) + delete(rawMsg, key) + case "apiVersion": + err = unpopulate(val, "APIVersion", &a.APIVersion) + delete(rawMsg, key) + case "apiVersionDescription": + err = unpopulate(val, "APIVersionDescription", &a.APIVersionDescription) + delete(rawMsg, key) + case "apiVersionSet": + err = unpopulate(val, "APIVersionSet", &a.APIVersionSet) + delete(rawMsg, key) + case "apiVersionSetId": + err = unpopulate(val, "APIVersionSetID", &a.APIVersionSetID) + delete(rawMsg, key) + case "authenticationSettings": + err = unpopulate(val, "AuthenticationSettings", &a.AuthenticationSettings) + delete(rawMsg, key) + case "contact": + err = unpopulate(val, "Contact", &a.Contact) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "isCurrent": + err = unpopulate(val, "IsCurrent", &a.IsCurrent) + delete(rawMsg, key) + case "isOnline": + err = unpopulate(val, "IsOnline", &a.IsOnline) + delete(rawMsg, key) + case "license": + err = unpopulate(val, "License", &a.License) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &a.Path) + delete(rawMsg, key) + case "protocols": + err = unpopulate(val, "Protocols", &a.Protocols) + delete(rawMsg, key) + case "serviceUrl": + err = unpopulate(val, "ServiceURL", &a.ServiceURL) + delete(rawMsg, key) + case "sourceApiId": + err = unpopulate(val, "SourceAPIID", &a.SourceAPIID) + delete(rawMsg, key) + case "subscriptionKeyParameterNames": + err = unpopulate(val, "SubscriptionKeyParameterNames", &a.SubscriptionKeyParameterNames) + delete(rawMsg, key) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &a.SubscriptionRequired) + delete(rawMsg, key) + case "termsOfServiceUrl": + err = unpopulate(val, "TermsOfServiceURL", &a.TermsOfServiceURL) + 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 APIContractUpdateProperties. +func (a APIContractUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiRevision", a.APIRevision) + populate(objectMap, "apiRevisionDescription", a.APIRevisionDescription) + populate(objectMap, "type", a.APIType) + populate(objectMap, "apiVersion", a.APIVersion) + populate(objectMap, "apiVersionDescription", a.APIVersionDescription) + populate(objectMap, "apiVersionSetId", a.APIVersionSetID) + populate(objectMap, "authenticationSettings", a.AuthenticationSettings) + populate(objectMap, "contact", a.Contact) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "isCurrent", a.IsCurrent) + populate(objectMap, "isOnline", a.IsOnline) + populate(objectMap, "license", a.License) + populate(objectMap, "path", a.Path) + populate(objectMap, "protocols", a.Protocols) + populate(objectMap, "serviceUrl", a.ServiceURL) + populate(objectMap, "subscriptionKeyParameterNames", a.SubscriptionKeyParameterNames) + populate(objectMap, "subscriptionRequired", a.SubscriptionRequired) + populate(objectMap, "termsOfServiceUrl", a.TermsOfServiceURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIContractUpdateProperties. +func (a *APIContractUpdateProperties) UnmarshalJSON(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 "apiRevision": + err = unpopulate(val, "APIRevision", &a.APIRevision) + delete(rawMsg, key) + case "apiRevisionDescription": + err = unpopulate(val, "APIRevisionDescription", &a.APIRevisionDescription) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "APIType", &a.APIType) + delete(rawMsg, key) + case "apiVersion": + err = unpopulate(val, "APIVersion", &a.APIVersion) + delete(rawMsg, key) + case "apiVersionDescription": + err = unpopulate(val, "APIVersionDescription", &a.APIVersionDescription) + delete(rawMsg, key) + case "apiVersionSetId": + err = unpopulate(val, "APIVersionSetID", &a.APIVersionSetID) + delete(rawMsg, key) + case "authenticationSettings": + err = unpopulate(val, "AuthenticationSettings", &a.AuthenticationSettings) + delete(rawMsg, key) + case "contact": + err = unpopulate(val, "Contact", &a.Contact) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "isCurrent": + err = unpopulate(val, "IsCurrent", &a.IsCurrent) + delete(rawMsg, key) + case "isOnline": + err = unpopulate(val, "IsOnline", &a.IsOnline) + delete(rawMsg, key) + case "license": + err = unpopulate(val, "License", &a.License) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &a.Path) + delete(rawMsg, key) + case "protocols": + err = unpopulate(val, "Protocols", &a.Protocols) + delete(rawMsg, key) + case "serviceUrl": + err = unpopulate(val, "ServiceURL", &a.ServiceURL) + delete(rawMsg, key) + case "subscriptionKeyParameterNames": + err = unpopulate(val, "SubscriptionKeyParameterNames", &a.SubscriptionKeyParameterNames) + delete(rawMsg, key) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &a.SubscriptionRequired) + delete(rawMsg, key) + case "termsOfServiceUrl": + err = unpopulate(val, "TermsOfServiceURL", &a.TermsOfServiceURL) + 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 APICreateOrUpdateParameter. +func (a APICreateOrUpdateParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APICreateOrUpdateParameter. +func (a *APICreateOrUpdateParameter) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 APICreateOrUpdateProperties. +func (a APICreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiRevision", a.APIRevision) + populate(objectMap, "apiRevisionDescription", a.APIRevisionDescription) + populate(objectMap, "type", a.APIType) + populate(objectMap, "apiVersion", a.APIVersion) + populate(objectMap, "apiVersionDescription", a.APIVersionDescription) + populate(objectMap, "apiVersionSet", a.APIVersionSet) + populate(objectMap, "apiVersionSetId", a.APIVersionSetID) + populate(objectMap, "authenticationSettings", a.AuthenticationSettings) + populate(objectMap, "contact", a.Contact) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "format", a.Format) + populate(objectMap, "isCurrent", a.IsCurrent) + populate(objectMap, "isOnline", a.IsOnline) + populate(objectMap, "license", a.License) + populate(objectMap, "path", a.Path) + populate(objectMap, "protocols", a.Protocols) + populate(objectMap, "serviceUrl", a.ServiceURL) + populate(objectMap, "apiType", a.SoapAPIType) + populate(objectMap, "sourceApiId", a.SourceAPIID) + populate(objectMap, "subscriptionKeyParameterNames", a.SubscriptionKeyParameterNames) + populate(objectMap, "subscriptionRequired", a.SubscriptionRequired) + populate(objectMap, "termsOfServiceUrl", a.TermsOfServiceURL) + populate(objectMap, "translateRequiredQueryParameters", a.TranslateRequiredQueryParametersConduct) + populate(objectMap, "value", a.Value) + populate(objectMap, "wsdlSelector", a.WsdlSelector) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APICreateOrUpdateProperties. +func (a *APICreateOrUpdateProperties) UnmarshalJSON(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 "apiRevision": + err = unpopulate(val, "APIRevision", &a.APIRevision) + delete(rawMsg, key) + case "apiRevisionDescription": + err = unpopulate(val, "APIRevisionDescription", &a.APIRevisionDescription) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "APIType", &a.APIType) + delete(rawMsg, key) + case "apiVersion": + err = unpopulate(val, "APIVersion", &a.APIVersion) + delete(rawMsg, key) + case "apiVersionDescription": + err = unpopulate(val, "APIVersionDescription", &a.APIVersionDescription) + delete(rawMsg, key) + case "apiVersionSet": + err = unpopulate(val, "APIVersionSet", &a.APIVersionSet) + delete(rawMsg, key) + case "apiVersionSetId": + err = unpopulate(val, "APIVersionSetID", &a.APIVersionSetID) + delete(rawMsg, key) + case "authenticationSettings": + err = unpopulate(val, "AuthenticationSettings", &a.AuthenticationSettings) + delete(rawMsg, key) + case "contact": + err = unpopulate(val, "Contact", &a.Contact) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "format": + err = unpopulate(val, "Format", &a.Format) + delete(rawMsg, key) + case "isCurrent": + err = unpopulate(val, "IsCurrent", &a.IsCurrent) + delete(rawMsg, key) + case "isOnline": + err = unpopulate(val, "IsOnline", &a.IsOnline) + delete(rawMsg, key) + case "license": + err = unpopulate(val, "License", &a.License) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &a.Path) + delete(rawMsg, key) + case "protocols": + err = unpopulate(val, "Protocols", &a.Protocols) + delete(rawMsg, key) + case "serviceUrl": + err = unpopulate(val, "ServiceURL", &a.ServiceURL) + delete(rawMsg, key) + case "apiType": + err = unpopulate(val, "SoapAPIType", &a.SoapAPIType) + delete(rawMsg, key) + case "sourceApiId": + err = unpopulate(val, "SourceAPIID", &a.SourceAPIID) + delete(rawMsg, key) + case "subscriptionKeyParameterNames": + err = unpopulate(val, "SubscriptionKeyParameterNames", &a.SubscriptionKeyParameterNames) + delete(rawMsg, key) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &a.SubscriptionRequired) + delete(rawMsg, key) + case "termsOfServiceUrl": + err = unpopulate(val, "TermsOfServiceURL", &a.TermsOfServiceURL) + delete(rawMsg, key) + case "translateRequiredQueryParameters": + err = unpopulate(val, "TranslateRequiredQueryParametersConduct", &a.TranslateRequiredQueryParametersConduct) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + case "wsdlSelector": + err = unpopulate(val, "WsdlSelector", &a.WsdlSelector) + 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 APICreateOrUpdatePropertiesWsdlSelector. +func (a APICreateOrUpdatePropertiesWsdlSelector) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "wsdlEndpointName", a.WsdlEndpointName) + populate(objectMap, "wsdlServiceName", a.WsdlServiceName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APICreateOrUpdatePropertiesWsdlSelector. +func (a *APICreateOrUpdatePropertiesWsdlSelector) UnmarshalJSON(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 "wsdlEndpointName": + err = unpopulate(val, "WsdlEndpointName", &a.WsdlEndpointName) + delete(rawMsg, key) + case "wsdlServiceName": + err = unpopulate(val, "WsdlServiceName", &a.WsdlServiceName) + 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 APIEntityBaseContract. +func (a APIEntityBaseContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiRevision", a.APIRevision) + populate(objectMap, "apiRevisionDescription", a.APIRevisionDescription) + populate(objectMap, "type", a.APIType) + populate(objectMap, "apiVersion", a.APIVersion) + populate(objectMap, "apiVersionDescription", a.APIVersionDescription) + populate(objectMap, "apiVersionSetId", a.APIVersionSetID) + populate(objectMap, "authenticationSettings", a.AuthenticationSettings) + populate(objectMap, "contact", a.Contact) + populate(objectMap, "description", a.Description) + populate(objectMap, "isCurrent", a.IsCurrent) + populate(objectMap, "isOnline", a.IsOnline) + populate(objectMap, "license", a.License) + populate(objectMap, "subscriptionKeyParameterNames", a.SubscriptionKeyParameterNames) + populate(objectMap, "subscriptionRequired", a.SubscriptionRequired) + populate(objectMap, "termsOfServiceUrl", a.TermsOfServiceURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIEntityBaseContract. +func (a *APIEntityBaseContract) UnmarshalJSON(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 "apiRevision": + err = unpopulate(val, "APIRevision", &a.APIRevision) + delete(rawMsg, key) + case "apiRevisionDescription": + err = unpopulate(val, "APIRevisionDescription", &a.APIRevisionDescription) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "APIType", &a.APIType) + delete(rawMsg, key) + case "apiVersion": + err = unpopulate(val, "APIVersion", &a.APIVersion) + delete(rawMsg, key) + case "apiVersionDescription": + err = unpopulate(val, "APIVersionDescription", &a.APIVersionDescription) + delete(rawMsg, key) + case "apiVersionSetId": + err = unpopulate(val, "APIVersionSetID", &a.APIVersionSetID) + delete(rawMsg, key) + case "authenticationSettings": + err = unpopulate(val, "AuthenticationSettings", &a.AuthenticationSettings) + delete(rawMsg, key) + case "contact": + err = unpopulate(val, "Contact", &a.Contact) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "isCurrent": + err = unpopulate(val, "IsCurrent", &a.IsCurrent) + delete(rawMsg, key) + case "isOnline": + err = unpopulate(val, "IsOnline", &a.IsOnline) + delete(rawMsg, key) + case "license": + err = unpopulate(val, "License", &a.License) + delete(rawMsg, key) + case "subscriptionKeyParameterNames": + err = unpopulate(val, "SubscriptionKeyParameterNames", &a.SubscriptionKeyParameterNames) + delete(rawMsg, key) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &a.SubscriptionRequired) + delete(rawMsg, key) + case "termsOfServiceUrl": + err = unpopulate(val, "TermsOfServiceURL", &a.TermsOfServiceURL) + 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 APIExportResult. +func (a APIExportResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "format", a.ExportResultFormat) + populate(objectMap, "id", a.ID) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIExportResult. +func (a *APIExportResult) UnmarshalJSON(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 "format": + err = unpopulate(val, "ExportResultFormat", &a.ExportResultFormat) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APIExportResultValue. +func (a APIExportResultValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "link", a.Link) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIExportResultValue. +func (a *APIExportResultValue) UnmarshalJSON(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 "link": + err = unpopulate(val, "Link", &a.Link) + 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 APILicenseInformation. +func (a APILicenseInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", a.Name) + populate(objectMap, "url", a.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APILicenseInformation. +func (a *APILicenseInformation) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &a.URL) + 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 APIReleaseCollection. +func (a APIReleaseCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", a.Count) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIReleaseCollection. +func (a *APIReleaseCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &a.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APIReleaseContract. +func (a APIReleaseContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIReleaseContract. +func (a *APIReleaseContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APIReleaseContractProperties. +func (a APIReleaseContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiId", a.APIID) + populateTimeRFC3339(objectMap, "createdDateTime", a.CreatedDateTime) + populate(objectMap, "notes", a.Notes) + populateTimeRFC3339(objectMap, "updatedDateTime", a.UpdatedDateTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIReleaseContractProperties. +func (a *APIReleaseContractProperties) UnmarshalJSON(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 "apiId": + err = unpopulate(val, "APIID", &a.APIID) + delete(rawMsg, key) + case "createdDateTime": + err = unpopulateTimeRFC3339(val, "CreatedDateTime", &a.CreatedDateTime) + delete(rawMsg, key) + case "notes": + err = unpopulate(val, "Notes", &a.Notes) + delete(rawMsg, key) + case "updatedDateTime": + err = unpopulateTimeRFC3339(val, "UpdatedDateTime", &a.UpdatedDateTime) + 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 APIRevisionCollection. +func (a APIRevisionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", a.Count) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIRevisionCollection. +func (a *APIRevisionCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &a.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APIRevisionContract. +func (a APIRevisionContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiId", a.APIID) + populate(objectMap, "apiRevision", a.APIRevision) + populateTimeRFC3339(objectMap, "createdDateTime", a.CreatedDateTime) + populate(objectMap, "description", a.Description) + populate(objectMap, "isCurrent", a.IsCurrent) + populate(objectMap, "isOnline", a.IsOnline) + populate(objectMap, "privateUrl", a.PrivateURL) + populateTimeRFC3339(objectMap, "updatedDateTime", a.UpdatedDateTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIRevisionContract. +func (a *APIRevisionContract) UnmarshalJSON(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 "apiId": + err = unpopulate(val, "APIID", &a.APIID) + delete(rawMsg, key) + case "apiRevision": + err = unpopulate(val, "APIRevision", &a.APIRevision) + delete(rawMsg, key) + case "createdDateTime": + err = unpopulateTimeRFC3339(val, "CreatedDateTime", &a.CreatedDateTime) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "isCurrent": + err = unpopulate(val, "IsCurrent", &a.IsCurrent) + delete(rawMsg, key) + case "isOnline": + err = unpopulate(val, "IsOnline", &a.IsOnline) + delete(rawMsg, key) + case "privateUrl": + err = unpopulate(val, "PrivateURL", &a.PrivateURL) + delete(rawMsg, key) + case "updatedDateTime": + err = unpopulateTimeRFC3339(val, "UpdatedDateTime", &a.UpdatedDateTime) + 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 APIRevisionInfoContract. +func (a APIRevisionInfoContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiRevisionDescription", a.APIRevisionDescription) + populate(objectMap, "apiVersionName", a.APIVersionName) + populate(objectMap, "apiVersionSet", a.APIVersionSet) + populate(objectMap, "sourceApiId", a.SourceAPIID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIRevisionInfoContract. +func (a *APIRevisionInfoContract) UnmarshalJSON(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 "apiRevisionDescription": + err = unpopulate(val, "APIRevisionDescription", &a.APIRevisionDescription) + delete(rawMsg, key) + case "apiVersionName": + err = unpopulate(val, "APIVersionName", &a.APIVersionName) + delete(rawMsg, key) + case "apiVersionSet": + err = unpopulate(val, "APIVersionSet", &a.APIVersionSet) + delete(rawMsg, key) + case "sourceApiId": + err = unpopulate(val, "SourceAPIID", &a.SourceAPIID) + 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 APITagResourceContractProperties. +func (a APITagResourceContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiRevision", a.APIRevision) + populate(objectMap, "apiRevisionDescription", a.APIRevisionDescription) + populate(objectMap, "type", a.APIType) + populate(objectMap, "apiVersion", a.APIVersion) + populate(objectMap, "apiVersionDescription", a.APIVersionDescription) + populate(objectMap, "apiVersionSetId", a.APIVersionSetID) + populate(objectMap, "authenticationSettings", a.AuthenticationSettings) + populate(objectMap, "contact", a.Contact) + populate(objectMap, "description", a.Description) + populate(objectMap, "id", a.ID) + populate(objectMap, "isCurrent", a.IsCurrent) + populate(objectMap, "isOnline", a.IsOnline) + populate(objectMap, "license", a.License) + populate(objectMap, "name", a.Name) + populate(objectMap, "path", a.Path) + populate(objectMap, "protocols", a.Protocols) + populate(objectMap, "serviceUrl", a.ServiceURL) + populate(objectMap, "subscriptionKeyParameterNames", a.SubscriptionKeyParameterNames) + populate(objectMap, "subscriptionRequired", a.SubscriptionRequired) + populate(objectMap, "termsOfServiceUrl", a.TermsOfServiceURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APITagResourceContractProperties. +func (a *APITagResourceContractProperties) UnmarshalJSON(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 "apiRevision": + err = unpopulate(val, "APIRevision", &a.APIRevision) + delete(rawMsg, key) + case "apiRevisionDescription": + err = unpopulate(val, "APIRevisionDescription", &a.APIRevisionDescription) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "APIType", &a.APIType) + delete(rawMsg, key) + case "apiVersion": + err = unpopulate(val, "APIVersion", &a.APIVersion) + delete(rawMsg, key) + case "apiVersionDescription": + err = unpopulate(val, "APIVersionDescription", &a.APIVersionDescription) + delete(rawMsg, key) + case "apiVersionSetId": + err = unpopulate(val, "APIVersionSetID", &a.APIVersionSetID) + delete(rawMsg, key) + case "authenticationSettings": + err = unpopulate(val, "AuthenticationSettings", &a.AuthenticationSettings) + delete(rawMsg, key) + case "contact": + err = unpopulate(val, "Contact", &a.Contact) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "isCurrent": + err = unpopulate(val, "IsCurrent", &a.IsCurrent) + delete(rawMsg, key) + case "isOnline": + err = unpopulate(val, "IsOnline", &a.IsOnline) + delete(rawMsg, key) + case "license": + err = unpopulate(val, "License", &a.License) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &a.Path) + delete(rawMsg, key) + case "protocols": + err = unpopulate(val, "Protocols", &a.Protocols) + delete(rawMsg, key) + case "serviceUrl": + err = unpopulate(val, "ServiceURL", &a.ServiceURL) + delete(rawMsg, key) + case "subscriptionKeyParameterNames": + err = unpopulate(val, "SubscriptionKeyParameterNames", &a.SubscriptionKeyParameterNames) + delete(rawMsg, key) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &a.SubscriptionRequired) + delete(rawMsg, key) + case "termsOfServiceUrl": + err = unpopulate(val, "TermsOfServiceURL", &a.TermsOfServiceURL) + 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 APIUpdateContract. +func (a APIUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIUpdateContract. +func (a *APIUpdateContract) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 APIVersionConstraint. +func (a APIVersionConstraint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "minApiVersion", a.MinAPIVersion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionConstraint. +func (a *APIVersionConstraint) UnmarshalJSON(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 "minApiVersion": + err = unpopulate(val, "MinAPIVersion", &a.MinAPIVersion) + 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 APIVersionSetCollection. +func (a APIVersionSetCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", a.Count) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetCollection. +func (a *APIVersionSetCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &a.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APIVersionSetContract. +func (a APIVersionSetContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetContract. +func (a *APIVersionSetContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type APIVersionSetContractDetails. +func (a APIVersionSetContractDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "versionHeaderName", a.VersionHeaderName) + populate(objectMap, "versionQueryName", a.VersionQueryName) + populate(objectMap, "versioningScheme", a.VersioningScheme) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetContractDetails. +func (a *APIVersionSetContractDetails) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "versionHeaderName": + err = unpopulate(val, "VersionHeaderName", &a.VersionHeaderName) + delete(rawMsg, key) + case "versionQueryName": + err = unpopulate(val, "VersionQueryName", &a.VersionQueryName) + delete(rawMsg, key) + case "versioningScheme": + err = unpopulate(val, "VersioningScheme", &a.VersioningScheme) + 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 APIVersionSetContractProperties. +func (a APIVersionSetContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "versionHeaderName", a.VersionHeaderName) + populate(objectMap, "versionQueryName", a.VersionQueryName) + populate(objectMap, "versioningScheme", a.VersioningScheme) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetContractProperties. +func (a *APIVersionSetContractProperties) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "versionHeaderName": + err = unpopulate(val, "VersionHeaderName", &a.VersionHeaderName) + delete(rawMsg, key) + case "versionQueryName": + err = unpopulate(val, "VersionQueryName", &a.VersionQueryName) + delete(rawMsg, key) + case "versioningScheme": + err = unpopulate(val, "VersioningScheme", &a.VersioningScheme) + 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 APIVersionSetEntityBase. +func (a APIVersionSetEntityBase) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + populate(objectMap, "versionHeaderName", a.VersionHeaderName) + populate(objectMap, "versionQueryName", a.VersionQueryName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetEntityBase. +func (a *APIVersionSetEntityBase) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "versionHeaderName": + err = unpopulate(val, "VersionHeaderName", &a.VersionHeaderName) + delete(rawMsg, key) + case "versionQueryName": + err = unpopulate(val, "VersionQueryName", &a.VersionQueryName) + 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 APIVersionSetUpdateParameters. +func (a APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetUpdateParameters. +func (a *APIVersionSetUpdateParameters) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 APIVersionSetUpdateParametersProperties. +func (a APIVersionSetUpdateParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "versionHeaderName", a.VersionHeaderName) + populate(objectMap, "versionQueryName", a.VersionQueryName) + populate(objectMap, "versioningScheme", a.VersioningScheme) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIVersionSetUpdateParametersProperties. +func (a *APIVersionSetUpdateParametersProperties) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "versionHeaderName": + err = unpopulate(val, "VersionHeaderName", &a.VersionHeaderName) + delete(rawMsg, key) + case "versionQueryName": + err = unpopulate(val, "VersionQueryName", &a.VersionQueryName) + delete(rawMsg, key) + case "versioningScheme": + err = unpopulate(val, "VersioningScheme", &a.VersioningScheme) + 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 AccessInformationCollection. +func (a AccessInformationCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", a.Count) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationCollection. +func (a *AccessInformationCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &a.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccessInformationContract. +func (a AccessInformationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationContract. +func (a *AccessInformationContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AccessInformationContractProperties. +func (a AccessInformationContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", a.Enabled) + populate(objectMap, "id", a.ID) + populate(objectMap, "principalId", a.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationContractProperties. +func (a *AccessInformationContractProperties) UnmarshalJSON(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 "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &a.PrincipalID) + 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 AccessInformationCreateParameterProperties. +func (a AccessInformationCreateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", a.Enabled) + populate(objectMap, "primaryKey", a.PrimaryKey) + populate(objectMap, "principalId", a.PrincipalID) + populate(objectMap, "secondaryKey", a.SecondaryKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationCreateParameterProperties. +func (a *AccessInformationCreateParameterProperties) UnmarshalJSON(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 "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) + delete(rawMsg, key) + case "primaryKey": + err = unpopulate(val, "PrimaryKey", &a.PrimaryKey) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &a.PrincipalID) + delete(rawMsg, key) + case "secondaryKey": + err = unpopulate(val, "SecondaryKey", &a.SecondaryKey) + 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 AccessInformationCreateParameters. +func (a AccessInformationCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationCreateParameters. +func (a *AccessInformationCreateParameters) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 AccessInformationSecretsContract. +func (a AccessInformationSecretsContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", a.Enabled) + populate(objectMap, "id", a.ID) + populate(objectMap, "primaryKey", a.PrimaryKey) + populate(objectMap, "principalId", a.PrincipalID) + populate(objectMap, "secondaryKey", a.SecondaryKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationSecretsContract. +func (a *AccessInformationSecretsContract) UnmarshalJSON(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 "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "primaryKey": + err = unpopulate(val, "PrimaryKey", &a.PrimaryKey) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &a.PrincipalID) + delete(rawMsg, key) + case "secondaryKey": + err = unpopulate(val, "SecondaryKey", &a.SecondaryKey) + 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 AccessInformationUpdateParameterProperties. +func (a AccessInformationUpdateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", a.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationUpdateParameterProperties. +func (a *AccessInformationUpdateParameterProperties) UnmarshalJSON(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 "enabled": + err = unpopulate(val, "Enabled", &a.Enabled) + 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 AccessInformationUpdateParameters. +func (a AccessInformationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", a.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AccessInformationUpdateParameters. +func (a *AccessInformationUpdateParameters) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &a.Properties) + 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 AdditionalLocation. +func (a AdditionalLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "disableGateway", a.DisableGateway) + populate(objectMap, "gatewayRegionalUrl", a.GatewayRegionalURL) + populate(objectMap, "location", a.Location) + populate(objectMap, "natGatewayState", a.NatGatewayState) + populate(objectMap, "outboundPublicIPAddresses", a.OutboundPublicIPAddresses) + populate(objectMap, "platformVersion", a.PlatformVersion) + populate(objectMap, "privateIPAddresses", a.PrivateIPAddresses) + populate(objectMap, "publicIpAddressId", a.PublicIPAddressID) + populate(objectMap, "publicIPAddresses", a.PublicIPAddresses) + populate(objectMap, "sku", a.SKU) + populate(objectMap, "virtualNetworkConfiguration", a.VirtualNetworkConfiguration) + populate(objectMap, "zones", a.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AdditionalLocation. +func (a *AdditionalLocation) UnmarshalJSON(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 "disableGateway": + err = unpopulate(val, "DisableGateway", &a.DisableGateway) + delete(rawMsg, key) + case "gatewayRegionalUrl": + err = unpopulate(val, "GatewayRegionalURL", &a.GatewayRegionalURL) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &a.Location) + delete(rawMsg, key) + case "natGatewayState": + err = unpopulate(val, "NatGatewayState", &a.NatGatewayState) + delete(rawMsg, key) + case "outboundPublicIPAddresses": + err = unpopulate(val, "OutboundPublicIPAddresses", &a.OutboundPublicIPAddresses) + delete(rawMsg, key) + case "platformVersion": + err = unpopulate(val, "PlatformVersion", &a.PlatformVersion) + delete(rawMsg, key) + case "privateIPAddresses": + err = unpopulate(val, "PrivateIPAddresses", &a.PrivateIPAddresses) + delete(rawMsg, key) + case "publicIpAddressId": + err = unpopulate(val, "PublicIPAddressID", &a.PublicIPAddressID) + delete(rawMsg, key) + case "publicIPAddresses": + err = unpopulate(val, "PublicIPAddresses", &a.PublicIPAddresses) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &a.SKU) + delete(rawMsg, key) + case "virtualNetworkConfiguration": + err = unpopulate(val, "VirtualNetworkConfiguration", &a.VirtualNetworkConfiguration) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &a.Zones) + 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 ApimResource. +func (a ApimResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApimResource. +func (a *ApimResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &a.Tags) + 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 ArmIDWrapper. +func (a ArmIDWrapper) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArmIDWrapper. +func (a *ArmIDWrapper) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AssociationContract. +func (a AssociationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssociationContract. +func (a *AssociationContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AssociationContractProperties. +func (a AssociationContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["provisioningState"] = "created" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AssociationContractProperties. +func (a *AssociationContractProperties) UnmarshalJSON(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 "provisioningState": + err = unpopulate(val, "ProvisioningState", &a.ProvisioningState) + 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 AuthenticationSettingsContract. +func (a AuthenticationSettingsContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "oAuth2", a.OAuth2) + populate(objectMap, "oAuth2AuthenticationSettings", a.OAuth2AuthenticationSettings) + populate(objectMap, "openid", a.Openid) + populate(objectMap, "openidAuthenticationSettings", a.OpenidAuthenticationSettings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthenticationSettingsContract. +func (a *AuthenticationSettingsContract) UnmarshalJSON(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 "oAuth2": + err = unpopulate(val, "OAuth2", &a.OAuth2) + delete(rawMsg, key) + case "oAuth2AuthenticationSettings": + err = unpopulate(val, "OAuth2AuthenticationSettings", &a.OAuth2AuthenticationSettings) + delete(rawMsg, key) + case "openid": + err = unpopulate(val, "Openid", &a.Openid) + delete(rawMsg, key) + case "openidAuthenticationSettings": + err = unpopulate(val, "OpenidAuthenticationSettings", &a.OpenidAuthenticationSettings) + 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 AuthorizationAccessPolicyCollection. +func (a AuthorizationAccessPolicyCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", a.Count) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationAccessPolicyCollection. +func (a *AuthorizationAccessPolicyCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &a.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationAccessPolicyContract. +func (a AuthorizationAccessPolicyContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationAccessPolicyContract. +func (a *AuthorizationAccessPolicyContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationAccessPolicyContractProperties. +func (a AuthorizationAccessPolicyContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "objectId", a.ObjectID) + populate(objectMap, "tenantId", a.TenantID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationAccessPolicyContractProperties. +func (a *AuthorizationAccessPolicyContractProperties) UnmarshalJSON(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 "objectId": + err = unpopulate(val, "ObjectID", &a.ObjectID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &a.TenantID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationCollection. +func (a AuthorizationCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", a.Count) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationCollection. +func (a *AuthorizationCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &a.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationConfirmConsentCodeRequestContract. +func (a AuthorizationConfirmConsentCodeRequestContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "consentCode", a.ConsentCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationConfirmConsentCodeRequestContract. +func (a *AuthorizationConfirmConsentCodeRequestContract) UnmarshalJSON(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 "consentCode": + err = unpopulate(val, "ConsentCode", &a.ConsentCode) + 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 AuthorizationContract. +func (a AuthorizationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationContract. +func (a *AuthorizationContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationContractProperties. +func (a AuthorizationContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationType", a.AuthorizationType) + populate(objectMap, "error", a.Error) + populate(objectMap, "oauth2grantType", a.OAuth2GrantType) + populate(objectMap, "parameters", a.Parameters) + populate(objectMap, "status", a.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationContractProperties. +func (a *AuthorizationContractProperties) UnmarshalJSON(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 "authorizationType": + err = unpopulate(val, "AuthorizationType", &a.AuthorizationType) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &a.Error) + delete(rawMsg, key) + case "oauth2grantType": + err = unpopulate(val, "OAuth2GrantType", &a.OAuth2GrantType) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &a.Parameters) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &a.Status) + 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 AuthorizationError. +func (a AuthorizationError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", a.Code) + populate(objectMap, "message", a.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationError. +func (a *AuthorizationError) UnmarshalJSON(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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationLoginRequestContract. +func (a AuthorizationLoginRequestContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "postLoginRedirectUrl", a.PostLoginRedirectURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationLoginRequestContract. +func (a *AuthorizationLoginRequestContract) UnmarshalJSON(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 "postLoginRedirectUrl": + err = unpopulate(val, "PostLoginRedirectURL", &a.PostLoginRedirectURL) + 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 AuthorizationLoginResponseContract. +func (a AuthorizationLoginResponseContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "loginLink", a.LoginLink) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationLoginResponseContract. +func (a *AuthorizationLoginResponseContract) UnmarshalJSON(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 "loginLink": + err = unpopulate(val, "LoginLink", &a.LoginLink) + 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 AuthorizationProviderCollection. +func (a AuthorizationProviderCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationProviderCollection. +func (a *AuthorizationProviderCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationProviderContract. +func (a AuthorizationProviderContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationProviderContract. +func (a *AuthorizationProviderContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationProviderContractProperties. +func (a AuthorizationProviderContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "identityProvider", a.IdentityProvider) + populate(objectMap, "oauth2", a.Oauth2) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationProviderContractProperties. +func (a *AuthorizationProviderContractProperties) UnmarshalJSON(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 "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "identityProvider": + err = unpopulate(val, "IdentityProvider", &a.IdentityProvider) + delete(rawMsg, key) + case "oauth2": + err = unpopulate(val, "Oauth2", &a.Oauth2) + 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 AuthorizationProviderOAuth2GrantTypes. +func (a AuthorizationProviderOAuth2GrantTypes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationCode", a.AuthorizationCode) + populate(objectMap, "clientCredentials", a.ClientCredentials) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationProviderOAuth2GrantTypes. +func (a *AuthorizationProviderOAuth2GrantTypes) UnmarshalJSON(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 "authorizationCode": + err = unpopulate(val, "AuthorizationCode", &a.AuthorizationCode) + delete(rawMsg, key) + case "clientCredentials": + err = unpopulate(val, "ClientCredentials", &a.ClientCredentials) + 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 AuthorizationProviderOAuth2Settings. +func (a AuthorizationProviderOAuth2Settings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "grantTypes", a.GrantTypes) + populate(objectMap, "redirectUrl", a.RedirectURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationProviderOAuth2Settings. +func (a *AuthorizationProviderOAuth2Settings) UnmarshalJSON(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 "grantTypes": + err = unpopulate(val, "GrantTypes", &a.GrantTypes) + delete(rawMsg, key) + case "redirectUrl": + err = unpopulate(val, "RedirectURL", &a.RedirectURL) + 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 AuthorizationServerCollection. +func (a AuthorizationServerCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", a.Count) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerCollection. +func (a *AuthorizationServerCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &a.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &a.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &a.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContract. +func (a AuthorizationServerContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerContract. +func (a *AuthorizationServerContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContractBaseProperties. +func (a AuthorizationServerContractBaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationMethods", a.AuthorizationMethods) + populate(objectMap, "bearerTokenSendingMethods", a.BearerTokenSendingMethods) + populate(objectMap, "clientAuthenticationMethod", a.ClientAuthenticationMethod) + populate(objectMap, "defaultScope", a.DefaultScope) + populate(objectMap, "description", a.Description) + populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) + populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) + populate(objectMap, "supportState", a.SupportState) + populate(objectMap, "tokenBodyParameters", a.TokenBodyParameters) + populate(objectMap, "tokenEndpoint", a.TokenEndpoint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerContractBaseProperties. +func (a *AuthorizationServerContractBaseProperties) UnmarshalJSON(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 "authorizationMethods": + err = unpopulate(val, "AuthorizationMethods", &a.AuthorizationMethods) + delete(rawMsg, key) + case "bearerTokenSendingMethods": + err = unpopulate(val, "BearerTokenSendingMethods", &a.BearerTokenSendingMethods) + delete(rawMsg, key) + case "clientAuthenticationMethod": + err = unpopulate(val, "ClientAuthenticationMethod", &a.ClientAuthenticationMethod) + delete(rawMsg, key) + case "defaultScope": + err = unpopulate(val, "DefaultScope", &a.DefaultScope) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "resourceOwnerPassword": + err = unpopulate(val, "ResourceOwnerPassword", &a.ResourceOwnerPassword) + delete(rawMsg, key) + case "resourceOwnerUsername": + err = unpopulate(val, "ResourceOwnerUsername", &a.ResourceOwnerUsername) + delete(rawMsg, key) + case "supportState": + err = unpopulate(val, "SupportState", &a.SupportState) + delete(rawMsg, key) + case "tokenBodyParameters": + err = unpopulate(val, "TokenBodyParameters", &a.TokenBodyParameters) + delete(rawMsg, key) + case "tokenEndpoint": + err = unpopulate(val, "TokenEndpoint", &a.TokenEndpoint) + 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 AuthorizationServerContractProperties. +func (a AuthorizationServerContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationEndpoint", a.AuthorizationEndpoint) + populate(objectMap, "authorizationMethods", a.AuthorizationMethods) + populate(objectMap, "bearerTokenSendingMethods", a.BearerTokenSendingMethods) + populate(objectMap, "clientAuthenticationMethod", a.ClientAuthenticationMethod) + populate(objectMap, "clientId", a.ClientID) + populate(objectMap, "clientRegistrationEndpoint", a.ClientRegistrationEndpoint) + populate(objectMap, "clientSecret", a.ClientSecret) + populate(objectMap, "defaultScope", a.DefaultScope) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "grantTypes", a.GrantTypes) + populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) + populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) + populate(objectMap, "supportState", a.SupportState) + populate(objectMap, "tokenBodyParameters", a.TokenBodyParameters) + populate(objectMap, "tokenEndpoint", a.TokenEndpoint) + populate(objectMap, "useInApiDocumentation", a.UseInAPIDocumentation) + populate(objectMap, "useInTestConsole", a.UseInTestConsole) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerContractProperties. +func (a *AuthorizationServerContractProperties) UnmarshalJSON(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 "authorizationEndpoint": + err = unpopulate(val, "AuthorizationEndpoint", &a.AuthorizationEndpoint) + delete(rawMsg, key) + case "authorizationMethods": + err = unpopulate(val, "AuthorizationMethods", &a.AuthorizationMethods) + delete(rawMsg, key) + case "bearerTokenSendingMethods": + err = unpopulate(val, "BearerTokenSendingMethods", &a.BearerTokenSendingMethods) + delete(rawMsg, key) + case "clientAuthenticationMethod": + err = unpopulate(val, "ClientAuthenticationMethod", &a.ClientAuthenticationMethod) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &a.ClientID) + delete(rawMsg, key) + case "clientRegistrationEndpoint": + err = unpopulate(val, "ClientRegistrationEndpoint", &a.ClientRegistrationEndpoint) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &a.ClientSecret) + delete(rawMsg, key) + case "defaultScope": + err = unpopulate(val, "DefaultScope", &a.DefaultScope) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "grantTypes": + err = unpopulate(val, "GrantTypes", &a.GrantTypes) + delete(rawMsg, key) + case "resourceOwnerPassword": + err = unpopulate(val, "ResourceOwnerPassword", &a.ResourceOwnerPassword) + delete(rawMsg, key) + case "resourceOwnerUsername": + err = unpopulate(val, "ResourceOwnerUsername", &a.ResourceOwnerUsername) + delete(rawMsg, key) + case "supportState": + err = unpopulate(val, "SupportState", &a.SupportState) + delete(rawMsg, key) + case "tokenBodyParameters": + err = unpopulate(val, "TokenBodyParameters", &a.TokenBodyParameters) + delete(rawMsg, key) + case "tokenEndpoint": + err = unpopulate(val, "TokenEndpoint", &a.TokenEndpoint) + delete(rawMsg, key) + case "useInApiDocumentation": + err = unpopulate(val, "UseInAPIDocumentation", &a.UseInAPIDocumentation) + delete(rawMsg, key) + case "useInTestConsole": + err = unpopulate(val, "UseInTestConsole", &a.UseInTestConsole) + 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 AuthorizationServerSecretsContract. +func (a AuthorizationServerSecretsContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientSecret", a.ClientSecret) + populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) + populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerSecretsContract. +func (a *AuthorizationServerSecretsContract) UnmarshalJSON(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 "clientSecret": + err = unpopulate(val, "ClientSecret", &a.ClientSecret) + delete(rawMsg, key) + case "resourceOwnerPassword": + err = unpopulate(val, "ResourceOwnerPassword", &a.ResourceOwnerPassword) + delete(rawMsg, key) + case "resourceOwnerUsername": + err = unpopulate(val, "ResourceOwnerUsername", &a.ResourceOwnerUsername) + 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 AuthorizationServerUpdateContract. +func (a AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerUpdateContract. +func (a *AuthorizationServerUpdateContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &a.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &a.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &a.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &a.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", a, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerUpdateContractProperties. +func (a AuthorizationServerUpdateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationEndpoint", a.AuthorizationEndpoint) + populate(objectMap, "authorizationMethods", a.AuthorizationMethods) + populate(objectMap, "bearerTokenSendingMethods", a.BearerTokenSendingMethods) + populate(objectMap, "clientAuthenticationMethod", a.ClientAuthenticationMethod) + populate(objectMap, "clientId", a.ClientID) + populate(objectMap, "clientRegistrationEndpoint", a.ClientRegistrationEndpoint) + populate(objectMap, "clientSecret", a.ClientSecret) + populate(objectMap, "defaultScope", a.DefaultScope) + populate(objectMap, "description", a.Description) + populate(objectMap, "displayName", a.DisplayName) + populate(objectMap, "grantTypes", a.GrantTypes) + populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) + populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) + populate(objectMap, "supportState", a.SupportState) + populate(objectMap, "tokenBodyParameters", a.TokenBodyParameters) + populate(objectMap, "tokenEndpoint", a.TokenEndpoint) + populate(objectMap, "useInApiDocumentation", a.UseInAPIDocumentation) + populate(objectMap, "useInTestConsole", a.UseInTestConsole) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type AuthorizationServerUpdateContractProperties. +func (a *AuthorizationServerUpdateContractProperties) UnmarshalJSON(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 "authorizationEndpoint": + err = unpopulate(val, "AuthorizationEndpoint", &a.AuthorizationEndpoint) + delete(rawMsg, key) + case "authorizationMethods": + err = unpopulate(val, "AuthorizationMethods", &a.AuthorizationMethods) + delete(rawMsg, key) + case "bearerTokenSendingMethods": + err = unpopulate(val, "BearerTokenSendingMethods", &a.BearerTokenSendingMethods) + delete(rawMsg, key) + case "clientAuthenticationMethod": + err = unpopulate(val, "ClientAuthenticationMethod", &a.ClientAuthenticationMethod) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &a.ClientID) + delete(rawMsg, key) + case "clientRegistrationEndpoint": + err = unpopulate(val, "ClientRegistrationEndpoint", &a.ClientRegistrationEndpoint) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &a.ClientSecret) + delete(rawMsg, key) + case "defaultScope": + err = unpopulate(val, "DefaultScope", &a.DefaultScope) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &a.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &a.DisplayName) + delete(rawMsg, key) + case "grantTypes": + err = unpopulate(val, "GrantTypes", &a.GrantTypes) + delete(rawMsg, key) + case "resourceOwnerPassword": + err = unpopulate(val, "ResourceOwnerPassword", &a.ResourceOwnerPassword) + delete(rawMsg, key) + case "resourceOwnerUsername": + err = unpopulate(val, "ResourceOwnerUsername", &a.ResourceOwnerUsername) + delete(rawMsg, key) + case "supportState": + err = unpopulate(val, "SupportState", &a.SupportState) + delete(rawMsg, key) + case "tokenBodyParameters": + err = unpopulate(val, "TokenBodyParameters", &a.TokenBodyParameters) + delete(rawMsg, key) + case "tokenEndpoint": + err = unpopulate(val, "TokenEndpoint", &a.TokenEndpoint) + delete(rawMsg, key) + case "useInApiDocumentation": + err = unpopulate(val, "UseInAPIDocumentation", &a.UseInAPIDocumentation) + delete(rawMsg, key) + case "useInTestConsole": + err = unpopulate(val, "UseInTestConsole", &a.UseInTestConsole) + 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 BackendAuthorizationHeaderCredentials. +func (b BackendAuthorizationHeaderCredentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "parameter", b.Parameter) + populate(objectMap, "scheme", b.Scheme) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendAuthorizationHeaderCredentials. +func (b *BackendAuthorizationHeaderCredentials) UnmarshalJSON(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 "parameter": + err = unpopulate(val, "Parameter", &b.Parameter) + delete(rawMsg, key) + case "scheme": + err = unpopulate(val, "Scheme", &b.Scheme) + 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 BackendBaseParameters. +func (b BackendBaseParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "credentials", b.Credentials) + populate(objectMap, "description", b.Description) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "proxy", b.Proxy) + populate(objectMap, "resourceId", b.ResourceID) + populate(objectMap, "tls", b.TLS) + populate(objectMap, "title", b.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendBaseParameters. +func (b *BackendBaseParameters) UnmarshalJSON(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 "credentials": + err = unpopulate(val, "Credentials", &b.Credentials) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &b.Description) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "proxy": + err = unpopulate(val, "Proxy", &b.Proxy) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &b.ResourceID) + delete(rawMsg, key) + case "tls": + err = unpopulate(val, "TLS", &b.TLS) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &b.Title) + 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 BackendCollection. +func (b BackendCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", b.Count) + populate(objectMap, "nextLink", b.NextLink) + populate(objectMap, "value", b.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendCollection. +func (b *BackendCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &b.Count) + delete(rawMsg, 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 BackendContract. +func (b BackendContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendContract. +func (b *BackendContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendContractProperties. +func (b BackendContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "credentials", b.Credentials) + populate(objectMap, "description", b.Description) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "protocol", b.Protocol) + populate(objectMap, "proxy", b.Proxy) + populate(objectMap, "resourceId", b.ResourceID) + populate(objectMap, "tls", b.TLS) + populate(objectMap, "title", b.Title) + populate(objectMap, "url", b.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendContractProperties. +func (b *BackendContractProperties) UnmarshalJSON(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 "credentials": + err = unpopulate(val, "Credentials", &b.Credentials) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &b.Description) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &b.Protocol) + delete(rawMsg, key) + case "proxy": + err = unpopulate(val, "Proxy", &b.Proxy) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &b.ResourceID) + delete(rawMsg, key) + case "tls": + err = unpopulate(val, "TLS", &b.TLS) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &b.Title) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &b.URL) + 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 BackendCredentialsContract. +func (b BackendCredentialsContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorization", b.Authorization) + populate(objectMap, "certificate", b.Certificate) + populate(objectMap, "certificateIds", b.CertificateIDs) + populate(objectMap, "header", b.Header) + populate(objectMap, "query", b.Query) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendCredentialsContract. +func (b *BackendCredentialsContract) UnmarshalJSON(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 "authorization": + err = unpopulate(val, "Authorization", &b.Authorization) + delete(rawMsg, key) + case "certificate": + err = unpopulate(val, "Certificate", &b.Certificate) + delete(rawMsg, key) + case "certificateIds": + err = unpopulate(val, "CertificateIDs", &b.CertificateIDs) + delete(rawMsg, key) + case "header": + err = unpopulate(val, "Header", &b.Header) + delete(rawMsg, key) + case "query": + err = unpopulate(val, "Query", &b.Query) + 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 BackendProperties. +func (b BackendProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "serviceFabricCluster", b.ServiceFabricCluster) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendProperties. +func (b *BackendProperties) UnmarshalJSON(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 "serviceFabricCluster": + err = unpopulate(val, "ServiceFabricCluster", &b.ServiceFabricCluster) + 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 BackendProxyContract. +func (b BackendProxyContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "password", b.Password) + populate(objectMap, "url", b.URL) + populate(objectMap, "username", b.Username) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendProxyContract. +func (b *BackendProxyContract) UnmarshalJSON(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 "password": + err = unpopulate(val, "Password", &b.Password) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &b.URL) + delete(rawMsg, key) + case "username": + err = unpopulate(val, "Username", &b.Username) + 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 BackendReconnectContract. +func (b BackendReconnectContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", b.ID) + populate(objectMap, "name", b.Name) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "type", b.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendReconnectContract. +func (b *BackendReconnectContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &b.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &b.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &b.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", b, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type BackendReconnectProperties. +func (b BackendReconnectProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "after", b.After) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendReconnectProperties. +func (b *BackendReconnectProperties) UnmarshalJSON(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 "after": + err = unpopulate(val, "After", &b.After) + 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 BackendServiceFabricClusterProperties. +func (b BackendServiceFabricClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientCertificateId", b.ClientCertificateID) + populate(objectMap, "clientCertificatethumbprint", b.ClientCertificatethumbprint) + populate(objectMap, "managementEndpoints", b.ManagementEndpoints) + populate(objectMap, "maxPartitionResolutionRetries", b.MaxPartitionResolutionRetries) + populate(objectMap, "serverCertificateThumbprints", b.ServerCertificateThumbprints) + populate(objectMap, "serverX509Names", b.ServerX509Names) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendServiceFabricClusterProperties. +func (b *BackendServiceFabricClusterProperties) UnmarshalJSON(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 "clientCertificateId": + err = unpopulate(val, "ClientCertificateID", &b.ClientCertificateID) + delete(rawMsg, key) + case "clientCertificatethumbprint": + err = unpopulate(val, "ClientCertificatethumbprint", &b.ClientCertificatethumbprint) + delete(rawMsg, key) + case "managementEndpoints": + err = unpopulate(val, "ManagementEndpoints", &b.ManagementEndpoints) + delete(rawMsg, key) + case "maxPartitionResolutionRetries": + err = unpopulate(val, "MaxPartitionResolutionRetries", &b.MaxPartitionResolutionRetries) + delete(rawMsg, key) + case "serverCertificateThumbprints": + err = unpopulate(val, "ServerCertificateThumbprints", &b.ServerCertificateThumbprints) + delete(rawMsg, key) + case "serverX509Names": + err = unpopulate(val, "ServerX509Names", &b.ServerX509Names) + 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 BackendTLSProperties. +func (b BackendTLSProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "validateCertificateChain", b.ValidateCertificateChain) + populate(objectMap, "validateCertificateName", b.ValidateCertificateName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendTLSProperties. +func (b *BackendTLSProperties) UnmarshalJSON(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 "validateCertificateChain": + err = unpopulate(val, "ValidateCertificateChain", &b.ValidateCertificateChain) + delete(rawMsg, key) + case "validateCertificateName": + err = unpopulate(val, "ValidateCertificateName", &b.ValidateCertificateName) + 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 BackendUpdateParameterProperties. +func (b BackendUpdateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "credentials", b.Credentials) + populate(objectMap, "description", b.Description) + populate(objectMap, "properties", b.Properties) + populate(objectMap, "protocol", b.Protocol) + populate(objectMap, "proxy", b.Proxy) + populate(objectMap, "resourceId", b.ResourceID) + populate(objectMap, "tls", b.TLS) + populate(objectMap, "title", b.Title) + populate(objectMap, "url", b.URL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendUpdateParameterProperties. +func (b *BackendUpdateParameterProperties) UnmarshalJSON(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 "credentials": + err = unpopulate(val, "Credentials", &b.Credentials) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &b.Description) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &b.Properties) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &b.Protocol) + delete(rawMsg, key) + case "proxy": + err = unpopulate(val, "Proxy", &b.Proxy) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &b.ResourceID) + delete(rawMsg, key) + case "tls": + err = unpopulate(val, "TLS", &b.TLS) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &b.Title) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &b.URL) + 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 BackendUpdateParameters. +func (b BackendUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", b.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BackendUpdateParameters. +func (b *BackendUpdateParameters) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &b.Properties) + 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 BodyDiagnosticSettings. +func (b BodyDiagnosticSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bytes", b.Bytes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type BodyDiagnosticSettings. +func (b *BodyDiagnosticSettings) UnmarshalJSON(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 "bytes": + err = unpopulate(val, "Bytes", &b.Bytes) + 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 CacheCollection. +func (c CacheCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", c.Count) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheCollection. +func (c *CacheCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &c.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheContract. +func (c CacheContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheContract. +func (c *CacheContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheContractProperties. +func (c CacheContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionString", c.ConnectionString) + populate(objectMap, "description", c.Description) + populate(objectMap, "resourceId", c.ResourceID) + populate(objectMap, "useFromLocation", c.UseFromLocation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheContractProperties. +func (c *CacheContractProperties) UnmarshalJSON(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 "connectionString": + err = unpopulate(val, "ConnectionString", &c.ConnectionString) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + delete(rawMsg, key) + case "useFromLocation": + err = unpopulate(val, "UseFromLocation", &c.UseFromLocation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheUpdateParameters. +func (c CacheUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheUpdateParameters. +func (c *CacheUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CacheUpdateProperties. +func (c CacheUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectionString", c.ConnectionString) + populate(objectMap, "description", c.Description) + populate(objectMap, "resourceId", c.ResourceID) + populate(objectMap, "useFromLocation", c.UseFromLocation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CacheUpdateProperties. +func (c *CacheUpdateProperties) UnmarshalJSON(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 "connectionString": + err = unpopulate(val, "ConnectionString", &c.ConnectionString) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &c.Description) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + delete(rawMsg, key) + case "useFromLocation": + err = unpopulate(val, "UseFromLocation", &c.UseFromLocation) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateCollection. +func (c CertificateCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", c.Count) + populate(objectMap, "nextLink", c.NextLink) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCollection. +func (c *CertificateCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &c.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateConfiguration. +func (c CertificateConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificate", c.Certificate) + populate(objectMap, "certificatePassword", c.CertificatePassword) + populate(objectMap, "encodedCertificate", c.EncodedCertificate) + populate(objectMap, "storeName", c.StoreName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateConfiguration. +func (c *CertificateConfiguration) UnmarshalJSON(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 "certificate": + err = unpopulate(val, "Certificate", &c.Certificate) + delete(rawMsg, key) + case "certificatePassword": + err = unpopulate(val, "CertificatePassword", &c.CertificatePassword) + delete(rawMsg, key) + case "encodedCertificate": + err = unpopulate(val, "EncodedCertificate", &c.EncodedCertificate) + delete(rawMsg, key) + case "storeName": + err = unpopulate(val, "StoreName", &c.StoreName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateContract. +func (c CertificateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateContract. +func (c *CertificateContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateContractProperties. +func (c CertificateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "expirationDate", c.ExpirationDate) + populate(objectMap, "keyVault", c.KeyVault) + populate(objectMap, "subject", c.Subject) + populate(objectMap, "thumbprint", c.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateContractProperties. +func (c *CertificateContractProperties) UnmarshalJSON(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 "expirationDate": + err = unpopulateTimeRFC3339(val, "ExpirationDate", &c.ExpirationDate) + delete(rawMsg, key) + case "keyVault": + err = unpopulate(val, "KeyVault", &c.KeyVault) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &c.Subject) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateCreateOrUpdateParameters. +func (c CertificateCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", c.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCreateOrUpdateParameters. +func (c *CertificateCreateOrUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateCreateOrUpdateProperties. +func (c CertificateCreateOrUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "data", c.Data) + populate(objectMap, "keyVault", c.KeyVault) + populate(objectMap, "password", c.Password) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateCreateOrUpdateProperties. +func (c *CertificateCreateOrUpdateProperties) UnmarshalJSON(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 "data": + err = unpopulate(val, "Data", &c.Data) + delete(rawMsg, key) + case "keyVault": + err = unpopulate(val, "KeyVault", &c.KeyVault) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &c.Password) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateInformation. +func (c CertificateInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "expiry", c.Expiry) + populate(objectMap, "subject", c.Subject) + populate(objectMap, "thumbprint", c.Thumbprint) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateInformation. +func (c *CertificateInformation) UnmarshalJSON(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 "expiry": + err = unpopulateTimeRFC3339(val, "Expiry", &c.Expiry) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &c.Subject) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, "Thumbprint", &c.Thumbprint) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ClientSecretContract. +func (c ClientSecretContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientSecret", c.ClientSecret) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ClientSecretContract. +func (c *ClientSecretContract) UnmarshalJSON(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 "clientSecret": + err = unpopulate(val, "ClientSecret", &c.ClientSecret) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequest. +func (c ConnectivityCheckRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "destination", c.Destination) + populate(objectMap, "preferredIPVersion", c.PreferredIPVersion) + populate(objectMap, "protocol", c.Protocol) + populate(objectMap, "protocolConfiguration", c.ProtocolConfiguration) + populate(objectMap, "source", c.Source) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequest. +func (c *ConnectivityCheckRequest) UnmarshalJSON(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 "destination": + err = unpopulate(val, "Destination", &c.Destination) + delete(rawMsg, key) + case "preferredIPVersion": + err = unpopulate(val, "PreferredIPVersion", &c.PreferredIPVersion) + delete(rawMsg, key) + case "protocol": + err = unpopulate(val, "Protocol", &c.Protocol) + delete(rawMsg, key) + case "protocolConfiguration": + err = unpopulate(val, "ProtocolConfiguration", &c.ProtocolConfiguration) + delete(rawMsg, key) + case "source": + err = unpopulate(val, "Source", &c.Source) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestDestination. +func (c ConnectivityCheckRequestDestination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", c.Address) + populate(objectMap, "port", c.Port) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestDestination. +func (c *ConnectivityCheckRequestDestination) UnmarshalJSON(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 "address": + err = unpopulate(val, "Address", &c.Address) + delete(rawMsg, key) + case "port": + err = unpopulate(val, "Port", &c.Port) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestProtocolConfiguration. +func (c ConnectivityCheckRequestProtocolConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "HTTPConfiguration", c.HTTPConfiguration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestProtocolConfiguration. +func (c *ConnectivityCheckRequestProtocolConfiguration) UnmarshalJSON(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 "HTTPConfiguration": + err = unpopulate(val, "HTTPConfiguration", &c.HTTPConfiguration) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration. +func (c ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "headers", c.Headers) + populate(objectMap, "method", c.Method) + populate(objectMap, "validStatusCodes", c.ValidStatusCodes) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration. +func (c *ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration) UnmarshalJSON(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 "headers": + err = unpopulate(val, "Headers", &c.Headers) + delete(rawMsg, key) + case "method": + err = unpopulate(val, "Method", &c.Method) + delete(rawMsg, key) + case "validStatusCodes": + err = unpopulate(val, "ValidStatusCodes", &c.ValidStatusCodes) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestSource. +func (c ConnectivityCheckRequestSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "instance", c.Instance) + populate(objectMap, "region", c.Region) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckRequestSource. +func (c *ConnectivityCheckRequestSource) UnmarshalJSON(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 "instance": + err = unpopulate(val, "Instance", &c.Instance) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &c.Region) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckResponse. +func (c ConnectivityCheckResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "avgLatencyInMs", c.AvgLatencyInMs) + populate(objectMap, "connectionStatus", c.ConnectionStatus) + populate(objectMap, "hops", c.Hops) + populate(objectMap, "maxLatencyInMs", c.MaxLatencyInMs) + populate(objectMap, "minLatencyInMs", c.MinLatencyInMs) + populate(objectMap, "probesFailed", c.ProbesFailed) + populate(objectMap, "probesSent", c.ProbesSent) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityCheckResponse. +func (c *ConnectivityCheckResponse) UnmarshalJSON(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 "avgLatencyInMs": + err = unpopulate(val, "AvgLatencyInMs", &c.AvgLatencyInMs) + delete(rawMsg, key) + case "connectionStatus": + err = unpopulate(val, "ConnectionStatus", &c.ConnectionStatus) + delete(rawMsg, key) + case "hops": + err = unpopulate(val, "Hops", &c.Hops) + delete(rawMsg, key) + case "maxLatencyInMs": + err = unpopulate(val, "MaxLatencyInMs", &c.MaxLatencyInMs) + delete(rawMsg, key) + case "minLatencyInMs": + err = unpopulate(val, "MinLatencyInMs", &c.MinLatencyInMs) + delete(rawMsg, key) + case "probesFailed": + err = unpopulate(val, "ProbesFailed", &c.ProbesFailed) + delete(rawMsg, key) + case "probesSent": + err = unpopulate(val, "ProbesSent", &c.ProbesSent) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityHop. +func (c ConnectivityHop) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "address", c.Address) + populate(objectMap, "id", c.ID) + populate(objectMap, "issues", c.Issues) + populate(objectMap, "nextHopIds", c.NextHopIDs) + populate(objectMap, "resourceId", c.ResourceID) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityHop. +func (c *ConnectivityHop) UnmarshalJSON(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 "address": + err = unpopulate(val, "Address", &c.Address) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "issues": + err = unpopulate(val, "Issues", &c.Issues) + delete(rawMsg, key) + case "nextHopIds": + err = unpopulate(val, "NextHopIDs", &c.NextHopIDs) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &c.ResourceID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityIssue. +func (c ConnectivityIssue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "context", c.Context) + populate(objectMap, "origin", c.Origin) + populate(objectMap, "severity", c.Severity) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityIssue. +func (c *ConnectivityIssue) UnmarshalJSON(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 "context": + err = unpopulate(val, "Context", &c.Context) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &c.Origin) + delete(rawMsg, key) + case "severity": + err = unpopulate(val, "Severity", &c.Severity) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ConnectivityStatusContract. +func (c ConnectivityStatusContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", c.Error) + populate(objectMap, "isOptional", c.IsOptional) + populateTimeRFC3339(objectMap, "lastStatusChange", c.LastStatusChange) + populateTimeRFC3339(objectMap, "lastUpdated", c.LastUpdated) + populate(objectMap, "name", c.Name) + populate(objectMap, "resourceType", c.ResourceType) + populate(objectMap, "status", c.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityStatusContract. +func (c *ConnectivityStatusContract) UnmarshalJSON(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 "error": + err = unpopulate(val, "Error", &c.Error) + delete(rawMsg, key) + case "isOptional": + err = unpopulate(val, "IsOptional", &c.IsOptional) + delete(rawMsg, key) + case "lastStatusChange": + err = unpopulateTimeRFC3339(val, "LastStatusChange", &c.LastStatusChange) + delete(rawMsg, key) + case "lastUpdated": + err = unpopulateTimeRFC3339(val, "LastUpdated", &c.LastUpdated) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &c.ResourceType) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &c.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContentItemCollection. +func (c ContentItemCollection) 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 ContentItemCollection. +func (c *ContentItemCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContentItemContract. +func (c ContentItemContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContentItemContract. +func (c *ContentItemContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContentTypeCollection. +func (c ContentTypeCollection) 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 ContentTypeCollection. +func (c *ContentTypeCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &c.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &c.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContentTypeContract. +func (c ContentTypeContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "type", c.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContentTypeContract. +func (c *ContentTypeContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &c.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &c.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ContentTypeContractProperties. +func (c ContentTypeContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", c.Description) + populate(objectMap, "id", c.ID) + populate(objectMap, "name", c.Name) + populate(objectMap, "schema", &c.Schema) + populate(objectMap, "version", c.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ContentTypeContractProperties. +func (c *ContentTypeContractProperties) UnmarshalJSON(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 "id": + err = unpopulate(val, "ID", &c.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &c.Name) + delete(rawMsg, key) + case "schema": + err = unpopulate(val, "Schema", &c.Schema) + delete(rawMsg, key) + case "version": + err = unpopulate(val, "Version", &c.Version) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DataMasking. +func (d DataMasking) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "headers", d.Headers) + populate(objectMap, "queryParams", d.QueryParams) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataMasking. +func (d *DataMasking) UnmarshalJSON(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 "headers": + err = unpopulate(val, "Headers", &d.Headers) + delete(rawMsg, key) + case "queryParams": + err = unpopulate(val, "QueryParams", &d.QueryParams) + 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 DataMaskingEntity. +func (d DataMaskingEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "mode", d.Mode) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DataMaskingEntity. +func (d *DataMaskingEntity) UnmarshalJSON(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 "mode": + err = unpopulate(val, "Mode", &d.Mode) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedServiceContract. +func (d DeletedServiceContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "location", d.Location) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServiceContract. +func (d *DeletedServiceContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &d.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeletedServiceContractProperties. +func (d DeletedServiceContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "deletionDate", d.DeletionDate) + populateTimeRFC3339(objectMap, "scheduledPurgeDate", d.ScheduledPurgeDate) + populate(objectMap, "serviceId", d.ServiceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServiceContractProperties. +func (d *DeletedServiceContractProperties) UnmarshalJSON(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 "deletionDate": + err = unpopulateTimeRFC3339(val, "DeletionDate", &d.DeletionDate) + delete(rawMsg, key) + case "scheduledPurgeDate": + err = unpopulateTimeRFC3339(val, "ScheduledPurgeDate", &d.ScheduledPurgeDate) + delete(rawMsg, key) + case "serviceId": + err = unpopulate(val, "ServiceID", &d.ServiceID) + 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 DeletedServicesCollection. +func (d DeletedServicesCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServicesCollection. +func (d *DeletedServicesCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DeployConfigurationParameterProperties. +func (d DeployConfigurationParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "branch", d.Branch) + populate(objectMap, "force", d.Force) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeployConfigurationParameterProperties. +func (d *DeployConfigurationParameterProperties) UnmarshalJSON(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 "branch": + err = unpopulate(val, "Branch", &d.Branch) + delete(rawMsg, key) + case "force": + err = unpopulate(val, "Force", &d.Force) + 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 DeployConfigurationParameters. +func (d DeployConfigurationParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DeployConfigurationParameters. +func (d *DeployConfigurationParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticCollection. +func (d DiagnosticCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", d.Count) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticCollection. +func (d *DiagnosticCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &d.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticContract. +func (d DiagnosticContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticContract. +func (d *DiagnosticContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DiagnosticContractProperties. +func (d DiagnosticContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "alwaysLog", d.AlwaysLog) + populate(objectMap, "backend", d.Backend) + populate(objectMap, "frontend", d.Frontend) + populate(objectMap, "httpCorrelationProtocol", d.HTTPCorrelationProtocol) + populate(objectMap, "logClientIp", d.LogClientIP) + populate(objectMap, "loggerId", d.LoggerID) + populate(objectMap, "metrics", d.Metrics) + populate(objectMap, "operationNameFormat", d.OperationNameFormat) + populate(objectMap, "sampling", d.Sampling) + populate(objectMap, "verbosity", d.Verbosity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DiagnosticContractProperties. +func (d *DiagnosticContractProperties) UnmarshalJSON(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 "alwaysLog": + err = unpopulate(val, "AlwaysLog", &d.AlwaysLog) + delete(rawMsg, key) + case "backend": + err = unpopulate(val, "Backend", &d.Backend) + delete(rawMsg, key) + case "frontend": + err = unpopulate(val, "Frontend", &d.Frontend) + delete(rawMsg, key) + case "httpCorrelationProtocol": + err = unpopulate(val, "HTTPCorrelationProtocol", &d.HTTPCorrelationProtocol) + delete(rawMsg, key) + case "logClientIp": + err = unpopulate(val, "LogClientIP", &d.LogClientIP) + delete(rawMsg, key) + case "loggerId": + err = unpopulate(val, "LoggerID", &d.LoggerID) + delete(rawMsg, key) + case "metrics": + err = unpopulate(val, "Metrics", &d.Metrics) + delete(rawMsg, key) + case "operationNameFormat": + err = unpopulate(val, "OperationNameFormat", &d.OperationNameFormat) + delete(rawMsg, key) + case "sampling": + err = unpopulate(val, "Sampling", &d.Sampling) + delete(rawMsg, key) + case "verbosity": + err = unpopulate(val, "Verbosity", &d.Verbosity) + 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 DocumentationCollection. +func (d DocumentationCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentationCollection. +func (d *DocumentationCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &d.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &d.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DocumentationContract. +func (d DocumentationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", d.ID) + populate(objectMap, "name", d.Name) + populate(objectMap, "properties", d.Properties) + populate(objectMap, "type", d.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentationContract. +func (d *DocumentationContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &d.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &d.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &d.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DocumentationContractProperties. +func (d DocumentationContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "content", d.Content) + populate(objectMap, "title", d.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentationContractProperties. +func (d *DocumentationContractProperties) UnmarshalJSON(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 "content": + err = unpopulate(val, "Content", &d.Content) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &d.Title) + 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 DocumentationUpdateContract. +func (d DocumentationUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", d.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DocumentationUpdateContract. +func (d *DocumentationUpdateContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &d.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EmailTemplateCollection. +func (e EmailTemplateCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", e.Count) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateCollection. +func (e *EmailTemplateCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &e.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &e.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &e.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EmailTemplateContract. +func (e EmailTemplateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", e.ID) + populate(objectMap, "name", e.Name) + populate(objectMap, "properties", e.Properties) + populate(objectMap, "type", e.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateContract. +func (e *EmailTemplateContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &e.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &e.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EmailTemplateContractProperties. +func (e EmailTemplateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "body", e.Body) + populate(objectMap, "description", e.Description) + populate(objectMap, "isDefault", e.IsDefault) + populate(objectMap, "parameters", e.Parameters) + populate(objectMap, "subject", e.Subject) + populate(objectMap, "title", e.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateContractProperties. +func (e *EmailTemplateContractProperties) UnmarshalJSON(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 "body": + err = unpopulate(val, "Body", &e.Body) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &e.Description) + delete(rawMsg, key) + case "isDefault": + err = unpopulate(val, "IsDefault", &e.IsDefault) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &e.Parameters) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &e.Subject) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &e.Title) + 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 EmailTemplateParametersContractProperties. +func (e EmailTemplateParametersContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", e.Description) + populate(objectMap, "name", e.Name) + populate(objectMap, "title", e.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateParametersContractProperties. +func (e *EmailTemplateParametersContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &e.Description) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &e.Name) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &e.Title) + 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 EmailTemplateUpdateParameterProperties. +func (e EmailTemplateUpdateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "body", e.Body) + populate(objectMap, "description", e.Description) + populate(objectMap, "parameters", e.Parameters) + populate(objectMap, "subject", e.Subject) + populate(objectMap, "title", e.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateUpdateParameterProperties. +func (e *EmailTemplateUpdateParameterProperties) UnmarshalJSON(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 "body": + err = unpopulate(val, "Body", &e.Body) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &e.Description) + delete(rawMsg, key) + case "parameters": + err = unpopulate(val, "Parameters", &e.Parameters) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, "Subject", &e.Subject) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &e.Title) + 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 EmailTemplateUpdateParameters. +func (e EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", e.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EmailTemplateUpdateParameters. +func (e *EmailTemplateUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &e.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointDependency. +func (e EndpointDependency) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "domainName", e.DomainName) + populate(objectMap, "endpointDetails", e.EndpointDetails) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDependency. +func (e *EndpointDependency) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "domainName": + err = unpopulate(val, "DomainName", &e.DomainName) + delete(rawMsg, key) + case "endpointDetails": + err = unpopulate(val, "EndpointDetails", &e.EndpointDetails) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type EndpointDetail. +func (e EndpointDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "port", e.Port) + populate(objectMap, "region", e.Region) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type EndpointDetail. +func (e *EndpointDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "port": + err = unpopulate(val, "Port", &e.Port) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &e.Region) + 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 ErrorFieldContract. +func (e ErrorFieldContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorFieldContract. +func (e *ErrorFieldContract) UnmarshalJSON(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 "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponseBody. +func (e ErrorResponseBody) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponseBody. +func (e *ErrorResponseBody) UnmarshalJSON(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 "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + 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 GatewayCertificateAuthorityCollection. +func (g GatewayCertificateAuthorityCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCertificateAuthorityCollection. +func (g *GatewayCertificateAuthorityCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayCertificateAuthorityContract. +func (g GatewayCertificateAuthorityContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCertificateAuthorityContract. +func (g *GatewayCertificateAuthorityContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayCertificateAuthorityContractProperties. +func (g GatewayCertificateAuthorityContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isTrusted", g.IsTrusted) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCertificateAuthorityContractProperties. +func (g *GatewayCertificateAuthorityContractProperties) UnmarshalJSON(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 "isTrusted": + err = unpopulate(val, "IsTrusted", &g.IsTrusted) + 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 GatewayCollection. +func (g GatewayCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", g.Count) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayCollection. +func (g *GatewayCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &g.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayContract. +func (g GatewayContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayContract. +func (g *GatewayContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayContractProperties. +func (g GatewayContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", g.Description) + populate(objectMap, "locationData", g.LocationData) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayContractProperties. +func (g *GatewayContractProperties) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "locationData": + err = unpopulate(val, "LocationData", &g.LocationData) + 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 GatewayHostnameConfigurationCollection. +func (g GatewayHostnameConfigurationCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostnameConfigurationCollection. +func (g *GatewayHostnameConfigurationCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayHostnameConfigurationContract. +func (g GatewayHostnameConfigurationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostnameConfigurationContract. +func (g *GatewayHostnameConfigurationContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayHostnameConfigurationContractProperties. +func (g GatewayHostnameConfigurationContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificateId", g.CertificateID) + populate(objectMap, "http2Enabled", g.HTTP2Enabled) + populate(objectMap, "hostname", g.Hostname) + populate(objectMap, "negotiateClientCertificate", g.NegotiateClientCertificate) + populate(objectMap, "tls10Enabled", g.Tls10Enabled) + populate(objectMap, "tls11Enabled", g.Tls11Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayHostnameConfigurationContractProperties. +func (g *GatewayHostnameConfigurationContractProperties) UnmarshalJSON(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 "certificateId": + err = unpopulate(val, "CertificateID", &g.CertificateID) + delete(rawMsg, key) + case "http2Enabled": + err = unpopulate(val, "HTTP2Enabled", &g.HTTP2Enabled) + delete(rawMsg, key) + case "hostname": + err = unpopulate(val, "Hostname", &g.Hostname) + delete(rawMsg, key) + case "negotiateClientCertificate": + err = unpopulate(val, "NegotiateClientCertificate", &g.NegotiateClientCertificate) + delete(rawMsg, key) + case "tls10Enabled": + err = unpopulate(val, "Tls10Enabled", &g.Tls10Enabled) + delete(rawMsg, key) + case "tls11Enabled": + err = unpopulate(val, "Tls11Enabled", &g.Tls11Enabled) + 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 GatewayKeyRegenerationRequestContract. +func (g GatewayKeyRegenerationRequestContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "keyType", g.KeyType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayKeyRegenerationRequestContract. +func (g *GatewayKeyRegenerationRequestContract) UnmarshalJSON(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 "keyType": + err = unpopulate(val, "KeyType", &g.KeyType) + 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 GatewayKeysContract. +func (g GatewayKeysContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "primary", g.Primary) + populate(objectMap, "secondary", g.Secondary) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayKeysContract. +func (g *GatewayKeysContract) UnmarshalJSON(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 "primary": + err = unpopulate(val, "Primary", &g.Primary) + delete(rawMsg, key) + case "secondary": + err = unpopulate(val, "Secondary", &g.Secondary) + 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 GatewayTokenContract. +func (g GatewayTokenContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayTokenContract. +func (g *GatewayTokenContract) UnmarshalJSON(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 "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GatewayTokenRequestContract. +func (g GatewayTokenRequestContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "expiry", g.Expiry) + populate(objectMap, "keyType", g.KeyType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayTokenRequestContract. +func (g *GatewayTokenRequestContract) UnmarshalJSON(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 "expiry": + err = unpopulateTimeRFC3339(val, "Expiry", &g.Expiry) + delete(rawMsg, key) + case "keyType": + err = unpopulate(val, "KeyType", &g.KeyType) + 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 GenerateSsoURLResult. +func (g GenerateSsoURLResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GenerateSsoURLResult. +func (g *GenerateSsoURLResult) UnmarshalJSON(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 "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GlobalSchemaCollection. +func (g GlobalSchemaCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", g.Count) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalSchemaCollection. +func (g *GlobalSchemaCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &g.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GlobalSchemaContract. +func (g GlobalSchemaContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalSchemaContract. +func (g *GlobalSchemaContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GlobalSchemaContractProperties. +func (g GlobalSchemaContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", g.Description) + populate(objectMap, "document", &g.Document) + populate(objectMap, "schemaType", g.SchemaType) + populate(objectMap, "value", &g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GlobalSchemaContractProperties. +func (g *GlobalSchemaContractProperties) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "document": + err = unpopulate(val, "Document", &g.Document) + delete(rawMsg, key) + case "schemaType": + err = unpopulate(val, "SchemaType", &g.SchemaType) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupCollection. +func (g GroupCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", g.Count) + populate(objectMap, "nextLink", g.NextLink) + populate(objectMap, "value", g.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupCollection. +func (g *GroupCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &g.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &g.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &g.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupContract. +func (g GroupContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", g.ID) + populate(objectMap, "name", g.Name) + populate(objectMap, "properties", g.Properties) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupContract. +func (g *GroupContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &g.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &g.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &g.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupContractProperties. +func (g GroupContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "builtIn", g.BuiltIn) + populate(objectMap, "description", g.Description) + populate(objectMap, "displayName", g.DisplayName) + populate(objectMap, "externalId", g.ExternalID) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupContractProperties. +func (g *GroupContractProperties) UnmarshalJSON(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 "builtIn": + err = unpopulate(val, "BuiltIn", &g.BuiltIn) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &g.DisplayName) + delete(rawMsg, key) + case "externalId": + err = unpopulate(val, "ExternalID", &g.ExternalID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupCreateParameters. +func (g GroupCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", g.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupCreateParameters. +func (g *GroupCreateParameters) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &g.Properties) + 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 GroupCreateParametersProperties. +func (g GroupCreateParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", g.Description) + populate(objectMap, "displayName", g.DisplayName) + populate(objectMap, "externalId", g.ExternalID) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupCreateParametersProperties. +func (g *GroupCreateParametersProperties) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &g.DisplayName) + delete(rawMsg, key) + case "externalId": + err = unpopulate(val, "ExternalID", &g.ExternalID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupUpdateParameters. +func (g GroupUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", g.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupUpdateParameters. +func (g *GroupUpdateParameters) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &g.Properties) + 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 GroupUpdateParametersProperties. +func (g GroupUpdateParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", g.Description) + populate(objectMap, "displayName", g.DisplayName) + populate(objectMap, "externalId", g.ExternalID) + populate(objectMap, "type", g.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type GroupUpdateParametersProperties. +func (g *GroupUpdateParametersProperties) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &g.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &g.DisplayName) + delete(rawMsg, key) + case "externalId": + err = unpopulate(val, "ExternalID", &g.ExternalID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &g.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", g, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HTTPHeader. +func (h HTTPHeader) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", h.Name) + populate(objectMap, "value", h.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPHeader. +func (h *HTTPHeader) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &h.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &h.Value) + 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 HTTPMessageDiagnostic. +func (h HTTPMessageDiagnostic) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "body", h.Body) + populate(objectMap, "dataMasking", h.DataMasking) + populate(objectMap, "headers", h.Headers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HTTPMessageDiagnostic. +func (h *HTTPMessageDiagnostic) UnmarshalJSON(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 "body": + err = unpopulate(val, "Body", &h.Body) + delete(rawMsg, key) + case "dataMasking": + err = unpopulate(val, "DataMasking", &h.DataMasking) + delete(rawMsg, key) + case "headers": + err = unpopulate(val, "Headers", &h.Headers) + 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 HostnameConfiguration. +func (h HostnameConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "certificate", h.Certificate) + populate(objectMap, "certificatePassword", h.CertificatePassword) + populate(objectMap, "certificateSource", h.CertificateSource) + populate(objectMap, "certificateStatus", h.CertificateStatus) + populate(objectMap, "defaultSslBinding", h.DefaultSSLBinding) + populate(objectMap, "encodedCertificate", h.EncodedCertificate) + populate(objectMap, "hostName", h.HostName) + populate(objectMap, "identityClientId", h.IdentityClientID) + populate(objectMap, "keyVaultId", h.KeyVaultID) + populate(objectMap, "negotiateClientCertificate", h.NegotiateClientCertificate) + populate(objectMap, "type", h.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HostnameConfiguration. +func (h *HostnameConfiguration) UnmarshalJSON(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 "certificate": + err = unpopulate(val, "Certificate", &h.Certificate) + delete(rawMsg, key) + case "certificatePassword": + err = unpopulate(val, "CertificatePassword", &h.CertificatePassword) + delete(rawMsg, key) + case "certificateSource": + err = unpopulate(val, "CertificateSource", &h.CertificateSource) + delete(rawMsg, key) + case "certificateStatus": + err = unpopulate(val, "CertificateStatus", &h.CertificateStatus) + delete(rawMsg, key) + case "defaultSslBinding": + err = unpopulate(val, "DefaultSSLBinding", &h.DefaultSSLBinding) + delete(rawMsg, key) + case "encodedCertificate": + err = unpopulate(val, "EncodedCertificate", &h.EncodedCertificate) + delete(rawMsg, key) + case "hostName": + err = unpopulate(val, "HostName", &h.HostName) + delete(rawMsg, key) + case "identityClientId": + err = unpopulate(val, "IdentityClientID", &h.IdentityClientID) + delete(rawMsg, key) + case "keyVaultId": + err = unpopulate(val, "KeyVaultID", &h.KeyVaultID) + delete(rawMsg, key) + case "negotiateClientCertificate": + err = unpopulate(val, "NegotiateClientCertificate", &h.NegotiateClientCertificate) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &h.Type) + 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 IdentityProviderBaseParameters. +func (i IdentityProviderBaseParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedTenants", i.AllowedTenants) + populate(objectMap, "authority", i.Authority) + populate(objectMap, "clientLibrary", i.ClientLibrary) + populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) + populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) + populate(objectMap, "signinPolicyName", i.SigninPolicyName) + populate(objectMap, "signinTenant", i.SigninTenant) + populate(objectMap, "signupPolicyName", i.SignupPolicyName) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderBaseParameters. +func (i *IdentityProviderBaseParameters) UnmarshalJSON(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 "allowedTenants": + err = unpopulate(val, "AllowedTenants", &i.AllowedTenants) + delete(rawMsg, key) + case "authority": + err = unpopulate(val, "Authority", &i.Authority) + delete(rawMsg, key) + case "clientLibrary": + err = unpopulate(val, "ClientLibrary", &i.ClientLibrary) + delete(rawMsg, key) + case "passwordResetPolicyName": + err = unpopulate(val, "PasswordResetPolicyName", &i.PasswordResetPolicyName) + delete(rawMsg, key) + case "profileEditingPolicyName": + err = unpopulate(val, "ProfileEditingPolicyName", &i.ProfileEditingPolicyName) + delete(rawMsg, key) + case "signinPolicyName": + err = unpopulate(val, "SigninPolicyName", &i.SigninPolicyName) + delete(rawMsg, key) + case "signinTenant": + err = unpopulate(val, "SigninTenant", &i.SigninTenant) + delete(rawMsg, key) + case "signupPolicyName": + err = unpopulate(val, "SignupPolicyName", &i.SignupPolicyName) + 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 IdentityProviderContract. +func (i IdentityProviderContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderContract. +func (i *IdentityProviderContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IdentityProviderContractProperties. +func (i IdentityProviderContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedTenants", i.AllowedTenants) + populate(objectMap, "authority", i.Authority) + populate(objectMap, "clientId", i.ClientID) + populate(objectMap, "clientLibrary", i.ClientLibrary) + populate(objectMap, "clientSecret", i.ClientSecret) + populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) + populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) + populate(objectMap, "signinPolicyName", i.SigninPolicyName) + populate(objectMap, "signinTenant", i.SigninTenant) + populate(objectMap, "signupPolicyName", i.SignupPolicyName) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderContractProperties. +func (i *IdentityProviderContractProperties) UnmarshalJSON(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 "allowedTenants": + err = unpopulate(val, "AllowedTenants", &i.AllowedTenants) + delete(rawMsg, key) + case "authority": + err = unpopulate(val, "Authority", &i.Authority) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &i.ClientID) + delete(rawMsg, key) + case "clientLibrary": + err = unpopulate(val, "ClientLibrary", &i.ClientLibrary) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &i.ClientSecret) + delete(rawMsg, key) + case "passwordResetPolicyName": + err = unpopulate(val, "PasswordResetPolicyName", &i.PasswordResetPolicyName) + delete(rawMsg, key) + case "profileEditingPolicyName": + err = unpopulate(val, "ProfileEditingPolicyName", &i.ProfileEditingPolicyName) + delete(rawMsg, key) + case "signinPolicyName": + err = unpopulate(val, "SigninPolicyName", &i.SigninPolicyName) + delete(rawMsg, key) + case "signinTenant": + err = unpopulate(val, "SigninTenant", &i.SigninTenant) + delete(rawMsg, key) + case "signupPolicyName": + err = unpopulate(val, "SignupPolicyName", &i.SignupPolicyName) + 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 IdentityProviderCreateContract. +func (i IdentityProviderCreateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderCreateContract. +func (i *IdentityProviderCreateContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IdentityProviderCreateContractProperties. +func (i IdentityProviderCreateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedTenants", i.AllowedTenants) + populate(objectMap, "authority", i.Authority) + populate(objectMap, "clientId", i.ClientID) + populate(objectMap, "clientLibrary", i.ClientLibrary) + populate(objectMap, "clientSecret", i.ClientSecret) + populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) + populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) + populate(objectMap, "signinPolicyName", i.SigninPolicyName) + populate(objectMap, "signinTenant", i.SigninTenant) + populate(objectMap, "signupPolicyName", i.SignupPolicyName) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderCreateContractProperties. +func (i *IdentityProviderCreateContractProperties) UnmarshalJSON(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 "allowedTenants": + err = unpopulate(val, "AllowedTenants", &i.AllowedTenants) + delete(rawMsg, key) + case "authority": + err = unpopulate(val, "Authority", &i.Authority) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &i.ClientID) + delete(rawMsg, key) + case "clientLibrary": + err = unpopulate(val, "ClientLibrary", &i.ClientLibrary) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &i.ClientSecret) + delete(rawMsg, key) + case "passwordResetPolicyName": + err = unpopulate(val, "PasswordResetPolicyName", &i.PasswordResetPolicyName) + delete(rawMsg, key) + case "profileEditingPolicyName": + err = unpopulate(val, "ProfileEditingPolicyName", &i.ProfileEditingPolicyName) + delete(rawMsg, key) + case "signinPolicyName": + err = unpopulate(val, "SigninPolicyName", &i.SigninPolicyName) + delete(rawMsg, key) + case "signinTenant": + err = unpopulate(val, "SigninTenant", &i.SigninTenant) + delete(rawMsg, key) + case "signupPolicyName": + err = unpopulate(val, "SignupPolicyName", &i.SignupPolicyName) + 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 IdentityProviderList. +func (i IdentityProviderList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", i.Count) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderList. +func (i *IdentityProviderList) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &i.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IdentityProviderUpdateParameters. +func (i IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", i.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderUpdateParameters. +func (i *IdentityProviderUpdateParameters) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &i.Properties) + 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 IdentityProviderUpdateProperties. +func (i IdentityProviderUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedTenants", i.AllowedTenants) + populate(objectMap, "authority", i.Authority) + populate(objectMap, "clientId", i.ClientID) + populate(objectMap, "clientLibrary", i.ClientLibrary) + populate(objectMap, "clientSecret", i.ClientSecret) + populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) + populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) + populate(objectMap, "signinPolicyName", i.SigninPolicyName) + populate(objectMap, "signinTenant", i.SigninTenant) + populate(objectMap, "signupPolicyName", i.SignupPolicyName) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IdentityProviderUpdateProperties. +func (i *IdentityProviderUpdateProperties) UnmarshalJSON(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 "allowedTenants": + err = unpopulate(val, "AllowedTenants", &i.AllowedTenants) + delete(rawMsg, key) + case "authority": + err = unpopulate(val, "Authority", &i.Authority) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &i.ClientID) + delete(rawMsg, key) + case "clientLibrary": + err = unpopulate(val, "ClientLibrary", &i.ClientLibrary) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &i.ClientSecret) + delete(rawMsg, key) + case "passwordResetPolicyName": + err = unpopulate(val, "PasswordResetPolicyName", &i.PasswordResetPolicyName) + delete(rawMsg, key) + case "profileEditingPolicyName": + err = unpopulate(val, "ProfileEditingPolicyName", &i.ProfileEditingPolicyName) + delete(rawMsg, key) + case "signinPolicyName": + err = unpopulate(val, "SigninPolicyName", &i.SigninPolicyName) + delete(rawMsg, key) + case "signinTenant": + err = unpopulate(val, "SigninTenant", &i.SigninTenant) + delete(rawMsg, key) + case "signupPolicyName": + err = unpopulate(val, "SignupPolicyName", &i.SignupPolicyName) + 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 IssueAttachmentCollection. +func (i IssueAttachmentCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", i.Count) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueAttachmentCollection. +func (i *IssueAttachmentCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &i.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IssueAttachmentContract. +func (i IssueAttachmentContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueAttachmentContract. +func (i *IssueAttachmentContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IssueAttachmentContractProperties. +func (i IssueAttachmentContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "content", i.Content) + populate(objectMap, "contentFormat", i.ContentFormat) + populate(objectMap, "title", i.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueAttachmentContractProperties. +func (i *IssueAttachmentContractProperties) UnmarshalJSON(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 "content": + err = unpopulate(val, "Content", &i.Content) + delete(rawMsg, key) + case "contentFormat": + err = unpopulate(val, "ContentFormat", &i.ContentFormat) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &i.Title) + 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 IssueCollection. +func (i IssueCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", i.Count) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCollection. +func (i *IssueCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &i.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IssueCommentCollection. +func (i IssueCommentCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", i.Count) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentCollection. +func (i *IssueCommentCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &i.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &i.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &i.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IssueCommentContract. +func (i IssueCommentContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentContract. +func (i *IssueCommentContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IssueCommentContractProperties. +func (i IssueCommentContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) + populate(objectMap, "text", i.Text) + populate(objectMap, "userId", i.UserID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentContractProperties. +func (i *IssueCommentContractProperties) UnmarshalJSON(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 "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) + delete(rawMsg, key) + case "text": + err = unpopulate(val, "Text", &i.Text) + delete(rawMsg, key) + case "userId": + err = unpopulate(val, "UserID", &i.UserID) + 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 IssueContract. +func (i IssueContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", i.ID) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueContract. +func (i *IssueContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &i.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &i.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &i.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &i.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", i, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type IssueContractBaseProperties. +func (i IssueContractBaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiId", i.APIID) + populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) + populate(objectMap, "state", i.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueContractBaseProperties. +func (i *IssueContractBaseProperties) UnmarshalJSON(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 "apiId": + err = unpopulate(val, "APIID", &i.APIID) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &i.State) + 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 IssueContractProperties. +func (i IssueContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiId", i.APIID) + populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) + populate(objectMap, "description", i.Description) + populate(objectMap, "state", i.State) + populate(objectMap, "title", i.Title) + populate(objectMap, "userId", i.UserID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueContractProperties. +func (i *IssueContractProperties) UnmarshalJSON(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 "apiId": + err = unpopulate(val, "APIID", &i.APIID) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &i.Description) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &i.State) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &i.Title) + delete(rawMsg, key) + case "userId": + err = unpopulate(val, "UserID", &i.UserID) + 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 IssueUpdateContract. +func (i IssueUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", i.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueUpdateContract. +func (i *IssueUpdateContract) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &i.Properties) + 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 IssueUpdateContractProperties. +func (i IssueUpdateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiId", i.APIID) + populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) + populate(objectMap, "description", i.Description) + populate(objectMap, "state", i.State) + populate(objectMap, "title", i.Title) + populate(objectMap, "userId", i.UserID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type IssueUpdateContractProperties. +func (i *IssueUpdateContractProperties) UnmarshalJSON(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 "apiId": + err = unpopulate(val, "APIID", &i.APIID) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &i.Description) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &i.State) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &i.Title) + delete(rawMsg, key) + case "userId": + err = unpopulate(val, "UserID", &i.UserID) + 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 KeyVaultContractCreateProperties. +func (k KeyVaultContractCreateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identityClientId", k.IdentityClientID) + populate(objectMap, "secretIdentifier", k.SecretIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultContractCreateProperties. +func (k *KeyVaultContractCreateProperties) UnmarshalJSON(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 "identityClientId": + err = unpopulate(val, "IdentityClientID", &k.IdentityClientID) + delete(rawMsg, key) + case "secretIdentifier": + err = unpopulate(val, "SecretIdentifier", &k.SecretIdentifier) + 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 KeyVaultContractProperties. +func (k KeyVaultContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identityClientId", k.IdentityClientID) + populate(objectMap, "lastStatus", k.LastStatus) + populate(objectMap, "secretIdentifier", k.SecretIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultContractProperties. +func (k *KeyVaultContractProperties) UnmarshalJSON(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 "identityClientId": + err = unpopulate(val, "IdentityClientID", &k.IdentityClientID) + delete(rawMsg, key) + case "lastStatus": + err = unpopulate(val, "LastStatus", &k.LastStatus) + delete(rawMsg, key) + case "secretIdentifier": + err = unpopulate(val, "SecretIdentifier", &k.SecretIdentifier) + 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 KeyVaultLastAccessStatusContractProperties. +func (k KeyVaultLastAccessStatusContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "code", k.Code) + populate(objectMap, "message", k.Message) + populateTimeRFC3339(objectMap, "timeStampUtc", k.TimeStampUTC) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultLastAccessStatusContractProperties. +func (k *KeyVaultLastAccessStatusContractProperties) UnmarshalJSON(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 "code": + err = unpopulate(val, "Code", &k.Code) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &k.Message) + delete(rawMsg, key) + case "timeStampUtc": + err = unpopulateTimeRFC3339(val, "TimeStampUTC", &k.TimeStampUTC) + 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 LoggerCollection. +func (l LoggerCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", l.Count) + populate(objectMap, "nextLink", l.NextLink) + populate(objectMap, "value", l.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerCollection. +func (l *LoggerCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &l.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &l.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &l.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LoggerContract. +func (l LoggerContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", l.ID) + populate(objectMap, "name", l.Name) + populate(objectMap, "properties", l.Properties) + populate(objectMap, "type", l.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerContract. +func (l *LoggerContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &l.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &l.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &l.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &l.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", l, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type LoggerContractProperties. +func (l LoggerContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "credentials", l.Credentials) + populate(objectMap, "description", l.Description) + populate(objectMap, "isBuffered", l.IsBuffered) + populate(objectMap, "loggerType", l.LoggerType) + populate(objectMap, "resourceId", l.ResourceID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerContractProperties. +func (l *LoggerContractProperties) UnmarshalJSON(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 "credentials": + err = unpopulate(val, "Credentials", &l.Credentials) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "isBuffered": + err = unpopulate(val, "IsBuffered", &l.IsBuffered) + delete(rawMsg, key) + case "loggerType": + err = unpopulate(val, "LoggerType", &l.LoggerType) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, "ResourceID", &l.ResourceID) + 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 LoggerUpdateContract. +func (l LoggerUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", l.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerUpdateContract. +func (l *LoggerUpdateContract) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &l.Properties) + 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 LoggerUpdateParameters. +func (l LoggerUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "credentials", l.Credentials) + populate(objectMap, "description", l.Description) + populate(objectMap, "isBuffered", l.IsBuffered) + populate(objectMap, "loggerType", l.LoggerType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type LoggerUpdateParameters. +func (l *LoggerUpdateParameters) UnmarshalJSON(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 "credentials": + err = unpopulate(val, "Credentials", &l.Credentials) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &l.Description) + delete(rawMsg, key) + case "isBuffered": + err = unpopulate(val, "IsBuffered", &l.IsBuffered) + delete(rawMsg, key) + case "loggerType": + err = unpopulate(val, "LoggerType", &l.LoggerType) + 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 NamedValueCollection. +func (n NamedValueCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", n.Count) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueCollection. +func (n *NamedValueCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &n.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NamedValueContract. +func (n NamedValueContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueContract. +func (n *NamedValueContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NamedValueContractProperties. +func (n NamedValueContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", n.DisplayName) + populate(objectMap, "keyVault", n.KeyVault) + populate(objectMap, "secret", n.Secret) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueContractProperties. +func (n *NamedValueContractProperties) UnmarshalJSON(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 "displayName": + err = unpopulate(val, "DisplayName", &n.DisplayName) + delete(rawMsg, key) + case "keyVault": + err = unpopulate(val, "KeyVault", &n.KeyVault) + delete(rawMsg, key) + case "secret": + err = unpopulate(val, "Secret", &n.Secret) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + 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 NamedValueCreateContract. +func (n NamedValueCreateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueCreateContract. +func (n *NamedValueCreateContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NamedValueCreateContractProperties. +func (n NamedValueCreateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", n.DisplayName) + populate(objectMap, "keyVault", n.KeyVault) + populate(objectMap, "secret", n.Secret) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueCreateContractProperties. +func (n *NamedValueCreateContractProperties) UnmarshalJSON(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 "displayName": + err = unpopulate(val, "DisplayName", &n.DisplayName) + delete(rawMsg, key) + case "keyVault": + err = unpopulate(val, "KeyVault", &n.KeyVault) + delete(rawMsg, key) + case "secret": + err = unpopulate(val, "Secret", &n.Secret) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + 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 NamedValueEntityBaseParameters. +func (n NamedValueEntityBaseParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "secret", n.Secret) + populate(objectMap, "tags", n.Tags) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueEntityBaseParameters. +func (n *NamedValueEntityBaseParameters) UnmarshalJSON(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 "secret": + err = unpopulate(val, "Secret", &n.Secret) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + 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 NamedValueSecretContract. +func (n NamedValueSecretContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueSecretContract. +func (n *NamedValueSecretContract) UnmarshalJSON(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 "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 NamedValueUpdateParameterProperties. +func (n NamedValueUpdateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", n.DisplayName) + populate(objectMap, "keyVault", n.KeyVault) + populate(objectMap, "secret", n.Secret) + populate(objectMap, "tags", n.Tags) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueUpdateParameterProperties. +func (n *NamedValueUpdateParameterProperties) UnmarshalJSON(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 "displayName": + err = unpopulate(val, "DisplayName", &n.DisplayName) + delete(rawMsg, key) + case "keyVault": + err = unpopulate(val, "KeyVault", &n.KeyVault) + delete(rawMsg, key) + case "secret": + err = unpopulate(val, "Secret", &n.Secret) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &n.Tags) + 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 NamedValueUpdateParameters. +func (n NamedValueUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", n.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NamedValueUpdateParameters. +func (n *NamedValueUpdateParameters) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &n.Properties) + 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 NetworkStatusContract. +func (n NetworkStatusContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "connectivityStatus", n.ConnectivityStatus) + populate(objectMap, "dnsServers", n.DNSServers) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkStatusContract. +func (n *NetworkStatusContract) UnmarshalJSON(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 "connectivityStatus": + err = unpopulate(val, "ConnectivityStatus", &n.ConnectivityStatus) + delete(rawMsg, key) + case "dnsServers": + err = unpopulate(val, "DNSServers", &n.DNSServers) + 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 NetworkStatusContractByLocation. +func (n NetworkStatusContractByLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", n.Location) + populate(objectMap, "networkStatus", n.NetworkStatus) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NetworkStatusContractByLocation. +func (n *NetworkStatusContractByLocation) UnmarshalJSON(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 "location": + err = unpopulate(val, "Location", &n.Location) + delete(rawMsg, key) + case "networkStatus": + err = unpopulate(val, "NetworkStatus", &n.NetworkStatus) + 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 NotificationCollection. +func (n NotificationCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", n.Count) + populate(objectMap, "nextLink", n.NextLink) + populate(objectMap, "value", n.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationCollection. +func (n *NotificationCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &n.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &n.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &n.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NotificationContract. +func (n NotificationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", n.ID) + populate(objectMap, "name", n.Name) + populate(objectMap, "properties", n.Properties) + populate(objectMap, "type", n.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationContract. +func (n *NotificationContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &n.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &n.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &n.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &n.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", n, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type NotificationContractProperties. +func (n NotificationContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", n.Description) + populate(objectMap, "recipients", n.Recipients) + populate(objectMap, "title", n.Title) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type NotificationContractProperties. +func (n *NotificationContractProperties) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &n.Description) + delete(rawMsg, key) + case "recipients": + err = unpopulate(val, "Recipients", &n.Recipients) + delete(rawMsg, key) + case "title": + err = unpopulate(val, "Title", &n.Title) + 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 OAuth2AuthenticationSettingsContract. +func (o OAuth2AuthenticationSettingsContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "authorizationServerId", o.AuthorizationServerID) + populate(objectMap, "scope", o.Scope) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OAuth2AuthenticationSettingsContract. +func (o *OAuth2AuthenticationSettingsContract) UnmarshalJSON(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 "authorizationServerId": + err = unpopulate(val, "AuthorizationServerID", &o.AuthorizationServerID) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &o.Scope) + 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 OpenIDAuthenticationSettingsContract. +func (o OpenIDAuthenticationSettingsContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "bearerTokenSendingMethods", o.BearerTokenSendingMethods) + populate(objectMap, "openidProviderId", o.OpenidProviderID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDAuthenticationSettingsContract. +func (o *OpenIDAuthenticationSettingsContract) UnmarshalJSON(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 "bearerTokenSendingMethods": + err = unpopulate(val, "BearerTokenSendingMethods", &o.BearerTokenSendingMethods) + delete(rawMsg, key) + case "openidProviderId": + err = unpopulate(val, "OpenidProviderID", &o.OpenidProviderID) + 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 OpenIDConnectProviderCollection. +func (o OpenIDConnectProviderCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", o.Count) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenIDConnectProviderCollection. +func (o *OpenIDConnectProviderCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &o.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderContract. +func (o OpenidConnectProviderContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderContract. +func (o *OpenidConnectProviderContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderContractProperties. +func (o OpenidConnectProviderContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", o.ClientID) + populate(objectMap, "clientSecret", o.ClientSecret) + populate(objectMap, "description", o.Description) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "metadataEndpoint", o.MetadataEndpoint) + populate(objectMap, "useInApiDocumentation", o.UseInAPIDocumentation) + populate(objectMap, "useInTestConsole", o.UseInTestConsole) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderContractProperties. +func (o *OpenidConnectProviderContractProperties) UnmarshalJSON(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 "clientId": + err = unpopulate(val, "ClientID", &o.ClientID) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &o.ClientSecret) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) + delete(rawMsg, key) + case "metadataEndpoint": + err = unpopulate(val, "MetadataEndpoint", &o.MetadataEndpoint) + delete(rawMsg, key) + case "useInApiDocumentation": + err = unpopulate(val, "UseInAPIDocumentation", &o.UseInAPIDocumentation) + delete(rawMsg, key) + case "useInTestConsole": + err = unpopulate(val, "UseInTestConsole", &o.UseInTestConsole) + 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 OpenidConnectProviderUpdateContract. +func (o OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderUpdateContract. +func (o *OpenidConnectProviderUpdateContract) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderUpdateContractProperties. +func (o OpenidConnectProviderUpdateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", o.ClientID) + populate(objectMap, "clientSecret", o.ClientSecret) + populate(objectMap, "description", o.Description) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "metadataEndpoint", o.MetadataEndpoint) + populate(objectMap, "useInApiDocumentation", o.UseInAPIDocumentation) + populate(objectMap, "useInTestConsole", o.UseInTestConsole) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OpenidConnectProviderUpdateContractProperties. +func (o *OpenidConnectProviderUpdateContractProperties) UnmarshalJSON(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 "clientId": + err = unpopulate(val, "ClientID", &o.ClientID) + delete(rawMsg, key) + case "clientSecret": + err = unpopulate(val, "ClientSecret", &o.ClientSecret) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) + delete(rawMsg, key) + case "metadataEndpoint": + err = unpopulate(val, "MetadataEndpoint", &o.MetadataEndpoint) + delete(rawMsg, key) + case "useInApiDocumentation": + err = unpopulate(val, "UseInAPIDocumentation", &o.UseInAPIDocumentation) + delete(rawMsg, key) + case "useInTestConsole": + err = unpopulate(val, "UseInTestConsole", &o.UseInTestConsole) + 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 Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "display", o.Display) + populate(objectMap, "name", o.Name) + populate(objectMap, "origin", o.Origin) + populate(objectMap, "properties", &o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Operation. +func (o *Operation) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "display": + err = unpopulate(val, "Display", &o.Display) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "origin": + err = unpopulate(val, "Origin", &o.Origin) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationCollection. +func (o OperationCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", o.Count) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationCollection. +func (o *OperationCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &o.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationContract. +func (o OperationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationContract. +func (o *OperationContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationContractProperties. +func (o OperationContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "method", o.Method) + populate(objectMap, "policies", o.Policies) + populate(objectMap, "request", o.Request) + populate(objectMap, "responses", o.Responses) + populate(objectMap, "templateParameters", o.TemplateParameters) + populate(objectMap, "urlTemplate", o.URLTemplate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationContractProperties. +func (o *OperationContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) + delete(rawMsg, key) + case "method": + err = unpopulate(val, "Method", &o.Method) + delete(rawMsg, key) + case "policies": + err = unpopulate(val, "Policies", &o.Policies) + delete(rawMsg, key) + case "request": + err = unpopulate(val, "Request", &o.Request) + delete(rawMsg, key) + case "responses": + err = unpopulate(val, "Responses", &o.Responses) + delete(rawMsg, key) + case "templateParameters": + err = unpopulate(val, "TemplateParameters", &o.TemplateParameters) + delete(rawMsg, key) + case "urlTemplate": + err = unpopulate(val, "URLTemplate", &o.URLTemplate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "operation", o.Operation) + populate(objectMap, "provider", o.Provider) + populate(objectMap, "resource", o.Resource) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationDisplay. +func (o *OperationDisplay) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &o.Operation) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &o.Provider) + delete(rawMsg, key) + case "resource": + err = unpopulate(val, "Resource", &o.Resource) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationEntityBaseContract. +func (o OperationEntityBaseContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "policies", o.Policies) + populate(objectMap, "request", o.Request) + populate(objectMap, "responses", o.Responses) + populate(objectMap, "templateParameters", o.TemplateParameters) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationEntityBaseContract. +func (o *OperationEntityBaseContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "policies": + err = unpopulate(val, "Policies", &o.Policies) + delete(rawMsg, key) + case "request": + err = unpopulate(val, "Request", &o.Request) + delete(rawMsg, key) + case "responses": + err = unpopulate(val, "Responses", &o.Responses) + delete(rawMsg, key) + case "templateParameters": + err = unpopulate(val, "TemplateParameters", &o.TemplateParameters) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationListResult. +func (o OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationListResult. +func (o *OperationListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationResultContract. +func (o OperationResultContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", o.ID) + populate(objectMap, "name", o.Name) + populate(objectMap, "properties", o.Properties) + populate(objectMap, "type", o.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultContract. +func (o *OperationResultContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &o.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationResultContractProperties. +func (o OperationResultContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionLog", o.ActionLog) + populate(objectMap, "error", o.Error) + populate(objectMap, "id", o.ID) + populate(objectMap, "resultInfo", o.ResultInfo) + populateTimeRFC3339(objectMap, "started", o.Started) + populate(objectMap, "status", o.Status) + populateTimeRFC3339(objectMap, "updated", o.Updated) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultContractProperties. +func (o *OperationResultContractProperties) UnmarshalJSON(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 "actionLog": + err = unpopulate(val, "ActionLog", &o.ActionLog) + 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 "resultInfo": + err = unpopulate(val, "ResultInfo", &o.ResultInfo) + delete(rawMsg, key) + case "started": + err = unpopulateTimeRFC3339(val, "Started", &o.Started) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &o.Status) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC3339(val, "Updated", &o.Updated) + 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 OperationResultLogItemContract. +func (o OperationResultLogItemContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", o.Action) + populate(objectMap, "objectKey", o.ObjectKey) + populate(objectMap, "objectType", o.ObjectType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultLogItemContract. +func (o *OperationResultLogItemContract) UnmarshalJSON(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 "action": + err = unpopulate(val, "Action", &o.Action) + delete(rawMsg, key) + case "objectKey": + err = unpopulate(val, "ObjectKey", &o.ObjectKey) + 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 OperationTagResourceContractProperties. +func (o OperationTagResourceContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiName", o.APIName) + populate(objectMap, "apiRevision", o.APIRevision) + populate(objectMap, "apiVersion", o.APIVersion) + populate(objectMap, "description", o.Description) + populate(objectMap, "id", o.ID) + populate(objectMap, "method", o.Method) + populate(objectMap, "name", o.Name) + populate(objectMap, "urlTemplate", o.URLTemplate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationTagResourceContractProperties. +func (o *OperationTagResourceContractProperties) UnmarshalJSON(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 "apiName": + err = unpopulate(val, "APIName", &o.APIName) + delete(rawMsg, key) + case "apiRevision": + err = unpopulate(val, "APIRevision", &o.APIRevision) + delete(rawMsg, key) + case "apiVersion": + err = unpopulate(val, "APIVersion", &o.APIVersion) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &o.ID) + delete(rawMsg, key) + case "method": + err = unpopulate(val, "Method", &o.Method) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &o.Name) + delete(rawMsg, key) + case "urlTemplate": + err = unpopulate(val, "URLTemplate", &o.URLTemplate) + 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 OperationUpdateContract. +func (o OperationUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", o.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationUpdateContract. +func (o *OperationUpdateContract) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &o.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OperationUpdateContractProperties. +func (o OperationUpdateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", o.Description) + populate(objectMap, "displayName", o.DisplayName) + populate(objectMap, "method", o.Method) + populate(objectMap, "policies", o.Policies) + populate(objectMap, "request", o.Request) + populate(objectMap, "responses", o.Responses) + populate(objectMap, "templateParameters", o.TemplateParameters) + populate(objectMap, "urlTemplate", o.URLTemplate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OperationUpdateContractProperties. +func (o *OperationUpdateContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &o.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &o.DisplayName) + delete(rawMsg, key) + case "method": + err = unpopulate(val, "Method", &o.Method) + delete(rawMsg, key) + case "policies": + err = unpopulate(val, "Policies", &o.Policies) + delete(rawMsg, key) + case "request": + err = unpopulate(val, "Request", &o.Request) + delete(rawMsg, key) + case "responses": + err = unpopulate(val, "Responses", &o.Responses) + delete(rawMsg, key) + case "templateParameters": + err = unpopulate(val, "TemplateParameters", &o.TemplateParameters) + delete(rawMsg, key) + case "urlTemplate": + err = unpopulate(val, "URLTemplate", &o.URLTemplate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpoint. +func (o OutboundEnvironmentEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "category", o.Category) + populate(objectMap, "endpoints", o.Endpoints) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpoint. +func (o *OutboundEnvironmentEndpoint) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "category": + err = unpopulate(val, "Category", &o.Category) + delete(rawMsg, key) + case "endpoints": + err = unpopulate(val, "Endpoints", &o.Endpoints) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type OutboundEnvironmentEndpointList. +func (o OutboundEnvironmentEndpointList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", o.NextLink) + populate(objectMap, "value", o.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type OutboundEnvironmentEndpointList. +func (o *OutboundEnvironmentEndpointList) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &o.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &o.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", o, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ParameterContract. +func (p ParameterContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "defaultValue", p.DefaultValue) + populate(objectMap, "description", p.Description) + populate(objectMap, "examples", p.Examples) + populate(objectMap, "name", p.Name) + populate(objectMap, "required", p.Required) + populate(objectMap, "schemaId", p.SchemaID) + populate(objectMap, "type", p.Type) + populate(objectMap, "typeName", p.TypeName) + populate(objectMap, "values", p.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ParameterContract. +func (p *ParameterContract) UnmarshalJSON(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 "defaultValue": + err = unpopulate(val, "DefaultValue", &p.DefaultValue) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "examples": + err = unpopulate(val, "Examples", &p.Examples) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "required": + err = unpopulate(val, "Required", &p.Required) + delete(rawMsg, key) + case "schemaId": + err = unpopulate(val, "SchemaID", &p.SchemaID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &p.TypeName) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &p.Values) + 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 ParameterExampleContract. +func (p ParameterExampleContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", p.Description) + populate(objectMap, "externalValue", p.ExternalValue) + populate(objectMap, "summary", p.Summary) + populate(objectMap, "value", &p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ParameterExampleContract. +func (p *ParameterExampleContract) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "externalValue": + err = unpopulate(val, "ExternalValue", &p.ExternalValue) + delete(rawMsg, key) + case "summary": + err = unpopulate(val, "Summary", &p.Summary) + 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 PipelineDiagnosticSettings. +func (p PipelineDiagnosticSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "request", p.Request) + populate(objectMap, "response", p.Response) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PipelineDiagnosticSettings. +func (p *PipelineDiagnosticSettings) UnmarshalJSON(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 "request": + err = unpopulate(val, "Request", &p.Request) + delete(rawMsg, key) + case "response": + err = unpopulate(val, "Response", &p.Response) + 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 PolicyCollection. +func (p PolicyCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", p.Count) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyCollection. +func (p *PolicyCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &p.Count) + delete(rawMsg, 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 PolicyContract. +func (p PolicyContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyContract. +func (p *PolicyContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PolicyContractProperties. +func (p PolicyContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "format", p.Format) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyContractProperties. +func (p *PolicyContractProperties) UnmarshalJSON(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 "format": + err = unpopulate(val, "Format", &p.Format) + 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 PolicyDescriptionCollection. +func (p PolicyDescriptionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", p.Count) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyDescriptionCollection. +func (p *PolicyDescriptionCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &p.Count) + 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 PolicyDescriptionContract. +func (p PolicyDescriptionContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyDescriptionContract. +func (p *PolicyDescriptionContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PolicyDescriptionContractProperties. +func (p PolicyDescriptionContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", p.Description) + populate(objectMap, "scope", p.Scope) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyDescriptionContractProperties. +func (p *PolicyDescriptionContractProperties) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &p.Scope) + 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 PolicyFragmentCollection. +func (p PolicyFragmentCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", p.Count) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyFragmentCollection. +func (p *PolicyFragmentCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &p.Count) + delete(rawMsg, 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 PolicyFragmentContract. +func (p PolicyFragmentContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyFragmentContract. +func (p *PolicyFragmentContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PolicyFragmentContractProperties. +func (p PolicyFragmentContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", p.Description) + populate(objectMap, "format", p.Format) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PolicyFragmentContractProperties. +func (p *PolicyFragmentContractProperties) UnmarshalJSON(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 "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "format": + err = unpopulate(val, "Format", &p.Format) + 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 PortalConfigCollection. +func (p PortalConfigCollection) 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 PortalConfigCollection. +func (p *PortalConfigCollection) UnmarshalJSON(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 PortalConfigContract. +func (p PortalConfigContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigContract. +func (p *PortalConfigContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PortalConfigCorsProperties. +func (p PortalConfigCorsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedOrigins", p.AllowedOrigins) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigCorsProperties. +func (p *PortalConfigCorsProperties) UnmarshalJSON(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 "allowedOrigins": + err = unpopulate(val, "AllowedOrigins", &p.AllowedOrigins) + 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 PortalConfigCspProperties. +func (p PortalConfigCspProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowedSources", p.AllowedSources) + populate(objectMap, "mode", p.Mode) + populate(objectMap, "reportUri", p.ReportURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigCspProperties. +func (p *PortalConfigCspProperties) UnmarshalJSON(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 "allowedSources": + err = unpopulate(val, "AllowedSources", &p.AllowedSources) + delete(rawMsg, key) + case "mode": + err = unpopulate(val, "Mode", &p.Mode) + delete(rawMsg, key) + case "reportUri": + err = unpopulate(val, "ReportURI", &p.ReportURI) + 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 PortalConfigDelegationProperties. +func (p PortalConfigDelegationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "delegateRegistration", p.DelegateRegistration) + populate(objectMap, "delegateSubscription", p.DelegateSubscription) + populate(objectMap, "delegationUrl", p.DelegationURL) + populate(objectMap, "validationKey", p.ValidationKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigDelegationProperties. +func (p *PortalConfigDelegationProperties) UnmarshalJSON(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 "delegateRegistration": + err = unpopulate(val, "DelegateRegistration", &p.DelegateRegistration) + delete(rawMsg, key) + case "delegateSubscription": + err = unpopulate(val, "DelegateSubscription", &p.DelegateSubscription) + delete(rawMsg, key) + case "delegationUrl": + err = unpopulate(val, "DelegationURL", &p.DelegationURL) + delete(rawMsg, key) + case "validationKey": + err = unpopulate(val, "ValidationKey", &p.ValidationKey) + 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 PortalConfigProperties. +func (p PortalConfigProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "cors", p.Cors) + populate(objectMap, "csp", p.Csp) + populate(objectMap, "delegation", p.Delegation) + populate(objectMap, "enableBasicAuth", p.EnableBasicAuth) + populate(objectMap, "signin", p.Signin) + populate(objectMap, "signup", p.Signup) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigProperties. +func (p *PortalConfigProperties) UnmarshalJSON(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 "cors": + err = unpopulate(val, "Cors", &p.Cors) + delete(rawMsg, key) + case "csp": + err = unpopulate(val, "Csp", &p.Csp) + delete(rawMsg, key) + case "delegation": + err = unpopulate(val, "Delegation", &p.Delegation) + delete(rawMsg, key) + case "enableBasicAuth": + err = unpopulate(val, "EnableBasicAuth", &p.EnableBasicAuth) + delete(rawMsg, key) + case "signin": + err = unpopulate(val, "Signin", &p.Signin) + delete(rawMsg, key) + case "signup": + err = unpopulate(val, "Signup", &p.Signup) + 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 PortalConfigPropertiesSignin. +func (p PortalConfigPropertiesSignin) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "require", p.Require) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigPropertiesSignin. +func (p *PortalConfigPropertiesSignin) UnmarshalJSON(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 "require": + err = unpopulate(val, "Require", &p.Require) + 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 PortalConfigPropertiesSignup. +func (p PortalConfigPropertiesSignup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "termsOfService", p.TermsOfService) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigPropertiesSignup. +func (p *PortalConfigPropertiesSignup) UnmarshalJSON(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 "termsOfService": + err = unpopulate(val, "TermsOfService", &p.TermsOfService) + 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 PortalConfigTermsOfServiceProperties. +func (p PortalConfigTermsOfServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "requireConsent", p.RequireConsent) + populate(objectMap, "text", p.Text) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalConfigTermsOfServiceProperties. +func (p *PortalConfigTermsOfServiceProperties) UnmarshalJSON(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 "requireConsent": + err = unpopulate(val, "RequireConsent", &p.RequireConsent) + delete(rawMsg, key) + case "text": + err = unpopulate(val, "Text", &p.Text) + 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 PortalDelegationSettings. +func (p PortalDelegationSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalDelegationSettings. +func (p *PortalDelegationSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PortalDelegationSettingsProperties. +func (p PortalDelegationSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subscriptions", p.Subscriptions) + populate(objectMap, "url", p.URL) + populate(objectMap, "userRegistration", p.UserRegistration) + populate(objectMap, "validationKey", p.ValidationKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalDelegationSettingsProperties. +func (p *PortalDelegationSettingsProperties) UnmarshalJSON(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 "subscriptions": + err = unpopulate(val, "Subscriptions", &p.Subscriptions) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &p.URL) + delete(rawMsg, key) + case "userRegistration": + err = unpopulate(val, "UserRegistration", &p.UserRegistration) + delete(rawMsg, key) + case "validationKey": + err = unpopulate(val, "ValidationKey", &p.ValidationKey) + 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 PortalRevisionCollection. +func (p PortalRevisionCollection) 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 PortalRevisionCollection. +func (p *PortalRevisionCollection) UnmarshalJSON(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 PortalRevisionContract. +func (p PortalRevisionContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalRevisionContract. +func (p *PortalRevisionContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PortalRevisionContractProperties. +func (p PortalRevisionContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdDateTime", p.CreatedDateTime) + populate(objectMap, "description", p.Description) + populate(objectMap, "isCurrent", p.IsCurrent) + populate(objectMap, "status", p.Status) + populate(objectMap, "statusDetails", p.StatusDetails) + populateTimeRFC3339(objectMap, "updatedDateTime", p.UpdatedDateTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalRevisionContractProperties. +func (p *PortalRevisionContractProperties) UnmarshalJSON(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 "createdDateTime": + err = unpopulateTimeRFC3339(val, "CreatedDateTime", &p.CreatedDateTime) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "isCurrent": + err = unpopulate(val, "IsCurrent", &p.IsCurrent) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + case "statusDetails": + err = unpopulate(val, "StatusDetails", &p.StatusDetails) + delete(rawMsg, key) + case "updatedDateTime": + err = unpopulateTimeRFC3339(val, "UpdatedDateTime", &p.UpdatedDateTime) + 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 PortalSettingValidationKeyContract. +func (p PortalSettingValidationKeyContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "validationKey", p.ValidationKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingValidationKeyContract. +func (p *PortalSettingValidationKeyContract) UnmarshalJSON(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 "validationKey": + err = unpopulate(val, "ValidationKey", &p.ValidationKey) + 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 PortalSettingsCollection. +func (p PortalSettingsCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", p.Count) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingsCollection. +func (p *PortalSettingsCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &p.Count) + 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 PortalSettingsContract. +func (p PortalSettingsContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingsContract. +func (p *PortalSettingsContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PortalSettingsContractProperties. +func (p PortalSettingsContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", p.Enabled) + populate(objectMap, "subscriptions", p.Subscriptions) + populate(objectMap, "termsOfService", p.TermsOfService) + populate(objectMap, "url", p.URL) + populate(objectMap, "userRegistration", p.UserRegistration) + populate(objectMap, "validationKey", p.ValidationKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSettingsContractProperties. +func (p *PortalSettingsContractProperties) UnmarshalJSON(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 "enabled": + err = unpopulate(val, "Enabled", &p.Enabled) + delete(rawMsg, key) + case "subscriptions": + err = unpopulate(val, "Subscriptions", &p.Subscriptions) + delete(rawMsg, key) + case "termsOfService": + err = unpopulate(val, "TermsOfService", &p.TermsOfService) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &p.URL) + delete(rawMsg, key) + case "userRegistration": + err = unpopulate(val, "UserRegistration", &p.UserRegistration) + delete(rawMsg, key) + case "validationKey": + err = unpopulate(val, "ValidationKey", &p.ValidationKey) + 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 PortalSigninSettingProperties. +func (p PortalSigninSettingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", p.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSigninSettingProperties. +func (p *PortalSigninSettingProperties) UnmarshalJSON(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 "enabled": + err = unpopulate(val, "Enabled", &p.Enabled) + 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 PortalSigninSettings. +func (p PortalSigninSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSigninSettings. +func (p *PortalSigninSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PortalSignupSettings. +func (p PortalSignupSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSignupSettings. +func (p *PortalSignupSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PortalSignupSettingsProperties. +func (p PortalSignupSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", p.Enabled) + populate(objectMap, "termsOfService", p.TermsOfService) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PortalSignupSettingsProperties. +func (p *PortalSignupSettingsProperties) UnmarshalJSON(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 "enabled": + err = unpopulate(val, "Enabled", &p.Enabled) + delete(rawMsg, key) + case "termsOfService": + err = unpopulate(val, "TermsOfService", &p.TermsOfService) + 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, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnection. +func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionListResult. +func (p *PrivateEndpointConnectionListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionProperties. +func (p *PrivateEndpointConnectionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "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 PrivateEndpointConnectionRequest. +func (p PrivateEndpointConnectionRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionRequest. +func (p *PrivateEndpointConnectionRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + 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 PrivateEndpointConnectionRequestProperties. +func (p PrivateEndpointConnectionRequestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionRequestProperties. +func (p *PrivateEndpointConnectionRequestProperties) UnmarshalJSON(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 "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + 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 PrivateEndpointConnectionWrapperProperties. +func (p PrivateEndpointConnectionWrapperProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateEndpointConnectionWrapperProperties. +func (p *PrivateEndpointConnectionWrapperProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) + case "privateEndpoint": + err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) + delete(rawMsg, key) + case "privateLinkServiceConnectionState": + err = unpopulate(val, "PrivateLinkServiceConnectionState", &p.PrivateLinkServiceConnectionState) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &p.ProvisioningState) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResource. +func (p PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResource. +func (p *PrivateLinkResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceListResult. +func (p *PrivateLinkResourceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &p.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type PrivateLinkResourceProperties. +func (p *PrivateLinkResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "groupId": + err = unpopulate(val, "GroupID", &p.GroupID) + delete(rawMsg, key) + case "requiredMembers": + err = unpopulate(val, "RequiredMembers", &p.RequiredMembers) + delete(rawMsg, key) + case "requiredZoneNames": + err = unpopulate(val, "RequiredZoneNames", &p.RequiredZoneNames) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. +func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionsRequired", p.ActionsRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "status", p.Status) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type 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 "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &p.Status) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProductCollection. +func (p ProductCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", p.Count) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductCollection. +func (p *ProductCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &p.Count) + delete(rawMsg, 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 ProductContract. +func (p ProductContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "properties", p.Properties) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductContract. +func (p *ProductContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &p.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProductContractProperties. +func (p ProductContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "approvalRequired", p.ApprovalRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "displayName", p.DisplayName) + populate(objectMap, "state", p.State) + populate(objectMap, "subscriptionRequired", p.SubscriptionRequired) + populate(objectMap, "subscriptionsLimit", p.SubscriptionsLimit) + populate(objectMap, "terms", p.Terms) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductContractProperties. +func (p *ProductContractProperties) UnmarshalJSON(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 "approvalRequired": + err = unpopulate(val, "ApprovalRequired", &p.ApprovalRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &p.DisplayName) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &p.State) + delete(rawMsg, key) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &p.SubscriptionRequired) + delete(rawMsg, key) + case "subscriptionsLimit": + err = unpopulate(val, "SubscriptionsLimit", &p.SubscriptionsLimit) + delete(rawMsg, key) + case "terms": + err = unpopulate(val, "Terms", &p.Terms) + 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 ProductEntityBaseParameters. +func (p ProductEntityBaseParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "approvalRequired", p.ApprovalRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "state", p.State) + populate(objectMap, "subscriptionRequired", p.SubscriptionRequired) + populate(objectMap, "subscriptionsLimit", p.SubscriptionsLimit) + populate(objectMap, "terms", p.Terms) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductEntityBaseParameters. +func (p *ProductEntityBaseParameters) UnmarshalJSON(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 "approvalRequired": + err = unpopulate(val, "ApprovalRequired", &p.ApprovalRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &p.State) + delete(rawMsg, key) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &p.SubscriptionRequired) + delete(rawMsg, key) + case "subscriptionsLimit": + err = unpopulate(val, "SubscriptionsLimit", &p.SubscriptionsLimit) + delete(rawMsg, key) + case "terms": + err = unpopulate(val, "Terms", &p.Terms) + 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 ProductTagResourceContractProperties. +func (p ProductTagResourceContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "approvalRequired", p.ApprovalRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "state", p.State) + populate(objectMap, "subscriptionRequired", p.SubscriptionRequired) + populate(objectMap, "subscriptionsLimit", p.SubscriptionsLimit) + populate(objectMap, "terms", p.Terms) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductTagResourceContractProperties. +func (p *ProductTagResourceContractProperties) UnmarshalJSON(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 "approvalRequired": + err = unpopulate(val, "ApprovalRequired", &p.ApprovalRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &p.State) + delete(rawMsg, key) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &p.SubscriptionRequired) + delete(rawMsg, key) + case "subscriptionsLimit": + err = unpopulate(val, "SubscriptionsLimit", &p.SubscriptionsLimit) + delete(rawMsg, key) + case "terms": + err = unpopulate(val, "Terms", &p.Terms) + 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 ProductUpdateParameters. +func (p ProductUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", p.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductUpdateParameters. +func (p *ProductUpdateParameters) UnmarshalJSON(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) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProductUpdateProperties. +func (p ProductUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "approvalRequired", p.ApprovalRequired) + populate(objectMap, "description", p.Description) + populate(objectMap, "displayName", p.DisplayName) + populate(objectMap, "state", p.State) + populate(objectMap, "subscriptionRequired", p.SubscriptionRequired) + populate(objectMap, "subscriptionsLimit", p.SubscriptionsLimit) + populate(objectMap, "terms", p.Terms) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProductUpdateProperties. +func (p *ProductUpdateProperties) UnmarshalJSON(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 "approvalRequired": + err = unpopulate(val, "ApprovalRequired", &p.ApprovalRequired) + delete(rawMsg, key) + case "description": + err = unpopulate(val, "Description", &p.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &p.DisplayName) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &p.State) + delete(rawMsg, key) + case "subscriptionRequired": + err = unpopulate(val, "SubscriptionRequired", &p.SubscriptionRequired) + delete(rawMsg, key) + case "subscriptionsLimit": + err = unpopulate(val, "SubscriptionsLimit", &p.SubscriptionsLimit) + delete(rawMsg, key) + case "terms": + err = unpopulate(val, "Terms", &p.Terms) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ProxyResource. +func (p ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", p.ID) + populate(objectMap, "name", p.Name) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ProxyResource. +func (p *ProxyResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &p.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &p.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &p.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", p, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QuotaCounterCollection. +func (q QuotaCounterCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", q.Count) + populate(objectMap, "nextLink", q.NextLink) + populate(objectMap, "value", q.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterCollection. +func (q *QuotaCounterCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &q.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &q.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &q.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QuotaCounterContract. +func (q QuotaCounterContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "counterKey", q.CounterKey) + populateTimeRFC3339(objectMap, "periodEndTime", q.PeriodEndTime) + populate(objectMap, "periodKey", q.PeriodKey) + populateTimeRFC3339(objectMap, "periodStartTime", q.PeriodStartTime) + populate(objectMap, "value", q.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterContract. +func (q *QuotaCounterContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "counterKey": + err = unpopulate(val, "CounterKey", &q.CounterKey) + delete(rawMsg, key) + case "periodEndTime": + err = unpopulateTimeRFC3339(val, "PeriodEndTime", &q.PeriodEndTime) + delete(rawMsg, key) + case "periodKey": + err = unpopulate(val, "PeriodKey", &q.PeriodKey) + delete(rawMsg, key) + case "periodStartTime": + err = unpopulateTimeRFC3339(val, "PeriodStartTime", &q.PeriodStartTime) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &q.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueContract. +func (q QuotaCounterValueContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", q.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterValueContract. +func (q *QuotaCounterValueContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "value": + err = unpopulate(val, "Value", &q.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueContractProperties. +func (q QuotaCounterValueContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "callsCount", q.CallsCount) + populate(objectMap, "kbTransferred", q.KbTransferred) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterValueContractProperties. +func (q *QuotaCounterValueContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "callsCount": + err = unpopulate(val, "CallsCount", &q.CallsCount) + delete(rawMsg, key) + case "kbTransferred": + err = unpopulate(val, "KbTransferred", &q.KbTransferred) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueUpdateContract. +func (q QuotaCounterValueUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", q.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterValueUpdateContract. +func (q *QuotaCounterValueUpdateContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &q.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", q, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecipientEmailCollection. +func (r RecipientEmailCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", r.Count) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientEmailCollection. +func (r *RecipientEmailCollection) UnmarshalJSON(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 "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 RecipientEmailContract. +func (r RecipientEmailContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientEmailContract. +func (r *RecipientEmailContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecipientEmailContractProperties. +func (r RecipientEmailContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "email", r.Email) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientEmailContractProperties. +func (r *RecipientEmailContractProperties) UnmarshalJSON(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 "email": + err = unpopulate(val, "Email", &r.Email) + 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 RecipientUserCollection. +func (r RecipientUserCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", r.Count) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientUserCollection. +func (r *RecipientUserCollection) UnmarshalJSON(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 "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 RecipientUserContract. +func (r RecipientUserContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientUserContract. +func (r *RecipientUserContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RecipientUsersContractProperties. +func (r RecipientUsersContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "userId", r.UserID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientUsersContractProperties. +func (r *RecipientUsersContractProperties) UnmarshalJSON(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 "userId": + err = unpopulate(val, "UserID", &r.UserID) + 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 RecipientsContractProperties. +func (r RecipientsContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "emails", r.Emails) + populate(objectMap, "users", r.Users) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RecipientsContractProperties. +func (r *RecipientsContractProperties) UnmarshalJSON(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 "emails": + err = unpopulate(val, "Emails", &r.Emails) + delete(rawMsg, key) + case "users": + err = unpopulate(val, "Users", &r.Users) + 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 RegionContract. +func (r RegionContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "isDeleted", r.IsDeleted) + populate(objectMap, "isMasterRegion", r.IsMasterRegion) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegionContract. +func (r *RegionContract) UnmarshalJSON(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 "isDeleted": + err = unpopulate(val, "IsDeleted", &r.IsDeleted) + delete(rawMsg, key) + case "isMasterRegion": + err = unpopulate(val, "IsMasterRegion", &r.IsMasterRegion) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + 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 RegionListResult. +func (r RegionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", r.Count) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegionListResult. +func (r *RegionListResult) UnmarshalJSON(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 "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 RegistrationDelegationSettingsProperties. +func (r RegistrationDelegationSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", r.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationDelegationSettingsProperties. +func (r *RegistrationDelegationSettingsProperties) UnmarshalJSON(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 "enabled": + err = unpopulate(val, "Enabled", &r.Enabled) + 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 RemotePrivateEndpointConnectionWrapper. +func (r RemotePrivateEndpointConnectionWrapper) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RemotePrivateEndpointConnectionWrapper. +func (r *RemotePrivateEndpointConnectionWrapper) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ReportCollection. +func (r ReportCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", r.Count) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReportCollection. +func (r *ReportCollection) UnmarshalJSON(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 "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 ReportRecordContract. +func (r ReportRecordContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiId", r.APIID) + populate(objectMap, "apiRegion", r.APIRegion) + populate(objectMap, "apiTimeAvg", r.APITimeAvg) + populate(objectMap, "apiTimeMax", r.APITimeMax) + populate(objectMap, "apiTimeMin", r.APITimeMin) + populate(objectMap, "bandwidth", r.Bandwidth) + populate(objectMap, "cacheHitCount", r.CacheHitCount) + populate(objectMap, "cacheMissCount", r.CacheMissCount) + populate(objectMap, "callCountBlocked", r.CallCountBlocked) + populate(objectMap, "callCountFailed", r.CallCountFailed) + populate(objectMap, "callCountOther", r.CallCountOther) + populate(objectMap, "callCountSuccess", r.CallCountSuccess) + populate(objectMap, "callCountTotal", r.CallCountTotal) + populate(objectMap, "country", r.Country) + populate(objectMap, "interval", r.Interval) + populate(objectMap, "name", r.Name) + populate(objectMap, "operationId", r.OperationID) + populate(objectMap, "productId", r.ProductID) + populate(objectMap, "region", r.Region) + populate(objectMap, "serviceTimeAvg", r.ServiceTimeAvg) + populate(objectMap, "serviceTimeMax", r.ServiceTimeMax) + populate(objectMap, "serviceTimeMin", r.ServiceTimeMin) + populate(objectMap, "subscriptionId", r.SubscriptionID) + populateTimeRFC3339(objectMap, "timestamp", r.Timestamp) + populate(objectMap, "userId", r.UserID) + populate(objectMap, "zip", r.Zip) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ReportRecordContract. +func (r *ReportRecordContract) UnmarshalJSON(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 "apiId": + err = unpopulate(val, "APIID", &r.APIID) + delete(rawMsg, key) + case "apiRegion": + err = unpopulate(val, "APIRegion", &r.APIRegion) + delete(rawMsg, key) + case "apiTimeAvg": + err = unpopulate(val, "APITimeAvg", &r.APITimeAvg) + delete(rawMsg, key) + case "apiTimeMax": + err = unpopulate(val, "APITimeMax", &r.APITimeMax) + delete(rawMsg, key) + case "apiTimeMin": + err = unpopulate(val, "APITimeMin", &r.APITimeMin) + delete(rawMsg, key) + case "bandwidth": + err = unpopulate(val, "Bandwidth", &r.Bandwidth) + delete(rawMsg, key) + case "cacheHitCount": + err = unpopulate(val, "CacheHitCount", &r.CacheHitCount) + delete(rawMsg, key) + case "cacheMissCount": + err = unpopulate(val, "CacheMissCount", &r.CacheMissCount) + delete(rawMsg, key) + case "callCountBlocked": + err = unpopulate(val, "CallCountBlocked", &r.CallCountBlocked) + delete(rawMsg, key) + case "callCountFailed": + err = unpopulate(val, "CallCountFailed", &r.CallCountFailed) + delete(rawMsg, key) + case "callCountOther": + err = unpopulate(val, "CallCountOther", &r.CallCountOther) + delete(rawMsg, key) + case "callCountSuccess": + err = unpopulate(val, "CallCountSuccess", &r.CallCountSuccess) + delete(rawMsg, key) + case "callCountTotal": + err = unpopulate(val, "CallCountTotal", &r.CallCountTotal) + delete(rawMsg, key) + case "country": + err = unpopulate(val, "Country", &r.Country) + delete(rawMsg, key) + case "interval": + err = unpopulate(val, "Interval", &r.Interval) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "operationId": + err = unpopulate(val, "OperationID", &r.OperationID) + delete(rawMsg, key) + case "productId": + err = unpopulate(val, "ProductID", &r.ProductID) + delete(rawMsg, key) + case "region": + err = unpopulate(val, "Region", &r.Region) + delete(rawMsg, key) + case "serviceTimeAvg": + err = unpopulate(val, "ServiceTimeAvg", &r.ServiceTimeAvg) + delete(rawMsg, key) + case "serviceTimeMax": + err = unpopulate(val, "ServiceTimeMax", &r.ServiceTimeMax) + delete(rawMsg, key) + case "serviceTimeMin": + err = unpopulate(val, "ServiceTimeMin", &r.ServiceTimeMin) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &r.SubscriptionID) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &r.Timestamp) + delete(rawMsg, key) + case "userId": + err = unpopulate(val, "UserID", &r.UserID) + delete(rawMsg, key) + case "zip": + err = unpopulate(val, "Zip", &r.Zip) + 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 RepresentationContract. +func (r RepresentationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "contentType", r.ContentType) + populate(objectMap, "examples", r.Examples) + populate(objectMap, "formParameters", r.FormParameters) + populate(objectMap, "schemaId", r.SchemaID) + populate(objectMap, "typeName", r.TypeName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RepresentationContract. +func (r *RepresentationContract) UnmarshalJSON(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 "contentType": + err = unpopulate(val, "ContentType", &r.ContentType) + delete(rawMsg, key) + case "examples": + err = unpopulate(val, "Examples", &r.Examples) + delete(rawMsg, key) + case "formParameters": + err = unpopulate(val, "FormParameters", &r.FormParameters) + delete(rawMsg, key) + case "schemaId": + err = unpopulate(val, "SchemaID", &r.SchemaID) + delete(rawMsg, key) + case "typeName": + err = unpopulate(val, "TypeName", &r.TypeName) + 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 RequestContract. +func (r RequestContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", r.Description) + populate(objectMap, "headers", r.Headers) + populate(objectMap, "queryParameters", r.QueryParameters) + populate(objectMap, "representations", r.Representations) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestContract. +func (r *RequestContract) UnmarshalJSON(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 "headers": + err = unpopulate(val, "Headers", &r.Headers) + delete(rawMsg, key) + case "queryParameters": + err = unpopulate(val, "QueryParameters", &r.QueryParameters) + delete(rawMsg, key) + case "representations": + err = unpopulate(val, "Representations", &r.Representations) + 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 RequestReportCollection. +func (r RequestReportCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", r.Count) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestReportCollection. +func (r *RequestReportCollection) UnmarshalJSON(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 "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 RequestReportRecordContract. +func (r RequestReportRecordContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiId", r.APIID) + populate(objectMap, "apiRegion", r.APIRegion) + populate(objectMap, "apiTime", r.APITime) + populate(objectMap, "backendResponseCode", r.BackendResponseCode) + populate(objectMap, "cache", r.Cache) + populate(objectMap, "ipAddress", r.IPAddress) + populate(objectMap, "method", r.Method) + populate(objectMap, "operationId", r.OperationID) + populate(objectMap, "productId", r.ProductID) + populate(objectMap, "requestId", r.RequestID) + populate(objectMap, "requestSize", r.RequestSize) + populate(objectMap, "responseCode", r.ResponseCode) + populate(objectMap, "responseSize", r.ResponseSize) + populate(objectMap, "serviceTime", r.ServiceTime) + populate(objectMap, "subscriptionId", r.SubscriptionID) + populateTimeRFC3339(objectMap, "timestamp", r.Timestamp) + populate(objectMap, "url", r.URL) + populate(objectMap, "userId", r.UserID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RequestReportRecordContract. +func (r *RequestReportRecordContract) UnmarshalJSON(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 "apiId": + err = unpopulate(val, "APIID", &r.APIID) + delete(rawMsg, key) + case "apiRegion": + err = unpopulate(val, "APIRegion", &r.APIRegion) + delete(rawMsg, key) + case "apiTime": + err = unpopulate(val, "APITime", &r.APITime) + delete(rawMsg, key) + case "backendResponseCode": + err = unpopulate(val, "BackendResponseCode", &r.BackendResponseCode) + delete(rawMsg, key) + case "cache": + err = unpopulate(val, "Cache", &r.Cache) + delete(rawMsg, key) + case "ipAddress": + err = unpopulate(val, "IPAddress", &r.IPAddress) + delete(rawMsg, key) + case "method": + err = unpopulate(val, "Method", &r.Method) + delete(rawMsg, key) + case "operationId": + err = unpopulate(val, "OperationID", &r.OperationID) + delete(rawMsg, key) + case "productId": + err = unpopulate(val, "ProductID", &r.ProductID) + delete(rawMsg, key) + case "requestId": + err = unpopulate(val, "RequestID", &r.RequestID) + delete(rawMsg, key) + case "requestSize": + err = unpopulate(val, "RequestSize", &r.RequestSize) + delete(rawMsg, key) + case "responseCode": + err = unpopulate(val, "ResponseCode", &r.ResponseCode) + delete(rawMsg, key) + case "responseSize": + err = unpopulate(val, "ResponseSize", &r.ResponseSize) + delete(rawMsg, key) + case "serviceTime": + err = unpopulate(val, "ServiceTime", &r.ServiceTime) + delete(rawMsg, key) + case "subscriptionId": + err = unpopulate(val, "SubscriptionID", &r.SubscriptionID) + delete(rawMsg, key) + case "timestamp": + err = unpopulateTimeRFC3339(val, "Timestamp", &r.Timestamp) + delete(rawMsg, key) + case "url": + err = unpopulate(val, "URL", &r.URL) + delete(rawMsg, key) + case "userId": + err = unpopulate(val, "UserID", &r.UserID) + 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 ResolverCollection. +func (r ResolverCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", r.Count) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverCollection. +func (r *ResolverCollection) UnmarshalJSON(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 "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 ResolverContract. +func (r ResolverContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverContract. +func (r *ResolverContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResolverEntityBaseContract. +func (r ResolverEntityBaseContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", r.Description) + populate(objectMap, "displayName", r.DisplayName) + populate(objectMap, "path", r.Path) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverEntityBaseContract. +func (r *ResolverEntityBaseContract) UnmarshalJSON(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 "displayName": + err = unpopulate(val, "DisplayName", &r.DisplayName) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &r.Path) + 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 ResolverResultContract. +func (r ResolverResultContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "properties", r.Properties) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverResultContract. +func (r *ResolverResultContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResolverResultContractProperties. +func (r ResolverResultContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "actionLog", r.ActionLog) + populate(objectMap, "error", r.Error) + populate(objectMap, "id", r.ID) + populate(objectMap, "resultInfo", r.ResultInfo) + populateTimeRFC3339(objectMap, "started", r.Started) + populate(objectMap, "status", r.Status) + populateTimeRFC3339(objectMap, "updated", r.Updated) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverResultContractProperties. +func (r *ResolverResultContractProperties) UnmarshalJSON(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 "actionLog": + err = unpopulate(val, "ActionLog", &r.ActionLog) + delete(rawMsg, key) + case "error": + err = unpopulate(val, "Error", &r.Error) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "resultInfo": + err = unpopulate(val, "ResultInfo", &r.ResultInfo) + delete(rawMsg, key) + case "started": + err = unpopulateTimeRFC3339(val, "Started", &r.Started) + delete(rawMsg, key) + case "status": + err = unpopulate(val, "Status", &r.Status) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC3339(val, "Updated", &r.Updated) + 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 ResolverResultLogItemContract. +func (r ResolverResultLogItemContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "action", r.Action) + populate(objectMap, "objectKey", r.ObjectKey) + populate(objectMap, "objectType", r.ObjectType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverResultLogItemContract. +func (r *ResolverResultLogItemContract) UnmarshalJSON(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 "action": + err = unpopulate(val, "Action", &r.Action) + delete(rawMsg, key) + case "objectKey": + err = unpopulate(val, "ObjectKey", &r.ObjectKey) + delete(rawMsg, 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 ResolverUpdateContract. +func (r ResolverUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", r.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverUpdateContract. +func (r *ResolverUpdateContract) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &r.Properties) + 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 ResolverUpdateContractProperties. +func (r ResolverUpdateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", r.Description) + populate(objectMap, "displayName", r.DisplayName) + populate(objectMap, "path", r.Path) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResolverUpdateContractProperties. +func (r *ResolverUpdateContractProperties) UnmarshalJSON(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 "displayName": + err = unpopulate(val, "DisplayName", &r.DisplayName) + delete(rawMsg, key) + case "path": + err = unpopulate(val, "Path", &r.Path) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Resource. +func (r *Resource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceCollection. +func (r ResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", r.Count) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceCollection. +func (r *ResourceCollection) UnmarshalJSON(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 "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 ResourceCollectionValueItem. +func (r ResourceCollectionValueItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", r.ID) + populate(objectMap, "name", r.Name) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceCollectionValueItem. +func (r *ResourceCollectionValueItem) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &r.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &r.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceLocationDataContract. +func (r ResourceLocationDataContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "city", r.City) + populate(objectMap, "countryOrRegion", r.CountryOrRegion) + populate(objectMap, "district", r.District) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceLocationDataContract. +func (r *ResourceLocationDataContract) UnmarshalJSON(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 "city": + err = unpopulate(val, "City", &r.City) + delete(rawMsg, key) + case "countryOrRegion": + err = unpopulate(val, "CountryOrRegion", &r.CountryOrRegion) + delete(rawMsg, key) + case "district": + err = unpopulate(val, "District", &r.District) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &r.Name) + 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 ResourceSKU. +func (r ResourceSKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", r.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKU. +func (r *ResourceSKU) UnmarshalJSON(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 "name": + err = unpopulate(val, "Name", &r.Name) + 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 ResourceSKUCapacity. +func (r ResourceSKUCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "default", r.Default) + populate(objectMap, "maximum", r.Maximum) + populate(objectMap, "minimum", r.Minimum) + populate(objectMap, "scaleType", r.ScaleType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUCapacity. +func (r *ResourceSKUCapacity) UnmarshalJSON(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 "default": + err = unpopulate(val, "Default", &r.Default) + delete(rawMsg, key) + case "maximum": + err = unpopulate(val, "Maximum", &r.Maximum) + delete(rawMsg, key) + case "minimum": + err = unpopulate(val, "Minimum", &r.Minimum) + delete(rawMsg, key) + case "scaleType": + err = unpopulate(val, "ScaleType", &r.ScaleType) + 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 ResourceSKUResult. +func (r ResourceSKUResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacity", r.Capacity) + populate(objectMap, "resourceType", r.ResourceType) + populate(objectMap, "sku", r.SKU) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResourceSKUResult. +func (r *ResourceSKUResult) UnmarshalJSON(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 "capacity": + err = unpopulate(val, "Capacity", &r.Capacity) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &r.ResourceType) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &r.SKU) + 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 ResourceSKUResults. +func (r ResourceSKUResults) 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 ResourceSKUResults. +func (r *ResourceSKUResults) UnmarshalJSON(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 ResponseContract. +func (r ResponseContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", r.Description) + populate(objectMap, "headers", r.Headers) + populate(objectMap, "representations", r.Representations) + populate(objectMap, "statusCode", r.StatusCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ResponseContract. +func (r *ResponseContract) UnmarshalJSON(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 "headers": + err = unpopulate(val, "Headers", &r.Headers) + delete(rawMsg, key) + case "representations": + err = unpopulate(val, "Representations", &r.Representations) + delete(rawMsg, key) + case "statusCode": + err = unpopulate(val, "StatusCode", &r.StatusCode) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", r, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKU. +func (s SKU) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersions", s.APIVersions) + populate(objectMap, "capabilities", s.Capabilities) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "costs", s.Costs) + populate(objectMap, "family", s.Family) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "locationInfo", s.LocationInfo) + populate(objectMap, "locations", s.Locations) + populate(objectMap, "name", s.Name) + populate(objectMap, "resourceType", s.ResourceType) + populate(objectMap, "restrictions", s.Restrictions) + populate(objectMap, "size", s.Size) + populate(objectMap, "tier", s.Tier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKU. +func (s *SKU) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiVersions": + err = unpopulate(val, "APIVersions", &s.APIVersions) + delete(rawMsg, key) + case "capabilities": + err = unpopulate(val, "Capabilities", &s.Capabilities) + delete(rawMsg, key) + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "costs": + err = unpopulate(val, "Costs", &s.Costs) + delete(rawMsg, key) + case "family": + err = unpopulate(val, "Family", &s.Family) + delete(rawMsg, key) + case "kind": + err = unpopulate(val, "Kind", &s.Kind) + delete(rawMsg, key) + case "locationInfo": + err = unpopulate(val, "LocationInfo", &s.LocationInfo) + delete(rawMsg, key) + case "locations": + err = unpopulate(val, "Locations", &s.Locations) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "resourceType": + err = unpopulate(val, "ResourceType", &s.ResourceType) + delete(rawMsg, key) + case "restrictions": + err = unpopulate(val, "Restrictions", &s.Restrictions) + delete(rawMsg, key) + case "size": + err = unpopulate(val, "Size", &s.Size) + delete(rawMsg, key) + case "tier": + err = unpopulate(val, "Tier", &s.Tier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUCapabilities. +func (s SKUCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapabilities. +func (s *SKUCapabilities) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUCapacity. +func (s SKUCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "default", s.Default) + populate(objectMap, "maximum", s.Maximum) + populate(objectMap, "minimum", s.Minimum) + populate(objectMap, "scaleType", s.ScaleType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCapacity. +func (s *SKUCapacity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "default": + err = unpopulate(val, "Default", &s.Default) + delete(rawMsg, key) + case "maximum": + err = unpopulate(val, "Maximum", &s.Maximum) + delete(rawMsg, key) + case "minimum": + err = unpopulate(val, "Minimum", &s.Minimum) + delete(rawMsg, key) + case "scaleType": + err = unpopulate(val, "ScaleType", &s.ScaleType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUCosts. +func (s SKUCosts) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "extendedUnit", s.ExtendedUnit) + populate(objectMap, "meterID", s.MeterID) + populate(objectMap, "quantity", s.Quantity) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUCosts. +func (s *SKUCosts) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "extendedUnit": + err = unpopulate(val, "ExtendedUnit", &s.ExtendedUnit) + delete(rawMsg, key) + case "meterID": + err = unpopulate(val, "MeterID", &s.MeterID) + delete(rawMsg, key) + case "quantity": + err = unpopulate(val, "Quantity", &s.Quantity) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKULocationInfo. +func (s SKULocationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", s.Location) + populate(objectMap, "zoneDetails", s.ZoneDetails) + populate(objectMap, "zones", s.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKULocationInfo. +func (s *SKULocationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "zoneDetails": + err = unpopulate(val, "ZoneDetails", &s.ZoneDetails) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &s.Zones) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKURestrictionInfo. +func (s SKURestrictionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "locations", s.Locations) + populate(objectMap, "zones", s.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKURestrictionInfo. +func (s *SKURestrictionInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "locations": + err = unpopulate(val, "Locations", &s.Locations) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &s.Zones) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKURestrictions. +func (s SKURestrictions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "reasonCode", s.ReasonCode) + populate(objectMap, "restrictionInfo", s.RestrictionInfo) + populate(objectMap, "type", s.Type) + populate(objectMap, "values", s.Values) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKURestrictions. +func (s *SKURestrictions) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "reasonCode": + err = unpopulate(val, "ReasonCode", &s.ReasonCode) + delete(rawMsg, key) + case "restrictionInfo": + err = unpopulate(val, "RestrictionInfo", &s.RestrictionInfo) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + case "values": + err = unpopulate(val, "Values", &s.Values) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUZoneDetails. +func (s SKUZoneDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capabilities", s.Capabilities) + populate(objectMap, "name", s.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUZoneDetails. +func (s *SKUZoneDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capabilities": + err = unpopulate(val, "Capabilities", &s.Capabilities) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SKUsResult. +func (s SKUsResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SKUsResult. +func (s *SKUsResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SamplingSettings. +func (s SamplingSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "percentage", s.Percentage) + populate(objectMap, "samplingType", s.SamplingType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SamplingSettings. +func (s *SamplingSettings) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "percentage": + err = unpopulate(val, "Percentage", &s.Percentage) + delete(rawMsg, key) + case "samplingType": + err = unpopulate(val, "SamplingType", &s.SamplingType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SaveConfigurationParameter. +func (s SaveConfigurationParameter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SaveConfigurationParameter. +func (s *SaveConfigurationParameter) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SaveConfigurationParameterProperties. +func (s SaveConfigurationParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "branch", s.Branch) + populate(objectMap, "force", s.Force) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SaveConfigurationParameterProperties. +func (s *SaveConfigurationParameterProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "branch": + err = unpopulate(val, "Branch", &s.Branch) + delete(rawMsg, key) + case "force": + err = unpopulate(val, "Force", &s.Force) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SchemaCollection. +func (s SchemaCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", s.Count) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SchemaCollection. +func (s *SchemaCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &s.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SchemaContract. +func (s SchemaContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SchemaContract. +func (s *SchemaContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SchemaContractProperties. +func (s SchemaContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "contentType", s.ContentType) + populate(objectMap, "document", s.Document) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SchemaContractProperties. +func (s *SchemaContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "contentType": + err = unpopulate(val, "ContentType", &s.ContentType) + delete(rawMsg, key) + case "document": + err = unpopulate(val, "Document", &s.Document) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SchemaDocumentProperties. +func (s SchemaDocumentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "components", &s.Components) + populate(objectMap, "definitions", &s.Definitions) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SchemaDocumentProperties. +func (s *SchemaDocumentProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "components": + err = unpopulate(val, "Components", &s.Components) + delete(rawMsg, key) + case "definitions": + err = unpopulate(val, "Definitions", &s.Definitions) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceApplyNetworkConfigurationParameters. +func (s ServiceApplyNetworkConfigurationParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "location", s.Location) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceApplyNetworkConfigurationParameters. +func (s *ServiceApplyNetworkConfigurationParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceBackupRestoreParameters. +func (s ServiceBackupRestoreParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "accessKey", s.AccessKey) + populate(objectMap, "accessType", s.AccessType) + populate(objectMap, "backupName", s.BackupName) + populate(objectMap, "clientId", s.ClientID) + populate(objectMap, "containerName", s.ContainerName) + populate(objectMap, "storageAccount", s.StorageAccount) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBackupRestoreParameters. +func (s *ServiceBackupRestoreParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "accessKey": + err = unpopulate(val, "AccessKey", &s.AccessKey) + delete(rawMsg, key) + case "accessType": + err = unpopulate(val, "AccessType", &s.AccessType) + delete(rawMsg, key) + case "backupName": + err = unpopulate(val, "BackupName", &s.BackupName) + delete(rawMsg, key) + case "clientId": + err = unpopulate(val, "ClientID", &s.ClientID) + delete(rawMsg, key) + case "containerName": + err = unpopulate(val, "ContainerName", &s.ContainerName) + delete(rawMsg, key) + case "storageAccount": + err = unpopulate(val, "StorageAccount", &s.StorageAccount) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceBaseProperties. +func (s ServiceBaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersionConstraint", s.APIVersionConstraint) + populate(objectMap, "additionalLocations", s.AdditionalLocations) + populate(objectMap, "certificates", s.Certificates) + populateTimeRFC3339(objectMap, "createdAtUtc", s.CreatedAtUTC) + populate(objectMap, "customProperties", s.CustomProperties) + populate(objectMap, "developerPortalUrl", s.DeveloperPortalURL) + populate(objectMap, "disableGateway", s.DisableGateway) + populate(objectMap, "enableClientCertificate", s.EnableClientCertificate) + populate(objectMap, "gatewayRegionalUrl", s.GatewayRegionalURL) + populate(objectMap, "gatewayUrl", s.GatewayURL) + populate(objectMap, "hostnameConfigurations", s.HostnameConfigurations) + populate(objectMap, "managementApiUrl", s.ManagementAPIURL) + populate(objectMap, "natGatewayState", s.NatGatewayState) + populate(objectMap, "notificationSenderEmail", s.NotificationSenderEmail) + populate(objectMap, "outboundPublicIPAddresses", s.OutboundPublicIPAddresses) + populate(objectMap, "platformVersion", s.PlatformVersion) + populate(objectMap, "portalUrl", s.PortalURL) + populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) + populate(objectMap, "privateIPAddresses", s.PrivateIPAddresses) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "publicIpAddressId", s.PublicIPAddressID) + populate(objectMap, "publicIPAddresses", s.PublicIPAddresses) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "restore", s.Restore) + populate(objectMap, "scmUrl", s.ScmURL) + populate(objectMap, "targetProvisioningState", s.TargetProvisioningState) + populate(objectMap, "virtualNetworkConfiguration", s.VirtualNetworkConfiguration) + populate(objectMap, "virtualNetworkType", s.VirtualNetworkType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBaseProperties. +func (s *ServiceBaseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiVersionConstraint": + err = unpopulate(val, "APIVersionConstraint", &s.APIVersionConstraint) + delete(rawMsg, key) + case "additionalLocations": + err = unpopulate(val, "AdditionalLocations", &s.AdditionalLocations) + delete(rawMsg, key) + case "certificates": + err = unpopulate(val, "Certificates", &s.Certificates) + delete(rawMsg, key) + case "createdAtUtc": + err = unpopulateTimeRFC3339(val, "CreatedAtUTC", &s.CreatedAtUTC) + delete(rawMsg, key) + case "customProperties": + err = unpopulate(val, "CustomProperties", &s.CustomProperties) + delete(rawMsg, key) + case "developerPortalUrl": + err = unpopulate(val, "DeveloperPortalURL", &s.DeveloperPortalURL) + delete(rawMsg, key) + case "disableGateway": + err = unpopulate(val, "DisableGateway", &s.DisableGateway) + delete(rawMsg, key) + case "enableClientCertificate": + err = unpopulate(val, "EnableClientCertificate", &s.EnableClientCertificate) + delete(rawMsg, key) + case "gatewayRegionalUrl": + err = unpopulate(val, "GatewayRegionalURL", &s.GatewayRegionalURL) + delete(rawMsg, key) + case "gatewayUrl": + err = unpopulate(val, "GatewayURL", &s.GatewayURL) + delete(rawMsg, key) + case "hostnameConfigurations": + err = unpopulate(val, "HostnameConfigurations", &s.HostnameConfigurations) + delete(rawMsg, key) + case "managementApiUrl": + err = unpopulate(val, "ManagementAPIURL", &s.ManagementAPIURL) + delete(rawMsg, key) + case "natGatewayState": + err = unpopulate(val, "NatGatewayState", &s.NatGatewayState) + delete(rawMsg, key) + case "notificationSenderEmail": + err = unpopulate(val, "NotificationSenderEmail", &s.NotificationSenderEmail) + delete(rawMsg, key) + case "outboundPublicIPAddresses": + err = unpopulate(val, "OutboundPublicIPAddresses", &s.OutboundPublicIPAddresses) + delete(rawMsg, key) + case "platformVersion": + err = unpopulate(val, "PlatformVersion", &s.PlatformVersion) + delete(rawMsg, key) + case "portalUrl": + err = unpopulate(val, "PortalURL", &s.PortalURL) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) + delete(rawMsg, key) + case "privateIPAddresses": + err = unpopulate(val, "PrivateIPAddresses", &s.PrivateIPAddresses) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "publicIpAddressId": + err = unpopulate(val, "PublicIPAddressID", &s.PublicIPAddressID) + delete(rawMsg, key) + case "publicIPAddresses": + err = unpopulate(val, "PublicIPAddresses", &s.PublicIPAddresses) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "restore": + err = unpopulate(val, "Restore", &s.Restore) + delete(rawMsg, key) + case "scmUrl": + err = unpopulate(val, "ScmURL", &s.ScmURL) + delete(rawMsg, key) + case "targetProvisioningState": + err = unpopulate(val, "TargetProvisioningState", &s.TargetProvisioningState) + delete(rawMsg, key) + case "virtualNetworkConfiguration": + err = unpopulate(val, "VirtualNetworkConfiguration", &s.VirtualNetworkConfiguration) + delete(rawMsg, key) + case "virtualNetworkType": + err = unpopulate(val, "VirtualNetworkType", &s.VirtualNetworkType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceCheckNameAvailabilityParameters. +func (s ServiceCheckNameAvailabilityParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", s.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceCheckNameAvailabilityParameters. +func (s *ServiceCheckNameAvailabilityParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceGetDomainOwnershipIdentifierResult. +func (s ServiceGetDomainOwnershipIdentifierResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "domainOwnershipIdentifier", s.DomainOwnershipIdentifier) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceGetDomainOwnershipIdentifierResult. +func (s *ServiceGetDomainOwnershipIdentifierResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "domainOwnershipIdentifier": + err = unpopulate(val, "DomainOwnershipIdentifier", &s.DomainOwnershipIdentifier) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceGetSsoTokenResult. +func (s ServiceGetSsoTokenResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "redirectUri", s.RedirectURI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceGetSsoTokenResult. +func (s *ServiceGetSsoTokenResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "redirectUri": + err = unpopulate(val, "RedirectURI", &s.RedirectURI) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceIdentity. +func (s ServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "principalId", s.PrincipalID) + populate(objectMap, "tenantId", s.TenantID) + populate(objectMap, "type", s.Type) + populate(objectMap, "userAssignedIdentities", s.UserAssignedIdentities) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceIdentity. +func (s *ServiceIdentity) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "principalId": + err = unpopulate(val, "PrincipalID", &s.PrincipalID) + delete(rawMsg, key) + case "tenantId": + err = unpopulate(val, "TenantID", &s.TenantID) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + case "userAssignedIdentities": + err = unpopulate(val, "UserAssignedIdentities", &s.UserAssignedIdentities) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceListResult. +func (s ServiceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceListResult. +func (s *ServiceListResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceNameAvailabilityResult. +func (s ServiceNameAvailabilityResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "message", s.Message) + populate(objectMap, "nameAvailable", s.NameAvailable) + populate(objectMap, "reason", s.Reason) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceNameAvailabilityResult. +func (s *ServiceNameAvailabilityResult) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, "Message", &s.Message) + delete(rawMsg, key) + case "nameAvailable": + err = unpopulate(val, "NameAvailable", &s.NameAvailable) + delete(rawMsg, key) + case "reason": + err = unpopulate(val, "Reason", &s.Reason) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceProperties. +func (s ServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersionConstraint", s.APIVersionConstraint) + populate(objectMap, "additionalLocations", s.AdditionalLocations) + populate(objectMap, "certificates", s.Certificates) + populateTimeRFC3339(objectMap, "createdAtUtc", s.CreatedAtUTC) + populate(objectMap, "customProperties", s.CustomProperties) + populate(objectMap, "developerPortalUrl", s.DeveloperPortalURL) + populate(objectMap, "disableGateway", s.DisableGateway) + populate(objectMap, "enableClientCertificate", s.EnableClientCertificate) + populate(objectMap, "gatewayRegionalUrl", s.GatewayRegionalURL) + populate(objectMap, "gatewayUrl", s.GatewayURL) + populate(objectMap, "hostnameConfigurations", s.HostnameConfigurations) + populate(objectMap, "managementApiUrl", s.ManagementAPIURL) + populate(objectMap, "natGatewayState", s.NatGatewayState) + populate(objectMap, "notificationSenderEmail", s.NotificationSenderEmail) + populate(objectMap, "outboundPublicIPAddresses", s.OutboundPublicIPAddresses) + populate(objectMap, "platformVersion", s.PlatformVersion) + populate(objectMap, "portalUrl", s.PortalURL) + populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) + populate(objectMap, "privateIPAddresses", s.PrivateIPAddresses) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "publicIpAddressId", s.PublicIPAddressID) + populate(objectMap, "publicIPAddresses", s.PublicIPAddresses) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "publisherEmail", s.PublisherEmail) + populate(objectMap, "publisherName", s.PublisherName) + populate(objectMap, "restore", s.Restore) + populate(objectMap, "scmUrl", s.ScmURL) + populate(objectMap, "targetProvisioningState", s.TargetProvisioningState) + populate(objectMap, "virtualNetworkConfiguration", s.VirtualNetworkConfiguration) + populate(objectMap, "virtualNetworkType", s.VirtualNetworkType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProperties. +func (s *ServiceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiVersionConstraint": + err = unpopulate(val, "APIVersionConstraint", &s.APIVersionConstraint) + delete(rawMsg, key) + case "additionalLocations": + err = unpopulate(val, "AdditionalLocations", &s.AdditionalLocations) + delete(rawMsg, key) + case "certificates": + err = unpopulate(val, "Certificates", &s.Certificates) + delete(rawMsg, key) + case "createdAtUtc": + err = unpopulateTimeRFC3339(val, "CreatedAtUTC", &s.CreatedAtUTC) + delete(rawMsg, key) + case "customProperties": + err = unpopulate(val, "CustomProperties", &s.CustomProperties) + delete(rawMsg, key) + case "developerPortalUrl": + err = unpopulate(val, "DeveloperPortalURL", &s.DeveloperPortalURL) + delete(rawMsg, key) + case "disableGateway": + err = unpopulate(val, "DisableGateway", &s.DisableGateway) + delete(rawMsg, key) + case "enableClientCertificate": + err = unpopulate(val, "EnableClientCertificate", &s.EnableClientCertificate) + delete(rawMsg, key) + case "gatewayRegionalUrl": + err = unpopulate(val, "GatewayRegionalURL", &s.GatewayRegionalURL) + delete(rawMsg, key) + case "gatewayUrl": + err = unpopulate(val, "GatewayURL", &s.GatewayURL) + delete(rawMsg, key) + case "hostnameConfigurations": + err = unpopulate(val, "HostnameConfigurations", &s.HostnameConfigurations) + delete(rawMsg, key) + case "managementApiUrl": + err = unpopulate(val, "ManagementAPIURL", &s.ManagementAPIURL) + delete(rawMsg, key) + case "natGatewayState": + err = unpopulate(val, "NatGatewayState", &s.NatGatewayState) + delete(rawMsg, key) + case "notificationSenderEmail": + err = unpopulate(val, "NotificationSenderEmail", &s.NotificationSenderEmail) + delete(rawMsg, key) + case "outboundPublicIPAddresses": + err = unpopulate(val, "OutboundPublicIPAddresses", &s.OutboundPublicIPAddresses) + delete(rawMsg, key) + case "platformVersion": + err = unpopulate(val, "PlatformVersion", &s.PlatformVersion) + delete(rawMsg, key) + case "portalUrl": + err = unpopulate(val, "PortalURL", &s.PortalURL) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) + delete(rawMsg, key) + case "privateIPAddresses": + err = unpopulate(val, "PrivateIPAddresses", &s.PrivateIPAddresses) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "publicIpAddressId": + err = unpopulate(val, "PublicIPAddressID", &s.PublicIPAddressID) + delete(rawMsg, key) + case "publicIPAddresses": + err = unpopulate(val, "PublicIPAddresses", &s.PublicIPAddresses) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "publisherEmail": + err = unpopulate(val, "PublisherEmail", &s.PublisherEmail) + delete(rawMsg, key) + case "publisherName": + err = unpopulate(val, "PublisherName", &s.PublisherName) + delete(rawMsg, key) + case "restore": + err = unpopulate(val, "Restore", &s.Restore) + delete(rawMsg, key) + case "scmUrl": + err = unpopulate(val, "ScmURL", &s.ScmURL) + delete(rawMsg, key) + case "targetProvisioningState": + err = unpopulate(val, "TargetProvisioningState", &s.TargetProvisioningState) + delete(rawMsg, key) + case "virtualNetworkConfiguration": + err = unpopulate(val, "VirtualNetworkConfiguration", &s.VirtualNetworkConfiguration) + delete(rawMsg, key) + case "virtualNetworkType": + err = unpopulate(val, "VirtualNetworkType", &s.VirtualNetworkType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceResource. +func (s ServiceResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "location", s.Location) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + populate(objectMap, "zones", s.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceResource. +func (s *ServiceResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) + case "location": + err = unpopulate(val, "Location", &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "systemData": + err = unpopulate(val, "SystemData", &s.SystemData) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &s.Zones) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceSKUProperties. +func (s ServiceSKUProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "capacity", s.Capacity) + populate(objectMap, "name", s.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceSKUProperties. +func (s *ServiceSKUProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "capacity": + err = unpopulate(val, "Capacity", &s.Capacity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceUpdateParameters. +func (s ServiceUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + populate(objectMap, "zones", s.Zones) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceUpdateParameters. +func (s *ServiceUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "etag": + err = unpopulate(val, "Etag", &s.Etag) + delete(rawMsg, key) + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "identity": + err = unpopulate(val, "Identity", &s.Identity) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "sku": + err = unpopulate(val, "SKU", &s.SKU) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, "Tags", &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + case "zones": + err = unpopulate(val, "Zones", &s.Zones) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceUpdateProperties. +func (s ServiceUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "apiVersionConstraint", s.APIVersionConstraint) + populate(objectMap, "additionalLocations", s.AdditionalLocations) + populate(objectMap, "certificates", s.Certificates) + populateTimeRFC3339(objectMap, "createdAtUtc", s.CreatedAtUTC) + populate(objectMap, "customProperties", s.CustomProperties) + populate(objectMap, "developerPortalUrl", s.DeveloperPortalURL) + populate(objectMap, "disableGateway", s.DisableGateway) + populate(objectMap, "enableClientCertificate", s.EnableClientCertificate) + populate(objectMap, "gatewayRegionalUrl", s.GatewayRegionalURL) + populate(objectMap, "gatewayUrl", s.GatewayURL) + populate(objectMap, "hostnameConfigurations", s.HostnameConfigurations) + populate(objectMap, "managementApiUrl", s.ManagementAPIURL) + populate(objectMap, "natGatewayState", s.NatGatewayState) + populate(objectMap, "notificationSenderEmail", s.NotificationSenderEmail) + populate(objectMap, "outboundPublicIPAddresses", s.OutboundPublicIPAddresses) + populate(objectMap, "platformVersion", s.PlatformVersion) + populate(objectMap, "portalUrl", s.PortalURL) + populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) + populate(objectMap, "privateIPAddresses", s.PrivateIPAddresses) + populate(objectMap, "provisioningState", s.ProvisioningState) + populate(objectMap, "publicIpAddressId", s.PublicIPAddressID) + populate(objectMap, "publicIPAddresses", s.PublicIPAddresses) + populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) + populate(objectMap, "publisherEmail", s.PublisherEmail) + populate(objectMap, "publisherName", s.PublisherName) + populate(objectMap, "restore", s.Restore) + populate(objectMap, "scmUrl", s.ScmURL) + populate(objectMap, "targetProvisioningState", s.TargetProvisioningState) + populate(objectMap, "virtualNetworkConfiguration", s.VirtualNetworkConfiguration) + populate(objectMap, "virtualNetworkType", s.VirtualNetworkType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceUpdateProperties. +func (s *ServiceUpdateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "apiVersionConstraint": + err = unpopulate(val, "APIVersionConstraint", &s.APIVersionConstraint) + delete(rawMsg, key) + case "additionalLocations": + err = unpopulate(val, "AdditionalLocations", &s.AdditionalLocations) + delete(rawMsg, key) + case "certificates": + err = unpopulate(val, "Certificates", &s.Certificates) + delete(rawMsg, key) + case "createdAtUtc": + err = unpopulateTimeRFC3339(val, "CreatedAtUTC", &s.CreatedAtUTC) + delete(rawMsg, key) + case "customProperties": + err = unpopulate(val, "CustomProperties", &s.CustomProperties) + delete(rawMsg, key) + case "developerPortalUrl": + err = unpopulate(val, "DeveloperPortalURL", &s.DeveloperPortalURL) + delete(rawMsg, key) + case "disableGateway": + err = unpopulate(val, "DisableGateway", &s.DisableGateway) + delete(rawMsg, key) + case "enableClientCertificate": + err = unpopulate(val, "EnableClientCertificate", &s.EnableClientCertificate) + delete(rawMsg, key) + case "gatewayRegionalUrl": + err = unpopulate(val, "GatewayRegionalURL", &s.GatewayRegionalURL) + delete(rawMsg, key) + case "gatewayUrl": + err = unpopulate(val, "GatewayURL", &s.GatewayURL) + delete(rawMsg, key) + case "hostnameConfigurations": + err = unpopulate(val, "HostnameConfigurations", &s.HostnameConfigurations) + delete(rawMsg, key) + case "managementApiUrl": + err = unpopulate(val, "ManagementAPIURL", &s.ManagementAPIURL) + delete(rawMsg, key) + case "natGatewayState": + err = unpopulate(val, "NatGatewayState", &s.NatGatewayState) + delete(rawMsg, key) + case "notificationSenderEmail": + err = unpopulate(val, "NotificationSenderEmail", &s.NotificationSenderEmail) + delete(rawMsg, key) + case "outboundPublicIPAddresses": + err = unpopulate(val, "OutboundPublicIPAddresses", &s.OutboundPublicIPAddresses) + delete(rawMsg, key) + case "platformVersion": + err = unpopulate(val, "PlatformVersion", &s.PlatformVersion) + delete(rawMsg, key) + case "portalUrl": + err = unpopulate(val, "PortalURL", &s.PortalURL) + delete(rawMsg, key) + case "privateEndpointConnections": + err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) + delete(rawMsg, key) + case "privateIPAddresses": + err = unpopulate(val, "PrivateIPAddresses", &s.PrivateIPAddresses) + delete(rawMsg, key) + case "provisioningState": + err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) + delete(rawMsg, key) + case "publicIpAddressId": + err = unpopulate(val, "PublicIPAddressID", &s.PublicIPAddressID) + delete(rawMsg, key) + case "publicIPAddresses": + err = unpopulate(val, "PublicIPAddresses", &s.PublicIPAddresses) + delete(rawMsg, key) + case "publicNetworkAccess": + err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) + delete(rawMsg, key) + case "publisherEmail": + err = unpopulate(val, "PublisherEmail", &s.PublisherEmail) + delete(rawMsg, key) + case "publisherName": + err = unpopulate(val, "PublisherName", &s.PublisherName) + delete(rawMsg, key) + case "restore": + err = unpopulate(val, "Restore", &s.Restore) + delete(rawMsg, key) + case "scmUrl": + err = unpopulate(val, "ScmURL", &s.ScmURL) + delete(rawMsg, key) + case "targetProvisioningState": + err = unpopulate(val, "TargetProvisioningState", &s.TargetProvisioningState) + delete(rawMsg, key) + case "virtualNetworkConfiguration": + err = unpopulate(val, "VirtualNetworkConfiguration", &s.VirtualNetworkConfiguration) + delete(rawMsg, key) + case "virtualNetworkType": + err = unpopulate(val, "VirtualNetworkType", &s.VirtualNetworkType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionCollection. +func (s SubscriptionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", s.Count) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionCollection. +func (s *SubscriptionCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &s.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &s.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &s.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionContract. +func (s SubscriptionContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", s.ID) + populate(objectMap, "name", s.Name) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionContract. +func (s *SubscriptionContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &s.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &s.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &s.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionContractProperties. +func (s SubscriptionContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowTracing", s.AllowTracing) + populateTimeRFC3339(objectMap, "createdDate", s.CreatedDate) + populate(objectMap, "displayName", s.DisplayName) + populateTimeRFC3339(objectMap, "endDate", s.EndDate) + populateTimeRFC3339(objectMap, "expirationDate", s.ExpirationDate) + populateTimeRFC3339(objectMap, "notificationDate", s.NotificationDate) + populate(objectMap, "ownerId", s.OwnerID) + populate(objectMap, "primaryKey", s.PrimaryKey) + populate(objectMap, "scope", s.Scope) + populate(objectMap, "secondaryKey", s.SecondaryKey) + populateTimeRFC3339(objectMap, "startDate", s.StartDate) + populate(objectMap, "state", s.State) + populate(objectMap, "stateComment", s.StateComment) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionContractProperties. +func (s *SubscriptionContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowTracing": + err = unpopulate(val, "AllowTracing", &s.AllowTracing) + delete(rawMsg, key) + case "createdDate": + err = unpopulateTimeRFC3339(val, "CreatedDate", &s.CreatedDate) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "endDate": + err = unpopulateTimeRFC3339(val, "EndDate", &s.EndDate) + delete(rawMsg, key) + case "expirationDate": + err = unpopulateTimeRFC3339(val, "ExpirationDate", &s.ExpirationDate) + delete(rawMsg, key) + case "notificationDate": + err = unpopulateTimeRFC3339(val, "NotificationDate", &s.NotificationDate) + delete(rawMsg, key) + case "ownerId": + err = unpopulate(val, "OwnerID", &s.OwnerID) + delete(rawMsg, key) + case "primaryKey": + err = unpopulate(val, "PrimaryKey", &s.PrimaryKey) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &s.Scope) + delete(rawMsg, key) + case "secondaryKey": + err = unpopulate(val, "SecondaryKey", &s.SecondaryKey) + delete(rawMsg, key) + case "startDate": + err = unpopulateTimeRFC3339(val, "StartDate", &s.StartDate) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "stateComment": + err = unpopulate(val, "StateComment", &s.StateComment) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionCreateParameterProperties. +func (s SubscriptionCreateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowTracing", s.AllowTracing) + populate(objectMap, "displayName", s.DisplayName) + populate(objectMap, "ownerId", s.OwnerID) + populate(objectMap, "primaryKey", s.PrimaryKey) + populate(objectMap, "scope", s.Scope) + populate(objectMap, "secondaryKey", s.SecondaryKey) + populate(objectMap, "state", s.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionCreateParameterProperties. +func (s *SubscriptionCreateParameterProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowTracing": + err = unpopulate(val, "AllowTracing", &s.AllowTracing) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "ownerId": + err = unpopulate(val, "OwnerID", &s.OwnerID) + delete(rawMsg, key) + case "primaryKey": + err = unpopulate(val, "PrimaryKey", &s.PrimaryKey) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &s.Scope) + delete(rawMsg, key) + case "secondaryKey": + err = unpopulate(val, "SecondaryKey", &s.SecondaryKey) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionCreateParameters. +func (s SubscriptionCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionCreateParameters. +func (s *SubscriptionCreateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionKeyParameterNamesContract. +func (s SubscriptionKeyParameterNamesContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "header", s.Header) + populate(objectMap, "query", s.Query) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionKeyParameterNamesContract. +func (s *SubscriptionKeyParameterNamesContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "header": + err = unpopulate(val, "Header", &s.Header) + delete(rawMsg, key) + case "query": + err = unpopulate(val, "Query", &s.Query) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionKeysContract. +func (s SubscriptionKeysContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "primaryKey", s.PrimaryKey) + populate(objectMap, "secondaryKey", s.SecondaryKey) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionKeysContract. +func (s *SubscriptionKeysContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "primaryKey": + err = unpopulate(val, "PrimaryKey", &s.PrimaryKey) + delete(rawMsg, key) + case "secondaryKey": + err = unpopulate(val, "SecondaryKey", &s.SecondaryKey) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionUpdateParameterProperties. +func (s SubscriptionUpdateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "allowTracing", s.AllowTracing) + populate(objectMap, "displayName", s.DisplayName) + populateTimeRFC3339(objectMap, "expirationDate", s.ExpirationDate) + populate(objectMap, "ownerId", s.OwnerID) + populate(objectMap, "primaryKey", s.PrimaryKey) + populate(objectMap, "scope", s.Scope) + populate(objectMap, "secondaryKey", s.SecondaryKey) + populate(objectMap, "state", s.State) + populate(objectMap, "stateComment", s.StateComment) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUpdateParameterProperties. +func (s *SubscriptionUpdateParameterProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "allowTracing": + err = unpopulate(val, "AllowTracing", &s.AllowTracing) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &s.DisplayName) + delete(rawMsg, key) + case "expirationDate": + err = unpopulateTimeRFC3339(val, "ExpirationDate", &s.ExpirationDate) + delete(rawMsg, key) + case "ownerId": + err = unpopulate(val, "OwnerID", &s.OwnerID) + delete(rawMsg, key) + case "primaryKey": + err = unpopulate(val, "PrimaryKey", &s.PrimaryKey) + delete(rawMsg, key) + case "scope": + err = unpopulate(val, "Scope", &s.Scope) + delete(rawMsg, key) + case "secondaryKey": + err = unpopulate(val, "SecondaryKey", &s.SecondaryKey) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &s.State) + delete(rawMsg, key) + case "stateComment": + err = unpopulate(val, "StateComment", &s.StateComment) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionUpdateParameters. +func (s SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", s.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUpdateParameters. +func (s *SubscriptionUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &s.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SubscriptionsDelegationSettingsProperties. +func (s SubscriptionsDelegationSettingsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "enabled", s.Enabled) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionsDelegationSettingsProperties. +func (s *SubscriptionsDelegationSettingsProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "enabled": + err = unpopulate(val, "Enabled", &s.Enabled) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SystemData. +func (s SystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) + populate(objectMap, "createdBy", s.CreatedBy) + populate(objectMap, "createdByType", s.CreatedByType) + populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) + populate(objectMap, "lastModifiedBy", s.LastModifiedBy) + populate(objectMap, "lastModifiedByType", s.LastModifiedByType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. +func (s *SystemData) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, "CreatedBy", &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, "CreatedByType", &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", s, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagCollection. +func (t TagCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", t.Count) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagCollection. +func (t *TagCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &t.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagContract. +func (t TagContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagContract. +func (t *TagContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagContractProperties. +func (t TagContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "displayName", t.DisplayName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagContractProperties. +func (t *TagContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, "DisplayName", &t.DisplayName) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagCreateUpdateParameters. +func (t TagCreateUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", t.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagCreateUpdateParameters. +func (t *TagCreateUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagDescriptionBaseProperties. +func (t TagDescriptionBaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", t.Description) + populate(objectMap, "externalDocsDescription", t.ExternalDocsDescription) + populate(objectMap, "externalDocsUrl", t.ExternalDocsURL) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagDescriptionBaseProperties. +func (t *TagDescriptionBaseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &t.Description) + delete(rawMsg, key) + case "externalDocsDescription": + err = unpopulate(val, "ExternalDocsDescription", &t.ExternalDocsDescription) + delete(rawMsg, key) + case "externalDocsUrl": + err = unpopulate(val, "ExternalDocsURL", &t.ExternalDocsURL) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagDescriptionCollection. +func (t TagDescriptionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", t.Count) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagDescriptionCollection. +func (t *TagDescriptionCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &t.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagDescriptionContract. +func (t TagDescriptionContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagDescriptionContract. +func (t *TagDescriptionContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagDescriptionContractProperties. +func (t TagDescriptionContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "description", t.Description) + populate(objectMap, "displayName", t.DisplayName) + populate(objectMap, "externalDocsDescription", t.ExternalDocsDescription) + populate(objectMap, "externalDocsUrl", t.ExternalDocsURL) + populate(objectMap, "tagId", t.TagID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagDescriptionContractProperties. +func (t *TagDescriptionContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, "Description", &t.Description) + delete(rawMsg, key) + case "displayName": + err = unpopulate(val, "DisplayName", &t.DisplayName) + delete(rawMsg, key) + case "externalDocsDescription": + err = unpopulate(val, "ExternalDocsDescription", &t.ExternalDocsDescription) + delete(rawMsg, key) + case "externalDocsUrl": + err = unpopulate(val, "ExternalDocsURL", &t.ExternalDocsURL) + delete(rawMsg, key) + case "tagId": + err = unpopulate(val, "TagID", &t.TagID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagDescriptionCreateParameters. +func (t TagDescriptionCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", t.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagDescriptionCreateParameters. +func (t *TagDescriptionCreateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagResourceCollection. +func (t TagResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", t.Count) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagResourceCollection. +func (t *TagResourceCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "count": + err = unpopulate(val, "Count", &t.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagResourceContract. +func (t TagResourceContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "api", t.API) + populate(objectMap, "operation", t.Operation) + populate(objectMap, "product", t.Product) + populate(objectMap, "tag", t.Tag) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagResourceContract. +func (t *TagResourceContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "api": + err = unpopulate(val, "API", &t.API) + delete(rawMsg, key) + case "operation": + err = unpopulate(val, "Operation", &t.Operation) + delete(rawMsg, key) + case "product": + err = unpopulate(val, "Product", &t.Product) + delete(rawMsg, key) + case "tag": + err = unpopulate(val, "Tag", &t.Tag) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagResourceContractProperties. +func (t TagResourceContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TagResourceContractProperties. +func (t *TagResourceContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TenantConfigurationSyncStateContract. +func (t TenantConfigurationSyncStateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TenantConfigurationSyncStateContract. +func (t *TenantConfigurationSyncStateContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TenantConfigurationSyncStateContractProperties. +func (t TenantConfigurationSyncStateContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "branch", t.Branch) + populate(objectMap, "commitId", t.CommitID) + populateTimeRFC3339(objectMap, "configurationChangeDate", t.ConfigurationChangeDate) + populate(objectMap, "isExport", t.IsExport) + populate(objectMap, "isGitEnabled", t.IsGitEnabled) + populate(objectMap, "isSynced", t.IsSynced) + populate(objectMap, "lastOperationId", t.LastOperationID) + populateTimeRFC3339(objectMap, "syncDate", t.SyncDate) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TenantConfigurationSyncStateContractProperties. +func (t *TenantConfigurationSyncStateContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "branch": + err = unpopulate(val, "Branch", &t.Branch) + delete(rawMsg, key) + case "commitId": + err = unpopulate(val, "CommitID", &t.CommitID) + delete(rawMsg, key) + case "configurationChangeDate": + err = unpopulateTimeRFC3339(val, "ConfigurationChangeDate", &t.ConfigurationChangeDate) + delete(rawMsg, key) + case "isExport": + err = unpopulate(val, "IsExport", &t.IsExport) + delete(rawMsg, key) + case "isGitEnabled": + err = unpopulate(val, "IsGitEnabled", &t.IsGitEnabled) + delete(rawMsg, key) + case "isSynced": + err = unpopulate(val, "IsSynced", &t.IsSynced) + delete(rawMsg, key) + case "lastOperationId": + err = unpopulate(val, "LastOperationID", &t.LastOperationID) + delete(rawMsg, key) + case "syncDate": + err = unpopulateTimeRFC3339(val, "SyncDate", &t.SyncDate) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TenantSettingsCollection. +func (t TenantSettingsCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "nextLink", t.NextLink) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TenantSettingsCollection. +func (t *TenantSettingsCollection) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "nextLink": + err = unpopulate(val, "NextLink", &t.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TenantSettingsContract. +func (t TenantSettingsContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", t.ID) + populate(objectMap, "name", t.Name) + populate(objectMap, "properties", t.Properties) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TenantSettingsContract. +func (t *TenantSettingsContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &t.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &t.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &t.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TenantSettingsContractProperties. +func (t TenantSettingsContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "settings", t.Settings) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TenantSettingsContractProperties. +func (t *TenantSettingsContractProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "settings": + err = unpopulate(val, "Settings", &t.Settings) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TermsOfServiceProperties. +func (t TermsOfServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "consentRequired", t.ConsentRequired) + populate(objectMap, "enabled", t.Enabled) + populate(objectMap, "text", t.Text) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TermsOfServiceProperties. +func (t *TermsOfServiceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "consentRequired": + err = unpopulate(val, "ConsentRequired", &t.ConsentRequired) + delete(rawMsg, key) + case "enabled": + err = unpopulate(val, "Enabled", &t.Enabled) + delete(rawMsg, key) + case "text": + err = unpopulate(val, "Text", &t.Text) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TokenBodyParameterContract. +func (t TokenBodyParameterContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "name", t.Name) + populate(objectMap, "value", t.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type TokenBodyParameterContract. +func (t *TokenBodyParameterContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "name": + err = unpopulate(val, "Name", &t.Name) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &t.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", t, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserCollection. +func (u UserCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", u.Count) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserCollection. +func (u *UserCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &u.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserContract. +func (u UserContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", u.ID) + populate(objectMap, "name", u.Name) + populate(objectMap, "properties", u.Properties) + populate(objectMap, "type", u.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserContract. +func (u *UserContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &u.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &u.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserContractProperties. +func (u UserContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "email", u.Email) + populate(objectMap, "firstName", u.FirstName) + populate(objectMap, "groups", u.Groups) + populate(objectMap, "identities", u.Identities) + populate(objectMap, "lastName", u.LastName) + populate(objectMap, "note", u.Note) + populateTimeRFC3339(objectMap, "registrationDate", u.RegistrationDate) + populate(objectMap, "state", u.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserContractProperties. +func (u *UserContractProperties) UnmarshalJSON(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 "email": + err = unpopulate(val, "Email", &u.Email) + delete(rawMsg, key) + case "firstName": + err = unpopulate(val, "FirstName", &u.FirstName) + delete(rawMsg, key) + case "groups": + err = unpopulate(val, "Groups", &u.Groups) + delete(rawMsg, key) + case "identities": + err = unpopulate(val, "Identities", &u.Identities) + delete(rawMsg, key) + case "lastName": + err = unpopulate(val, "LastName", &u.LastName) + delete(rawMsg, key) + case "note": + err = unpopulate(val, "Note", &u.Note) + delete(rawMsg, key) + case "registrationDate": + err = unpopulateTimeRFC3339(val, "RegistrationDate", &u.RegistrationDate) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &u.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserCreateParameterProperties. +func (u UserCreateParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "appType", u.AppType) + populate(objectMap, "confirmation", u.Confirmation) + populate(objectMap, "email", u.Email) + populate(objectMap, "firstName", u.FirstName) + populate(objectMap, "identities", u.Identities) + populate(objectMap, "lastName", u.LastName) + populate(objectMap, "note", u.Note) + populate(objectMap, "password", u.Password) + populate(objectMap, "state", u.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserCreateParameterProperties. +func (u *UserCreateParameterProperties) UnmarshalJSON(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 "appType": + err = unpopulate(val, "AppType", &u.AppType) + delete(rawMsg, key) + case "confirmation": + err = unpopulate(val, "Confirmation", &u.Confirmation) + delete(rawMsg, key) + case "email": + err = unpopulate(val, "Email", &u.Email) + delete(rawMsg, key) + case "firstName": + err = unpopulate(val, "FirstName", &u.FirstName) + delete(rawMsg, key) + case "identities": + err = unpopulate(val, "Identities", &u.Identities) + delete(rawMsg, key) + case "lastName": + err = unpopulate(val, "LastName", &u.LastName) + delete(rawMsg, key) + case "note": + err = unpopulate(val, "Note", &u.Note) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &u.Password) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &u.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserCreateParameters. +func (u UserCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", u.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserCreateParameters. +func (u *UserCreateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserEntityBaseParameters. +func (u UserEntityBaseParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "identities", u.Identities) + populate(objectMap, "note", u.Note) + populate(objectMap, "state", u.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserEntityBaseParameters. +func (u *UserEntityBaseParameters) UnmarshalJSON(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 "identities": + err = unpopulate(val, "Identities", &u.Identities) + delete(rawMsg, key) + case "note": + err = unpopulate(val, "Note", &u.Note) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &u.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserIdentityCollection. +func (u UserIdentityCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "count", u.Count) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentityCollection. +func (u *UserIdentityCollection) UnmarshalJSON(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 "count": + err = unpopulate(val, "Count", &u.Count) + delete(rawMsg, key) + case "nextLink": + err = unpopulate(val, "NextLink", &u.NextLink) + delete(rawMsg, key) + case "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserIdentityContract. +func (u UserIdentityContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", u.ID) + populate(objectMap, "provider", u.Provider) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentityContract. +func (u *UserIdentityContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &u.ID) + delete(rawMsg, key) + case "provider": + err = unpopulate(val, "Provider", &u.Provider) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserIdentityProperties. +func (u UserIdentityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "clientId", u.ClientID) + populate(objectMap, "principalId", u.PrincipalID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserIdentityProperties. +func (u *UserIdentityProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "clientId": + err = unpopulate(val, "ClientID", &u.ClientID) + delete(rawMsg, key) + case "principalId": + err = unpopulate(val, "PrincipalID", &u.PrincipalID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserTokenParameterProperties. +func (u UserTokenParameterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populateTimeRFC3339(objectMap, "expiry", u.Expiry) + populate(objectMap, "keyType", u.KeyType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserTokenParameterProperties. +func (u *UserTokenParameterProperties) UnmarshalJSON(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 "expiry": + err = unpopulateTimeRFC3339(val, "Expiry", &u.Expiry) + delete(rawMsg, key) + case "keyType": + err = unpopulate(val, "KeyType", &u.KeyType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserTokenParameters. +func (u UserTokenParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", u.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserTokenParameters. +func (u *UserTokenParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserTokenResult. +func (u UserTokenResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserTokenResult. +func (u *UserTokenResult) UnmarshalJSON(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 "value": + err = unpopulate(val, "Value", &u.Value) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserUpdateParameters. +func (u UserUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", u.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserUpdateParameters. +func (u *UserUpdateParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, "Properties", &u.Properties) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserUpdateParametersProperties. +func (u UserUpdateParametersProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "email", u.Email) + populate(objectMap, "firstName", u.FirstName) + populate(objectMap, "identities", u.Identities) + populate(objectMap, "lastName", u.LastName) + populate(objectMap, "note", u.Note) + populate(objectMap, "password", u.Password) + populate(objectMap, "state", u.State) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserUpdateParametersProperties. +func (u *UserUpdateParametersProperties) UnmarshalJSON(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 "email": + err = unpopulate(val, "Email", &u.Email) + delete(rawMsg, key) + case "firstName": + err = unpopulate(val, "FirstName", &u.FirstName) + delete(rawMsg, key) + case "identities": + err = unpopulate(val, "Identities", &u.Identities) + delete(rawMsg, key) + case "lastName": + err = unpopulate(val, "LastName", &u.LastName) + delete(rawMsg, key) + case "note": + err = unpopulate(val, "Note", &u.Note) + delete(rawMsg, key) + case "password": + err = unpopulate(val, "Password", &u.Password) + delete(rawMsg, key) + case "state": + err = unpopulate(val, "State", &u.State) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type VirtualNetworkConfiguration. +func (v VirtualNetworkConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "subnetResourceId", v.SubnetResourceID) + populate(objectMap, "subnetname", v.Subnetname) + populate(objectMap, "vnetid", v.Vnetid) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VirtualNetworkConfiguration. +func (v *VirtualNetworkConfiguration) UnmarshalJSON(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 "subnetResourceId": + err = unpopulate(val, "SubnetResourceID", &v.SubnetResourceID) + delete(rawMsg, key) + case "subnetname": + err = unpopulate(val, "Subnetname", &v.Subnetname) + delete(rawMsg, key) + case "vnetid": + err = unpopulate(val, "Vnetid", &v.Vnetid) + 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 WikiCollection. +func (w WikiCollection) 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 WikiCollection. +func (w *WikiCollection) UnmarshalJSON(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 WikiContract. +func (w WikiContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "id", w.ID) + populate(objectMap, "name", w.Name) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WikiContract. +func (w *WikiContract) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, "ID", &w.ID) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &w.Name) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, "Properties", &w.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, "Type", &w.Type) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", w, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type WikiContractProperties. +func (w WikiContractProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "documents", w.Documents) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WikiContractProperties. +func (w *WikiContractProperties) UnmarshalJSON(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 "documents": + err = unpopulate(val, "Documents", &w.Documents) + 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 WikiDocumentationContract. +func (w WikiDocumentationContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "documentationId", w.DocumentationID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WikiDocumentationContract. +func (w *WikiDocumentationContract) UnmarshalJSON(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 "documentationId": + err = unpopulate(val, "DocumentationID", &w.DocumentationID) + 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 WikiUpdateContract. +func (w WikiUpdateContract) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "properties", w.Properties) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WikiUpdateContract. +func (w *WikiUpdateContract) UnmarshalJSON(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 "properties": + err = unpopulate(val, "Properties", &w.Properties) + 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 X509CertificateName. +func (x X509CertificateName) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "issuerCertificateThumbprint", x.IssuerCertificateThumbprint) + populate(objectMap, "name", x.Name) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type X509CertificateName. +func (x *X509CertificateName) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", x, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "issuerCertificateThumbprint": + err = unpopulate(val, "IssuerCertificateThumbprint", &x.IssuerCertificateThumbprint) + delete(rawMsg, key) + case "name": + err = unpopulate(val, "Name", &x.Name) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", x, err) + } + } + return nil +} + +func populate(m map[string]any, k string, v any) { + if v == nil { + return + } else if azcore.IsNullValue(v) { + m[k] = nil + } else if !reflect.ValueOf(v).IsNil() { + m[k] = v + } +} + +func unpopulate(data json.RawMessage, fn string, v any) error { + if data == nil { + return nil + } + if err := json.Unmarshal(data, v); err != nil { + return fmt.Errorf("struct field %s: %v", fn, err) + } + return nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_namedvalue_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/namedvalue_client.go similarity index 86% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_namedvalue_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/namedvalue_client.go index 33998ed90c26..992592ccbffc 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_namedvalue_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/namedvalue_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 armapimanagement @@ -32,10 +33,9 @@ type NamedValueClient struct { } // NewNamedValueClient creates a new instance of NamedValueClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewNamedValueClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NamedValueClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewNamedValueClient(subscriptionID string, credential azcore.TokenCredentia // BeginCreateOrUpdate - Creates or updates named value. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// namedValueID - Identifier of the NamedValue. -// parameters - Create parameters. -// options - NamedValueClientBeginCreateOrUpdateOptions contains the optional parameters for the NamedValueClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - namedValueID - Identifier of the NamedValue. +// - parameters - Create parameters. +// - options - NamedValueClientBeginCreateOrUpdateOptions contains the optional parameters for the NamedValueClient.BeginCreateOrUpdate +// method. func (client *NamedValueClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, parameters NamedValueCreateContract, options *NamedValueClientBeginCreateOrUpdateOptions) (*runtime.Poller[NamedValueClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, namedValueID, parameters, options) @@ -81,7 +82,8 @@ func (client *NamedValueClient) BeginCreateOrUpdate(ctx context.Context, resourc // CreateOrUpdate - Creates or updates named value. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *NamedValueClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, parameters NamedValueCreateContract, options *NamedValueClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, parameters, options) if err != nil { @@ -121,7 +123,7 @@ func (client *NamedValueClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -132,13 +134,14 @@ func (client *NamedValueClient) createOrUpdateCreateRequest(ctx context.Context, // Delete - Deletes specific named value from the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// namedValueID - Identifier of the NamedValue. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - NamedValueClientDeleteOptions contains the optional parameters for the NamedValueClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - namedValueID - Identifier of the NamedValue. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - NamedValueClientDeleteOptions contains the optional parameters for the NamedValueClient.Delete method. func (client *NamedValueClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, ifMatch string, options *NamedValueClientDeleteOptions) (NamedValueClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, ifMatch, options) if err != nil { @@ -178,7 +181,7 @@ func (client *NamedValueClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -187,11 +190,12 @@ func (client *NamedValueClient) deleteCreateRequest(ctx context.Context, resourc // Get - Gets the details of the named value specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// namedValueID - Identifier of the NamedValue. -// options - NamedValueClientGetOptions contains the optional parameters for the NamedValueClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - namedValueID - Identifier of the NamedValue. +// - options - NamedValueClientGetOptions contains the optional parameters for the NamedValueClient.Get method. func (client *NamedValueClient) Get(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientGetOptions) (NamedValueClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, options) if err != nil { @@ -231,7 +235,7 @@ func (client *NamedValueClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,11 +254,12 @@ func (client *NamedValueClient) getHandleResponse(resp *http.Response) (NamedVal } // GetEntityTag - Gets the entity state (Etag) version of the named value specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// namedValueID - Identifier of the NamedValue. -// options - NamedValueClientGetEntityTagOptions contains the optional parameters for the NamedValueClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - namedValueID - Identifier of the NamedValue. +// - options - NamedValueClientGetEntityTagOptions contains the optional parameters for the NamedValueClient.GetEntityTag method. func (client *NamedValueClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientGetEntityTagOptions) (NamedValueClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, options) if err != nil { @@ -294,7 +299,7 @@ func (client *NamedValueClient) getEntityTagCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -311,12 +316,12 @@ func (client *NamedValueClient) getEntityTagHandleResponse(resp *http.Response) } // NewListByServicePager - Lists a collection of named values defined within a service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - NamedValueClientListByServiceOptions contains the optional parameters for the NamedValueClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - NamedValueClientListByServiceOptions contains the optional parameters for the NamedValueClient.NewListByServicePager +// method. func (client *NamedValueClient) NewListByServicePager(resourceGroupName string, serviceName string, options *NamedValueClientListByServiceOptions) *runtime.Pager[NamedValueClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[NamedValueClientListByServiceResponse]{ More: func(page NamedValueClientListByServiceResponse) bool { @@ -377,7 +382,7 @@ func (client *NamedValueClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.IsKeyVaultRefreshFailed != nil { reqQP.Set("isKeyVaultRefreshFailed", strconv.FormatBool(*options.IsKeyVaultRefreshFailed)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -394,11 +399,12 @@ func (client *NamedValueClient) listByServiceHandleResponse(resp *http.Response) // ListValue - Gets the secret of the named value specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// namedValueID - Identifier of the NamedValue. -// options - NamedValueClientListValueOptions contains the optional parameters for the NamedValueClient.ListValue method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - namedValueID - Identifier of the NamedValue. +// - options - NamedValueClientListValueOptions contains the optional parameters for the NamedValueClient.ListValue method. func (client *NamedValueClient) ListValue(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientListValueOptions) (NamedValueClientListValueResponse, error) { req, err := client.listValueCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, options) if err != nil { @@ -438,7 +444,7 @@ func (client *NamedValueClient) listValueCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -458,12 +464,13 @@ func (client *NamedValueClient) listValueHandleResponse(resp *http.Response) (Na // BeginRefreshSecret - Refresh the secret of the named value specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// namedValueID - Identifier of the NamedValue. -// options - NamedValueClientBeginRefreshSecretOptions contains the optional parameters for the NamedValueClient.BeginRefreshSecret -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - namedValueID - Identifier of the NamedValue. +// - options - NamedValueClientBeginRefreshSecretOptions contains the optional parameters for the NamedValueClient.BeginRefreshSecret +// method. func (client *NamedValueClient) BeginRefreshSecret(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientBeginRefreshSecretOptions) (*runtime.Poller[NamedValueClientRefreshSecretResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.refreshSecret(ctx, resourceGroupName, serviceName, namedValueID, options) @@ -480,7 +487,8 @@ func (client *NamedValueClient) BeginRefreshSecret(ctx context.Context, resource // RefreshSecret - Refresh the secret of the named value specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *NamedValueClient) refreshSecret(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, options *NamedValueClientBeginRefreshSecretOptions) (*http.Response, error) { req, err := client.refreshSecretCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, options) if err != nil { @@ -520,7 +528,7 @@ func (client *NamedValueClient) refreshSecretCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -528,14 +536,15 @@ func (client *NamedValueClient) refreshSecretCreateRequest(ctx context.Context, // BeginUpdate - Updates the specific named value. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// namedValueID - Identifier of the NamedValue. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - NamedValueClientBeginUpdateOptions contains the optional parameters for the NamedValueClient.BeginUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - namedValueID - Identifier of the NamedValue. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - NamedValueClientBeginUpdateOptions contains the optional parameters for the NamedValueClient.BeginUpdate method. func (client *NamedValueClient) BeginUpdate(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, ifMatch string, parameters NamedValueUpdateParameters, options *NamedValueClientBeginUpdateOptions) (*runtime.Poller[NamedValueClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, serviceName, namedValueID, ifMatch, parameters, options) @@ -552,7 +561,8 @@ func (client *NamedValueClient) BeginUpdate(ctx context.Context, resourceGroupNa // Update - Updates the specific named value. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *NamedValueClient) update(ctx context.Context, resourceGroupName string, serviceName string, namedValueID string, ifMatch string, parameters NamedValueUpdateParameters, options *NamedValueClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, namedValueID, ifMatch, parameters, options) if err != nil { @@ -592,7 +602,7 @@ func (client *NamedValueClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_networkstatus_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/networkstatus_client.go similarity index 86% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_networkstatus_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/networkstatus_client.go index 8baba805c533..c1519ee15e5c 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_networkstatus_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/networkstatus_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 armapimanagement @@ -31,10 +32,9 @@ type NetworkStatusClient struct { } // NewNetworkStatusClient creates a new instance of NetworkStatusClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewNetworkStatusClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NetworkStatusClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewNetworkStatusClient(subscriptionID string, credential azcore.TokenCreden // ListByLocation - Gets the Connectivity Status to the external resources on which the Api Management service depends from // inside the Cloud Service. This also returns the DNS Servers as visible to the CloudService. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// locationName - Location in which the API Management service is deployed. This is one of the Azure Regions like West US, -// East US, South Central US. -// options - NetworkStatusClientListByLocationOptions contains the optional parameters for the NetworkStatusClient.ListByLocation -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - locationName - Location in which the API Management service is deployed. This is one of the Azure Regions like West US, +// East US, South Central US. +// - options - NetworkStatusClientListByLocationOptions contains the optional parameters for the NetworkStatusClient.ListByLocation +// method. func (client *NetworkStatusClient) ListByLocation(ctx context.Context, resourceGroupName string, serviceName string, locationName string, options *NetworkStatusClientListByLocationOptions) (NetworkStatusClientListByLocationResponse, error) { req, err := client.listByLocationCreateRequest(ctx, resourceGroupName, serviceName, locationName, options) if err != nil { @@ -104,7 +105,7 @@ func (client *NetworkStatusClient) listByLocationCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -122,11 +123,12 @@ func (client *NetworkStatusClient) listByLocationHandleResponse(resp *http.Respo // ListByService - Gets the Connectivity Status to the external resources on which the Api Management service depends from // inside the Cloud Service. This also returns the DNS Servers as visible to the CloudService. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - NetworkStatusClientListByServiceOptions contains the optional parameters for the NetworkStatusClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - NetworkStatusClientListByServiceOptions contains the optional parameters for the NetworkStatusClient.ListByService +// method. func (client *NetworkStatusClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *NetworkStatusClientListByServiceOptions) (NetworkStatusClientListByServiceResponse, error) { req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -162,7 +164,7 @@ func (client *NetworkStatusClient) listByServiceCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_notification_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/notification_client.go similarity index 88% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_notification_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/notification_client.go index 6c2df61e1dc1..1f7dec0bbddb 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_notification_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/notification_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 armapimanagement @@ -32,10 +33,9 @@ type NotificationClient struct { } // NewNotificationClient creates a new instance of NotificationClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewNotificationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NotificationClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewNotificationClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Create or Update API Management publisher notification. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// notificationName - Notification Name Identifier. -// options - NotificationClientCreateOrUpdateOptions contains the optional parameters for the NotificationClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - notificationName - Notification Name Identifier. +// - options - NotificationClientCreateOrUpdateOptions contains the optional parameters for the NotificationClient.CreateOrUpdate +// method. func (client *NotificationClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, options *NotificationClientCreateOrUpdateOptions) (NotificationClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, notificationName, options) if err != nil { @@ -103,7 +104,7 @@ func (client *NotificationClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -123,11 +124,12 @@ func (client *NotificationClient) createOrUpdateHandleResponse(resp *http.Respon // Get - Gets the details of the Notification specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// notificationName - Notification Name Identifier. -// options - NotificationClientGetOptions contains the optional parameters for the NotificationClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - notificationName - Notification Name Identifier. +// - options - NotificationClientGetOptions contains the optional parameters for the NotificationClient.Get method. func (client *NotificationClient) Get(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, options *NotificationClientGetOptions) (NotificationClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, notificationName, options) if err != nil { @@ -167,7 +169,7 @@ func (client *NotificationClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -183,12 +185,12 @@ func (client *NotificationClient) getHandleResponse(resp *http.Response) (Notifi } // NewListByServicePager - Lists a collection of properties defined within a service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - NotificationClientListByServiceOptions contains the optional parameters for the NotificationClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - NotificationClientListByServiceOptions contains the optional parameters for the NotificationClient.NewListByServicePager +// method. func (client *NotificationClient) NewListByServicePager(resourceGroupName string, serviceName string, options *NotificationClientListByServiceOptions) *runtime.Pager[NotificationClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[NotificationClientListByServiceResponse]{ More: func(page NotificationClientListByServiceResponse) bool { @@ -243,7 +245,7 @@ func (client *NotificationClient) listByServiceCreateRequest(ctx context.Context if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_notificationrecipientemail_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientemail_client.go similarity index 86% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_notificationrecipientemail_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientemail_client.go index 87274f959225..bc4ed98b0c2f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_notificationrecipientemail_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientemail_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 armapimanagement @@ -31,10 +32,9 @@ type NotificationRecipientEmailClient struct { } // NewNotificationRecipientEmailClient creates a new instance of NotificationRecipientEmailClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewNotificationRecipientEmailClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NotificationRecipientEmailClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +56,14 @@ func NewNotificationRecipientEmailClient(subscriptionID string, credential azcor } // CheckEntityExists - Determine if Notification Recipient Email subscribed to the notification. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// notificationName - Notification Name Identifier. -// email - Email identifier. -// options - NotificationRecipientEmailClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientEmailClient.CheckEntityExists -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - notificationName - Notification Name Identifier. +// - email - Email identifier. +// - options - NotificationRecipientEmailClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientEmailClient.CheckEntityExists +// method. func (client *NotificationRecipientEmailClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, email string, options *NotificationRecipientEmailClientCheckEntityExistsOptions) (NotificationRecipientEmailClientCheckEntityExistsResponse, error) { req, err := client.checkEntityExistsCreateRequest(ctx, resourceGroupName, serviceName, notificationName, email, options) if err != nil { @@ -106,7 +107,7 @@ func (client *NotificationRecipientEmailClient) checkEntityExistsCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,13 +115,14 @@ func (client *NotificationRecipientEmailClient) checkEntityExistsCreateRequest(c // CreateOrUpdate - Adds the Email address to the list of Recipients for the Notification. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// notificationName - Notification Name Identifier. -// email - Email identifier. -// options - NotificationRecipientEmailClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientEmailClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - notificationName - Notification Name Identifier. +// - email - Email identifier. +// - options - NotificationRecipientEmailClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientEmailClient.CreateOrUpdate +// method. func (client *NotificationRecipientEmailClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, email string, options *NotificationRecipientEmailClientCreateOrUpdateOptions) (NotificationRecipientEmailClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, notificationName, email, options) if err != nil { @@ -164,7 +166,7 @@ func (client *NotificationRecipientEmailClient) createOrUpdateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,13 +183,14 @@ func (client *NotificationRecipientEmailClient) createOrUpdateHandleResponse(res // Delete - Removes the email from the list of Notification. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// notificationName - Notification Name Identifier. -// email - Email identifier. -// options - NotificationRecipientEmailClientDeleteOptions contains the optional parameters for the NotificationRecipientEmailClient.Delete -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - notificationName - Notification Name Identifier. +// - email - Email identifier. +// - options - NotificationRecipientEmailClientDeleteOptions contains the optional parameters for the NotificationRecipientEmailClient.Delete +// method. func (client *NotificationRecipientEmailClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, email string, options *NotificationRecipientEmailClientDeleteOptions) (NotificationRecipientEmailClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, notificationName, email, options) if err != nil { @@ -231,7 +234,7 @@ func (client *NotificationRecipientEmailClient) deleteCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,12 +242,13 @@ func (client *NotificationRecipientEmailClient) deleteCreateRequest(ctx context. // ListByNotification - Gets the list of the Notification Recipient Emails subscribed to a notification. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// notificationName - Notification Name Identifier. -// options - NotificationRecipientEmailClientListByNotificationOptions contains the optional parameters for the NotificationRecipientEmailClient.ListByNotification -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - notificationName - Notification Name Identifier. +// - options - NotificationRecipientEmailClientListByNotificationOptions contains the optional parameters for the NotificationRecipientEmailClient.ListByNotification +// method. func (client *NotificationRecipientEmailClient) ListByNotification(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, options *NotificationRecipientEmailClientListByNotificationOptions) (NotificationRecipientEmailClientListByNotificationResponse, error) { req, err := client.listByNotificationCreateRequest(ctx, resourceGroupName, serviceName, notificationName, options) if err != nil { @@ -284,7 +288,7 @@ func (client *NotificationRecipientEmailClient) listByNotificationCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_notificationrecipientuser_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientuser_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_notificationrecipientuser_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientuser_client.go index 4a894d1a59b6..65585406f6b0 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_notificationrecipientuser_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/notificationrecipientuser_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 armapimanagement @@ -31,10 +32,9 @@ type NotificationRecipientUserClient struct { } // NewNotificationRecipientUserClient creates a new instance of NotificationRecipientUserClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewNotificationRecipientUserClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*NotificationRecipientUserClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,13 +56,14 @@ func NewNotificationRecipientUserClient(subscriptionID string, credential azcore } // CheckEntityExists - Determine if the Notification Recipient User is subscribed to the notification. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// notificationName - Notification Name Identifier. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - NotificationRecipientUserClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientUserClient.CheckEntityExists -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - notificationName - Notification Name Identifier. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - NotificationRecipientUserClientCheckEntityExistsOptions contains the optional parameters for the NotificationRecipientUserClient.CheckEntityExists +// method. func (client *NotificationRecipientUserClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string, options *NotificationRecipientUserClientCheckEntityExistsOptions) (NotificationRecipientUserClientCheckEntityExistsResponse, error) { req, err := client.checkEntityExistsCreateRequest(ctx, resourceGroupName, serviceName, notificationName, userID, options) if err != nil { @@ -106,7 +107,7 @@ func (client *NotificationRecipientUserClient) checkEntityExistsCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,13 +115,14 @@ func (client *NotificationRecipientUserClient) checkEntityExistsCreateRequest(ct // CreateOrUpdate - Adds the API Management User to the list of Recipients for the Notification. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// notificationName - Notification Name Identifier. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - NotificationRecipientUserClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientUserClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - notificationName - Notification Name Identifier. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - NotificationRecipientUserClientCreateOrUpdateOptions contains the optional parameters for the NotificationRecipientUserClient.CreateOrUpdate +// method. func (client *NotificationRecipientUserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string, options *NotificationRecipientUserClientCreateOrUpdateOptions) (NotificationRecipientUserClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, notificationName, userID, options) if err != nil { @@ -164,7 +166,7 @@ func (client *NotificationRecipientUserClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,13 +183,14 @@ func (client *NotificationRecipientUserClient) createOrUpdateHandleResponse(resp // Delete - Removes the API Management user from the list of Notification. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// notificationName - Notification Name Identifier. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - NotificationRecipientUserClientDeleteOptions contains the optional parameters for the NotificationRecipientUserClient.Delete -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - notificationName - Notification Name Identifier. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - NotificationRecipientUserClientDeleteOptions contains the optional parameters for the NotificationRecipientUserClient.Delete +// method. func (client *NotificationRecipientUserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, userID string, options *NotificationRecipientUserClientDeleteOptions) (NotificationRecipientUserClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, notificationName, userID, options) if err != nil { @@ -231,7 +234,7 @@ func (client *NotificationRecipientUserClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -239,12 +242,13 @@ func (client *NotificationRecipientUserClient) deleteCreateRequest(ctx context.C // ListByNotification - Gets the list of the Notification Recipient User subscribed to the notification. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// notificationName - Notification Name Identifier. -// options - NotificationRecipientUserClientListByNotificationOptions contains the optional parameters for the NotificationRecipientUserClient.ListByNotification -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - notificationName - Notification Name Identifier. +// - options - NotificationRecipientUserClientListByNotificationOptions contains the optional parameters for the NotificationRecipientUserClient.ListByNotification +// method. func (client *NotificationRecipientUserClient) ListByNotification(ctx context.Context, resourceGroupName string, serviceName string, notificationName NotificationName, options *NotificationRecipientUserClientListByNotificationOptions) (NotificationRecipientUserClientListByNotificationResponse, error) { req, err := client.listByNotificationCreateRequest(ctx, resourceGroupName, serviceName, notificationName, options) if err != nil { @@ -284,7 +288,7 @@ func (client *NotificationRecipientUserClient) listByNotificationCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_openidconnectprovider_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/openidconnectprovider_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_openidconnectprovider_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/openidconnectprovider_client.go index 633800e75953..ee998a44e294 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_openidconnectprovider_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/openidconnectprovider_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 armapimanagement @@ -32,10 +33,9 @@ type OpenIDConnectProviderClient struct { } // NewOpenIDConnectProviderClient creates a new instance of OpenIDConnectProviderClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOpenIDConnectProviderClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OpenIDConnectProviderClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewOpenIDConnectProviderClient(subscriptionID string, credential azcore.Tok // CreateOrUpdate - Creates or updates the OpenID Connect Provider. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// opid - Identifier of the OpenID Connect Provider. -// parameters - Create parameters. -// options - OpenIDConnectProviderClientCreateOrUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - opid - Identifier of the OpenID Connect Provider. +// - parameters - Create parameters. +// - options - OpenIDConnectProviderClientCreateOrUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.CreateOrUpdate +// method. func (client *OpenIDConnectProviderClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, opid string, parameters OpenidConnectProviderContract, options *OpenIDConnectProviderClientCreateOrUpdateOptions) (OpenIDConnectProviderClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, opid, parameters, options) if err != nil { @@ -104,7 +105,7 @@ func (client *OpenIDConnectProviderClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -127,14 +128,15 @@ func (client *OpenIDConnectProviderClient) createOrUpdateHandleResponse(resp *ht // Delete - Deletes specific OpenID Connect Provider of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// opid - Identifier of the OpenID Connect Provider. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - OpenIDConnectProviderClientDeleteOptions contains the optional parameters for the OpenIDConnectProviderClient.Delete -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - opid - Identifier of the OpenID Connect Provider. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - OpenIDConnectProviderClientDeleteOptions contains the optional parameters for the OpenIDConnectProviderClient.Delete +// method. func (client *OpenIDConnectProviderClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, opid string, ifMatch string, options *OpenIDConnectProviderClientDeleteOptions) (OpenIDConnectProviderClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, opid, ifMatch, options) if err != nil { @@ -174,7 +176,7 @@ func (client *OpenIDConnectProviderClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -183,12 +185,13 @@ func (client *OpenIDConnectProviderClient) deleteCreateRequest(ctx context.Conte // Get - Gets specific OpenID Connect Provider without secrets. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// opid - Identifier of the OpenID Connect Provider. -// options - OpenIDConnectProviderClientGetOptions contains the optional parameters for the OpenIDConnectProviderClient.Get -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - opid - Identifier of the OpenID Connect Provider. +// - options - OpenIDConnectProviderClientGetOptions contains the optional parameters for the OpenIDConnectProviderClient.Get +// method. func (client *OpenIDConnectProviderClient) Get(ctx context.Context, resourceGroupName string, serviceName string, opid string, options *OpenIDConnectProviderClientGetOptions) (OpenIDConnectProviderClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, opid, options) if err != nil { @@ -228,7 +231,7 @@ func (client *OpenIDConnectProviderClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,12 +250,13 @@ func (client *OpenIDConnectProviderClient) getHandleResponse(resp *http.Response } // GetEntityTag - Gets the entity state (Etag) version of the openIdConnectProvider specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// opid - Identifier of the OpenID Connect Provider. -// options - OpenIDConnectProviderClientGetEntityTagOptions contains the optional parameters for the OpenIDConnectProviderClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - opid - Identifier of the OpenID Connect Provider. +// - options - OpenIDConnectProviderClientGetEntityTagOptions contains the optional parameters for the OpenIDConnectProviderClient.GetEntityTag +// method. func (client *OpenIDConnectProviderClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, opid string, options *OpenIDConnectProviderClientGetEntityTagOptions) (OpenIDConnectProviderClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, opid, options) if err != nil { @@ -292,7 +296,7 @@ func (client *OpenIDConnectProviderClient) getEntityTagCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -309,12 +313,12 @@ func (client *OpenIDConnectProviderClient) getEntityTagHandleResponse(resp *http } // NewListByServicePager - Lists of all the OpenId Connect Providers. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - OpenIDConnectProviderClientListByServiceOptions contains the optional parameters for the OpenIDConnectProviderClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - OpenIDConnectProviderClientListByServiceOptions contains the optional parameters for the OpenIDConnectProviderClient.NewListByServicePager +// method. func (client *OpenIDConnectProviderClient) NewListByServicePager(resourceGroupName string, serviceName string, options *OpenIDConnectProviderClientListByServiceOptions) *runtime.Pager[OpenIDConnectProviderClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[OpenIDConnectProviderClientListByServiceResponse]{ More: func(page OpenIDConnectProviderClientListByServiceResponse) bool { @@ -372,7 +376,7 @@ func (client *OpenIDConnectProviderClient) listByServiceCreateRequest(ctx contex if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -389,12 +393,13 @@ func (client *OpenIDConnectProviderClient) listByServiceHandleResponse(resp *htt // ListSecrets - Gets the client secret details of the OpenID Connect Provider. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// opid - Identifier of the OpenID Connect Provider. -// options - OpenIDConnectProviderClientListSecretsOptions contains the optional parameters for the OpenIDConnectProviderClient.ListSecrets -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - opid - Identifier of the OpenID Connect Provider. +// - options - OpenIDConnectProviderClientListSecretsOptions contains the optional parameters for the OpenIDConnectProviderClient.ListSecrets +// method. func (client *OpenIDConnectProviderClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, opid string, options *OpenIDConnectProviderClientListSecretsOptions) (OpenIDConnectProviderClientListSecretsResponse, error) { req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, serviceName, opid, options) if err != nil { @@ -434,7 +439,7 @@ func (client *OpenIDConnectProviderClient) listSecretsCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -454,15 +459,16 @@ func (client *OpenIDConnectProviderClient) listSecretsHandleResponse(resp *http. // Update - Updates the specific OpenID Connect Provider. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// opid - Identifier of the OpenID Connect Provider. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - OpenIDConnectProviderClientUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.Update -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - opid - Identifier of the OpenID Connect Provider. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - OpenIDConnectProviderClientUpdateOptions contains the optional parameters for the OpenIDConnectProviderClient.Update +// method. func (client *OpenIDConnectProviderClient) Update(ctx context.Context, resourceGroupName string, serviceName string, opid string, ifMatch string, parameters OpenidConnectProviderUpdateContract, options *OpenIDConnectProviderClientUpdateOptions) (OpenIDConnectProviderClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, opid, ifMatch, parameters, options) if err != nil { @@ -502,7 +508,7 @@ func (client *OpenIDConnectProviderClient) updateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_operation_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/operation_client.go similarity index 86% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_operation_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/operation_client.go index 6d8945585be9..bd9ff81c6264 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_operation_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/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 armapimanagement @@ -32,10 +33,9 @@ type OperationClient struct { } // NewOperationClient creates a new instance of OperationClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - 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{} @@ -57,13 +57,14 @@ func NewOperationClient(subscriptionID string, credential azcore.TokenCredential } // NewListByTagsPager - Lists a collection of operations associated with tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// options - OperationClientListByTagsOptions contains the optional parameters for the OperationClient.ListByTags method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - OperationClientListByTagsOptions contains the optional parameters for the OperationClient.NewListByTagsPager +// method. func (client *OperationClient) NewListByTagsPager(resourceGroupName string, serviceName string, apiID string, options *OperationClientListByTagsOptions) *runtime.Pager[OperationClientListByTagsResponse] { return runtime.NewPager(runtime.PagingHandler[OperationClientListByTagsResponse]{ More: func(page OperationClientListByTagsResponse) bool { @@ -128,7 +129,7 @@ func (client *OperationClient) listByTagsCreateRequest(ctx context.Context, reso if options != nil && options.IncludeNotTaggedOperations != nil { reqQP.Set("includeNotTaggedOperations", strconv.FormatBool(*options.IncludeNotTaggedOperations)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_operations_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/operations_client.go similarity index 90% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_operations_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/operations_client.go index 491dc92d5565..852dd6eb6c87 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_operations_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/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 armapimanagement @@ -27,8 +28,8 @@ type OperationsClient struct { } // NewOperationsClient creates a new instance of OperationsClient with the specified values. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -49,9 +50,9 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO } // NewListPager - Lists all of the available REST API operations of the Microsoft.ApiManagement provider. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. +// +// Generated from API version 2022-08-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", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_outboundnetworkdependenciesendpoints_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/outboundnetworkdependenciesendpoints_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_outboundnetworkdependenciesendpoints_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/outboundnetworkdependenciesendpoints_client.go index 53be20e43c75..f1f6bcda41d4 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_outboundnetworkdependenciesendpoints_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/outboundnetworkdependenciesendpoints_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 armapimanagement @@ -31,10 +32,9 @@ type OutboundNetworkDependenciesEndpointsClient struct { } // NewOutboundNetworkDependenciesEndpointsClient creates a new instance of OutboundNetworkDependenciesEndpointsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewOutboundNetworkDependenciesEndpointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*OutboundNetworkDependenciesEndpointsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewOutboundNetworkDependenciesEndpointsClient(subscriptionID string, creden // ListByService - Gets the network endpoints of all outbound dependencies of a ApiManagement service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - OutboundNetworkDependenciesEndpointsClientListByServiceOptions contains the optional parameters for the OutboundNetworkDependenciesEndpointsClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - OutboundNetworkDependenciesEndpointsClientListByServiceOptions contains the optional parameters for the OutboundNetworkDependenciesEndpointsClient.ListByService +// method. func (client *OutboundNetworkDependenciesEndpointsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *OutboundNetworkDependenciesEndpointsClientListByServiceOptions) (OutboundNetworkDependenciesEndpointsClientListByServiceResponse, error) { req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -97,7 +98,7 @@ func (client *OutboundNetworkDependenciesEndpointsClient) listByServiceCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_policy_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/policy_client.go similarity index 86% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_policy_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/policy_client.go index 6d88487165ab..d96a745e9374 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_policy_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/policy_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 armapimanagement @@ -31,10 +32,9 @@ type PolicyClient struct { } // NewPolicyClient creates a new instance of PolicyClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PolicyClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewPolicyClient(subscriptionID string, credential azcore.TokenCredential, o // CreateOrUpdate - Creates or updates the global policy configuration of the Api Management service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// policyID - The identifier of the Policy. -// parameters - The policy contents to apply. -// options - PolicyClientCreateOrUpdateOptions contains the optional parameters for the PolicyClient.CreateOrUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - policyID - The identifier of the Policy. +// - parameters - The policy contents to apply. +// - options - PolicyClientCreateOrUpdateOptions contains the optional parameters for the PolicyClient.CreateOrUpdate method. func (client *PolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, policyID PolicyIDName, parameters PolicyContract, options *PolicyClientCreateOrUpdateOptions) (PolicyClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, policyID, parameters, options) if err != nil { @@ -102,7 +103,7 @@ func (client *PolicyClient) createOrUpdateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -125,13 +126,14 @@ func (client *PolicyClient) createOrUpdateHandleResponse(resp *http.Response) (P // Delete - Deletes the global policy configuration of the Api Management Service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// policyID - The identifier of the Policy. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - PolicyClientDeleteOptions contains the optional parameters for the PolicyClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - policyID - The identifier of the Policy. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - PolicyClientDeleteOptions contains the optional parameters for the PolicyClient.Delete method. func (client *PolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, policyID PolicyIDName, ifMatch string, options *PolicyClientDeleteOptions) (PolicyClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, policyID, ifMatch, options) if err != nil { @@ -171,7 +173,7 @@ func (client *PolicyClient) deleteCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -180,11 +182,12 @@ func (client *PolicyClient) deleteCreateRequest(ctx context.Context, resourceGro // Get - Get the Global policy definition of the Api Management service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// policyID - The identifier of the Policy. -// options - PolicyClientGetOptions contains the optional parameters for the PolicyClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - policyID - The identifier of the Policy. +// - options - PolicyClientGetOptions contains the optional parameters for the PolicyClient.Get method. func (client *PolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, policyID PolicyIDName, options *PolicyClientGetOptions) (PolicyClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, policyID, options) if err != nil { @@ -227,7 +230,7 @@ func (client *PolicyClient) getCreateRequest(ctx context.Context, resourceGroupN if options != nil && options.Format != nil { reqQP.Set("format", string(*options.Format)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -246,11 +249,12 @@ func (client *PolicyClient) getHandleResponse(resp *http.Response) (PolicyClient } // GetEntityTag - Gets the entity state (Etag) version of the Global policy definition in the Api Management service. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// policyID - The identifier of the Policy. -// options - PolicyClientGetEntityTagOptions contains the optional parameters for the PolicyClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - policyID - The identifier of the Policy. +// - options - PolicyClientGetEntityTagOptions contains the optional parameters for the PolicyClient.GetEntityTag method. func (client *PolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, policyID PolicyIDName, options *PolicyClientGetEntityTagOptions) (PolicyClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, policyID, options) if err != nil { @@ -290,7 +294,7 @@ func (client *PolicyClient) getEntityTagCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -308,10 +312,11 @@ func (client *PolicyClient) getEntityTagHandleResponse(resp *http.Response) (Pol // ListByService - Lists all the Global Policy definitions of the Api Management service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - PolicyClientListByServiceOptions contains the optional parameters for the PolicyClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - PolicyClientListByServiceOptions contains the optional parameters for the PolicyClient.ListByService method. func (client *PolicyClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *PolicyClientListByServiceOptions) (PolicyClientListByServiceResponse, error) { req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -347,7 +352,7 @@ func (client *PolicyClient) listByServiceCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_policydescription_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/policydescription_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_policydescription_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/policydescription_client.go index c17d29c43b7c..6c5fba2748d5 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_policydescription_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/policydescription_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 armapimanagement @@ -31,10 +32,9 @@ type PolicyDescriptionClient struct { } // NewPolicyDescriptionClient creates a new instance of PolicyDescriptionClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPolicyDescriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PolicyDescriptionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewPolicyDescriptionClient(subscriptionID string, credential azcore.TokenCr // ListByService - Lists all policy descriptions. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - PolicyDescriptionClientListByServiceOptions contains the optional parameters for the PolicyDescriptionClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - PolicyDescriptionClientListByServiceOptions contains the optional parameters for the PolicyDescriptionClient.ListByService +// method. func (client *PolicyDescriptionClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *PolicyDescriptionClientListByServiceOptions) (PolicyDescriptionClientListByServiceResponse, error) { req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -100,7 +101,7 @@ func (client *PolicyDescriptionClient) listByServiceCreateRequest(ctx context.Co if options != nil && options.Scope != nil { reqQP.Set("scope", string(*options.Scope)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/policyfragment_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/policyfragment_client.go new file mode 100644 index 000000000000..59e9fa02e267 --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/policyfragment_client.go @@ -0,0 +1,459 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/cloud" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strconv" + "strings" +) + +// PolicyFragmentClient contains the methods for the PolicyFragment group. +// Don't use this type directly, use NewPolicyFragmentClient() instead. +type PolicyFragmentClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPolicyFragmentClient creates a new instance of PolicyFragmentClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPolicyFragmentClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PolicyFragmentClient, 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 := &PolicyFragmentClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// BeginCreateOrUpdate - Creates or updates a policy fragment. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - id - A resource identifier. +// - parameters - The policy fragment contents to apply. +// - options - PolicyFragmentClientBeginCreateOrUpdateOptions contains the optional parameters for the PolicyFragmentClient.BeginCreateOrUpdate +// method. +func (client *PolicyFragmentClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, id string, parameters PolicyFragmentContract, options *PolicyFragmentClientBeginCreateOrUpdateOptions) (*runtime.Poller[PolicyFragmentClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, id, parameters, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[PolicyFragmentClientCreateOrUpdateResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[PolicyFragmentClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) + } +} + +// CreateOrUpdate - Creates or updates a policy fragment. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +func (client *PolicyFragmentClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, id string, parameters PolicyFragmentContract, options *PolicyFragmentClientBeginCreateOrUpdateOptions) (*http.Response, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, id, parameters, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PolicyFragmentClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, id string, parameters PolicyFragmentContract, options *PolicyFragmentClientBeginCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// Delete - Deletes a policy fragment. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - id - A resource identifier. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - PolicyFragmentClientDeleteOptions contains the optional parameters for the PolicyFragmentClient.Delete method. +func (client *PolicyFragmentClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, id string, ifMatch string, options *PolicyFragmentClientDeleteOptions) (PolicyFragmentClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, id, ifMatch, options) + if err != nil { + return PolicyFragmentClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PolicyFragmentClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return PolicyFragmentClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return PolicyFragmentClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *PolicyFragmentClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, id string, ifMatch string, options *PolicyFragmentClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets a policy fragment. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - id - A resource identifier. +// - options - PolicyFragmentClientGetOptions contains the optional parameters for the PolicyFragmentClient.Get method. +func (client *PolicyFragmentClient) Get(ctx context.Context, resourceGroupName string, serviceName string, id string, options *PolicyFragmentClientGetOptions) (PolicyFragmentClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, id, options) + if err != nil { + return PolicyFragmentClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PolicyFragmentClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PolicyFragmentClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PolicyFragmentClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, id string, options *PolicyFragmentClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + if options != nil && options.Format != nil { + reqQP.Set("format", string(*options.Format)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PolicyFragmentClient) getHandleResponse(resp *http.Response) (PolicyFragmentClientGetResponse, error) { + result := PolicyFragmentClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.PolicyFragmentContract); err != nil { + return PolicyFragmentClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of a policy fragment. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - id - A resource identifier. +// - options - PolicyFragmentClientGetEntityTagOptions contains the optional parameters for the PolicyFragmentClient.GetEntityTag +// method. +func (client *PolicyFragmentClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, id string, options *PolicyFragmentClientGetEntityTagOptions) (PolicyFragmentClientGetEntityTagResponse, error) { + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, id, options) + if err != nil { + return PolicyFragmentClientGetEntityTagResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PolicyFragmentClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PolicyFragmentClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + } + return client.getEntityTagHandleResponse(resp) +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *PolicyFragmentClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, id string, options *PolicyFragmentClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *PolicyFragmentClient) getEntityTagHandleResponse(resp *http.Response) (PolicyFragmentClientGetEntityTagResponse, error) { + result := PolicyFragmentClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// ListByService - Gets all policy fragments. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - PolicyFragmentClientListByServiceOptions contains the optional parameters for the PolicyFragmentClient.ListByService +// method. +func (client *PolicyFragmentClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *PolicyFragmentClientListByServiceOptions) (PolicyFragmentClientListByServiceResponse, error) { + req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return PolicyFragmentClientListByServiceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PolicyFragmentClientListByServiceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PolicyFragmentClientListByServiceResponse{}, runtime.NewResponseError(resp) + } + return client.listByServiceHandleResponse(resp) +} + +// listByServiceCreateRequest creates the ListByService request. +func (client *PolicyFragmentClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PolicyFragmentClientListByServiceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.Orderby != nil { + reqQP.Set("$orderby", *options.Orderby) + } + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServiceHandleResponse handles the ListByService response. +func (client *PolicyFragmentClient) listByServiceHandleResponse(resp *http.Response) (PolicyFragmentClientListByServiceResponse, error) { + result := PolicyFragmentClientListByServiceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PolicyFragmentCollection); err != nil { + return PolicyFragmentClientListByServiceResponse{}, err + } + return result, nil +} + +// ListReferences - Lists policy resources that reference the policy fragment. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - id - A resource identifier. +// - options - PolicyFragmentClientListReferencesOptions contains the optional parameters for the PolicyFragmentClient.ListReferences +// method. +func (client *PolicyFragmentClient) ListReferences(ctx context.Context, resourceGroupName string, serviceName string, id string, options *PolicyFragmentClientListReferencesOptions) (PolicyFragmentClientListReferencesResponse, error) { + req, err := client.listReferencesCreateRequest(ctx, resourceGroupName, serviceName, id, options) + if err != nil { + return PolicyFragmentClientListReferencesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PolicyFragmentClientListReferencesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PolicyFragmentClientListReferencesResponse{}, runtime.NewResponseError(resp) + } + return client.listReferencesHandleResponse(resp) +} + +// listReferencesCreateRequest creates the ListReferences request. +func (client *PolicyFragmentClient) listReferencesCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, id string, options *PolicyFragmentClientListReferencesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/policyFragments/{id}/listReferences" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if id == "" { + return nil, errors.New("parameter id cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{id}", url.PathEscape(id)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + if options != nil && options.Top != nil { + reqQP.Set("$top", strconv.FormatInt(int64(*options.Top), 10)) + } + if options != nil && options.Skip != nil { + reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listReferencesHandleResponse handles the ListReferences response. +func (client *PolicyFragmentClient) listReferencesHandleResponse(resp *http.Response) (PolicyFragmentClientListReferencesResponse, error) { + result := PolicyFragmentClientListReferencesResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.ResourceCollection); err != nil { + return PolicyFragmentClientListReferencesResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/portalconfig_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/portalconfig_client.go new file mode 100644 index 000000000000..68f2c9d2a50a --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/portalconfig_client.go @@ -0,0 +1,375 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +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" +) + +// PortalConfigClient contains the methods for the PortalConfig group. +// Don't use this type directly, use NewPortalConfigClient() instead. +type PortalConfigClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewPortalConfigClient creates a new instance of PortalConfigClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewPortalConfigClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PortalConfigClient, 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 := &PortalConfigClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Create or update the developer portal configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - portalConfigID - Portal configuration identifier. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update the developer portal configuration. +// - options - PortalConfigClientCreateOrUpdateOptions contains the optional parameters for the PortalConfigClient.CreateOrUpdate +// method. +func (client *PortalConfigClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, ifMatch string, parameters PortalConfigContract, options *PortalConfigClientCreateOrUpdateOptions) (PortalConfigClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, portalConfigID, ifMatch, parameters, options) + if err != nil { + return PortalConfigClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PortalConfigClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PortalConfigClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *PortalConfigClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, ifMatch string, parameters PortalConfigContract, options *PortalConfigClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if portalConfigID == "" { + return nil, errors.New("parameter portalConfigID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{portalConfigId}", url.PathEscape(portalConfigID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *PortalConfigClient) createOrUpdateHandleResponse(resp *http.Response) (PortalConfigClientCreateOrUpdateResponse, error) { + result := PortalConfigClientCreateOrUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PortalConfigContract); err != nil { + return PortalConfigClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Get - Get the developer portal configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - portalConfigID - Portal configuration identifier. +// - options - PortalConfigClientGetOptions contains the optional parameters for the PortalConfigClient.Get method. +func (client *PortalConfigClient) Get(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, options *PortalConfigClientGetOptions) (PortalConfigClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, portalConfigID, options) + if err != nil { + return PortalConfigClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PortalConfigClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PortalConfigClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *PortalConfigClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, options *PortalConfigClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if portalConfigID == "" { + return nil, errors.New("parameter portalConfigID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{portalConfigId}", url.PathEscape(portalConfigID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *PortalConfigClient) getHandleResponse(resp *http.Response) (PortalConfigClientGetResponse, error) { + result := PortalConfigClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.PortalConfigContract); err != nil { + return PortalConfigClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of the developer portal configuration. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - portalConfigID - Portal configuration identifier. +// - options - PortalConfigClientGetEntityTagOptions contains the optional parameters for the PortalConfigClient.GetEntityTag +// method. +func (client *PortalConfigClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, options *PortalConfigClientGetEntityTagOptions) (PortalConfigClientGetEntityTagResponse, error) { + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, portalConfigID, options) + if err != nil { + return PortalConfigClientGetEntityTagResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PortalConfigClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PortalConfigClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + } + return client.getEntityTagHandleResponse(resp) +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *PortalConfigClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, options *PortalConfigClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if portalConfigID == "" { + return nil, errors.New("parameter portalConfigID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{portalConfigId}", url.PathEscape(portalConfigID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *PortalConfigClient) getEntityTagHandleResponse(resp *http.Response) (PortalConfigClientGetEntityTagResponse, error) { + result := PortalConfigClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// ListByService - Lists the developer portal configurations. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - PortalConfigClientListByServiceOptions contains the optional parameters for the PortalConfigClient.ListByService +// method. +func (client *PortalConfigClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *PortalConfigClientListByServiceOptions) (PortalConfigClientListByServiceResponse, error) { + req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return PortalConfigClientListByServiceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PortalConfigClientListByServiceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PortalConfigClientListByServiceResponse{}, runtime.NewResponseError(resp) + } + return client.listByServiceHandleResponse(resp) +} + +// listByServiceCreateRequest creates the ListByService request. +func (client *PortalConfigClient) listByServiceCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *PortalConfigClientListByServiceOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listByServiceHandleResponse handles the ListByService response. +func (client *PortalConfigClient) listByServiceHandleResponse(resp *http.Response) (PortalConfigClientListByServiceResponse, error) { + result := PortalConfigClientListByServiceResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PortalConfigCollection); err != nil { + return PortalConfigClientListByServiceResponse{}, err + } + return result, nil +} + +// Update - Update the developer portal configuration. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - portalConfigID - Portal configuration identifier. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update the developer portal configuration. +// - options - PortalConfigClientUpdateOptions contains the optional parameters for the PortalConfigClient.Update method. +func (client *PortalConfigClient) Update(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, ifMatch string, parameters PortalConfigContract, options *PortalConfigClientUpdateOptions) (PortalConfigClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, portalConfigID, ifMatch, parameters, options) + if err != nil { + return PortalConfigClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PortalConfigClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PortalConfigClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *PortalConfigClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, portalConfigID string, ifMatch string, parameters PortalConfigContract, options *PortalConfigClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/portalconfigs/{portalConfigId}" + 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 serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if portalConfigID == "" { + return nil, errors.New("parameter portalConfigID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{portalConfigId}", url.PathEscape(portalConfigID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateHandleResponse handles the Update response. +func (client *PortalConfigClient) updateHandleResponse(resp *http.Response) (PortalConfigClientUpdateResponse, error) { + result := PortalConfigClientUpdateResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.PortalConfigContract); err != nil { + return PortalConfigClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_portalrevision_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/portalrevision_client.go similarity index 86% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_portalrevision_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/portalrevision_client.go index fc995c983796..36064e8a866d 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_portalrevision_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/portalrevision_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 armapimanagement @@ -32,10 +33,9 @@ type PortalRevisionClient struct { } // NewPortalRevisionClient creates a new instance of PortalRevisionClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPortalRevisionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PortalRevisionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -59,12 +59,13 @@ func NewPortalRevisionClient(subscriptionID string, credential azcore.TokenCrede // BeginCreateOrUpdate - Creates a new developer portal's revision by running the portal's publishing. The isCurrent property // indicates if the revision is publicly accessible. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance. -// options - PortalRevisionClientBeginCreateOrUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance. +// - options - PortalRevisionClientBeginCreateOrUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginCreateOrUpdate +// method. func (client *PortalRevisionClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, parameters PortalRevisionContract, options *PortalRevisionClientBeginCreateOrUpdateOptions) (*runtime.Poller[PortalRevisionClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, portalRevisionID, parameters, options) @@ -82,7 +83,8 @@ func (client *PortalRevisionClient) BeginCreateOrUpdate(ctx context.Context, res // CreateOrUpdate - Creates a new developer portal's revision by running the portal's publishing. The isCurrent property indicates // if the revision is publicly accessible. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *PortalRevisionClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, parameters PortalRevisionContract, options *PortalRevisionClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, portalRevisionID, parameters, options) if err != nil { @@ -122,7 +124,7 @@ func (client *PortalRevisionClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -130,11 +132,12 @@ func (client *PortalRevisionClient) createOrUpdateCreateRequest(ctx context.Cont // Get - Gets the developer portal's revision specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance. -// options - PortalRevisionClientGetOptions contains the optional parameters for the PortalRevisionClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance. +// - options - PortalRevisionClientGetOptions contains the optional parameters for the PortalRevisionClient.Get method. func (client *PortalRevisionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, options *PortalRevisionClientGetOptions) (PortalRevisionClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, portalRevisionID, options) if err != nil { @@ -174,7 +177,7 @@ func (client *PortalRevisionClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,12 +196,13 @@ func (client *PortalRevisionClient) getHandleResponse(resp *http.Response) (Port } // GetEntityTag - Gets the developer portal revision specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance. -// options - PortalRevisionClientGetEntityTagOptions contains the optional parameters for the PortalRevisionClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance. +// - options - PortalRevisionClientGetEntityTagOptions contains the optional parameters for the PortalRevisionClient.GetEntityTag +// method. func (client *PortalRevisionClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, options *PortalRevisionClientGetEntityTagOptions) (PortalRevisionClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, portalRevisionID, options) if err != nil { @@ -238,7 +242,7 @@ func (client *PortalRevisionClient) getEntityTagCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,12 +259,12 @@ func (client *PortalRevisionClient) getEntityTagHandleResponse(resp *http.Respon } // NewListByServicePager - Lists developer portal's revisions. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - PortalRevisionClientListByServiceOptions contains the optional parameters for the PortalRevisionClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - PortalRevisionClientListByServiceOptions contains the optional parameters for the PortalRevisionClient.NewListByServicePager +// method. func (client *PortalRevisionClient) NewListByServicePager(resourceGroupName string, serviceName string, options *PortalRevisionClientListByServiceOptions) *runtime.Pager[PortalRevisionClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[PortalRevisionClientListByServiceResponse]{ More: func(page PortalRevisionClientListByServiceResponse) bool { @@ -318,7 +322,7 @@ func (client *PortalRevisionClient) listByServiceCreateRequest(ctx context.Conte if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -335,14 +339,15 @@ func (client *PortalRevisionClient) listByServiceHandleResponse(resp *http.Respo // BeginUpdate - Updates the description of specified portal revision or makes it current. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - PortalRevisionClientBeginUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - portalRevisionID - Portal revision identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - PortalRevisionClientBeginUpdateOptions contains the optional parameters for the PortalRevisionClient.BeginUpdate +// method. func (client *PortalRevisionClient) BeginUpdate(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, ifMatch string, parameters PortalRevisionContract, options *PortalRevisionClientBeginUpdateOptions) (*runtime.Poller[PortalRevisionClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, serviceName, portalRevisionID, ifMatch, parameters, options) @@ -359,7 +364,8 @@ func (client *PortalRevisionClient) BeginUpdate(ctx context.Context, resourceGro // Update - Updates the description of specified portal revision or makes it current. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *PortalRevisionClient) update(ctx context.Context, resourceGroupName string, serviceName string, portalRevisionID string, ifMatch string, parameters PortalRevisionContract, options *PortalRevisionClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, portalRevisionID, ifMatch, parameters, options) if err != nil { @@ -399,7 +405,7 @@ func (client *PortalRevisionClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_portalsettings_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/portalsettings_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_portalsettings_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/portalsettings_client.go index 6f23242b77ce..a7b558f0c39d 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_portalsettings_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/portalsettings_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 armapimanagement @@ -31,10 +32,9 @@ type PortalSettingsClient struct { } // NewPortalSettingsClient creates a new instance of PortalSettingsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewPortalSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PortalSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewPortalSettingsClient(subscriptionID string, credential azcore.TokenCrede // ListByService - Lists a collection of portalsettings defined within a service instance.. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - PortalSettingsClientListByServiceOptions contains the optional parameters for the PortalSettingsClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - PortalSettingsClientListByServiceOptions contains the optional parameters for the PortalSettingsClient.ListByService +// method. func (client *PortalSettingsClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, options *PortalSettingsClientListByServiceOptions) (PortalSettingsClientListByServiceResponse, error) { req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -97,7 +98,7 @@ func (client *PortalSettingsClient) listByServiceCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_privateendpointconnection_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/privateendpointconnection_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_privateendpointconnection_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/privateendpointconnection_client.go index a5de6646e6b9..d71f63167e53 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_privateendpointconnection_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/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 armapimanagement @@ -31,10 +32,9 @@ type PrivateEndpointConnectionClient struct { } // NewPrivateEndpointConnectionClient creates a new instance of PrivateEndpointConnectionClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - 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{} @@ -57,12 +57,13 @@ func NewPrivateEndpointConnectionClient(subscriptionID string, credential azcore // BeginCreateOrUpdate - Creates a new Private Endpoint Connection or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// privateEndpointConnectionName - Name of the private endpoint connection. -// options - PrivateEndpointConnectionClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - privateEndpointConnectionName - Name of the private endpoint connection. +// - options - PrivateEndpointConnectionClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginCreateOrUpdate +// method. func (client *PrivateEndpointConnectionClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, privateEndpointConnectionName string, privateEndpointConnectionRequest PrivateEndpointConnectionRequest, options *PrivateEndpointConnectionClientBeginCreateOrUpdateOptions) (*runtime.Poller[PrivateEndpointConnectionClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, privateEndpointConnectionName, privateEndpointConnectionRequest, options) @@ -77,7 +78,8 @@ func (client *PrivateEndpointConnectionClient) BeginCreateOrUpdate(ctx context.C // CreateOrUpdate - Creates a new Private Endpoint Connection or updates an existing one. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *PrivateEndpointConnectionClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, privateEndpointConnectionName string, privateEndpointConnectionRequest PrivateEndpointConnectionRequest, options *PrivateEndpointConnectionClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, privateEndpointConnectionName, privateEndpointConnectionRequest, options) if err != nil { @@ -117,7 +119,7 @@ func (client *PrivateEndpointConnectionClient) createOrUpdateCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, privateEndpointConnectionRequest) @@ -125,12 +127,13 @@ func (client *PrivateEndpointConnectionClient) createOrUpdateCreateRequest(ctx c // BeginDelete - Deletes the specified Private Endpoint Connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// privateEndpointConnectionName - Name of the private endpoint connection. -// options - PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - privateEndpointConnectionName - Name of the private endpoint connection. +// - options - PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete +// method. func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*runtime.Poller[PrivateEndpointConnectionClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, privateEndpointConnectionName, options) @@ -145,7 +148,8 @@ func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, // Delete - Deletes the specified Private Endpoint Connection. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *PrivateEndpointConnectionClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, privateEndpointConnectionName, options) if err != nil { @@ -185,7 +189,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,12 +197,13 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C // GetByName - Gets the details of the Private Endpoint Connection specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// privateEndpointConnectionName - Name of the private endpoint connection. -// options - PrivateEndpointConnectionClientGetByNameOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetByName -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - privateEndpointConnectionName - Name of the private endpoint connection. +// - options - PrivateEndpointConnectionClientGetByNameOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetByName +// method. func (client *PrivateEndpointConnectionClient) GetByName(ctx context.Context, resourceGroupName string, serviceName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientGetByNameOptions) (PrivateEndpointConnectionClientGetByNameResponse, error) { req, err := client.getByNameCreateRequest(ctx, resourceGroupName, serviceName, privateEndpointConnectionName, options) if err != nil { @@ -238,7 +243,7 @@ func (client *PrivateEndpointConnectionClient) getByNameCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,12 +260,13 @@ func (client *PrivateEndpointConnectionClient) getByNameHandleResponse(resp *htt // GetPrivateLinkResource - Gets the private link resources // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// privateLinkSubResourceName - Name of the private link resource. -// options - PrivateEndpointConnectionClientGetPrivateLinkResourceOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetPrivateLinkResource -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - privateLinkSubResourceName - Name of the private link resource. +// - options - PrivateEndpointConnectionClientGetPrivateLinkResourceOptions contains the optional parameters for the PrivateEndpointConnectionClient.GetPrivateLinkResource +// method. func (client *PrivateEndpointConnectionClient) GetPrivateLinkResource(ctx context.Context, resourceGroupName string, serviceName string, privateLinkSubResourceName string, options *PrivateEndpointConnectionClientGetPrivateLinkResourceOptions) (PrivateEndpointConnectionClientGetPrivateLinkResourceResponse, error) { req, err := client.getPrivateLinkResourceCreateRequest(ctx, resourceGroupName, serviceName, privateLinkSubResourceName, options) if err != nil { @@ -300,7 +306,7 @@ func (client *PrivateEndpointConnectionClient) getPrivateLinkResourceCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -316,12 +322,12 @@ func (client *PrivateEndpointConnectionClient) getPrivateLinkResourceHandleRespo } // NewListByServicePager - Lists all private endpoint connections of the API Management service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - PrivateEndpointConnectionClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - PrivateEndpointConnectionClientListByServiceOptions contains the optional parameters for the PrivateEndpointConnectionClient.NewListByServicePager +// method. func (client *PrivateEndpointConnectionClient) NewListByServicePager(resourceGroupName string, serviceName string, options *PrivateEndpointConnectionClientListByServiceOptions) *runtime.Pager[PrivateEndpointConnectionClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[PrivateEndpointConnectionClientListByServiceResponse]{ More: func(page PrivateEndpointConnectionClientListByServiceResponse) bool { @@ -364,7 +370,7 @@ func (client *PrivateEndpointConnectionClient) listByServiceCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -381,11 +387,12 @@ func (client *PrivateEndpointConnectionClient) listByServiceHandleResponse(resp // ListPrivateLinkResources - Gets the private link resources // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - PrivateEndpointConnectionClientListPrivateLinkResourcesOptions contains the optional parameters for the PrivateEndpointConnectionClient.ListPrivateLinkResources -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - PrivateEndpointConnectionClientListPrivateLinkResourcesOptions contains the optional parameters for the PrivateEndpointConnectionClient.ListPrivateLinkResources +// method. func (client *PrivateEndpointConnectionClient) ListPrivateLinkResources(ctx context.Context, resourceGroupName string, serviceName string, options *PrivateEndpointConnectionClientListPrivateLinkResourcesOptions) (PrivateEndpointConnectionClientListPrivateLinkResourcesResponse, error) { req, err := client.listPrivateLinkResourcesCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -421,7 +428,7 @@ func (client *PrivateEndpointConnectionClient) listPrivateLinkResourcesCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_product_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/product_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_product_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/product_client.go index 6c63de124c0d..6fcd776e66f4 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_product_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/product_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 armapimanagement @@ -32,10 +33,9 @@ type ProductClient struct { } // NewProductClient creates a new instance of ProductClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProductClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewProductClient(subscriptionID string, credential azcore.TokenCredential, // CreateOrUpdate - Creates or Updates a product. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// parameters - Create or update parameters. -// options - ProductClientCreateOrUpdateOptions contains the optional parameters for the ProductClient.CreateOrUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - parameters - Create or update parameters. +// - options - ProductClientCreateOrUpdateOptions contains the optional parameters for the ProductClient.CreateOrUpdate method. func (client *ProductClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters ProductContract, options *ProductClientCreateOrUpdateOptions) (ProductClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, productID, parameters, options) if err != nil { @@ -103,7 +104,7 @@ func (client *ProductClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -126,13 +127,14 @@ func (client *ProductClient) createOrUpdateHandleResponse(resp *http.Response) ( // Delete - Delete product. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - ProductClientDeleteOptions contains the optional parameters for the ProductClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - ProductClientDeleteOptions contains the optional parameters for the ProductClient.Delete method. func (client *ProductClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, options *ProductClientDeleteOptions) (ProductClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, productID, ifMatch, options) if err != nil { @@ -175,7 +177,7 @@ func (client *ProductClient) deleteCreateRequest(ctx context.Context, resourceGr if options != nil && options.DeleteSubscriptions != nil { reqQP.Set("deleteSubscriptions", strconv.FormatBool(*options.DeleteSubscriptions)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -184,11 +186,12 @@ func (client *ProductClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets the details of the product specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// options - ProductClientGetOptions contains the optional parameters for the ProductClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - ProductClientGetOptions contains the optional parameters for the ProductClient.Get method. func (client *ProductClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductClientGetOptions) (ProductClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, productID, options) if err != nil { @@ -228,7 +231,7 @@ func (client *ProductClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -247,11 +250,12 @@ func (client *ProductClient) getHandleResponse(resp *http.Response) (ProductClie } // GetEntityTag - Gets the entity state (Etag) version of the product specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// options - ProductClientGetEntityTagOptions contains the optional parameters for the ProductClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - ProductClientGetEntityTagOptions contains the optional parameters for the ProductClient.GetEntityTag method. func (client *ProductClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductClientGetEntityTagOptions) (ProductClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, productID, options) if err != nil { @@ -291,7 +295,7 @@ func (client *ProductClient) getEntityTagCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -308,11 +312,12 @@ func (client *ProductClient) getEntityTagHandleResponse(resp *http.Response) (Pr } // NewListByServicePager - Lists a collection of products in the specified service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - ProductClientListByServiceOptions contains the optional parameters for the ProductClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - ProductClientListByServiceOptions contains the optional parameters for the ProductClient.NewListByServicePager +// method. func (client *ProductClient) NewListByServicePager(resourceGroupName string, serviceName string, options *ProductClientListByServiceOptions) *runtime.Pager[ProductClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[ProductClientListByServiceResponse]{ More: func(page ProductClientListByServiceResponse) bool { @@ -376,7 +381,7 @@ func (client *ProductClient) listByServiceCreateRequest(ctx context.Context, res if options != nil && options.Tags != nil { reqQP.Set("tags", *options.Tags) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,11 +397,11 @@ func (client *ProductClient) listByServiceHandleResponse(resp *http.Response) (P } // NewListByTagsPager - Lists a collection of products associated with tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - ProductClientListByTagsOptions contains the optional parameters for the ProductClient.ListByTags method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - ProductClientListByTagsOptions contains the optional parameters for the ProductClient.NewListByTagsPager method. func (client *ProductClient) NewListByTagsPager(resourceGroupName string, serviceName string, options *ProductClientListByTagsOptions) *runtime.Pager[ProductClientListByTagsResponse] { return runtime.NewPager(runtime.PagingHandler[ProductClientListByTagsResponse]{ More: func(page ProductClientListByTagsResponse) bool { @@ -457,7 +462,7 @@ func (client *ProductClient) listByTagsCreateRequest(ctx context.Context, resour if options != nil && options.IncludeNotTaggedProducts != nil { reqQP.Set("includeNotTaggedProducts", strconv.FormatBool(*options.IncludeNotTaggedProducts)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -474,14 +479,15 @@ func (client *ProductClient) listByTagsHandleResponse(resp *http.Response) (Prod // Update - Update existing product details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - ProductClientUpdateOptions contains the optional parameters for the ProductClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - ProductClientUpdateOptions contains the optional parameters for the ProductClient.Update method. func (client *ProductClient) Update(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, parameters ProductUpdateParameters, options *ProductClientUpdateOptions) (ProductClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, productID, ifMatch, parameters, options) if err != nil { @@ -521,7 +527,7 @@ func (client *ProductClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_productapi_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/productapi_client.go similarity index 83% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_productapi_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/productapi_client.go index 59a3b118d38e..7319a224b952 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_productapi_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productapi_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 armapimanagement @@ -32,10 +33,9 @@ type ProductAPIClient struct { } // NewProductAPIClient creates a new instance of ProductAPIClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProductAPIClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductAPIClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +57,15 @@ func NewProductAPIClient(subscriptionID string, credential azcore.TokenCredentia } // CheckEntityExists - Checks that API entity specified by identifier is associated with the Product entity. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// options - ProductAPIClientCheckEntityExistsOptions contains the optional parameters for the ProductAPIClient.CheckEntityExists -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - ProductAPIClientCheckEntityExistsOptions contains the optional parameters for the ProductAPIClient.CheckEntityExists +// method. func (client *ProductAPIClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiID string, options *ProductAPIClientCheckEntityExistsOptions) (ProductAPIClientCheckEntityExistsResponse, error) { req, err := client.checkEntityExistsCreateRequest(ctx, resourceGroupName, serviceName, productID, apiID, options) if err != nil { @@ -108,7 +109,7 @@ func (client *ProductAPIClient) checkEntityExistsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -116,14 +117,15 @@ func (client *ProductAPIClient) checkEntityExistsCreateRequest(ctx context.Conte // CreateOrUpdate - Adds an API to the specified product. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// options - ProductAPIClientCreateOrUpdateOptions contains the optional parameters for the ProductAPIClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - ProductAPIClientCreateOrUpdateOptions contains the optional parameters for the ProductAPIClient.CreateOrUpdate +// method. func (client *ProductAPIClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiID string, options *ProductAPIClientCreateOrUpdateOptions) (ProductAPIClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, productID, apiID, options) if err != nil { @@ -167,7 +169,7 @@ func (client *ProductAPIClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -184,13 +186,14 @@ func (client *ProductAPIClient) createOrUpdateHandleResponse(resp *http.Response // Delete - Deletes the specified API from the specified product. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// options - ProductAPIClientDeleteOptions contains the optional parameters for the ProductAPIClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - ProductAPIClientDeleteOptions contains the optional parameters for the ProductAPIClient.Delete method. func (client *ProductAPIClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, apiID string, options *ProductAPIClientDeleteOptions) (ProductAPIClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, productID, apiID, options) if err != nil { @@ -234,20 +237,20 @@ func (client *ProductAPIClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListByProductPager - Lists a collection of the APIs associated with a product. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// options - ProductAPIClientListByProductOptions contains the optional parameters for the ProductAPIClient.ListByProduct -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - ProductAPIClientListByProductOptions contains the optional parameters for the ProductAPIClient.NewListByProductPager +// method. func (client *ProductAPIClient) NewListByProductPager(resourceGroupName string, serviceName string, productID string, options *ProductAPIClientListByProductOptions) *runtime.Pager[ProductAPIClientListByProductResponse] { return runtime.NewPager(runtime.PagingHandler[ProductAPIClientListByProductResponse]{ More: func(page ProductAPIClientListByProductResponse) bool { @@ -309,7 +312,7 @@ func (client *ProductAPIClient) listByProductCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_productgroup_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/productgroup_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_productgroup_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/productgroup_client.go index 850910738068..6474fb823b07 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_productgroup_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productgroup_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 armapimanagement @@ -32,10 +33,9 @@ type ProductGroupClient struct { } // NewProductGroupClient creates a new instance of ProductGroupClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProductGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductGroupClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,14 @@ func NewProductGroupClient(subscriptionID string, credential azcore.TokenCredent } // CheckEntityExists - Checks that Group entity specified by identifier is associated with the Product entity. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// groupID - Group identifier. Must be unique in the current API Management service instance. -// options - ProductGroupClientCheckEntityExistsOptions contains the optional parameters for the ProductGroupClient.CheckEntityExists -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - groupID - Group identifier. Must be unique in the current API Management service instance. +// - options - ProductGroupClientCheckEntityExistsOptions contains the optional parameters for the ProductGroupClient.CheckEntityExists +// method. func (client *ProductGroupClient) CheckEntityExists(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string, options *ProductGroupClientCheckEntityExistsOptions) (ProductGroupClientCheckEntityExistsResponse, error) { req, err := client.checkEntityExistsCreateRequest(ctx, resourceGroupName, serviceName, productID, groupID, options) if err != nil { @@ -107,7 +108,7 @@ func (client *ProductGroupClient) checkEntityExistsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,13 +116,14 @@ func (client *ProductGroupClient) checkEntityExistsCreateRequest(ctx context.Con // CreateOrUpdate - Adds the association between the specified developer group with the specified product. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// groupID - Group identifier. Must be unique in the current API Management service instance. -// options - ProductGroupClientCreateOrUpdateOptions contains the optional parameters for the ProductGroupClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - groupID - Group identifier. Must be unique in the current API Management service instance. +// - options - ProductGroupClientCreateOrUpdateOptions contains the optional parameters for the ProductGroupClient.CreateOrUpdate +// method. func (client *ProductGroupClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string, options *ProductGroupClientCreateOrUpdateOptions) (ProductGroupClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, productID, groupID, options) if err != nil { @@ -165,7 +167,7 @@ func (client *ProductGroupClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -182,12 +184,13 @@ func (client *ProductGroupClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Deletes the association between the specified group and product. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// groupID - Group identifier. Must be unique in the current API Management service instance. -// options - ProductGroupClientDeleteOptions contains the optional parameters for the ProductGroupClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - groupID - Group identifier. Must be unique in the current API Management service instance. +// - options - ProductGroupClientDeleteOptions contains the optional parameters for the ProductGroupClient.Delete method. func (client *ProductGroupClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, groupID string, options *ProductGroupClientDeleteOptions) (ProductGroupClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, productID, groupID, options) if err != nil { @@ -231,20 +234,20 @@ func (client *ProductGroupClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil } // NewListByProductPager - Lists the collection of developer groups associated with the specified product. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// options - ProductGroupClientListByProductOptions contains the optional parameters for the ProductGroupClient.ListByProduct -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - ProductGroupClientListByProductOptions contains the optional parameters for the ProductGroupClient.NewListByProductPager +// method. func (client *ProductGroupClient) NewListByProductPager(resourceGroupName string, serviceName string, productID string, options *ProductGroupClientListByProductOptions) *runtime.Pager[ProductGroupClientListByProductResponse] { return runtime.NewPager(runtime.PagingHandler[ProductGroupClientListByProductResponse]{ More: func(page ProductGroupClientListByProductResponse) bool { @@ -306,7 +309,7 @@ func (client *ProductGroupClient) listByProductCreateRequest(ctx context.Context if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_productpolicy_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/productpolicy_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_productpolicy_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/productpolicy_client.go index 2575e22788d4..6c4405f8be77 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_productpolicy_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productpolicy_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 armapimanagement @@ -31,10 +32,9 @@ type ProductPolicyClient struct { } // NewProductPolicyClient creates a new instance of ProductPolicyClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProductPolicyClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductPolicyClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +57,15 @@ func NewProductPolicyClient(subscriptionID string, credential azcore.TokenCreden // CreateOrUpdate - Creates or updates policy configuration for the Product. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// policyID - The identifier of the Policy. -// parameters - The policy contents to apply. -// options - ProductPolicyClientCreateOrUpdateOptions contains the optional parameters for the ProductPolicyClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - parameters - The policy contents to apply. +// - options - ProductPolicyClientCreateOrUpdateOptions contains the optional parameters for the ProductPolicyClient.CreateOrUpdate +// method. func (client *ProductPolicyClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, policyID PolicyIDName, parameters PolicyContract, options *ProductPolicyClientCreateOrUpdateOptions) (ProductPolicyClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, productID, policyID, parameters, options) if err != nil { @@ -108,7 +109,7 @@ func (client *ProductPolicyClient) createOrUpdateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -131,14 +132,15 @@ func (client *ProductPolicyClient) createOrUpdateHandleResponse(resp *http.Respo // Delete - Deletes the policy configuration at the Product. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// policyID - The identifier of the Policy. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - ProductPolicyClientDeleteOptions contains the optional parameters for the ProductPolicyClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - ProductPolicyClientDeleteOptions contains the optional parameters for the ProductPolicyClient.Delete method. func (client *ProductPolicyClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, policyID PolicyIDName, ifMatch string, options *ProductPolicyClientDeleteOptions) (ProductPolicyClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, productID, policyID, ifMatch, options) if err != nil { @@ -182,7 +184,7 @@ func (client *ProductPolicyClient) deleteCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -191,12 +193,13 @@ func (client *ProductPolicyClient) deleteCreateRequest(ctx context.Context, reso // Get - Get the policy configuration at the Product level. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// policyID - The identifier of the Policy. -// options - ProductPolicyClientGetOptions contains the optional parameters for the ProductPolicyClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - options - ProductPolicyClientGetOptions contains the optional parameters for the ProductPolicyClient.Get method. func (client *ProductPolicyClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string, policyID PolicyIDName, options *ProductPolicyClientGetOptions) (ProductPolicyClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, productID, policyID, options) if err != nil { @@ -243,7 +246,7 @@ func (client *ProductPolicyClient) getCreateRequest(ctx context.Context, resourc if options != nil && options.Format != nil { reqQP.Set("format", string(*options.Format)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -262,13 +265,14 @@ func (client *ProductPolicyClient) getHandleResponse(resp *http.Response) (Produ } // GetEntityTag - Get the ETag of the policy configuration at the Product level. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// policyID - The identifier of the Policy. -// options - ProductPolicyClientGetEntityTagOptions contains the optional parameters for the ProductPolicyClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - policyID - The identifier of the Policy. +// - options - ProductPolicyClientGetEntityTagOptions contains the optional parameters for the ProductPolicyClient.GetEntityTag +// method. func (client *ProductPolicyClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, productID string, policyID PolicyIDName, options *ProductPolicyClientGetEntityTagOptions) (ProductPolicyClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, productID, policyID, options) if err != nil { @@ -312,7 +316,7 @@ func (client *ProductPolicyClient) getEntityTagCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -330,12 +334,13 @@ func (client *ProductPolicyClient) getEntityTagHandleResponse(resp *http.Respons // ListByProduct - Get the policy configuration at the Product level. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// options - ProductPolicyClientListByProductOptions contains the optional parameters for the ProductPolicyClient.ListByProduct -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - ProductPolicyClientListByProductOptions contains the optional parameters for the ProductPolicyClient.ListByProduct +// method. func (client *ProductPolicyClient) ListByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductPolicyClientListByProductOptions) (ProductPolicyClientListByProductResponse, error) { req, err := client.listByProductCreateRequest(ctx, resourceGroupName, serviceName, productID, options) if err != nil { @@ -375,7 +380,7 @@ func (client *ProductPolicyClient) listByProductCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_productsubscriptions_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/productsubscriptions_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_productsubscriptions_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/productsubscriptions_client.go index df9c0dda6411..54228994f9f9 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_productsubscriptions_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productsubscriptions_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 armapimanagement @@ -32,10 +33,9 @@ type ProductSubscriptionsClient struct { } // NewProductSubscriptionsClient creates a new instance of ProductSubscriptionsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewProductSubscriptionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductSubscriptionsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,13 +57,13 @@ func NewProductSubscriptionsClient(subscriptionID string, credential azcore.Toke } // NewListPager - Lists the collection of subscriptions to the specified product. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// options - ProductSubscriptionsClientListOptions contains the optional parameters for the ProductSubscriptionsClient.List -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - ProductSubscriptionsClientListOptions contains the optional parameters for the ProductSubscriptionsClient.NewListPager +// method. func (client *ProductSubscriptionsClient) NewListPager(resourceGroupName string, serviceName string, productID string, options *ProductSubscriptionsClientListOptions) *runtime.Pager[ProductSubscriptionsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ProductSubscriptionsClientListResponse]{ More: func(page ProductSubscriptionsClientListResponse) bool { @@ -125,7 +125,7 @@ func (client *ProductSubscriptionsClient) listCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productwiki_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/productwiki_client.go new file mode 100644 index 000000000000..a099b794d70d --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productwiki_client.go @@ -0,0 +1,379 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +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" +) + +// ProductWikiClient contains the methods for the ProductWiki group. +// Don't use this type directly, use NewProductWikiClient() instead. +type ProductWikiClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewProductWikiClient creates a new instance of ProductWikiClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewProductWikiClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductWikiClient, 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 := &ProductWikiClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// CreateOrUpdate - Creates a new Wiki for a Product or updates an existing one. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - ProductWikiClientCreateOrUpdateOptions contains the optional parameters for the ProductWikiClient.CreateOrUpdate +// method. +func (client *ProductWikiClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters WikiContract, options *ProductWikiClientCreateOrUpdateOptions) (ProductWikiClientCreateOrUpdateResponse, error) { + req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, productID, parameters, options) + if err != nil { + return ProductWikiClientCreateOrUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ProductWikiClientCreateOrUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { + return ProductWikiClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.createOrUpdateHandleResponse(resp) +} + +// createOrUpdateCreateRequest creates the CreateOrUpdate request. +func (client *ProductWikiClient) createOrUpdateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, productID string, parameters WikiContract, options *ProductWikiClientCreateOrUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if productID == "" { + return nil, errors.New("parameter productID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{productId}", url.PathEscape(productID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPut, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + if options != nil && options.IfMatch != nil { + req.Raw().Header["If-Match"] = []string{*options.IfMatch} + } + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// createOrUpdateHandleResponse handles the CreateOrUpdate response. +func (client *ProductWikiClient) createOrUpdateHandleResponse(resp *http.Response) (ProductWikiClientCreateOrUpdateResponse, error) { + result := ProductWikiClientCreateOrUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiContract); err != nil { + return ProductWikiClientCreateOrUpdateResponse{}, err + } + return result, nil +} + +// Delete - Deletes the specified Wiki from a Product. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - ProductWikiClientDeleteOptions contains the optional parameters for the ProductWikiClient.Delete method. +func (client *ProductWikiClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, options *ProductWikiClientDeleteOptions) (ProductWikiClientDeleteResponse, error) { + req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, productID, ifMatch, options) + if err != nil { + return ProductWikiClientDeleteResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ProductWikiClientDeleteResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { + return ProductWikiClientDeleteResponse{}, runtime.NewResponseError(resp) + } + return ProductWikiClientDeleteResponse{}, nil +} + +// deleteCreateRequest creates the Delete request. +func (client *ProductWikiClient) deleteCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, options *ProductWikiClientDeleteOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if productID == "" { + return nil, errors.New("parameter productID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{productId}", url.PathEscape(productID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodDelete, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// Get - Gets the details of the Wiki for a Product specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - ProductWikiClientGetOptions contains the optional parameters for the ProductWikiClient.Get method. +func (client *ProductWikiClient) Get(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductWikiClientGetOptions) (ProductWikiClientGetResponse, error) { + req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, productID, options) + if err != nil { + return ProductWikiClientGetResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ProductWikiClientGetResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProductWikiClientGetResponse{}, runtime.NewResponseError(resp) + } + return client.getHandleResponse(resp) +} + +// getCreateRequest creates the Get request. +func (client *ProductWikiClient) getCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductWikiClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if productID == "" { + return nil, errors.New("parameter productID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{productId}", url.PathEscape(productID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *ProductWikiClient) getHandleResponse(resp *http.Response) (ProductWikiClientGetResponse, error) { + result := ProductWikiClientGetResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiContract); err != nil { + return ProductWikiClientGetResponse{}, err + } + return result, nil +} + +// GetEntityTag - Gets the entity state (Etag) version of the Wiki for a Product specified by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - ProductWikiClientGetEntityTagOptions contains the optional parameters for the ProductWikiClient.GetEntityTag +// method. +func (client *ProductWikiClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductWikiClientGetEntityTagOptions) (ProductWikiClientGetEntityTagResponse, error) { + req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, productID, options) + if err != nil { + return ProductWikiClientGetEntityTagResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ProductWikiClientGetEntityTagResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProductWikiClientGetEntityTagResponse{}, runtime.NewResponseError(resp) + } + return client.getEntityTagHandleResponse(resp) +} + +// getEntityTagCreateRequest creates the GetEntityTag request. +func (client *ProductWikiClient) getEntityTagCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductWikiClientGetEntityTagOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if productID == "" { + return nil, errors.New("parameter productID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{productId}", url.PathEscape(productID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodHead, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// getEntityTagHandleResponse handles the GetEntityTag response. +func (client *ProductWikiClient) getEntityTagHandleResponse(resp *http.Response) (ProductWikiClientGetEntityTagResponse, error) { + result := ProductWikiClientGetEntityTagResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + result.Success = resp.StatusCode >= 200 && resp.StatusCode < 300 + return result, nil +} + +// Update - Updates the details of the Wiki for a Product specified by its identifier. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Wiki Update parameters. +// - options - ProductWikiClientUpdateOptions contains the optional parameters for the ProductWikiClient.Update method. +func (client *ProductWikiClient) Update(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, parameters WikiUpdateContract, options *ProductWikiClientUpdateOptions) (ProductWikiClientUpdateResponse, error) { + req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, productID, ifMatch, parameters, options) + if err != nil { + return ProductWikiClientUpdateResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ProductWikiClientUpdateResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProductWikiClientUpdateResponse{}, runtime.NewResponseError(resp) + } + return client.updateHandleResponse(resp) +} + +// updateCreateRequest creates the Update request. +func (client *ProductWikiClient) updateCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, productID string, ifMatch string, parameters WikiUpdateContract, options *ProductWikiClientUpdateOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis/default" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if productID == "" { + return nil, errors.New("parameter productID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{productId}", url.PathEscape(productID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPatch, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["If-Match"] = []string{ifMatch} + req.Raw().Header["Accept"] = []string{"application/json"} + return req, runtime.MarshalAsJSON(req, parameters) +} + +// updateHandleResponse handles the Update response. +func (client *ProductWikiClient) updateHandleResponse(resp *http.Response) (ProductWikiClientUpdateResponse, error) { + result := ProductWikiClientUpdateResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiContract); err != nil { + return ProductWikiClientUpdateResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/productwikis_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/productwikis_client.go new file mode 100644 index 000000000000..7a8cd754b33d --- /dev/null +++ b/sdk/resourcemanager/apimanagement/armapimanagement/productwikis_client.go @@ -0,0 +1,133 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. + +package armapimanagement + +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" +) + +// ProductWikisClient contains the methods for the ProductWikis group. +// Don't use this type directly, use NewProductWikisClient() instead. +type ProductWikisClient struct { + host string + subscriptionID string + pl runtime.Pipeline +} + +// NewProductWikisClient creates a new instance of ProductWikisClient with the specified values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewProductWikisClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ProductWikisClient, 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 := &ProductWikisClient{ + subscriptionID: subscriptionID, + host: ep, + pl: pl, + } + return client, nil +} + +// NewListPager - Gets the details of the Wiki for a Product specified by its identifier. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - ProductWikisClientListOptions contains the optional parameters for the ProductWikisClient.NewListPager method. +func (client *ProductWikisClient) NewListPager(resourceGroupName string, serviceName string, productID string, options *ProductWikisClientListOptions) *runtime.Pager[ProductWikisClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[ProductWikisClientListResponse]{ + More: func(page ProductWikisClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *ProductWikisClientListResponse) (ProductWikisClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, serviceName, productID, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ProductWikisClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ProductWikisClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ProductWikisClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) + }, + }) +} + +// listCreateRequest creates the List request. +func (client *ProductWikisClient) listCreateRequest(ctx context.Context, resourceGroupName string, serviceName string, productID string, options *ProductWikisClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/products/{productId}/wikis" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if productID == "" { + return nil, errors.New("parameter productID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{productId}", url.PathEscape(productID)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodGet, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + +// listHandleResponse handles the List response. +func (client *ProductWikisClient) listHandleResponse(resp *http.Response) (ProductWikisClientListResponse, error) { + result := ProductWikisClientListResponse{} + if val := resp.Header.Get("ETag"); val != "" { + result.ETag = &val + } + if err := runtime.UnmarshalAsJSON(resp, &result.WikiCollection); err != nil { + return ProductWikisClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_quotabycounterkeys_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/quotabycounterkeys_client.go similarity index 81% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_quotabycounterkeys_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/quotabycounterkeys_client.go index 503cb32bc293..57edc2ea7660 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_quotabycounterkeys_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/quotabycounterkeys_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 armapimanagement @@ -31,10 +32,9 @@ type QuotaByCounterKeysClient struct { } // NewQuotaByCounterKeysClient creates a new instance of QuotaByCounterKeysClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewQuotaByCounterKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaByCounterKeysClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +58,15 @@ func NewQuotaByCounterKeysClient(subscriptionID string, credential azcore.TokenC // ListByService - Lists a collection of current quota counter periods associated with the counter-key configured in the policy // on the specified service instance. The api does not support paging yet. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the -// quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s -// accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key -// options - QuotaByCounterKeysClientListByServiceOptions contains the optional parameters for the QuotaByCounterKeysClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the +// quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s +// accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key +// - options - QuotaByCounterKeysClientListByServiceOptions contains the optional parameters for the QuotaByCounterKeysClient.ListByService +// method. func (client *QuotaByCounterKeysClient) ListByService(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, options *QuotaByCounterKeysClientListByServiceOptions) (QuotaByCounterKeysClientListByServiceResponse, error) { req, err := client.listByServiceCreateRequest(ctx, resourceGroupName, serviceName, quotaCounterKey, options) if err != nil { @@ -105,7 +106,7 @@ func (client *QuotaByCounterKeysClient) listByServiceCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -123,15 +124,16 @@ func (client *QuotaByCounterKeysClient) listByServiceHandleResponse(resp *http.R // Update - Updates all the quota counter values specified with the existing quota counter key to a value in the specified // service instance. This should be used for reset of the quota counter values. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the -// quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s -// accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key -// parameters - The value of the quota counter to be applied to all quota counter periods. -// options - QuotaByCounterKeysClientUpdateOptions contains the optional parameters for the QuotaByCounterKeysClient.Update -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the +// quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s +// accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key +// - parameters - The value of the quota counter to be applied to all quota counter periods. +// - options - QuotaByCounterKeysClientUpdateOptions contains the optional parameters for the QuotaByCounterKeysClient.Update +// method. func (client *QuotaByCounterKeysClient) Update(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, parameters QuotaCounterValueUpdateContract, options *QuotaByCounterKeysClientUpdateOptions) (QuotaByCounterKeysClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, quotaCounterKey, parameters, options) if err != nil { @@ -171,7 +173,7 @@ func (client *QuotaByCounterKeysClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-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/apimanagement/armapimanagement/zz_generated_quotabyperiodkeys_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/quotabyperiodkeys_client.go similarity index 81% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_quotabyperiodkeys_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/quotabyperiodkeys_client.go index 456376c9c3c8..dc588724c0fd 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_quotabyperiodkeys_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/quotabyperiodkeys_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 armapimanagement @@ -31,10 +32,9 @@ type QuotaByPeriodKeysClient struct { } // NewQuotaByPeriodKeysClient creates a new instance of QuotaByPeriodKeysClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewQuotaByPeriodKeysClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*QuotaByPeriodKeysClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,14 +58,15 @@ func NewQuotaByPeriodKeysClient(subscriptionID string, credential azcore.TokenCr // Get - Gets the value of the quota counter associated with the counter-key in the policy for the specific period in service // instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the -// quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s -// accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key -// quotaPeriodKey - Quota period key identifier. -// options - QuotaByPeriodKeysClientGetOptions contains the optional parameters for the QuotaByPeriodKeysClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the +// quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s +// accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key +// - quotaPeriodKey - Quota period key identifier. +// - options - QuotaByPeriodKeysClientGetOptions contains the optional parameters for the QuotaByPeriodKeysClient.Get method. func (client *QuotaByPeriodKeysClient) Get(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, quotaPeriodKey string, options *QuotaByPeriodKeysClientGetOptions) (QuotaByPeriodKeysClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey, options) if err != nil { @@ -109,7 +110,7 @@ func (client *QuotaByPeriodKeysClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,16 +127,17 @@ func (client *QuotaByPeriodKeysClient) getHandleResponse(resp *http.Response) (Q // Update - Updates an existing quota counter value in the specified service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the -// quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s -// accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key -// quotaPeriodKey - Quota period key identifier. -// parameters - The value of the Quota counter to be applied on the specified period. -// options - QuotaByPeriodKeysClientUpdateOptions contains the optional parameters for the QuotaByPeriodKeysClient.Update -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - quotaCounterKey - Quota counter key identifier.This is the result of expression defined in counter-key attribute of the +// quota-by-key policy.For Example, if you specify counter-key="boo" in the policy, then it’s +// accessible by "boo" counter key. But if it’s defined as counter-key="@("b"+"a")" then it will be accessible by "ba" key +// - quotaPeriodKey - Quota period key identifier. +// - parameters - The value of the Quota counter to be applied on the specified period. +// - options - QuotaByPeriodKeysClientUpdateOptions contains the optional parameters for the QuotaByPeriodKeysClient.Update +// method. func (client *QuotaByPeriodKeysClient) Update(ctx context.Context, resourceGroupName string, serviceName string, quotaCounterKey string, quotaPeriodKey string, parameters QuotaCounterValueUpdateContract, options *QuotaByPeriodKeysClientUpdateOptions) (QuotaByPeriodKeysClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, quotaCounterKey, quotaPeriodKey, parameters, options) if err != nil { @@ -179,7 +181,7 @@ func (client *QuotaByPeriodKeysClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-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/apimanagement/armapimanagement/zz_generated_region_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/region_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_region_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/region_client.go index 1609d0de5723..743eae3cf06e 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_region_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/region_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 armapimanagement @@ -31,10 +32,9 @@ type RegionClient struct { } // NewRegionClient creates a new instance of RegionClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewRegionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RegionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,11 +56,12 @@ func NewRegionClient(subscriptionID string, credential azcore.TokenCredential, o } // NewListByServicePager - Lists all azure regions in which the service exists. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - RegionClientListByServiceOptions contains the optional parameters for the RegionClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - RegionClientListByServiceOptions contains the optional parameters for the RegionClient.NewListByServicePager +// method. func (client *RegionClient) NewListByServicePager(resourceGroupName string, serviceName string, options *RegionClientListByServiceOptions) *runtime.Pager[RegionClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[RegionClientListByServiceResponse]{ More: func(page RegionClientListByServiceResponse) bool { @@ -109,7 +110,7 @@ func (client *RegionClient) listByServiceCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_reports_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/reports_client.go similarity index 73% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_reports_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/reports_client.go index 41d6e2052426..d69f73f7f95f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_reports_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/reports_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 armapimanagement @@ -32,10 +33,9 @@ type ReportsClient struct { } // NewReportsClient creates a new instance of ReportsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewReportsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ReportsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,12 @@ func NewReportsClient(subscriptionID string, credential azcore.TokenCredential, } // NewListByAPIPager - Lists report records by API. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// filter - The filter to apply on the operation. -// options - ReportsClientListByAPIOptions contains the optional parameters for the ReportsClient.ListByAPI method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - filter - The filter to apply on the operation. +// - options - ReportsClientListByAPIOptions contains the optional parameters for the ReportsClient.NewListByAPIPager method. func (client *ReportsClient) NewListByAPIPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListByAPIOptions) *runtime.Pager[ReportsClientListByAPIResponse] { return runtime.NewPager(runtime.PagingHandler[ReportsClientListByAPIResponse]{ More: func(page ReportsClientListByAPIResponse) bool { @@ -121,7 +121,7 @@ func (client *ReportsClient) listByAPICreateRequest(ctx context.Context, resourc if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -137,36 +137,36 @@ func (client *ReportsClient) listByAPIHandleResponse(resp *http.Response) (Repor } // NewListByGeoPager - Lists report records by geography. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// filter - | Field | Usage | Supported operators | Supported functions | -// |-------------|-------------|-------------|-------------| -// | timestamp | filter | ge, le | | -// | country | select | | | -// | region | select | | | -// | zip | select | | | -// | apiRegion | filter | eq | | -// | userId | filter | eq | | -// | productId | filter | eq | | -// | subscriptionId | filter | eq | | -// | apiId | filter | eq | | -// | operationId | filter | eq | | -// | callCountSuccess | select | | | -// | callCountBlocked | select | | | -// | callCountFailed | select | | | -// | callCountOther | select | | | -// | bandwidth | select, orderBy | | | -// | cacheHitsCount | select | | | -// | cacheMissCount | select | | | -// | apiTimeAvg | select | | | -// | apiTimeMin | select | | | -// | apiTimeMax | select | | | -// | serviceTimeAvg | select | | | -// | serviceTimeMin | select | | | -// | serviceTimeMax | select | | | -// options - ReportsClientListByGeoOptions contains the optional parameters for the ReportsClient.ListByGeo method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - filter - | Field | Usage | Supported operators | Supported functions | +// |-------------|-------------|-------------|-------------| +// | timestamp | filter | ge, le | | +// | country | select | | | +// | region | select | | | +// | zip | select | | | +// | apiRegion | filter | eq | | +// | userId | filter | eq | | +// | productId | filter | eq | | +// | subscriptionId | filter | eq | | +// | apiId | filter | eq | | +// | operationId | filter | eq | | +// | callCountSuccess | select | | | +// | callCountBlocked | select | | | +// | callCountFailed | select | | | +// | callCountOther | select | | | +// | bandwidth | select, orderBy | | | +// | cacheHitsCount | select | | | +// | cacheMissCount | select | | | +// | apiTimeAvg | select | | | +// | apiTimeMin | select | | | +// | apiTimeMax | select | | | +// | serviceTimeAvg | select | | | +// | serviceTimeMin | select | | | +// | serviceTimeMax | select | | | +// - options - ReportsClientListByGeoOptions contains the optional parameters for the ReportsClient.NewListByGeoPager method. func (client *ReportsClient) NewListByGeoPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListByGeoOptions) *runtime.Pager[ReportsClientListByGeoResponse] { return runtime.NewPager(runtime.PagingHandler[ReportsClientListByGeoResponse]{ More: func(page ReportsClientListByGeoResponse) bool { @@ -222,7 +222,7 @@ func (client *ReportsClient) listByGeoCreateRequest(ctx context.Context, resourc if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -238,35 +238,36 @@ func (client *ReportsClient) listByGeoHandleResponse(resp *http.Response) (Repor } // NewListByOperationPager - Lists report records by API Operations. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// filter - | Field | Usage | Supported operators | Supported functions | -// |-------------|-------------|-------------|-------------| -// | timestamp | filter | ge, le | | -// | displayName | select, orderBy | | | -// | apiRegion | filter | eq | | -// | userId | filter | eq | | -// | productId | filter | eq | | -// | subscriptionId | filter | eq | | -// | apiId | filter | eq | | -// | operationId | select, filter | eq | | -// | callCountSuccess | select, orderBy | | | -// | callCountBlocked | select, orderBy | | | -// | callCountFailed | select, orderBy | | | -// | callCountOther | select, orderBy | | | -// | callCountTotal | select, orderBy | | | -// | bandwidth | select, orderBy | | | -// | cacheHitsCount | select | | | -// | cacheMissCount | select | | | -// | apiTimeAvg | select, orderBy | | | -// | apiTimeMin | select | | | -// | apiTimeMax | select | | | -// | serviceTimeAvg | select | | | -// | serviceTimeMin | select | | | -// | serviceTimeMax | select | | | -// options - ReportsClientListByOperationOptions contains the optional parameters for the ReportsClient.ListByOperation method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - filter - | Field | Usage | Supported operators | Supported functions | +// |-------------|-------------|-------------|-------------| +// | timestamp | filter | ge, le | | +// | displayName | select, orderBy | | | +// | apiRegion | filter | eq | | +// | userId | filter | eq | | +// | productId | filter | eq | | +// | subscriptionId | filter | eq | | +// | apiId | filter | eq | | +// | operationId | select, filter | eq | | +// | callCountSuccess | select, orderBy | | | +// | callCountBlocked | select, orderBy | | | +// | callCountFailed | select, orderBy | | | +// | callCountOther | select, orderBy | | | +// | callCountTotal | select, orderBy | | | +// | bandwidth | select, orderBy | | | +// | cacheHitsCount | select | | | +// | cacheMissCount | select | | | +// | apiTimeAvg | select, orderBy | | | +// | apiTimeMin | select | | | +// | apiTimeMax | select | | | +// | serviceTimeAvg | select | | | +// | serviceTimeMin | select | | | +// | serviceTimeMax | select | | | +// - options - ReportsClientListByOperationOptions contains the optional parameters for the ReportsClient.NewListByOperationPager +// method. func (client *ReportsClient) NewListByOperationPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListByOperationOptions) *runtime.Pager[ReportsClientListByOperationResponse] { return runtime.NewPager(runtime.PagingHandler[ReportsClientListByOperationResponse]{ More: func(page ReportsClientListByOperationResponse) bool { @@ -325,7 +326,7 @@ func (client *ReportsClient) listByOperationCreateRequest(ctx context.Context, r if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -341,33 +342,34 @@ func (client *ReportsClient) listByOperationHandleResponse(resp *http.Response) } // NewListByProductPager - Lists report records by Product. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// filter - | Field | Usage | Supported operators | Supported functions | -// |-------------|-------------|-------------|-------------| -// | timestamp | filter | ge, le | | -// | displayName | select, orderBy | | | -// | apiRegion | filter | eq | | -// | userId | filter | eq | | -// | productId | select, filter | eq | | -// | subscriptionId | filter | eq | | -// | callCountSuccess | select, orderBy | | | -// | callCountBlocked | select, orderBy | | | -// | callCountFailed | select, orderBy | | | -// | callCountOther | select, orderBy | | | -// | callCountTotal | select, orderBy | | | -// | bandwidth | select, orderBy | | | -// | cacheHitsCount | select | | | -// | cacheMissCount | select | | | -// | apiTimeAvg | select, orderBy | | | -// | apiTimeMin | select | | | -// | apiTimeMax | select | | | -// | serviceTimeAvg | select | | | -// | serviceTimeMin | select | | | -// | serviceTimeMax | select | | | -// options - ReportsClientListByProductOptions contains the optional parameters for the ReportsClient.ListByProduct method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - filter - | Field | Usage | Supported operators | Supported functions | +// |-------------|-------------|-------------|-------------| +// | timestamp | filter | ge, le | | +// | displayName | select, orderBy | | | +// | apiRegion | filter | eq | | +// | userId | filter | eq | | +// | productId | select, filter | eq | | +// | subscriptionId | filter | eq | | +// | callCountSuccess | select, orderBy | | | +// | callCountBlocked | select, orderBy | | | +// | callCountFailed | select, orderBy | | | +// | callCountOther | select, orderBy | | | +// | callCountTotal | select, orderBy | | | +// | bandwidth | select, orderBy | | | +// | cacheHitsCount | select | | | +// | cacheMissCount | select | | | +// | apiTimeAvg | select, orderBy | | | +// | apiTimeMin | select | | | +// | apiTimeMax | select | | | +// | serviceTimeAvg | select | | | +// | serviceTimeMin | select | | | +// | serviceTimeMax | select | | | +// - options - ReportsClientListByProductOptions contains the optional parameters for the ReportsClient.NewListByProductPager +// method. func (client *ReportsClient) NewListByProductPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListByProductOptions) *runtime.Pager[ReportsClientListByProductResponse] { return runtime.NewPager(runtime.PagingHandler[ReportsClientListByProductResponse]{ More: func(page ReportsClientListByProductResponse) bool { @@ -426,7 +428,7 @@ func (client *ReportsClient) listByProductCreateRequest(ctx context.Context, res if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -442,20 +444,21 @@ func (client *ReportsClient) listByProductHandleResponse(resp *http.Response) (R } // NewListByRequestPager - Lists report records by Request. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// filter - | Field | Usage | Supported operators | Supported functions | -// |-------------|-------------|-------------|-------------| -// | timestamp | filter | ge, le | | -// | apiId | filter | eq | | -// | operationId | filter | eq | | -// | productId | filter | eq | | -// | userId | filter | eq | | -// | apiRegion | filter | eq | | -// | subscriptionId | filter | eq | | -// options - ReportsClientListByRequestOptions contains the optional parameters for the ReportsClient.ListByRequest method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - filter - | Field | Usage | Supported operators | Supported functions | +// |-------------|-------------|-------------|-------------| +// | timestamp | filter | ge, le | | +// | apiId | filter | eq | | +// | operationId | filter | eq | | +// | productId | filter | eq | | +// | userId | filter | eq | | +// | apiRegion | filter | eq | | +// | subscriptionId | filter | eq | | +// - options - ReportsClientListByRequestOptions contains the optional parameters for the ReportsClient.NewListByRequestPager +// method. func (client *ReportsClient) NewListByRequestPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListByRequestOptions) *runtime.Pager[ReportsClientListByRequestResponse] { return runtime.NewPager(runtime.PagingHandler[ReportsClientListByRequestResponse]{ More: func(page ReportsClientListByRequestResponse) bool { @@ -505,7 +508,7 @@ func (client *ReportsClient) listByRequestCreateRequest(ctx context.Context, res if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -521,34 +524,34 @@ func (client *ReportsClient) listByRequestHandleResponse(resp *http.Response) (R } // NewListBySubscriptionPager - Lists report records by subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// filter - | Field | Usage | Supported operators | Supported functions | -// |-------------|-------------|-------------|-------------| -// | timestamp | filter | ge, le | | -// | displayName | select, orderBy | | | -// | apiRegion | filter | eq | | -// | userId | select, filter | eq | | -// | productId | select, filter | eq | | -// | subscriptionId | select, filter | eq | | -// | callCountSuccess | select, orderBy | | | -// | callCountBlocked | select, orderBy | | | -// | callCountFailed | select, orderBy | | | -// | callCountOther | select, orderBy | | | -// | callCountTotal | select, orderBy | | | -// | bandwidth | select, orderBy | | | -// | cacheHitsCount | select | | | -// | cacheMissCount | select | | | -// | apiTimeAvg | select, orderBy | | | -// | apiTimeMin | select | | | -// | apiTimeMax | select | | | -// | serviceTimeAvg | select | | | -// | serviceTimeMin | select | | | -// | serviceTimeMax | select | | | -// options - ReportsClientListBySubscriptionOptions contains the optional parameters for the ReportsClient.ListBySubscription -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - filter - | Field | Usage | Supported operators | Supported functions | +// |-------------|-------------|-------------|-------------| +// | timestamp | filter | ge, le | | +// | displayName | select, orderBy | | | +// | apiRegion | filter | eq | | +// | userId | select, filter | eq | | +// | productId | select, filter | eq | | +// | subscriptionId | select, filter | eq | | +// | callCountSuccess | select, orderBy | | | +// | callCountBlocked | select, orderBy | | | +// | callCountFailed | select, orderBy | | | +// | callCountOther | select, orderBy | | | +// | callCountTotal | select, orderBy | | | +// | bandwidth | select, orderBy | | | +// | cacheHitsCount | select | | | +// | cacheMissCount | select | | | +// | apiTimeAvg | select, orderBy | | | +// | apiTimeMin | select | | | +// | apiTimeMax | select | | | +// | serviceTimeAvg | select | | | +// | serviceTimeMin | select | | | +// | serviceTimeMax | select | | | +// - options - ReportsClientListBySubscriptionOptions contains the optional parameters for the ReportsClient.NewListBySubscriptionPager +// method. func (client *ReportsClient) NewListBySubscriptionPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListBySubscriptionOptions) *runtime.Pager[ReportsClientListBySubscriptionResponse] { return runtime.NewPager(runtime.PagingHandler[ReportsClientListBySubscriptionResponse]{ More: func(page ReportsClientListBySubscriptionResponse) bool { @@ -607,7 +610,7 @@ func (client *ReportsClient) listBySubscriptionCreateRequest(ctx context.Context if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -623,37 +626,37 @@ func (client *ReportsClient) listBySubscriptionHandleResponse(resp *http.Respons } // NewListByTimePager - Lists report records by Time. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// filter - | Field | Usage | Supported operators | Supported functions | -// |-------------|-------------|-------------|-------------| -// | timestamp | filter, select | ge, le | | -// | interval | select | | | -// | apiRegion | filter | eq | | -// | userId | filter | eq | | -// | productId | filter | eq | | -// | subscriptionId | filter | eq | | -// | apiId | filter | eq | | -// | operationId | filter | eq | | -// | callCountSuccess | select | | | -// | callCountBlocked | select | | | -// | callCountFailed | select | | | -// | callCountOther | select | | | -// | bandwidth | select, orderBy | | | -// | cacheHitsCount | select | | | -// | cacheMissCount | select | | | -// | apiTimeAvg | select | | | -// | apiTimeMin | select | | | -// | apiTimeMax | select | | | -// | serviceTimeAvg | select | | | -// | serviceTimeMin | select | | | -// | serviceTimeMax | select | | | -// interval - By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 -// format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert -// TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). -// options - ReportsClientListByTimeOptions contains the optional parameters for the ReportsClient.ListByTime method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - filter - | Field | Usage | Supported operators | Supported functions | +// |-------------|-------------|-------------|-------------| +// | timestamp | filter, select | ge, le | | +// | interval | select | | | +// | apiRegion | filter | eq | | +// | userId | filter | eq | | +// | productId | filter | eq | | +// | subscriptionId | filter | eq | | +// | apiId | filter | eq | | +// | operationId | filter | eq | | +// | callCountSuccess | select | | | +// | callCountBlocked | select | | | +// | callCountFailed | select | | | +// | callCountOther | select | | | +// | bandwidth | select, orderBy | | | +// | cacheHitsCount | select | | | +// | cacheMissCount | select | | | +// | apiTimeAvg | select | | | +// | apiTimeMin | select | | | +// | apiTimeMax | select | | | +// | serviceTimeAvg | select | | | +// | serviceTimeMin | select | | | +// | serviceTimeMax | select | | | +// - interval - By time interval. Interval must be multiple of 15 minutes and may not be zero. The value should be in ISO 8601 +// format (http://en.wikipedia.org/wiki/ISO_8601#Durations).This code can be used to convert +// TimeSpan to a valid interval string: XmlConvert.ToString(new TimeSpan(hours, minutes, seconds)). +// - options - ReportsClientListByTimeOptions contains the optional parameters for the ReportsClient.NewListByTimePager method. func (client *ReportsClient) NewListByTimePager(resourceGroupName string, serviceName string, filter string, interval string, options *ReportsClientListByTimeOptions) *runtime.Pager[ReportsClientListByTimeResponse] { return runtime.NewPager(runtime.PagingHandler[ReportsClientListByTimeResponse]{ More: func(page ReportsClientListByTimeResponse) bool { @@ -713,7 +716,7 @@ func (client *ReportsClient) listByTimeCreateRequest(ctx context.Context, resour reqQP.Set("$orderby", *options.Orderby) } reqQP.Set("interval", interval) - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -729,35 +732,35 @@ func (client *ReportsClient) listByTimeHandleResponse(resp *http.Response) (Repo } // NewListByUserPager - Lists report records by User. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// filter - | Field | Usage | Supported operators | Supported functions | -// |-------------|-------------|-------------|-------------| -// | timestamp | filter | ge, le | | -// | displayName | select, orderBy | | | -// | userId | select, filter | eq | | -// | apiRegion | filter | eq | | -// | productId | filter | eq | | -// | subscriptionId | filter | eq | | -// | apiId | filter | eq | | -// | operationId | filter | eq | | -// | callCountSuccess | select, orderBy | | | -// | callCountBlocked | select, orderBy | | | -// | callCountFailed | select, orderBy | | | -// | callCountOther | select, orderBy | | | -// | callCountTotal | select, orderBy | | | -// | bandwidth | select, orderBy | | | -// | cacheHitsCount | select | | | -// | cacheMissCount | select | | | -// | apiTimeAvg | select, orderBy | | | -// | apiTimeMin | select | | | -// | apiTimeMax | select | | | -// | serviceTimeAvg | select | | | -// | serviceTimeMin | select | | | -// | serviceTimeMax | select | | | -// options - ReportsClientListByUserOptions contains the optional parameters for the ReportsClient.ListByUser method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - filter - | Field | Usage | Supported operators | Supported functions | +// |-------------|-------------|-------------|-------------| +// | timestamp | filter | ge, le | | +// | displayName | select, orderBy | | | +// | userId | select, filter | eq | | +// | apiRegion | filter | eq | | +// | productId | filter | eq | | +// | subscriptionId | filter | eq | | +// | apiId | filter | eq | | +// | operationId | filter | eq | | +// | callCountSuccess | select, orderBy | | | +// | callCountBlocked | select, orderBy | | | +// | callCountFailed | select, orderBy | | | +// | callCountOther | select, orderBy | | | +// | callCountTotal | select, orderBy | | | +// | bandwidth | select, orderBy | | | +// | cacheHitsCount | select | | | +// | cacheMissCount | select | | | +// | apiTimeAvg | select, orderBy | | | +// | apiTimeMin | select | | | +// | apiTimeMax | select | | | +// | serviceTimeAvg | select | | | +// | serviceTimeMin | select | | | +// | serviceTimeMax | select | | | +// - options - ReportsClientListByUserOptions contains the optional parameters for the ReportsClient.NewListByUserPager method. func (client *ReportsClient) NewListByUserPager(resourceGroupName string, serviceName string, filter string, options *ReportsClientListByUserOptions) *runtime.Pager[ReportsClientListByUserResponse] { return runtime.NewPager(runtime.PagingHandler[ReportsClientListByUserResponse]{ More: func(page ReportsClientListByUserResponse) bool { @@ -816,7 +819,7 @@ func (client *ReportsClient) listByUserCreateRequest(ctx context.Context, resour if options != nil && options.Orderby != nil { reqQP.Set("$orderby", *options.Orderby) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_response_types.go b/sdk/resourcemanager/apimanagement/armapimanagement/response_types.go similarity index 80% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_response_types.go rename to sdk/resourcemanager/apimanagement/armapimanagement/response_types.go index ad91f737008a..cd2bc8cc4f0a 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_response_types.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/response_types.go @@ -5,10 +5,11 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is regenerated. +// DO NOT EDIT. package armapimanagement -// APIClientCreateOrUpdateResponse contains the response from method APIClient.CreateOrUpdate. +// APIClientCreateOrUpdateResponse contains the response from method APIClient.BeginCreateOrUpdate. type APIClientCreateOrUpdateResponse struct { APIContract } @@ -34,12 +35,12 @@ type APIClientGetResponse struct { ETag *string } -// APIClientListByServiceResponse contains the response from method APIClient.ListByService. +// APIClientListByServiceResponse contains the response from method APIClient.NewListByServicePager. type APIClientListByServiceResponse struct { APICollection } -// APIClientListByTagsResponse contains the response from method APIClient.ListByTags. +// APIClientListByTagsResponse contains the response from method APIClient.NewListByTagsPager. type APIClientListByTagsResponse struct { TagResourceCollection } @@ -79,7 +80,7 @@ type APIDiagnosticClientGetResponse struct { ETag *string } -// APIDiagnosticClientListByServiceResponse contains the response from method APIDiagnosticClient.ListByService. +// APIDiagnosticClientListByServiceResponse contains the response from method APIDiagnosticClient.NewListByServicePager. type APIDiagnosticClientListByServiceResponse struct { DiagnosticCollection } @@ -124,7 +125,7 @@ type APIIssueAttachmentClientGetResponse struct { ETag *string } -// APIIssueAttachmentClientListByServiceResponse contains the response from method APIIssueAttachmentClient.ListByService. +// APIIssueAttachmentClientListByServiceResponse contains the response from method APIIssueAttachmentClient.NewListByServicePager. type APIIssueAttachmentClientListByServiceResponse struct { IssueAttachmentCollection } @@ -157,7 +158,7 @@ type APIIssueClientGetResponse struct { ETag *string } -// APIIssueClientListByServiceResponse contains the response from method APIIssueClient.ListByService. +// APIIssueClientListByServiceResponse contains the response from method APIIssueClient.NewListByServicePager. type APIIssueClientListByServiceResponse struct { IssueCollection } @@ -197,7 +198,7 @@ type APIIssueCommentClientGetResponse struct { ETag *string } -// APIIssueCommentClientListByServiceResponse contains the response from method APIIssueCommentClient.ListByService. +// APIIssueCommentClientListByServiceResponse contains the response from method APIIssueCommentClient.NewListByServicePager. type APIIssueCommentClientListByServiceResponse struct { IssueCommentCollection } @@ -230,7 +231,7 @@ type APIOperationClientGetResponse struct { ETag *string } -// APIOperationClientListByAPIResponse contains the response from method APIOperationClient.ListByAPI. +// APIOperationClientListByAPIResponse contains the response from method APIOperationClient.NewListByAPIPager. type APIOperationClientListByAPIResponse struct { OperationCollection } @@ -308,7 +309,7 @@ type APIPolicyClientListByAPIResponse struct { PolicyCollection } -// APIProductClientListByApisResponse contains the response from method APIProductClient.ListByApis. +// APIProductClientListByApisResponse contains the response from method APIProductClient.NewListByApisPager. type APIProductClientListByApisResponse struct { ProductCollection } @@ -341,7 +342,7 @@ type APIReleaseClientGetResponse struct { ETag *string } -// APIReleaseClientListByServiceResponse contains the response from method APIReleaseClient.ListByService. +// APIReleaseClientListByServiceResponse contains the response from method APIReleaseClient.NewListByServicePager. type APIReleaseClientListByServiceResponse struct { APIReleaseCollection } @@ -353,12 +354,12 @@ type APIReleaseClientUpdateResponse struct { ETag *string } -// APIRevisionClientListByServiceResponse contains the response from method APIRevisionClient.ListByService. +// APIRevisionClientListByServiceResponse contains the response from method APIRevisionClient.NewListByServicePager. type APIRevisionClientListByServiceResponse struct { APIRevisionCollection } -// APISchemaClientCreateOrUpdateResponse contains the response from method APISchemaClient.CreateOrUpdate. +// APISchemaClientCreateOrUpdateResponse contains the response from method APISchemaClient.BeginCreateOrUpdate. type APISchemaClientCreateOrUpdateResponse struct { SchemaContract } @@ -384,7 +385,7 @@ type APISchemaClientGetResponse struct { ETag *string } -// APISchemaClientListByAPIResponse contains the response from method APISchemaClient.ListByAPI. +// APISchemaClientListByAPIResponse contains the response from method APISchemaClient.NewListByAPIPager. type APISchemaClientListByAPIResponse struct { SchemaCollection } @@ -417,7 +418,7 @@ type APITagDescriptionClientGetResponse struct { ETag *string } -// APITagDescriptionClientListByServiceResponse contains the response from method APITagDescriptionClient.ListByService. +// APITagDescriptionClientListByServiceResponse contains the response from method APITagDescriptionClient.NewListByServicePager. type APITagDescriptionClientListByServiceResponse struct { TagDescriptionCollection } @@ -450,7 +451,7 @@ type APIVersionSetClientGetResponse struct { ETag *string } -// APIVersionSetClientListByServiceResponse contains the response from method APIVersionSetClient.ListByService. +// APIVersionSetClientListByServiceResponse contains the response from method APIVersionSetClient.NewListByServicePager. type APIVersionSetClientListByServiceResponse struct { APIVersionSetCollection } @@ -462,6 +463,131 @@ type APIVersionSetClientUpdateResponse struct { ETag *string } +// APIWikiClientCreateOrUpdateResponse contains the response from method APIWikiClient.CreateOrUpdate. +type APIWikiClientCreateOrUpdateResponse struct { + WikiContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// APIWikiClientDeleteResponse contains the response from method APIWikiClient.Delete. +type APIWikiClientDeleteResponse struct { + // placeholder for future response values +} + +// APIWikiClientGetEntityTagResponse contains the response from method APIWikiClient.GetEntityTag. +type APIWikiClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// APIWikiClientGetResponse contains the response from method APIWikiClient.Get. +type APIWikiClientGetResponse struct { + WikiContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// APIWikiClientUpdateResponse contains the response from method APIWikiClient.Update. +type APIWikiClientUpdateResponse struct { + WikiContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// APIWikisClientListResponse contains the response from method APIWikisClient.NewListPager. +type APIWikisClientListResponse struct { + WikiCollection +} + +// AuthorizationAccessPolicyClientCreateOrUpdateResponse contains the response from method AuthorizationAccessPolicyClient.CreateOrUpdate. +type AuthorizationAccessPolicyClientCreateOrUpdateResponse struct { + AuthorizationAccessPolicyContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationAccessPolicyClientDeleteResponse contains the response from method AuthorizationAccessPolicyClient.Delete. +type AuthorizationAccessPolicyClientDeleteResponse struct { + // placeholder for future response values +} + +// AuthorizationAccessPolicyClientGetResponse contains the response from method AuthorizationAccessPolicyClient.Get. +type AuthorizationAccessPolicyClientGetResponse struct { + AuthorizationAccessPolicyContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationAccessPolicyClientListByAuthorizationResponse contains the response from method AuthorizationAccessPolicyClient.NewListByAuthorizationPager. +type AuthorizationAccessPolicyClientListByAuthorizationResponse struct { + AuthorizationAccessPolicyCollection +} + +// AuthorizationClientConfirmConsentCodeResponse contains the response from method AuthorizationClient.ConfirmConsentCode. +type AuthorizationClientConfirmConsentCodeResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationClientCreateOrUpdateResponse contains the response from method AuthorizationClient.CreateOrUpdate. +type AuthorizationClientCreateOrUpdateResponse struct { + AuthorizationContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationClientDeleteResponse contains the response from method AuthorizationClient.Delete. +type AuthorizationClientDeleteResponse struct { + // placeholder for future response values +} + +// AuthorizationClientGetResponse contains the response from method AuthorizationClient.Get. +type AuthorizationClientGetResponse struct { + AuthorizationContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationClientListByAuthorizationProviderResponse contains the response from method AuthorizationClient.NewListByAuthorizationProviderPager. +type AuthorizationClientListByAuthorizationProviderResponse struct { + AuthorizationCollection +} + +// AuthorizationLoginLinksClientPostResponse contains the response from method AuthorizationLoginLinksClient.Post. +type AuthorizationLoginLinksClientPostResponse struct { + AuthorizationLoginResponseContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationProviderClientCreateOrUpdateResponse contains the response from method AuthorizationProviderClient.CreateOrUpdate. +type AuthorizationProviderClientCreateOrUpdateResponse struct { + AuthorizationProviderContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationProviderClientDeleteResponse contains the response from method AuthorizationProviderClient.Delete. +type AuthorizationProviderClientDeleteResponse struct { + // placeholder for future response values +} + +// AuthorizationProviderClientGetResponse contains the response from method AuthorizationProviderClient.Get. +type AuthorizationProviderClientGetResponse struct { + AuthorizationProviderContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// AuthorizationProviderClientListByServiceResponse contains the response from method AuthorizationProviderClient.NewListByServicePager. +type AuthorizationProviderClientListByServiceResponse struct { + AuthorizationProviderCollection +} + // AuthorizationServerClientCreateOrUpdateResponse contains the response from method AuthorizationServerClient.CreateOrUpdate. type AuthorizationServerClientCreateOrUpdateResponse struct { AuthorizationServerContract @@ -490,7 +616,7 @@ type AuthorizationServerClientGetResponse struct { ETag *string } -// AuthorizationServerClientListByServiceResponse contains the response from method AuthorizationServerClient.ListByService. +// AuthorizationServerClientListByServiceResponse contains the response from method AuthorizationServerClient.NewListByServicePager. type AuthorizationServerClientListByServiceResponse struct { AuthorizationServerCollection } @@ -537,7 +663,7 @@ type BackendClientGetResponse struct { ETag *string } -// BackendClientListByServiceResponse contains the response from method BackendClient.ListByService. +// BackendClientListByServiceResponse contains the response from method BackendClient.NewListByServicePager. type BackendClientListByServiceResponse struct { BackendCollection } @@ -582,7 +708,7 @@ type CacheClientGetResponse struct { ETag *string } -// CacheClientListByServiceResponse contains the response from method CacheClient.ListByService. +// CacheClientListByServiceResponse contains the response from method CacheClient.NewListByServicePager. type CacheClientListByServiceResponse struct { CacheCollection } @@ -622,7 +748,7 @@ type CertificateClientGetResponse struct { ETag *string } -// CertificateClientListByServiceResponse contains the response from method CertificateClient.ListByService. +// CertificateClientListByServiceResponse contains the response from method CertificateClient.NewListByServicePager. type CertificateClientListByServiceResponse struct { CertificateCollection } @@ -634,7 +760,7 @@ type CertificateClientRefreshSecretResponse struct { ETag *string } -// ClientPerformConnectivityCheckAsyncResponse contains the response from method Client.PerformConnectivityCheckAsync. +// ClientPerformConnectivityCheckAsyncResponse contains the response from method Client.BeginPerformConnectivityCheckAsync. type ClientPerformConnectivityCheckAsyncResponse struct { ConnectivityCheckResponse } @@ -667,7 +793,7 @@ type ContentItemClientGetResponse struct { ETag *string } -// ContentItemClientListByServiceResponse contains the response from method ContentItemClient.ListByService. +// ContentItemClientListByServiceResponse contains the response from method ContentItemClient.NewListByServicePager. type ContentItemClientListByServiceResponse struct { ContentItemCollection } @@ -691,7 +817,7 @@ type ContentTypeClientGetResponse struct { ETag *string } -// ContentTypeClientListByServiceResponse contains the response from method ContentTypeClient.ListByService. +// ContentTypeClientListByServiceResponse contains the response from method ContentTypeClient.NewListByServicePager. type ContentTypeClientListByServiceResponse struct { ContentTypeCollection } @@ -732,12 +858,12 @@ type DeletedServicesClientGetByNameResponse struct { DeletedServiceContract } -// DeletedServicesClientListBySubscriptionResponse contains the response from method DeletedServicesClient.ListBySubscription. +// DeletedServicesClientListBySubscriptionResponse contains the response from method DeletedServicesClient.NewListBySubscriptionPager. type DeletedServicesClientListBySubscriptionResponse struct { DeletedServicesCollection } -// DeletedServicesClientPurgeResponse contains the response from method DeletedServicesClient.Purge. +// DeletedServicesClientPurgeResponse contains the response from method DeletedServicesClient.BeginPurge. type DeletedServicesClientPurgeResponse struct { DeletedServiceContract } @@ -770,7 +896,7 @@ type DiagnosticClientGetResponse struct { ETag *string } -// DiagnosticClientListByServiceResponse contains the response from method DiagnosticClient.ListByService. +// DiagnosticClientListByServiceResponse contains the response from method DiagnosticClient.NewListByServicePager. type DiagnosticClientListByServiceResponse struct { DiagnosticCollection } @@ -782,6 +908,46 @@ type DiagnosticClientUpdateResponse struct { ETag *string } +// DocumentationClientCreateOrUpdateResponse contains the response from method DocumentationClient.CreateOrUpdate. +type DocumentationClientCreateOrUpdateResponse struct { + DocumentationContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// DocumentationClientDeleteResponse contains the response from method DocumentationClient.Delete. +type DocumentationClientDeleteResponse struct { + // placeholder for future response values +} + +// DocumentationClientGetEntityTagResponse contains the response from method DocumentationClient.GetEntityTag. +type DocumentationClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// DocumentationClientGetResponse contains the response from method DocumentationClient.Get. +type DocumentationClientGetResponse struct { + DocumentationContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// DocumentationClientListByServiceResponse contains the response from method DocumentationClient.NewListByServicePager. +type DocumentationClientListByServiceResponse struct { + DocumentationCollection +} + +// DocumentationClientUpdateResponse contains the response from method DocumentationClient.Update. +type DocumentationClientUpdateResponse struct { + DocumentationContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + // EmailTemplateClientCreateOrUpdateResponse contains the response from method EmailTemplateClient.CreateOrUpdate. type EmailTemplateClientCreateOrUpdateResponse struct { EmailTemplateContract @@ -808,7 +974,7 @@ type EmailTemplateClientGetResponse struct { ETag *string } -// EmailTemplateClientListByServiceResponse contains the response from method EmailTemplateClient.ListByService. +// EmailTemplateClientListByServiceResponse contains the response from method EmailTemplateClient.NewListByServicePager. type EmailTemplateClientListByServiceResponse struct { EmailTemplateCollection } @@ -839,7 +1005,7 @@ type GatewayAPIClientGetEntityTagResponse struct { Success bool } -// GatewayAPIClientListByServiceResponse contains the response from method GatewayAPIClient.ListByService. +// GatewayAPIClientListByServiceResponse contains the response from method GatewayAPIClient.NewListByServicePager. type GatewayAPIClientListByServiceResponse struct { APICollection } @@ -872,7 +1038,7 @@ type GatewayCertificateAuthorityClientGetResponse struct { ETag *string } -// GatewayCertificateAuthorityClientListByServiceResponse contains the response from method GatewayCertificateAuthorityClient.ListByService. +// GatewayCertificateAuthorityClientListByServiceResponse contains the response from method GatewayCertificateAuthorityClient.NewListByServicePager. type GatewayCertificateAuthorityClientListByServiceResponse struct { GatewayCertificateAuthorityCollection } @@ -910,7 +1076,7 @@ type GatewayClientGetResponse struct { ETag *string } -// GatewayClientListByServiceResponse contains the response from method GatewayClient.ListByService. +// GatewayClientListByServiceResponse contains the response from method GatewayClient.NewListByServicePager. type GatewayClientListByServiceResponse struct { GatewayCollection } @@ -962,12 +1128,12 @@ type GatewayHostnameConfigurationClientGetResponse struct { ETag *string } -// GatewayHostnameConfigurationClientListByServiceResponse contains the response from method GatewayHostnameConfigurationClient.ListByService. +// GatewayHostnameConfigurationClientListByServiceResponse contains the response from method GatewayHostnameConfigurationClient.NewListByServicePager. type GatewayHostnameConfigurationClientListByServiceResponse struct { GatewayHostnameConfigurationCollection } -// GlobalSchemaClientCreateOrUpdateResponse contains the response from method GlobalSchemaClient.CreateOrUpdate. +// GlobalSchemaClientCreateOrUpdateResponse contains the response from method GlobalSchemaClient.BeginCreateOrUpdate. type GlobalSchemaClientCreateOrUpdateResponse struct { GlobalSchemaContract } @@ -993,11 +1159,84 @@ type GlobalSchemaClientGetResponse struct { ETag *string } -// GlobalSchemaClientListByServiceResponse contains the response from method GlobalSchemaClient.ListByService. +// GlobalSchemaClientListByServiceResponse contains the response from method GlobalSchemaClient.NewListByServicePager. type GlobalSchemaClientListByServiceResponse struct { GlobalSchemaCollection } +// GraphQLAPIResolverClientCreateOrUpdateResponse contains the response from method GraphQLAPIResolverClient.CreateOrUpdate. +type GraphQLAPIResolverClientCreateOrUpdateResponse struct { + ResolverContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// GraphQLAPIResolverClientDeleteResponse contains the response from method GraphQLAPIResolverClient.Delete. +type GraphQLAPIResolverClientDeleteResponse struct { + // placeholder for future response values +} + +// GraphQLAPIResolverClientGetEntityTagResponse contains the response from method GraphQLAPIResolverClient.GetEntityTag. +type GraphQLAPIResolverClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// GraphQLAPIResolverClientGetResponse contains the response from method GraphQLAPIResolverClient.Get. +type GraphQLAPIResolverClientGetResponse struct { + ResolverContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// GraphQLAPIResolverClientListByAPIResponse contains the response from method GraphQLAPIResolverClient.NewListByAPIPager. +type GraphQLAPIResolverClientListByAPIResponse struct { + ResolverCollection +} + +// GraphQLAPIResolverClientUpdateResponse contains the response from method GraphQLAPIResolverClient.Update. +type GraphQLAPIResolverClientUpdateResponse struct { + ResolverContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// GraphQLAPIResolverPolicyClientCreateOrUpdateResponse contains the response from method GraphQLAPIResolverPolicyClient.CreateOrUpdate. +type GraphQLAPIResolverPolicyClientCreateOrUpdateResponse struct { + PolicyContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// GraphQLAPIResolverPolicyClientDeleteResponse contains the response from method GraphQLAPIResolverPolicyClient.Delete. +type GraphQLAPIResolverPolicyClientDeleteResponse struct { + // placeholder for future response values +} + +// GraphQLAPIResolverPolicyClientGetEntityTagResponse contains the response from method GraphQLAPIResolverPolicyClient.GetEntityTag. +type GraphQLAPIResolverPolicyClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// GraphQLAPIResolverPolicyClientGetResponse contains the response from method GraphQLAPIResolverPolicyClient.Get. +type GraphQLAPIResolverPolicyClientGetResponse struct { + PolicyContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// GraphQLAPIResolverPolicyClientListByResolverResponse contains the response from method GraphQLAPIResolverPolicyClient.NewListByResolverPager. +type GraphQLAPIResolverPolicyClientListByResolverResponse struct { + PolicyCollection +} + // GroupClientCreateOrUpdateResponse contains the response from method GroupClient.CreateOrUpdate. type GroupClientCreateOrUpdateResponse struct { GroupContract @@ -1026,7 +1265,7 @@ type GroupClientGetResponse struct { ETag *string } -// GroupClientListByServiceResponse contains the response from method GroupClient.ListByService. +// GroupClientListByServiceResponse contains the response from method GroupClient.NewListByServicePager. type GroupClientListByServiceResponse struct { GroupCollection } @@ -1054,7 +1293,7 @@ type GroupUserClientDeleteResponse struct { // placeholder for future response values } -// GroupUserClientListResponse contains the response from method GroupUserClient.List. +// GroupUserClientListResponse contains the response from method GroupUserClient.NewListPager. type GroupUserClientListResponse struct { UserCollection } @@ -1087,7 +1326,7 @@ type IdentityProviderClientGetResponse struct { ETag *string } -// IdentityProviderClientListByServiceResponse contains the response from method IdentityProviderClient.ListByService. +// IdentityProviderClientListByServiceResponse contains the response from method IdentityProviderClient.NewListByServicePager. type IdentityProviderClientListByServiceResponse struct { IdentityProviderList } @@ -1113,7 +1352,7 @@ type IssueClientGetResponse struct { ETag *string } -// IssueClientListByServiceResponse contains the response from method IssueClient.ListByService. +// IssueClientListByServiceResponse contains the response from method IssueClient.NewListByServicePager. type IssueClientListByServiceResponse struct { IssueCollection } @@ -1146,7 +1385,7 @@ type LoggerClientGetResponse struct { ETag *string } -// LoggerClientListByServiceResponse contains the response from method LoggerClient.ListByService. +// LoggerClientListByServiceResponse contains the response from method LoggerClient.NewListByServicePager. type LoggerClientListByServiceResponse struct { LoggerCollection } @@ -1158,7 +1397,7 @@ type LoggerClientUpdateResponse struct { ETag *string } -// NamedValueClientCreateOrUpdateResponse contains the response from method NamedValueClient.CreateOrUpdate. +// NamedValueClientCreateOrUpdateResponse contains the response from method NamedValueClient.BeginCreateOrUpdate. type NamedValueClientCreateOrUpdateResponse struct { NamedValueContract } @@ -1184,7 +1423,7 @@ type NamedValueClientGetResponse struct { ETag *string } -// NamedValueClientListByServiceResponse contains the response from method NamedValueClient.ListByService. +// NamedValueClientListByServiceResponse contains the response from method NamedValueClient.NewListByServicePager. type NamedValueClientListByServiceResponse struct { NamedValueCollection } @@ -1196,12 +1435,12 @@ type NamedValueClientListValueResponse struct { ETag *string } -// NamedValueClientRefreshSecretResponse contains the response from method NamedValueClient.RefreshSecret. +// NamedValueClientRefreshSecretResponse contains the response from method NamedValueClient.BeginRefreshSecret. type NamedValueClientRefreshSecretResponse struct { NamedValueContract } -// NamedValueClientUpdateResponse contains the response from method NamedValueClient.Update. +// NamedValueClientUpdateResponse contains the response from method NamedValueClient.BeginUpdate. type NamedValueClientUpdateResponse struct { NamedValueContract } @@ -1227,7 +1466,7 @@ type NotificationClientGetResponse struct { NotificationContract } -// NotificationClientListByServiceResponse contains the response from method NotificationClient.ListByService. +// NotificationClientListByServiceResponse contains the response from method NotificationClient.NewListByServicePager. type NotificationClientListByServiceResponse struct { NotificationCollection } @@ -1302,7 +1541,7 @@ type OpenIDConnectProviderClientGetResponse struct { ETag *string } -// OpenIDConnectProviderClientListByServiceResponse contains the response from method OpenIDConnectProviderClient.ListByService. +// OpenIDConnectProviderClientListByServiceResponse contains the response from method OpenIDConnectProviderClient.NewListByServicePager. type OpenIDConnectProviderClientListByServiceResponse struct { OpenIDConnectProviderCollection } @@ -1321,12 +1560,12 @@ type OpenIDConnectProviderClientUpdateResponse struct { ETag *string } -// OperationClientListByTagsResponse contains the response from method OperationClient.ListByTags. +// OperationClientListByTagsResponse contains the response from method OperationClient.NewListByTagsPager. type OperationClientListByTagsResponse struct { TagResourceCollection } -// OperationsClientListResponse contains the response from method OperationsClient.List. +// OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { OperationListResult } @@ -1374,7 +1613,74 @@ type PolicyDescriptionClientListByServiceResponse struct { PolicyDescriptionCollection } -// PortalRevisionClientCreateOrUpdateResponse contains the response from method PortalRevisionClient.CreateOrUpdate. +// PolicyFragmentClientCreateOrUpdateResponse contains the response from method PolicyFragmentClient.BeginCreateOrUpdate. +type PolicyFragmentClientCreateOrUpdateResponse struct { + PolicyFragmentContract +} + +// PolicyFragmentClientDeleteResponse contains the response from method PolicyFragmentClient.Delete. +type PolicyFragmentClientDeleteResponse struct { + // placeholder for future response values +} + +// PolicyFragmentClientGetEntityTagResponse contains the response from method PolicyFragmentClient.GetEntityTag. +type PolicyFragmentClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// PolicyFragmentClientGetResponse contains the response from method PolicyFragmentClient.Get. +type PolicyFragmentClientGetResponse struct { + PolicyFragmentContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// PolicyFragmentClientListByServiceResponse contains the response from method PolicyFragmentClient.ListByService. +type PolicyFragmentClientListByServiceResponse struct { + PolicyFragmentCollection +} + +// PolicyFragmentClientListReferencesResponse contains the response from method PolicyFragmentClient.ListReferences. +type PolicyFragmentClientListReferencesResponse struct { + ResourceCollection +} + +// PortalConfigClientCreateOrUpdateResponse contains the response from method PortalConfigClient.CreateOrUpdate. +type PortalConfigClientCreateOrUpdateResponse struct { + PortalConfigContract +} + +// PortalConfigClientGetEntityTagResponse contains the response from method PortalConfigClient.GetEntityTag. +type PortalConfigClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// PortalConfigClientGetResponse contains the response from method PortalConfigClient.Get. +type PortalConfigClientGetResponse struct { + PortalConfigContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// PortalConfigClientListByServiceResponse contains the response from method PortalConfigClient.ListByService. +type PortalConfigClientListByServiceResponse struct { + PortalConfigCollection +} + +// PortalConfigClientUpdateResponse contains the response from method PortalConfigClient.Update. +type PortalConfigClientUpdateResponse struct { + PortalConfigContract +} + +// PortalRevisionClientCreateOrUpdateResponse contains the response from method PortalRevisionClient.BeginCreateOrUpdate. type PortalRevisionClientCreateOrUpdateResponse struct { PortalRevisionContract } @@ -1395,12 +1701,12 @@ type PortalRevisionClientGetResponse struct { ETag *string } -// PortalRevisionClientListByServiceResponse contains the response from method PortalRevisionClient.ListByService. +// PortalRevisionClientListByServiceResponse contains the response from method PortalRevisionClient.NewListByServicePager. type PortalRevisionClientListByServiceResponse struct { PortalRevisionCollection } -// PortalRevisionClientUpdateResponse contains the response from method PortalRevisionClient.Update. +// PortalRevisionClientUpdateResponse contains the response from method PortalRevisionClient.BeginUpdate. type PortalRevisionClientUpdateResponse struct { PortalRevisionContract } @@ -1410,12 +1716,12 @@ type PortalSettingsClientListByServiceResponse struct { PortalSettingsCollection } -// PrivateEndpointConnectionClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionClient.CreateOrUpdate. +// PrivateEndpointConnectionClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionClient.BeginCreateOrUpdate. type PrivateEndpointConnectionClientCreateOrUpdateResponse struct { PrivateEndpointConnection } -// PrivateEndpointConnectionClientDeleteResponse contains the response from method PrivateEndpointConnectionClient.Delete. +// PrivateEndpointConnectionClientDeleteResponse contains the response from method PrivateEndpointConnectionClient.BeginDelete. type PrivateEndpointConnectionClientDeleteResponse struct { // placeholder for future response values } @@ -1430,7 +1736,7 @@ type PrivateEndpointConnectionClientGetPrivateLinkResourceResponse struct { PrivateLinkResource } -// PrivateEndpointConnectionClientListByServiceResponse contains the response from method PrivateEndpointConnectionClient.ListByService. +// PrivateEndpointConnectionClientListByServiceResponse contains the response from method PrivateEndpointConnectionClient.NewListByServicePager. type PrivateEndpointConnectionClientListByServiceResponse struct { PrivateEndpointConnectionListResult } @@ -1456,7 +1762,7 @@ type ProductAPIClientDeleteResponse struct { // placeholder for future response values } -// ProductAPIClientListByProductResponse contains the response from method ProductAPIClient.ListByProduct. +// ProductAPIClientListByProductResponse contains the response from method ProductAPIClient.NewListByProductPager. type ProductAPIClientListByProductResponse struct { APICollection } @@ -1489,12 +1795,12 @@ type ProductClientGetResponse struct { ETag *string } -// ProductClientListByServiceResponse contains the response from method ProductClient.ListByService. +// ProductClientListByServiceResponse contains the response from method ProductClient.NewListByServicePager. type ProductClientListByServiceResponse struct { ProductCollection } -// ProductClientListByTagsResponse contains the response from method ProductClient.ListByTags. +// ProductClientListByTagsResponse contains the response from method ProductClient.NewListByTagsPager. type ProductClientListByTagsResponse struct { TagResourceCollection } @@ -1522,7 +1828,7 @@ type ProductGroupClientDeleteResponse struct { // placeholder for future response values } -// ProductGroupClientListByProductResponse contains the response from method ProductGroupClient.ListByProduct. +// ProductGroupClientListByProductResponse contains the response from method ProductGroupClient.NewListByProductPager. type ProductGroupClientListByProductResponse struct { GroupCollection } @@ -1560,11 +1866,53 @@ type ProductPolicyClientListByProductResponse struct { PolicyCollection } -// ProductSubscriptionsClientListResponse contains the response from method ProductSubscriptionsClient.List. +// ProductSubscriptionsClientListResponse contains the response from method ProductSubscriptionsClient.NewListPager. type ProductSubscriptionsClientListResponse struct { SubscriptionCollection } +// ProductWikiClientCreateOrUpdateResponse contains the response from method ProductWikiClient.CreateOrUpdate. +type ProductWikiClientCreateOrUpdateResponse struct { + WikiContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// ProductWikiClientDeleteResponse contains the response from method ProductWikiClient.Delete. +type ProductWikiClientDeleteResponse struct { + // placeholder for future response values +} + +// ProductWikiClientGetEntityTagResponse contains the response from method ProductWikiClient.GetEntityTag. +type ProductWikiClientGetEntityTagResponse struct { + // ETag contains the information returned from the ETag header response. + ETag *string + + // Success indicates if the operation succeeded or failed. + Success bool +} + +// ProductWikiClientGetResponse contains the response from method ProductWikiClient.Get. +type ProductWikiClientGetResponse struct { + WikiContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// ProductWikiClientUpdateResponse contains the response from method ProductWikiClient.Update. +type ProductWikiClientUpdateResponse struct { + WikiContract + // ETag contains the information returned from the ETag header response. + ETag *string +} + +// ProductWikisClientListResponse contains the response from method ProductWikisClient.NewListPager. +type ProductWikisClientListResponse struct { + WikiCollection + // ETag contains the information returned from the ETag header response. + ETag *string +} + // QuotaByCounterKeysClientListByServiceResponse contains the response from method QuotaByCounterKeysClient.ListByService. type QuotaByCounterKeysClientListByServiceResponse struct { QuotaCounterCollection @@ -1585,62 +1933,62 @@ type QuotaByPeriodKeysClientUpdateResponse struct { QuotaCounterContract } -// RegionClientListByServiceResponse contains the response from method RegionClient.ListByService. +// RegionClientListByServiceResponse contains the response from method RegionClient.NewListByServicePager. type RegionClientListByServiceResponse struct { RegionListResult } -// ReportsClientListByAPIResponse contains the response from method ReportsClient.ListByAPI. +// ReportsClientListByAPIResponse contains the response from method ReportsClient.NewListByAPIPager. type ReportsClientListByAPIResponse struct { ReportCollection } -// ReportsClientListByGeoResponse contains the response from method ReportsClient.ListByGeo. +// ReportsClientListByGeoResponse contains the response from method ReportsClient.NewListByGeoPager. type ReportsClientListByGeoResponse struct { ReportCollection } -// ReportsClientListByOperationResponse contains the response from method ReportsClient.ListByOperation. +// ReportsClientListByOperationResponse contains the response from method ReportsClient.NewListByOperationPager. type ReportsClientListByOperationResponse struct { ReportCollection } -// ReportsClientListByProductResponse contains the response from method ReportsClient.ListByProduct. +// ReportsClientListByProductResponse contains the response from method ReportsClient.NewListByProductPager. type ReportsClientListByProductResponse struct { ReportCollection } -// ReportsClientListByRequestResponse contains the response from method ReportsClient.ListByRequest. +// ReportsClientListByRequestResponse contains the response from method ReportsClient.NewListByRequestPager. type ReportsClientListByRequestResponse struct { RequestReportCollection } -// ReportsClientListBySubscriptionResponse contains the response from method ReportsClient.ListBySubscription. +// ReportsClientListBySubscriptionResponse contains the response from method ReportsClient.NewListBySubscriptionPager. type ReportsClientListBySubscriptionResponse struct { ReportCollection } -// ReportsClientListByTimeResponse contains the response from method ReportsClient.ListByTime. +// ReportsClientListByTimeResponse contains the response from method ReportsClient.NewListByTimePager. type ReportsClientListByTimeResponse struct { ReportCollection } -// ReportsClientListByUserResponse contains the response from method ReportsClient.ListByUser. +// ReportsClientListByUserResponse contains the response from method ReportsClient.NewListByUserPager. type ReportsClientListByUserResponse struct { ReportCollection } -// SKUsClientListResponse contains the response from method SKUsClient.List. +// SKUsClientListResponse contains the response from method SKUsClient.NewListPager. type SKUsClientListResponse struct { SKUsResult } -// ServiceClientApplyNetworkConfigurationUpdatesResponse contains the response from method ServiceClient.ApplyNetworkConfigurationUpdates. +// ServiceClientApplyNetworkConfigurationUpdatesResponse contains the response from method ServiceClient.BeginApplyNetworkConfigurationUpdates. type ServiceClientApplyNetworkConfigurationUpdatesResponse struct { ServiceResource } -// ServiceClientBackupResponse contains the response from method ServiceClient.Backup. +// ServiceClientBackupResponse contains the response from method ServiceClient.BeginBackup. type ServiceClientBackupResponse struct { ServiceResource } @@ -1650,12 +1998,12 @@ type ServiceClientCheckNameAvailabilityResponse struct { ServiceNameAvailabilityResult } -// ServiceClientCreateOrUpdateResponse contains the response from method ServiceClient.CreateOrUpdate. +// ServiceClientCreateOrUpdateResponse contains the response from method ServiceClient.BeginCreateOrUpdate. type ServiceClientCreateOrUpdateResponse struct { ServiceResource } -// ServiceClientDeleteResponse contains the response from method ServiceClient.Delete. +// ServiceClientDeleteResponse contains the response from method ServiceClient.BeginDelete. type ServiceClientDeleteResponse struct { ServiceResource } @@ -1675,27 +2023,32 @@ type ServiceClientGetSsoTokenResponse struct { ServiceGetSsoTokenResult } -// ServiceClientListByResourceGroupResponse contains the response from method ServiceClient.ListByResourceGroup. +// ServiceClientListByResourceGroupResponse contains the response from method ServiceClient.NewListByResourceGroupPager. type ServiceClientListByResourceGroupResponse struct { ServiceListResult } -// ServiceClientListResponse contains the response from method ServiceClient.List. +// ServiceClientListResponse contains the response from method ServiceClient.NewListPager. type ServiceClientListResponse struct { ServiceListResult } -// ServiceClientRestoreResponse contains the response from method ServiceClient.Restore. +// ServiceClientMigrateToStv2Response contains the response from method ServiceClient.BeginMigrateToStv2. +type ServiceClientMigrateToStv2Response struct { + ServiceResource +} + +// ServiceClientRestoreResponse contains the response from method ServiceClient.BeginRestore. type ServiceClientRestoreResponse struct { ServiceResource } -// ServiceClientUpdateResponse contains the response from method ServiceClient.Update. +// ServiceClientUpdateResponse contains the response from method ServiceClient.BeginUpdate. type ServiceClientUpdateResponse struct { ServiceResource } -// ServiceSKUsClientListAvailableServiceSKUsResponse contains the response from method ServiceSKUsClient.ListAvailableServiceSKUs. +// ServiceSKUsClientListAvailableServiceSKUsResponse contains the response from method ServiceSKUsClient.NewListAvailableServiceSKUsPager. type ServiceSKUsClientListAvailableServiceSKUsResponse struct { ResourceSKUResults } @@ -1780,7 +2133,7 @@ type SubscriptionClientGetResponse struct { ETag *string } -// SubscriptionClientListResponse contains the response from method SubscriptionClient.List. +// SubscriptionClientListResponse contains the response from method SubscriptionClient.NewListPager. type SubscriptionClientListResponse struct { SubscriptionCollection } @@ -1917,22 +2270,22 @@ type TagClientGetResponse struct { ETag *string } -// TagClientListByAPIResponse contains the response from method TagClient.ListByAPI. +// TagClientListByAPIResponse contains the response from method TagClient.NewListByAPIPager. type TagClientListByAPIResponse struct { TagCollection } -// TagClientListByOperationResponse contains the response from method TagClient.ListByOperation. +// TagClientListByOperationResponse contains the response from method TagClient.NewListByOperationPager. type TagClientListByOperationResponse struct { TagCollection } -// TagClientListByProductResponse contains the response from method TagClient.ListByProduct. +// TagClientListByProductResponse contains the response from method TagClient.NewListByProductPager. type TagClientListByProductResponse struct { TagCollection } -// TagClientListByServiceResponse contains the response from method TagClient.ListByService. +// TagClientListByServiceResponse contains the response from method TagClient.NewListByServicePager. type TagClientListByServiceResponse struct { TagCollection } @@ -1944,7 +2297,7 @@ type TagClientUpdateResponse struct { ETag *string } -// TagResourceClientListByServiceResponse contains the response from method TagResourceClient.ListByService. +// TagResourceClientListByServiceResponse contains the response from method TagResourceClient.NewListByServicePager. type TagResourceClientListByServiceResponse struct { TagResourceCollection } @@ -1972,7 +2325,7 @@ type TenantAccessClientGetResponse struct { ETag *string } -// TenantAccessClientListByServiceResponse contains the response from method TenantAccessClient.ListByService. +// TenantAccessClientListByServiceResponse contains the response from method TenantAccessClient.NewListByServicePager. type TenantAccessClientListByServiceResponse struct { AccessInformationCollection } @@ -2011,7 +2364,7 @@ type TenantAccessGitClientRegenerateSecondaryKeyResponse struct { // placeholder for future response values } -// TenantConfigurationClientDeployResponse contains the response from method TenantConfigurationClient.Deploy. +// TenantConfigurationClientDeployResponse contains the response from method TenantConfigurationClient.BeginDeploy. type TenantConfigurationClientDeployResponse struct { OperationResultContract } @@ -2021,12 +2374,12 @@ type TenantConfigurationClientGetSyncStateResponse struct { TenantConfigurationSyncStateContract } -// TenantConfigurationClientSaveResponse contains the response from method TenantConfigurationClient.Save. +// TenantConfigurationClientSaveResponse contains the response from method TenantConfigurationClient.BeginSave. type TenantConfigurationClientSaveResponse struct { OperationResultContract } -// TenantConfigurationClientValidateResponse contains the response from method TenantConfigurationClient.Validate. +// TenantConfigurationClientValidateResponse contains the response from method TenantConfigurationClient.BeginValidate. type TenantConfigurationClientValidateResponse struct { OperationResultContract } @@ -2038,7 +2391,7 @@ type TenantSettingsClientGetResponse struct { ETag *string } -// TenantSettingsClientListByServiceResponse contains the response from method TenantSettingsClient.ListByService. +// TenantSettingsClientListByServiceResponse contains the response from method TenantSettingsClient.NewListByServicePager. type TenantSettingsClientListByServiceResponse struct { TenantSettingsCollection } @@ -2081,7 +2434,7 @@ type UserClientGetSharedAccessTokenResponse struct { UserTokenResult } -// UserClientListByServiceResponse contains the response from method UserClient.ListByService. +// UserClientListByServiceResponse contains the response from method UserClient.NewListByServicePager. type UserClientListByServiceResponse struct { UserCollection } @@ -2098,12 +2451,12 @@ type UserConfirmationPasswordClientSendResponse struct { // placeholder for future response values } -// UserGroupClientListResponse contains the response from method UserGroupClient.List. +// UserGroupClientListResponse contains the response from method UserGroupClient.NewListPager. type UserGroupClientListResponse struct { GroupCollection } -// UserIdentitiesClientListResponse contains the response from method UserIdentitiesClient.List. +// UserIdentitiesClientListResponse contains the response from method UserIdentitiesClient.NewListPager. type UserIdentitiesClientListResponse struct { UserIdentityCollection } @@ -2115,7 +2468,7 @@ type UserSubscriptionClientGetResponse struct { ETag *string } -// UserSubscriptionClientListResponse contains the response from method UserSubscriptionClient.List. +// UserSubscriptionClientListResponse contains the response from method UserSubscriptionClient.NewListPager. type UserSubscriptionClientListResponse struct { SubscriptionCollection } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_service_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/service_client.go similarity index 80% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_service_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/service_client.go index d6719acc4d14..c835d2f12e70 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_service_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/service_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 armapimanagement @@ -31,10 +32,9 @@ type ServiceClient struct { } // NewServiceClient creates a new instance of ServiceClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServiceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,11 +58,12 @@ func NewServiceClient(subscriptionID string, credential azcore.TokenCredential, // BeginApplyNetworkConfigurationUpdates - Updates the Microsoft.ApiManagement resource running in the Virtual network to // pick the updated DNS changes. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - ServiceClientBeginApplyNetworkConfigurationUpdatesOptions contains the optional parameters for the ServiceClient.BeginApplyNetworkConfigurationUpdates -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - ServiceClientBeginApplyNetworkConfigurationUpdatesOptions contains the optional parameters for the ServiceClient.BeginApplyNetworkConfigurationUpdates +// method. func (client *ServiceClient) BeginApplyNetworkConfigurationUpdates(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginApplyNetworkConfigurationUpdatesOptions) (*runtime.Poller[ServiceClientApplyNetworkConfigurationUpdatesResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.applyNetworkConfigurationUpdates(ctx, resourceGroupName, serviceName, options) @@ -80,7 +81,8 @@ func (client *ServiceClient) BeginApplyNetworkConfigurationUpdates(ctx context.C // ApplyNetworkConfigurationUpdates - Updates the Microsoft.ApiManagement resource running in the Virtual network to pick // the updated DNS changes. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *ServiceClient) applyNetworkConfigurationUpdates(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginApplyNetworkConfigurationUpdatesOptions) (*http.Response, error) { req, err := client.applyNetworkConfigurationUpdatesCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -116,7 +118,7 @@ func (client *ServiceClient) applyNetworkConfigurationUpdatesCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { @@ -128,11 +130,12 @@ func (client *ServiceClient) applyNetworkConfigurationUpdatesCreateRequest(ctx c // BeginBackup - Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation // and could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// parameters - Parameters supplied to the ApiManagementService_Backup operation. -// options - ServiceClientBeginBackupOptions contains the optional parameters for the ServiceClient.BeginBackup method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - parameters - Parameters supplied to the ApiManagementService_Backup operation. +// - options - ServiceClientBeginBackupOptions contains the optional parameters for the ServiceClient.BeginBackup method. func (client *ServiceClient) BeginBackup(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceBackupRestoreParameters, options *ServiceClientBeginBackupOptions) (*runtime.Poller[ServiceClientBackupResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.backup(ctx, resourceGroupName, serviceName, parameters, options) @@ -150,7 +153,8 @@ func (client *ServiceClient) BeginBackup(ctx context.Context, resourceGroupName // Backup - Creates a backup of the API Management service to the given Azure Storage Account. This is long running operation // and could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *ServiceClient) backup(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceBackupRestoreParameters, options *ServiceClientBeginBackupOptions) (*http.Response, error) { req, err := client.backupCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { @@ -186,7 +190,7 @@ func (client *ServiceClient) backupCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -194,10 +198,11 @@ func (client *ServiceClient) backupCreateRequest(ctx context.Context, resourceGr // CheckNameAvailability - Checks availability and correctness of a name for an API Management service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// parameters - Parameters supplied to the CheckNameAvailability operation. -// options - ServiceClientCheckNameAvailabilityOptions contains the optional parameters for the ServiceClient.CheckNameAvailability -// method. +// +// Generated from API version 2022-08-01 +// - parameters - Parameters supplied to the CheckNameAvailability operation. +// - options - ServiceClientCheckNameAvailabilityOptions contains the optional parameters for the ServiceClient.CheckNameAvailability +// method. func (client *ServiceClient) CheckNameAvailability(ctx context.Context, parameters ServiceCheckNameAvailabilityParameters, options *ServiceClientCheckNameAvailabilityOptions) (ServiceClientCheckNameAvailabilityResponse, error) { req, err := client.checkNameAvailabilityCreateRequest(ctx, parameters, options) if err != nil { @@ -225,7 +230,7 @@ func (client *ServiceClient) checkNameAvailabilityCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -243,12 +248,13 @@ func (client *ServiceClient) checkNameAvailabilityHandleResponse(resp *http.Resp // BeginCreateOrUpdate - Creates or updates an API Management service. This is long running operation and could take several // minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// parameters - Parameters supplied to the CreateOrUpdate API Management service operation. -// options - ServiceClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceClient.BeginCreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - parameters - Parameters supplied to the CreateOrUpdate API Management service operation. +// - options - ServiceClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceClient.BeginCreateOrUpdate +// method. func (client *ServiceClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceResource, options *ServiceClientBeginCreateOrUpdateOptions) (*runtime.Poller[ServiceClientCreateOrUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceName, parameters, options) @@ -264,7 +270,8 @@ func (client *ServiceClient) BeginCreateOrUpdate(ctx context.Context, resourceGr // CreateOrUpdate - Creates or updates an API Management service. This is long running operation and could take several minutes // to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *ServiceClient) createOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceResource, options *ServiceClientBeginCreateOrUpdateOptions) (*http.Response, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { @@ -274,7 +281,7 @@ func (client *ServiceClient) createOrUpdate(ctx context.Context, resourceGroupNa if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated, http.StatusAccepted) { + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { return nil, runtime.NewResponseError(resp) } return resp, nil @@ -300,7 +307,7 @@ func (client *ServiceClient) createOrUpdateCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -308,10 +315,11 @@ func (client *ServiceClient) createOrUpdateCreateRequest(ctx context.Context, re // BeginDelete - Deletes an existing API Management service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - ServiceClientBeginDeleteOptions contains the optional parameters for the ServiceClient.BeginDelete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - ServiceClientBeginDeleteOptions contains the optional parameters for the ServiceClient.BeginDelete method. func (client *ServiceClient) BeginDelete(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginDeleteOptions) (*runtime.Poller[ServiceClientDeleteResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deleteOperation(ctx, resourceGroupName, serviceName, options) @@ -326,7 +334,8 @@ func (client *ServiceClient) BeginDelete(ctx context.Context, resourceGroupName // Delete - Deletes an existing API Management service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *ServiceClient) deleteOperation(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginDeleteOptions) (*http.Response, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -362,7 +371,7 @@ func (client *ServiceClient) deleteCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -370,10 +379,11 @@ func (client *ServiceClient) deleteCreateRequest(ctx context.Context, resourceGr // Get - Gets an API Management service resource description. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - ServiceClientGetOptions contains the optional parameters for the ServiceClient.Get method. func (client *ServiceClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientGetOptions) (ServiceClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -409,7 +419,7 @@ func (client *ServiceClient) getCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -426,9 +436,10 @@ func (client *ServiceClient) getHandleResponse(resp *http.Response) (ServiceClie // GetDomainOwnershipIdentifier - Get the custom domain ownership identifier for an API Management service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// options - ServiceClientGetDomainOwnershipIdentifierOptions contains the optional parameters for the ServiceClient.GetDomainOwnershipIdentifier -// method. +// +// Generated from API version 2022-08-01 +// - options - ServiceClientGetDomainOwnershipIdentifierOptions contains the optional parameters for the ServiceClient.GetDomainOwnershipIdentifier +// method. func (client *ServiceClient) GetDomainOwnershipIdentifier(ctx context.Context, options *ServiceClientGetDomainOwnershipIdentifierOptions) (ServiceClientGetDomainOwnershipIdentifierResponse, error) { req, err := client.getDomainOwnershipIdentifierCreateRequest(ctx, options) if err != nil { @@ -456,7 +467,7 @@ func (client *ServiceClient) getDomainOwnershipIdentifierCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -473,10 +484,11 @@ func (client *ServiceClient) getDomainOwnershipIdentifierHandleResponse(resp *ht // GetSsoToken - Gets the Single-Sign-On token for the API Management Service which is valid for 5 Minutes. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - ServiceClientGetSsoTokenOptions contains the optional parameters for the ServiceClient.GetSsoToken method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - ServiceClientGetSsoTokenOptions contains the optional parameters for the ServiceClient.GetSsoToken method. func (client *ServiceClient) GetSsoToken(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientGetSsoTokenOptions) (ServiceClientGetSsoTokenResponse, error) { req, err := client.getSsoTokenCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -512,7 +524,7 @@ func (client *ServiceClient) getSsoTokenCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -528,9 +540,9 @@ func (client *ServiceClient) getSsoTokenHandleResponse(resp *http.Response) (Ser } // NewListPager - Lists all API Management services within an Azure subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// options - ServiceClientListOptions contains the optional parameters for the ServiceClient.List method. +// +// Generated from API version 2022-08-01 +// - options - ServiceClientListOptions contains the optional parameters for the ServiceClient.NewListPager method. func (client *ServiceClient) NewListPager(options *ServiceClientListOptions) *runtime.Pager[ServiceClientListResponse] { return runtime.NewPager(runtime.PagingHandler[ServiceClientListResponse]{ More: func(page ServiceClientListResponse) bool { @@ -571,7 +583,7 @@ func (client *ServiceClient) listCreateRequest(ctx context.Context, options *Ser return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -587,11 +599,11 @@ func (client *ServiceClient) listHandleResponse(resp *http.Response) (ServiceCli } // NewListByResourceGroupPager - List all API Management services within a resource group. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// options - ServiceClientListByResourceGroupOptions contains the optional parameters for the ServiceClient.ListByResourceGroup -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - options - ServiceClientListByResourceGroupOptions contains the optional parameters for the ServiceClient.NewListByResourceGroupPager +// method. func (client *ServiceClient) NewListByResourceGroupPager(resourceGroupName string, options *ServiceClientListByResourceGroupOptions) *runtime.Pager[ServiceClientListByResourceGroupResponse] { return runtime.NewPager(runtime.PagingHandler[ServiceClientListByResourceGroupResponse]{ More: func(page ServiceClientListByResourceGroupResponse) bool { @@ -636,7 +648,7 @@ func (client *ServiceClient) listByResourceGroupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -651,15 +663,87 @@ func (client *ServiceClient) listByResourceGroupHandleResponse(resp *http.Respon return result, nil } +// BeginMigrateToStv2 - Upgrades an API Management service to the Stv2 platform. For details refer to https://aka.ms/apim-migrate-stv2. +// This change is not reversible. This is long running operation and could take several +// minutes to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - ServiceClientBeginMigrateToStv2Options contains the optional parameters for the ServiceClient.BeginMigrateToStv2 +// method. +func (client *ServiceClient) BeginMigrateToStv2(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginMigrateToStv2Options) (*runtime.Poller[ServiceClientMigrateToStv2Response], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.migrateToStv2(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + return runtime.NewPoller(resp, client.pl, &runtime.NewPollerOptions[ServiceClientMigrateToStv2Response]{ + FinalStateVia: runtime.FinalStateViaLocation, + }) + } else { + return runtime.NewPollerFromResumeToken[ServiceClientMigrateToStv2Response](options.ResumeToken, client.pl, nil) + } +} + +// MigrateToStv2 - Upgrades an API Management service to the Stv2 platform. For details refer to https://aka.ms/apim-migrate-stv2. +// This change is not reversible. This is long running operation and could take several +// minutes to complete. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2022-08-01 +func (client *ServiceClient) migrateToStv2(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginMigrateToStv2Options) (*http.Response, error) { + req, err := client.migrateToStv2CreateRequest(ctx, resourceGroupName, serviceName, options) + if err != nil { + return nil, err + } + resp, err := client.pl.Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { + return nil, runtime.NewResponseError(resp) + } + return resp, nil +} + +// migrateToStv2CreateRequest creates the MigrateToStv2 request. +func (client *ServiceClient) migrateToStv2CreateRequest(ctx context.Context, resourceGroupName string, serviceName string, options *ServiceClientBeginMigrateToStv2Options) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/migrateToStv2" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if serviceName == "" { + return nil, errors.New("parameter serviceName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{serviceName}", url.PathEscape(serviceName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.host, urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2022-08-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + return req, nil +} + // BeginRestore - Restores a backup of an API Management service created using the ApiManagementService_Backup operation on // the current service. This is a long running operation and could take several minutes to // complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// parameters - Parameters supplied to the Restore API Management service from backup operation. -// options - ServiceClientBeginRestoreOptions contains the optional parameters for the ServiceClient.BeginRestore method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - parameters - Parameters supplied to the Restore API Management service from backup operation. +// - options - ServiceClientBeginRestoreOptions contains the optional parameters for the ServiceClient.BeginRestore method. func (client *ServiceClient) BeginRestore(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceBackupRestoreParameters, options *ServiceClientBeginRestoreOptions) (*runtime.Poller[ServiceClientRestoreResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.restore(ctx, resourceGroupName, serviceName, parameters, options) @@ -678,7 +762,8 @@ func (client *ServiceClient) BeginRestore(ctx context.Context, resourceGroupName // current service. This is a long running operation and could take several minutes to // complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *ServiceClient) restore(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceBackupRestoreParameters, options *ServiceClientBeginRestoreOptions) (*http.Response, error) { req, err := client.restoreCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { @@ -714,7 +799,7 @@ func (client *ServiceClient) restoreCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -722,11 +807,12 @@ func (client *ServiceClient) restoreCreateRequest(ctx context.Context, resourceG // BeginUpdate - Updates an existing API Management service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// parameters - Parameters supplied to the CreateOrUpdate API Management service operation. -// options - ServiceClientBeginUpdateOptions contains the optional parameters for the ServiceClient.BeginUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - parameters - Parameters supplied to the CreateOrUpdate API Management service operation. +// - options - ServiceClientBeginUpdateOptions contains the optional parameters for the ServiceClient.BeginUpdate method. func (client *ServiceClient) BeginUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUpdateParameters, options *ServiceClientBeginUpdateOptions) (*runtime.Poller[ServiceClientUpdateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.update(ctx, resourceGroupName, serviceName, parameters, options) @@ -741,7 +827,8 @@ func (client *ServiceClient) BeginUpdate(ctx context.Context, resourceGroupName // Update - Updates an existing API Management service. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *ServiceClient) update(ctx context.Context, resourceGroupName string, serviceName string, parameters ServiceUpdateParameters, options *ServiceClientBeginUpdateOptions) (*http.Response, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { @@ -777,7 +864,7 @@ func (client *ServiceClient) updateCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-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/apimanagement/armapimanagement/zz_generated_serviceskus_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/serviceskus_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_serviceskus_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/serviceskus_client.go index 8195a602620a..817ebe63b088 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_serviceskus_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/serviceskus_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 armapimanagement @@ -31,10 +32,9 @@ type ServiceSKUsClient struct { } // NewServiceSKUsClient creates a new instance of ServiceSKUsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewServiceSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceSKUsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +56,12 @@ func NewServiceSKUsClient(subscriptionID string, credential azcore.TokenCredenti } // NewListAvailableServiceSKUsPager - Gets all available SKU for a given API Management service -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - ServiceSKUsClientListAvailableServiceSKUsOptions contains the optional parameters for the ServiceSKUsClient.ListAvailableServiceSKUs -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - ServiceSKUsClientListAvailableServiceSKUsOptions contains the optional parameters for the ServiceSKUsClient.NewListAvailableServiceSKUsPager +// method. func (client *ServiceSKUsClient) NewListAvailableServiceSKUsPager(resourceGroupName string, serviceName string, options *ServiceSKUsClientListAvailableServiceSKUsOptions) *runtime.Pager[ServiceSKUsClientListAvailableServiceSKUsResponse] { return runtime.NewPager(runtime.PagingHandler[ServiceSKUsClientListAvailableServiceSKUsResponse]{ More: func(page ServiceSKUsClientListAvailableServiceSKUsResponse) bool { @@ -110,7 +110,7 @@ func (client *ServiceSKUsClient) listAvailableServiceSKUsCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_signinsettings_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/signinsettings_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_signinsettings_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/signinsettings_client.go index 3084e68554a0..dcb0a92e2c3f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_signinsettings_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/signinsettings_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 armapimanagement @@ -31,10 +32,9 @@ type SignInSettingsClient struct { } // NewSignInSettingsClient creates a new instance of SignInSettingsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSignInSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SignInSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewSignInSettingsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Create or Update Sign-In settings. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// parameters - Create or update parameters. -// options - SignInSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignInSettingsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - parameters - Create or update parameters. +// - options - SignInSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignInSettingsClient.CreateOrUpdate +// method. func (client *SignInSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSigninSettings, options *SignInSettingsClientCreateOrUpdateOptions) (SignInSettingsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { @@ -98,7 +99,7 @@ func (client *SignInSettingsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -118,10 +119,11 @@ func (client *SignInSettingsClient) createOrUpdateHandleResponse(resp *http.Resp // Get - Get Sign In Settings for the Portal // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - SignInSettingsClientGetOptions contains the optional parameters for the SignInSettingsClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - SignInSettingsClientGetOptions contains the optional parameters for the SignInSettingsClient.Get method. func (client *SignInSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *SignInSettingsClientGetOptions) (SignInSettingsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -157,7 +159,7 @@ func (client *SignInSettingsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -176,11 +178,12 @@ func (client *SignInSettingsClient) getHandleResponse(resp *http.Response) (Sign } // GetEntityTag - Gets the entity state (Etag) version of the SignInSettings. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - SignInSettingsClientGetEntityTagOptions contains the optional parameters for the SignInSettingsClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - SignInSettingsClientGetEntityTagOptions contains the optional parameters for the SignInSettingsClient.GetEntityTag +// method. func (client *SignInSettingsClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, options *SignInSettingsClientGetEntityTagOptions) (SignInSettingsClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -216,7 +219,7 @@ func (client *SignInSettingsClient) getEntityTagCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,13 +237,14 @@ func (client *SignInSettingsClient) getEntityTagHandleResponse(resp *http.Respon // Update - Update Sign-In settings. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update Sign-In settings. -// options - SignInSettingsClientUpdateOptions contains the optional parameters for the SignInSettingsClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update Sign-In settings. +// - options - SignInSettingsClientUpdateOptions contains the optional parameters for the SignInSettingsClient.Update method. func (client *SignInSettingsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, ifMatch string, parameters PortalSigninSettings, options *SignInSettingsClientUpdateOptions) (SignInSettingsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, ifMatch, parameters, options) if err != nil { @@ -276,7 +280,7 @@ func (client *SignInSettingsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_signupsettings_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/signupsettings_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_signupsettings_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/signupsettings_client.go index 763109324850..eebace91d6c9 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_signupsettings_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/signupsettings_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 armapimanagement @@ -31,10 +32,9 @@ type SignUpSettingsClient struct { } // NewSignUpSettingsClient creates a new instance of SignUpSettingsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSignUpSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SignUpSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewSignUpSettingsClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Create or Update Sign-Up settings. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// parameters - Create or update parameters. -// options - SignUpSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignUpSettingsClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - parameters - Create or update parameters. +// - options - SignUpSettingsClientCreateOrUpdateOptions contains the optional parameters for the SignUpSettingsClient.CreateOrUpdate +// method. func (client *SignUpSettingsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, parameters PortalSignupSettings, options *SignUpSettingsClientCreateOrUpdateOptions) (SignUpSettingsClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, parameters, options) if err != nil { @@ -98,7 +99,7 @@ func (client *SignUpSettingsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -118,10 +119,11 @@ func (client *SignUpSettingsClient) createOrUpdateHandleResponse(resp *http.Resp // Get - Get Sign Up Settings for the Portal // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - SignUpSettingsClientGetOptions contains the optional parameters for the SignUpSettingsClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - SignUpSettingsClientGetOptions contains the optional parameters for the SignUpSettingsClient.Get method. func (client *SignUpSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, options *SignUpSettingsClientGetOptions) (SignUpSettingsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -157,7 +159,7 @@ func (client *SignUpSettingsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -176,11 +178,12 @@ func (client *SignUpSettingsClient) getHandleResponse(resp *http.Response) (Sign } // GetEntityTag - Gets the entity state (Etag) version of the SignUpSettings. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - SignUpSettingsClientGetEntityTagOptions contains the optional parameters for the SignUpSettingsClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - SignUpSettingsClientGetEntityTagOptions contains the optional parameters for the SignUpSettingsClient.GetEntityTag +// method. func (client *SignUpSettingsClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, options *SignUpSettingsClientGetEntityTagOptions) (SignUpSettingsClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, options) if err != nil { @@ -216,7 +219,7 @@ func (client *SignUpSettingsClient) getEntityTagCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -234,13 +237,14 @@ func (client *SignUpSettingsClient) getEntityTagHandleResponse(resp *http.Respon // Update - Update Sign-Up settings. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update Sign-Up settings. -// options - SignUpSettingsClientUpdateOptions contains the optional parameters for the SignUpSettingsClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update Sign-Up settings. +// - options - SignUpSettingsClientUpdateOptions contains the optional parameters for the SignUpSettingsClient.Update method. func (client *SignUpSettingsClient) Update(ctx context.Context, resourceGroupName string, serviceName string, ifMatch string, parameters PortalSignupSettings, options *SignUpSettingsClientUpdateOptions) (SignUpSettingsClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, ifMatch, parameters, options) if err != nil { @@ -276,7 +280,7 @@ func (client *SignUpSettingsClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_skus_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/skus_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_skus_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/skus_client.go index 3d6ef25c14e1..25bf0fa7f5a8 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_skus_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/skus_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 armapimanagement @@ -31,10 +32,9 @@ type SKUsClient struct { } // NewSKUsClient creates a new instance of SKUsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SKUsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,9 +56,9 @@ func NewSKUsClient(subscriptionID string, credential azcore.TokenCredential, opt } // NewListPager - Gets the list of Microsoft.ApiManagement SKUs available for your Subscription. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// options - SKUsClientListOptions contains the optional parameters for the SKUsClient.List method. +// +// Generated from API version 2022-08-01 +// - options - SKUsClientListOptions contains the optional parameters for the SKUsClient.NewListPager method. func (client *SKUsClient) NewListPager(options *SKUsClientListOptions) *runtime.Pager[SKUsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SKUsClientListResponse]{ More: func(page SKUsClientListResponse) bool { @@ -99,7 +99,7 @@ func (client *SKUsClient) listCreateRequest(ctx context.Context, options *SKUsCl return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_subscription_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/subscription_client.go similarity index 84% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_subscription_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/subscription_client.go index 9135acc132e1..bd9c549f34c2 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_subscription_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/subscription_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 armapimanagement @@ -32,10 +33,9 @@ type SubscriptionClient struct { } // NewSubscriptionClient creates a new instance of SubscriptionClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewSubscriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SubscriptionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewSubscriptionClient(subscriptionID string, credential azcore.TokenCredent // CreateOrUpdate - Creates or updates the subscription of specified user to the specified product. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. -// parameters - Create parameters. -// options - SubscriptionClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionClient.CreateOrUpdate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. +// - parameters - Create parameters. +// - options - SubscriptionClientCreateOrUpdateOptions contains the optional parameters for the SubscriptionClient.CreateOrUpdate +// method. func (client *SubscriptionClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, sid string, parameters SubscriptionCreateParameters, options *SubscriptionClientCreateOrUpdateOptions) (SubscriptionClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, sid, parameters, options) if err != nil { @@ -107,7 +108,7 @@ func (client *SubscriptionClient) createOrUpdateCreateRequest(ctx context.Contex if options != nil && options.Notify != nil { reqQP.Set("notify", strconv.FormatBool(*options.Notify)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.AppType != nil { reqQP.Set("appType", string(*options.AppType)) } @@ -133,13 +134,14 @@ func (client *SubscriptionClient) createOrUpdateHandleResponse(resp *http.Respon // Delete - Deletes the specified subscription. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - SubscriptionClientDeleteOptions contains the optional parameters for the SubscriptionClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - SubscriptionClientDeleteOptions contains the optional parameters for the SubscriptionClient.Delete method. func (client *SubscriptionClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, sid string, ifMatch string, options *SubscriptionClientDeleteOptions) (SubscriptionClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, sid, ifMatch, options) if err != nil { @@ -179,7 +181,7 @@ func (client *SubscriptionClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -188,11 +190,12 @@ func (client *SubscriptionClient) deleteCreateRequest(ctx context.Context, resou // Get - Gets the specified Subscription entity. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. -// options - SubscriptionClientGetOptions contains the optional parameters for the SubscriptionClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. +// - options - SubscriptionClientGetOptions contains the optional parameters for the SubscriptionClient.Get method. func (client *SubscriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientGetOptions) (SubscriptionClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, sid, options) if err != nil { @@ -232,7 +235,7 @@ func (client *SubscriptionClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -251,12 +254,13 @@ func (client *SubscriptionClient) getHandleResponse(resp *http.Response) (Subscr } // GetEntityTag - Gets the entity state (Etag) version of the apimanagement subscription specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. -// options - SubscriptionClientGetEntityTagOptions contains the optional parameters for the SubscriptionClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. +// - options - SubscriptionClientGetEntityTagOptions contains the optional parameters for the SubscriptionClient.GetEntityTag +// method. func (client *SubscriptionClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientGetEntityTagOptions) (SubscriptionClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, sid, options) if err != nil { @@ -296,7 +300,7 @@ func (client *SubscriptionClient) getEntityTagCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -313,11 +317,11 @@ func (client *SubscriptionClient) getEntityTagHandleResponse(resp *http.Response } // NewListPager - Lists all subscriptions of the API Management service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - SubscriptionClientListOptions contains the optional parameters for the SubscriptionClient.List method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - SubscriptionClientListOptions contains the optional parameters for the SubscriptionClient.NewListPager method. func (client *SubscriptionClient) NewListPager(resourceGroupName string, serviceName string, options *SubscriptionClientListOptions) *runtime.Pager[SubscriptionClientListResponse] { return runtime.NewPager(runtime.PagingHandler[SubscriptionClientListResponse]{ More: func(page SubscriptionClientListResponse) bool { @@ -375,7 +379,7 @@ func (client *SubscriptionClient) listCreateRequest(ctx context.Context, resourc if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -392,12 +396,13 @@ func (client *SubscriptionClient) listHandleResponse(resp *http.Response) (Subsc // ListSecrets - Gets the specified Subscription keys. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. -// options - SubscriptionClientListSecretsOptions contains the optional parameters for the SubscriptionClient.ListSecrets -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. +// - options - SubscriptionClientListSecretsOptions contains the optional parameters for the SubscriptionClient.ListSecrets +// method. func (client *SubscriptionClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientListSecretsOptions) (SubscriptionClientListSecretsResponse, error) { req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, serviceName, sid, options) if err != nil { @@ -437,7 +442,7 @@ func (client *SubscriptionClient) listSecretsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -457,12 +462,13 @@ func (client *SubscriptionClient) listSecretsHandleResponse(resp *http.Response) // RegeneratePrimaryKey - Regenerates primary key of existing subscription of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. -// options - SubscriptionClientRegeneratePrimaryKeyOptions contains the optional parameters for the SubscriptionClient.RegeneratePrimaryKey -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. +// - options - SubscriptionClientRegeneratePrimaryKeyOptions contains the optional parameters for the SubscriptionClient.RegeneratePrimaryKey +// method. func (client *SubscriptionClient) RegeneratePrimaryKey(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientRegeneratePrimaryKeyOptions) (SubscriptionClientRegeneratePrimaryKeyResponse, error) { req, err := client.regeneratePrimaryKeyCreateRequest(ctx, resourceGroupName, serviceName, sid, options) if err != nil { @@ -502,7 +508,7 @@ func (client *SubscriptionClient) regeneratePrimaryKeyCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -510,12 +516,13 @@ func (client *SubscriptionClient) regeneratePrimaryKeyCreateRequest(ctx context. // RegenerateSecondaryKey - Regenerates secondary key of existing subscription of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. -// options - SubscriptionClientRegenerateSecondaryKeyOptions contains the optional parameters for the SubscriptionClient.RegenerateSecondaryKey -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. +// - options - SubscriptionClientRegenerateSecondaryKeyOptions contains the optional parameters for the SubscriptionClient.RegenerateSecondaryKey +// method. func (client *SubscriptionClient) RegenerateSecondaryKey(ctx context.Context, resourceGroupName string, serviceName string, sid string, options *SubscriptionClientRegenerateSecondaryKeyOptions) (SubscriptionClientRegenerateSecondaryKeyResponse, error) { req, err := client.regenerateSecondaryKeyCreateRequest(ctx, resourceGroupName, serviceName, sid, options) if err != nil { @@ -555,7 +562,7 @@ func (client *SubscriptionClient) regenerateSecondaryKeyCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -563,14 +570,15 @@ func (client *SubscriptionClient) regenerateSecondaryKeyCreateRequest(ctx contex // Update - Updates the details of a subscription specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - SubscriptionClientUpdateOptions contains the optional parameters for the SubscriptionClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - SubscriptionClientUpdateOptions contains the optional parameters for the SubscriptionClient.Update method. func (client *SubscriptionClient) Update(ctx context.Context, resourceGroupName string, serviceName string, sid string, ifMatch string, parameters SubscriptionUpdateParameters, options *SubscriptionClientUpdateOptions) (SubscriptionClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, sid, ifMatch, parameters, options) if err != nil { @@ -613,7 +621,7 @@ func (client *SubscriptionClient) updateCreateRequest(ctx context.Context, resou if options != nil && options.Notify != nil { reqQP.Set("notify", strconv.FormatBool(*options.Notify)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.AppType != nil { reqQP.Set("appType", string(*options.AppType)) } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tag_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/tag_client.go similarity index 83% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tag_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/tag_client.go index 622d74e21de6..4a7d06e29d01 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tag_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tag_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 armapimanagement @@ -32,10 +33,9 @@ type TagClient struct { } // NewTagClient creates a new instance of TagClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTagClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TagClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewTagClient(subscriptionID string, credential azcore.TokenCredential, opti // AssignToAPI - Assign tag to the Api. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientAssignToAPIOptions contains the optional parameters for the TagClient.AssignToAPI method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientAssignToAPIOptions contains the optional parameters for the TagClient.AssignToAPI method. func (client *TagClient) AssignToAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagID string, options *TagClientAssignToAPIOptions) (TagClientAssignToAPIResponse, error) { req, err := client.assignToAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, tagID, options) if err != nil { @@ -108,7 +109,7 @@ func (client *TagClient) assignToAPICreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -128,14 +129,15 @@ func (client *TagClient) assignToAPIHandleResponse(resp *http.Response) (TagClie // AssignToOperation - Assign tag to the Operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientAssignToOperationOptions contains the optional parameters for the TagClient.AssignToOperation method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientAssignToOperationOptions contains the optional parameters for the TagClient.AssignToOperation method. func (client *TagClient) AssignToOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, tagID string, options *TagClientAssignToOperationOptions) (TagClientAssignToOperationResponse, error) { req, err := client.assignToOperationCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, tagID, options) if err != nil { @@ -183,7 +185,7 @@ func (client *TagClient) assignToOperationCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -200,12 +202,13 @@ func (client *TagClient) assignToOperationHandleResponse(resp *http.Response) (T // AssignToProduct - Assign tag to the Product. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientAssignToProductOptions contains the optional parameters for the TagClient.AssignToProduct method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientAssignToProductOptions contains the optional parameters for the TagClient.AssignToProduct method. func (client *TagClient) AssignToProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, options *TagClientAssignToProductOptions) (TagClientAssignToProductResponse, error) { req, err := client.assignToProductCreateRequest(ctx, resourceGroupName, serviceName, productID, tagID, options) if err != nil { @@ -249,7 +252,7 @@ func (client *TagClient) assignToProductCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -266,12 +269,13 @@ func (client *TagClient) assignToProductHandleResponse(resp *http.Response) (Tag // CreateOrUpdate - Creates a tag. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// parameters - Create parameters. -// options - TagClientCreateOrUpdateOptions contains the optional parameters for the TagClient.CreateOrUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - parameters - Create parameters. +// - options - TagClientCreateOrUpdateOptions contains the optional parameters for the TagClient.CreateOrUpdate method. func (client *TagClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, tagID string, parameters TagCreateUpdateParameters, options *TagClientCreateOrUpdateOptions) (TagClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, tagID, parameters, options) if err != nil { @@ -311,7 +315,7 @@ func (client *TagClient) createOrUpdateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -334,13 +338,14 @@ func (client *TagClient) createOrUpdateHandleResponse(resp *http.Response) (TagC // Delete - Deletes specific tag of the API Management service instance. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - TagClientDeleteOptions contains the optional parameters for the TagClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - TagClientDeleteOptions contains the optional parameters for the TagClient.Delete method. func (client *TagClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, tagID string, ifMatch string, options *TagClientDeleteOptions) (TagClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, tagID, ifMatch, options) if err != nil { @@ -380,7 +385,7 @@ func (client *TagClient) deleteCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -389,13 +394,14 @@ func (client *TagClient) deleteCreateRequest(ctx context.Context, resourceGroupN // DetachFromAPI - Detach the tag from the Api. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientDetachFromAPIOptions contains the optional parameters for the TagClient.DetachFromAPI method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientDetachFromAPIOptions contains the optional parameters for the TagClient.DetachFromAPI method. func (client *TagClient) DetachFromAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagID string, options *TagClientDetachFromAPIOptions) (TagClientDetachFromAPIResponse, error) { req, err := client.detachFromAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, tagID, options) if err != nil { @@ -439,7 +445,7 @@ func (client *TagClient) detachFromAPICreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -447,14 +453,15 @@ func (client *TagClient) detachFromAPICreateRequest(ctx context.Context, resourc // DetachFromOperation - Detach the tag from the Operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientDetachFromOperationOptions contains the optional parameters for the TagClient.DetachFromOperation method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientDetachFromOperationOptions contains the optional parameters for the TagClient.DetachFromOperation method. func (client *TagClient) DetachFromOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, tagID string, options *TagClientDetachFromOperationOptions) (TagClientDetachFromOperationResponse, error) { req, err := client.detachFromOperationCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, tagID, options) if err != nil { @@ -502,7 +509,7 @@ func (client *TagClient) detachFromOperationCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -510,12 +517,13 @@ func (client *TagClient) detachFromOperationCreateRequest(ctx context.Context, r // DetachFromProduct - Detach the tag from the Product. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientDetachFromProductOptions contains the optional parameters for the TagClient.DetachFromProduct method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientDetachFromProductOptions contains the optional parameters for the TagClient.DetachFromProduct method. func (client *TagClient) DetachFromProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, options *TagClientDetachFromProductOptions) (TagClientDetachFromProductResponse, error) { req, err := client.detachFromProductCreateRequest(ctx, resourceGroupName, serviceName, productID, tagID, options) if err != nil { @@ -559,7 +567,7 @@ func (client *TagClient) detachFromProductCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -567,11 +575,12 @@ func (client *TagClient) detachFromProductCreateRequest(ctx context.Context, res // Get - Gets the details of the tag specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientGetOptions contains the optional parameters for the TagClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientGetOptions contains the optional parameters for the TagClient.Get method. func (client *TagClient) Get(ctx context.Context, resourceGroupName string, serviceName string, tagID string, options *TagClientGetOptions) (TagClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, tagID, options) if err != nil { @@ -611,7 +620,7 @@ func (client *TagClient) getCreateRequest(ctx context.Context, resourceGroupName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -631,13 +640,14 @@ func (client *TagClient) getHandleResponse(resp *http.Response) (TagClientGetRes // GetByAPI - Get tag associated with the API. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientGetByAPIOptions contains the optional parameters for the TagClient.GetByAPI method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientGetByAPIOptions contains the optional parameters for the TagClient.GetByAPI method. func (client *TagClient) GetByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagID string, options *TagClientGetByAPIOptions) (TagClientGetByAPIResponse, error) { req, err := client.getByAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, tagID, options) if err != nil { @@ -681,7 +691,7 @@ func (client *TagClient) getByAPICreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -701,14 +711,15 @@ func (client *TagClient) getByAPIHandleResponse(resp *http.Response) (TagClientG // GetByOperation - Get tag associated with the Operation. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientGetByOperationOptions contains the optional parameters for the TagClient.GetByOperation method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientGetByOperationOptions contains the optional parameters for the TagClient.GetByOperation method. func (client *TagClient) GetByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, tagID string, options *TagClientGetByOperationOptions) (TagClientGetByOperationResponse, error) { req, err := client.getByOperationCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, tagID, options) if err != nil { @@ -756,7 +767,7 @@ func (client *TagClient) getByOperationCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -776,12 +787,13 @@ func (client *TagClient) getByOperationHandleResponse(resp *http.Response) (TagC // GetByProduct - Get tag associated with the Product. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientGetByProductOptions contains the optional parameters for the TagClient.GetByProduct method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientGetByProductOptions contains the optional parameters for the TagClient.GetByProduct method. func (client *TagClient) GetByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, options *TagClientGetByProductOptions) (TagClientGetByProductResponse, error) { req, err := client.getByProductCreateRequest(ctx, resourceGroupName, serviceName, productID, tagID, options) if err != nil { @@ -825,7 +837,7 @@ func (client *TagClient) getByProductCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -844,11 +856,12 @@ func (client *TagClient) getByProductHandleResponse(resp *http.Response) (TagCli } // GetEntityState - Gets the entity state version of the tag specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientGetEntityStateOptions contains the optional parameters for the TagClient.GetEntityState method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientGetEntityStateOptions contains the optional parameters for the TagClient.GetEntityState method. func (client *TagClient) GetEntityState(ctx context.Context, resourceGroupName string, serviceName string, tagID string, options *TagClientGetEntityStateOptions) (TagClientGetEntityStateResponse, error) { req, err := client.getEntityStateCreateRequest(ctx, resourceGroupName, serviceName, tagID, options) if err != nil { @@ -888,7 +901,7 @@ func (client *TagClient) getEntityStateCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -905,13 +918,14 @@ func (client *TagClient) getEntityStateHandleResponse(resp *http.Response) (TagC } // GetEntityStateByAPI - Gets the entity state version of the tag specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientGetEntityStateByAPIOptions contains the optional parameters for the TagClient.GetEntityStateByAPI method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientGetEntityStateByAPIOptions contains the optional parameters for the TagClient.GetEntityStateByAPI method. func (client *TagClient) GetEntityStateByAPI(ctx context.Context, resourceGroupName string, serviceName string, apiID string, tagID string, options *TagClientGetEntityStateByAPIOptions) (TagClientGetEntityStateByAPIResponse, error) { req, err := client.getEntityStateByAPICreateRequest(ctx, resourceGroupName, serviceName, apiID, tagID, options) if err != nil { @@ -955,7 +969,7 @@ func (client *TagClient) getEntityStateByAPICreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -972,15 +986,16 @@ func (client *TagClient) getEntityStateByAPIHandleResponse(resp *http.Response) } // GetEntityStateByOperation - Gets the entity state version of the tag specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientGetEntityStateByOperationOptions contains the optional parameters for the TagClient.GetEntityStateByOperation -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientGetEntityStateByOperationOptions contains the optional parameters for the TagClient.GetEntityStateByOperation +// method. func (client *TagClient) GetEntityStateByOperation(ctx context.Context, resourceGroupName string, serviceName string, apiID string, operationID string, tagID string, options *TagClientGetEntityStateByOperationOptions) (TagClientGetEntityStateByOperationResponse, error) { req, err := client.getEntityStateByOperationCreateRequest(ctx, resourceGroupName, serviceName, apiID, operationID, tagID, options) if err != nil { @@ -1028,7 +1043,7 @@ func (client *TagClient) getEntityStateByOperationCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1045,13 +1060,14 @@ func (client *TagClient) getEntityStateByOperationHandleResponse(resp *http.Resp } // GetEntityStateByProduct - Gets the entity state version of the tag specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// options - TagClientGetEntityStateByProductOptions contains the optional parameters for the TagClient.GetEntityStateByProduct -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - options - TagClientGetEntityStateByProductOptions contains the optional parameters for the TagClient.GetEntityStateByProduct +// method. func (client *TagClient) GetEntityStateByProduct(ctx context.Context, resourceGroupName string, serviceName string, productID string, tagID string, options *TagClientGetEntityStateByProductOptions) (TagClientGetEntityStateByProductResponse, error) { req, err := client.getEntityStateByProductCreateRequest(ctx, resourceGroupName, serviceName, productID, tagID, options) if err != nil { @@ -1095,7 +1111,7 @@ func (client *TagClient) getEntityStateByProductCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1112,13 +1128,13 @@ func (client *TagClient) getEntityStateByProductHandleResponse(resp *http.Respon } // NewListByAPIPager - Lists all Tags associated with the API. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// options - TagClientListByAPIOptions contains the optional parameters for the TagClient.ListByAPI method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - options - TagClientListByAPIOptions contains the optional parameters for the TagClient.NewListByAPIPager method. func (client *TagClient) NewListByAPIPager(resourceGroupName string, serviceName string, apiID string, options *TagClientListByAPIOptions) *runtime.Pager[TagClientListByAPIResponse] { return runtime.NewPager(runtime.PagingHandler[TagClientListByAPIResponse]{ More: func(page TagClientListByAPIResponse) bool { @@ -1180,7 +1196,7 @@ func (client *TagClient) listByAPICreateRequest(ctx context.Context, resourceGro if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1196,14 +1212,14 @@ func (client *TagClient) listByAPIHandleResponse(resp *http.Response) (TagClient } // NewListByOperationPager - Lists all Tags associated with the Operation. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has -// ;rev=n as a suffix where n is the revision number. -// operationID - Operation identifier within an API. Must be unique in the current API Management service instance. -// options - TagClientListByOperationOptions contains the optional parameters for the TagClient.ListByOperation method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - apiID - API revision identifier. Must be unique in the current API Management service instance. Non-current revision has +// ;rev=n as a suffix where n is the revision number. +// - operationID - Operation identifier within an API. Must be unique in the current API Management service instance. +// - options - TagClientListByOperationOptions contains the optional parameters for the TagClient.NewListByOperationPager method. func (client *TagClient) NewListByOperationPager(resourceGroupName string, serviceName string, apiID string, operationID string, options *TagClientListByOperationOptions) *runtime.Pager[TagClientListByOperationResponse] { return runtime.NewPager(runtime.PagingHandler[TagClientListByOperationResponse]{ More: func(page TagClientListByOperationResponse) bool { @@ -1269,7 +1285,7 @@ func (client *TagClient) listByOperationCreateRequest(ctx context.Context, resou if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1285,12 +1301,12 @@ func (client *TagClient) listByOperationHandleResponse(resp *http.Response) (Tag } // NewListByProductPager - Lists all Tags associated with the Product. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// productID - Product identifier. Must be unique in the current API Management service instance. -// options - TagClientListByProductOptions contains the optional parameters for the TagClient.ListByProduct method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - productID - Product identifier. Must be unique in the current API Management service instance. +// - options - TagClientListByProductOptions contains the optional parameters for the TagClient.NewListByProductPager method. func (client *TagClient) NewListByProductPager(resourceGroupName string, serviceName string, productID string, options *TagClientListByProductOptions) *runtime.Pager[TagClientListByProductResponse] { return runtime.NewPager(runtime.PagingHandler[TagClientListByProductResponse]{ More: func(page TagClientListByProductResponse) bool { @@ -1352,7 +1368,7 @@ func (client *TagClient) listByProductCreateRequest(ctx context.Context, resourc if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1368,11 +1384,11 @@ func (client *TagClient) listByProductHandleResponse(resp *http.Response) (TagCl } // NewListByServicePager - Lists a collection of tags defined within a service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - TagClientListByServiceOptions contains the optional parameters for the TagClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - TagClientListByServiceOptions contains the optional parameters for the TagClient.NewListByServicePager method. func (client *TagClient) NewListByServicePager(resourceGroupName string, serviceName string, options *TagClientListByServiceOptions) *runtime.Pager[TagClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[TagClientListByServiceResponse]{ More: func(page TagClientListByServiceResponse) bool { @@ -1433,7 +1449,7 @@ func (client *TagClient) listByServiceCreateRequest(ctx context.Context, resourc if options != nil && options.Scope != nil { reqQP.Set("scope", *options.Scope) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1450,14 +1466,15 @@ func (client *TagClient) listByServiceHandleResponse(resp *http.Response) (TagCl // Update - Updates the details of the tag specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// tagID - Tag identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - TagClientUpdateOptions contains the optional parameters for the TagClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - tagID - Tag identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - TagClientUpdateOptions contains the optional parameters for the TagClient.Update method. func (client *TagClient) Update(ctx context.Context, resourceGroupName string, serviceName string, tagID string, ifMatch string, parameters TagCreateUpdateParameters, options *TagClientUpdateOptions) (TagClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, tagID, ifMatch, parameters, options) if err != nil { @@ -1497,7 +1514,7 @@ func (client *TagClient) updateCreateRequest(ctx context.Context, resourceGroupN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tagresource_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/tagresource_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tagresource_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/tagresource_client.go index ac501a29bd93..c0b9309253a2 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tagresource_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tagresource_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 armapimanagement @@ -32,10 +33,9 @@ type TagResourceClient struct { } // NewTagResourceClient creates a new instance of TagResourceClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTagResourceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TagResourceClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,12 @@ func NewTagResourceClient(subscriptionID string, credential azcore.TokenCredenti } // NewListByServicePager - Lists a collection of resources associated with tags. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - TagResourceClientListByServiceOptions contains the optional parameters for the TagResourceClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - TagResourceClientListByServiceOptions contains the optional parameters for the TagResourceClient.NewListByServicePager +// method. func (client *TagResourceClient) NewListByServicePager(resourceGroupName string, serviceName string, options *TagResourceClientListByServiceOptions) *runtime.Pager[TagResourceClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[TagResourceClientListByServiceResponse]{ More: func(page TagResourceClientListByServiceResponse) bool { @@ -120,7 +120,7 @@ func (client *TagResourceClient) listByServiceCreateRequest(ctx context.Context, if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tenantaccess_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccess_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tenantaccess_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/tenantaccess_client.go index b72309722180..cbe2de124e3f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tenantaccess_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccess_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 armapimanagement @@ -31,10 +32,9 @@ type TenantAccessClient struct { } // NewTenantAccessClient creates a new instance of TenantAccessClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTenantAccessClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantAccessClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,14 +57,15 @@ func NewTenantAccessClient(subscriptionID string, credential azcore.TokenCredent // Create - Update tenant access information details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// accessName - The identifier of the Access configuration. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Parameters supplied to retrieve the Tenant Access Information. -// options - TenantAccessClientCreateOptions contains the optional parameters for the TenantAccessClient.Create method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - accessName - The identifier of the Access configuration. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Parameters supplied to retrieve the Tenant Access Information. +// - options - TenantAccessClientCreateOptions contains the optional parameters for the TenantAccessClient.Create method. func (client *TenantAccessClient) Create(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, ifMatch string, parameters AccessInformationCreateParameters, options *TenantAccessClientCreateOptions) (TenantAccessClientCreateResponse, error) { req, err := client.createCreateRequest(ctx, resourceGroupName, serviceName, accessName, ifMatch, parameters, options) if err != nil { @@ -104,7 +105,7 @@ func (client *TenantAccessClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} @@ -125,11 +126,12 @@ func (client *TenantAccessClient) createHandleResponse(resp *http.Response) (Ten // Get - Get tenant access information details without secrets. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// accessName - The identifier of the Access configuration. -// options - TenantAccessClientGetOptions contains the optional parameters for the TenantAccessClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - accessName - The identifier of the Access configuration. +// - options - TenantAccessClientGetOptions contains the optional parameters for the TenantAccessClient.Get method. func (client *TenantAccessClient) Get(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientGetOptions) (TenantAccessClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { @@ -169,7 +171,7 @@ func (client *TenantAccessClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,12 +190,13 @@ func (client *TenantAccessClient) getHandleResponse(resp *http.Response) (Tenant } // GetEntityTag - Tenant access metadata -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// accessName - The identifier of the Access configuration. -// options - TenantAccessClientGetEntityTagOptions contains the optional parameters for the TenantAccessClient.GetEntityTag -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - accessName - The identifier of the Access configuration. +// - options - TenantAccessClientGetEntityTagOptions contains the optional parameters for the TenantAccessClient.GetEntityTag +// method. func (client *TenantAccessClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientGetEntityTagOptions) (TenantAccessClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { @@ -233,7 +236,7 @@ func (client *TenantAccessClient) getEntityTagCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -250,12 +253,12 @@ func (client *TenantAccessClient) getEntityTagHandleResponse(resp *http.Response } // NewListByServicePager - Returns list of access infos - for Git and Management endpoints. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - TenantAccessClientListByServiceOptions contains the optional parameters for the TenantAccessClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - TenantAccessClientListByServiceOptions contains the optional parameters for the TenantAccessClient.NewListByServicePager +// method. func (client *TenantAccessClient) NewListByServicePager(resourceGroupName string, serviceName string, options *TenantAccessClientListByServiceOptions) *runtime.Pager[TenantAccessClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[TenantAccessClientListByServiceResponse]{ More: func(page TenantAccessClientListByServiceResponse) bool { @@ -307,7 +310,7 @@ func (client *TenantAccessClient) listByServiceCreateRequest(ctx context.Context if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -324,12 +327,13 @@ func (client *TenantAccessClient) listByServiceHandleResponse(resp *http.Respons // ListSecrets - Get tenant access information details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// accessName - The identifier of the Access configuration. -// options - TenantAccessClientListSecretsOptions contains the optional parameters for the TenantAccessClient.ListSecrets -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - accessName - The identifier of the Access configuration. +// - options - TenantAccessClientListSecretsOptions contains the optional parameters for the TenantAccessClient.ListSecrets +// method. func (client *TenantAccessClient) ListSecrets(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientListSecretsOptions) (TenantAccessClientListSecretsResponse, error) { req, err := client.listSecretsCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { @@ -369,7 +373,7 @@ func (client *TenantAccessClient) listSecretsCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -389,12 +393,13 @@ func (client *TenantAccessClient) listSecretsHandleResponse(resp *http.Response) // RegeneratePrimaryKey - Regenerate primary access key // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// accessName - The identifier of the Access configuration. -// options - TenantAccessClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessClient.RegeneratePrimaryKey -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - accessName - The identifier of the Access configuration. +// - options - TenantAccessClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessClient.RegeneratePrimaryKey +// method. func (client *TenantAccessClient) RegeneratePrimaryKey(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientRegeneratePrimaryKeyOptions) (TenantAccessClientRegeneratePrimaryKeyResponse, error) { req, err := client.regeneratePrimaryKeyCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { @@ -434,7 +439,7 @@ func (client *TenantAccessClient) regeneratePrimaryKeyCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -442,12 +447,13 @@ func (client *TenantAccessClient) regeneratePrimaryKeyCreateRequest(ctx context. // RegenerateSecondaryKey - Regenerate secondary access key // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// accessName - The identifier of the Access configuration. -// options - TenantAccessClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessClient.RegenerateSecondaryKey -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - accessName - The identifier of the Access configuration. +// - options - TenantAccessClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessClient.RegenerateSecondaryKey +// method. func (client *TenantAccessClient) RegenerateSecondaryKey(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessClientRegenerateSecondaryKeyOptions) (TenantAccessClientRegenerateSecondaryKeyResponse, error) { req, err := client.regenerateSecondaryKeyCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { @@ -487,7 +493,7 @@ func (client *TenantAccessClient) regenerateSecondaryKeyCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -495,14 +501,15 @@ func (client *TenantAccessClient) regenerateSecondaryKeyCreateRequest(ctx contex // Update - Update tenant access information details. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// accessName - The identifier of the Access configuration. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Parameters supplied to retrieve the Tenant Access Information. -// options - TenantAccessClientUpdateOptions contains the optional parameters for the TenantAccessClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - accessName - The identifier of the Access configuration. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Parameters supplied to retrieve the Tenant Access Information. +// - options - TenantAccessClientUpdateOptions contains the optional parameters for the TenantAccessClient.Update method. func (client *TenantAccessClient) Update(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, ifMatch string, parameters AccessInformationUpdateParameters, options *TenantAccessClientUpdateOptions) (TenantAccessClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, accessName, ifMatch, parameters, options) if err != nil { @@ -542,7 +549,7 @@ func (client *TenantAccessClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tenantaccessgit_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccessgit_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tenantaccessgit_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/tenantaccessgit_client.go index 6316d7750d1c..1393ea302322 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tenantaccessgit_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tenantaccessgit_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 armapimanagement @@ -31,10 +32,9 @@ type TenantAccessGitClient struct { } // NewTenantAccessGitClient creates a new instance of TenantAccessGitClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTenantAccessGitClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantAccessGitClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewTenantAccessGitClient(subscriptionID string, credential azcore.TokenCred // RegeneratePrimaryKey - Regenerate primary access key for GIT. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// accessName - The identifier of the Access configuration. -// options - TenantAccessGitClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegeneratePrimaryKey -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - accessName - The identifier of the Access configuration. +// - options - TenantAccessGitClientRegeneratePrimaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegeneratePrimaryKey +// method. func (client *TenantAccessGitClient) RegeneratePrimaryKey(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessGitClientRegeneratePrimaryKeyOptions) (TenantAccessGitClientRegeneratePrimaryKeyResponse, error) { req, err := client.regeneratePrimaryKeyCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { @@ -102,7 +103,7 @@ func (client *TenantAccessGitClient) regeneratePrimaryKeyCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -110,12 +111,13 @@ func (client *TenantAccessGitClient) regeneratePrimaryKeyCreateRequest(ctx conte // RegenerateSecondaryKey - Regenerate secondary access key for GIT. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// accessName - The identifier of the Access configuration. -// options - TenantAccessGitClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegenerateSecondaryKey -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - accessName - The identifier of the Access configuration. +// - options - TenantAccessGitClientRegenerateSecondaryKeyOptions contains the optional parameters for the TenantAccessGitClient.RegenerateSecondaryKey +// method. func (client *TenantAccessGitClient) RegenerateSecondaryKey(ctx context.Context, resourceGroupName string, serviceName string, accessName AccessIDName, options *TenantAccessGitClientRegenerateSecondaryKeyOptions) (TenantAccessGitClientRegenerateSecondaryKeyResponse, error) { req, err := client.regenerateSecondaryKeyCreateRequest(ctx, resourceGroupName, serviceName, accessName, options) if err != nil { @@ -155,7 +157,7 @@ func (client *TenantAccessGitClient) regenerateSecondaryKeyCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tenantconfiguration_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/tenantconfiguration_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tenantconfiguration_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/tenantconfiguration_client.go index 131834643181..709b2b87bc47 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tenantconfiguration_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tenantconfiguration_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 armapimanagement @@ -31,10 +32,9 @@ type TenantConfigurationClient struct { } // NewTenantConfigurationClient creates a new instance of TenantConfigurationClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTenantConfigurationClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantConfigurationClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,13 +58,14 @@ func NewTenantConfigurationClient(subscriptionID string, credential azcore.Token // BeginDeploy - This operation applies changes from the specified Git branch to the configuration database. This is a long // running operation and could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// configurationName - The identifier of the Git Configuration Operation. -// parameters - Deploy Configuration parameters. -// options - TenantConfigurationClientBeginDeployOptions contains the optional parameters for the TenantConfigurationClient.BeginDeploy -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - configurationName - The identifier of the Git Configuration Operation. +// - parameters - Deploy Configuration parameters. +// - options - TenantConfigurationClientBeginDeployOptions contains the optional parameters for the TenantConfigurationClient.BeginDeploy +// method. func (client *TenantConfigurationClient) BeginDeploy(ctx context.Context, resourceGroupName string, serviceName string, configurationName ConfigurationIDName, parameters DeployConfigurationParameters, options *TenantConfigurationClientBeginDeployOptions) (*runtime.Poller[TenantConfigurationClientDeployResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.deploy(ctx, resourceGroupName, serviceName, configurationName, parameters, options) @@ -82,7 +83,8 @@ func (client *TenantConfigurationClient) BeginDeploy(ctx context.Context, resour // Deploy - This operation applies changes from the specified Git branch to the configuration database. This is a long running // operation and could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *TenantConfigurationClient) deploy(ctx context.Context, resourceGroupName string, serviceName string, configurationName ConfigurationIDName, parameters DeployConfigurationParameters, options *TenantConfigurationClientBeginDeployOptions) (*http.Response, error) { req, err := client.deployCreateRequest(ctx, resourceGroupName, serviceName, configurationName, parameters, options) if err != nil { @@ -122,7 +124,7 @@ func (client *TenantConfigurationClient) deployCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -130,12 +132,13 @@ func (client *TenantConfigurationClient) deployCreateRequest(ctx context.Context // GetSyncState - Gets the status of the most recent synchronization between the configuration database and the Git repository. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// configurationName - The identifier of the Git Configuration Operation. -// options - TenantConfigurationClientGetSyncStateOptions contains the optional parameters for the TenantConfigurationClient.GetSyncState -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - configurationName - The identifier of the Git Configuration Operation. +// - options - TenantConfigurationClientGetSyncStateOptions contains the optional parameters for the TenantConfigurationClient.GetSyncState +// method. func (client *TenantConfigurationClient) GetSyncState(ctx context.Context, resourceGroupName string, serviceName string, configurationName ConfigurationIDName, options *TenantConfigurationClientGetSyncStateOptions) (TenantConfigurationClientGetSyncStateResponse, error) { req, err := client.getSyncStateCreateRequest(ctx, resourceGroupName, serviceName, configurationName, options) if err != nil { @@ -175,7 +178,7 @@ func (client *TenantConfigurationClient) getSyncStateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -193,13 +196,14 @@ func (client *TenantConfigurationClient) getSyncStateHandleResponse(resp *http.R // BeginSave - This operation creates a commit with the current configuration snapshot to the specified branch in the repository. // This is a long running operation and could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// configurationName - The identifier of the Git Configuration Operation. -// parameters - Save Configuration parameters. -// options - TenantConfigurationClientBeginSaveOptions contains the optional parameters for the TenantConfigurationClient.BeginSave -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - configurationName - The identifier of the Git Configuration Operation. +// - parameters - Save Configuration parameters. +// - options - TenantConfigurationClientBeginSaveOptions contains the optional parameters for the TenantConfigurationClient.BeginSave +// method. func (client *TenantConfigurationClient) BeginSave(ctx context.Context, resourceGroupName string, serviceName string, configurationName ConfigurationIDName, parameters SaveConfigurationParameter, options *TenantConfigurationClientBeginSaveOptions) (*runtime.Poller[TenantConfigurationClientSaveResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.save(ctx, resourceGroupName, serviceName, configurationName, parameters, options) @@ -217,7 +221,8 @@ func (client *TenantConfigurationClient) BeginSave(ctx context.Context, resource // Save - This operation creates a commit with the current configuration snapshot to the specified branch in the repository. // This is a long running operation and could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *TenantConfigurationClient) save(ctx context.Context, resourceGroupName string, serviceName string, configurationName ConfigurationIDName, parameters SaveConfigurationParameter, options *TenantConfigurationClientBeginSaveOptions) (*http.Response, error) { req, err := client.saveCreateRequest(ctx, resourceGroupName, serviceName, configurationName, parameters, options) if err != nil { @@ -257,7 +262,7 @@ func (client *TenantConfigurationClient) saveCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -266,13 +271,14 @@ func (client *TenantConfigurationClient) saveCreateRequest(ctx context.Context, // BeginValidate - This operation validates the changes in the specified Git branch. This is a long running operation and // could take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// configurationName - The identifier of the Git Configuration Operation. -// parameters - Validate Configuration parameters. -// options - TenantConfigurationClientBeginValidateOptions contains the optional parameters for the TenantConfigurationClient.BeginValidate -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - configurationName - The identifier of the Git Configuration Operation. +// - parameters - Validate Configuration parameters. +// - options - TenantConfigurationClientBeginValidateOptions contains the optional parameters for the TenantConfigurationClient.BeginValidate +// method. func (client *TenantConfigurationClient) BeginValidate(ctx context.Context, resourceGroupName string, serviceName string, configurationName ConfigurationIDName, parameters DeployConfigurationParameters, options *TenantConfigurationClientBeginValidateOptions) (*runtime.Poller[TenantConfigurationClientValidateResponse], error) { if options == nil || options.ResumeToken == "" { resp, err := client.validate(ctx, resourceGroupName, serviceName, configurationName, parameters, options) @@ -290,7 +296,8 @@ func (client *TenantConfigurationClient) BeginValidate(ctx context.Context, reso // Validate - This operation validates the changes in the specified Git branch. This is a long running operation and could // take several minutes to complete. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 +// +// Generated from API version 2022-08-01 func (client *TenantConfigurationClient) validate(ctx context.Context, resourceGroupName string, serviceName string, configurationName ConfigurationIDName, parameters DeployConfigurationParameters, options *TenantConfigurationClientBeginValidateOptions) (*http.Response, error) { req, err := client.validateCreateRequest(ctx, resourceGroupName, serviceName, configurationName, parameters, options) if err != nil { @@ -330,7 +337,7 @@ func (client *TenantConfigurationClient) validateCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-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/apimanagement/armapimanagement/zz_generated_tenantsettings_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/tenantsettings_client.go similarity index 87% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tenantsettings_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/tenantsettings_client.go index 099c7eff9a0a..1a4686ae199c 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_tenantsettings_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/tenantsettings_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 armapimanagement @@ -31,10 +32,9 @@ type TenantSettingsClient struct { } // NewTenantSettingsClient creates a new instance of TenantSettingsClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewTenantSettingsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*TenantSettingsClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,11 +57,12 @@ func NewTenantSettingsClient(subscriptionID string, credential azcore.TokenCrede // Get - Get tenant settings. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// settingsType - The identifier of the settings. -// options - TenantSettingsClientGetOptions contains the optional parameters for the TenantSettingsClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - settingsType - The identifier of the settings. +// - options - TenantSettingsClientGetOptions contains the optional parameters for the TenantSettingsClient.Get method. func (client *TenantSettingsClient) Get(ctx context.Context, resourceGroupName string, serviceName string, settingsType SettingsTypeName, options *TenantSettingsClientGetOptions) (TenantSettingsClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, settingsType, options) if err != nil { @@ -101,7 +102,7 @@ func (client *TenantSettingsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -120,12 +121,12 @@ func (client *TenantSettingsClient) getHandleResponse(resp *http.Response) (Tena } // NewListByServicePager - Public settings. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - TenantSettingsClientListByServiceOptions contains the optional parameters for the TenantSettingsClient.ListByService -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - TenantSettingsClientListByServiceOptions contains the optional parameters for the TenantSettingsClient.NewListByServicePager +// method. func (client *TenantSettingsClient) NewListByServicePager(resourceGroupName string, serviceName string, options *TenantSettingsClientListByServiceOptions) *runtime.Pager[TenantSettingsClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[TenantSettingsClientListByServiceResponse]{ More: func(page TenantSettingsClientListByServiceResponse) bool { @@ -177,7 +178,7 @@ func (client *TenantSettingsClient) listByServiceCreateRequest(ctx context.Conte if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_time_rfc3339.go b/sdk/resourcemanager/apimanagement/armapimanagement/time_rfc3339.go similarity index 96% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_time_rfc3339.go rename to sdk/resourcemanager/apimanagement/armapimanagement/time_rfc3339.go index 066071cd0713..92ccea1c52c9 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/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 armapimanagement @@ -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/apimanagement/armapimanagement/zz_generated_user_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/user_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_user_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/user_client.go index 496fac8cc865..262caba045cd 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_user_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/user_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 armapimanagement @@ -32,10 +33,9 @@ type UserClient struct { } // NewUserClient creates a new instance of UserClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewUserClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewUserClient(subscriptionID string, credential azcore.TokenCredential, opt // CreateOrUpdate - Creates or Updates a user. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// userID - User identifier. Must be unique in the current API Management service instance. -// parameters - Create or update parameters. -// options - UserClientCreateOrUpdateOptions contains the optional parameters for the UserClient.CreateOrUpdate method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - parameters - Create or update parameters. +// - options - UserClientCreateOrUpdateOptions contains the optional parameters for the UserClient.CreateOrUpdate method. func (client *UserClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserCreateParameters, options *UserClientCreateOrUpdateOptions) (UserClientCreateOrUpdateResponse, error) { req, err := client.createOrUpdateCreateRequest(ctx, resourceGroupName, serviceName, userID, parameters, options) if err != nil { @@ -106,7 +107,7 @@ func (client *UserClient) createOrUpdateCreateRequest(ctx context.Context, resou if options != nil && options.Notify != nil { reqQP.Set("notify", strconv.FormatBool(*options.Notify)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header["If-Match"] = []string{*options.IfMatch} @@ -129,13 +130,14 @@ func (client *UserClient) createOrUpdateHandleResponse(resp *http.Response) (Use // Delete - Deletes specific user. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// userID - User identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// options - UserClientDeleteOptions contains the optional parameters for the UserClient.Delete method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - options - UserClientDeleteOptions contains the optional parameters for the UserClient.Delete method. func (client *UserClient) Delete(ctx context.Context, resourceGroupName string, serviceName string, userID string, ifMatch string, options *UserClientDeleteOptions) (UserClientDeleteResponse, error) { req, err := client.deleteCreateRequest(ctx, resourceGroupName, serviceName, userID, ifMatch, options) if err != nil { @@ -181,7 +183,7 @@ func (client *UserClient) deleteCreateRequest(ctx context.Context, resourceGroup if options != nil && options.Notify != nil { reqQP.Set("notify", strconv.FormatBool(*options.Notify)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.AppType != nil { reqQP.Set("appType", string(*options.AppType)) } @@ -194,11 +196,12 @@ func (client *UserClient) deleteCreateRequest(ctx context.Context, resourceGroup // GenerateSsoURL - Retrieves a redirection URL containing an authentication token for signing a given user into the developer // portal. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - UserClientGenerateSsoURLOptions contains the optional parameters for the UserClient.GenerateSsoURL method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - UserClientGenerateSsoURLOptions contains the optional parameters for the UserClient.GenerateSsoURL method. func (client *UserClient) GenerateSsoURL(ctx context.Context, resourceGroupName string, serviceName string, userID string, options *UserClientGenerateSsoURLOptions) (UserClientGenerateSsoURLResponse, error) { req, err := client.generateSsoURLCreateRequest(ctx, resourceGroupName, serviceName, userID, options) if err != nil { @@ -238,7 +241,7 @@ func (client *UserClient) generateSsoURLCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -255,11 +258,12 @@ func (client *UserClient) generateSsoURLHandleResponse(resp *http.Response) (Use // Get - Gets the details of the user specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - UserClientGetOptions contains the optional parameters for the UserClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - UserClientGetOptions contains the optional parameters for the UserClient.Get method. func (client *UserClient) Get(ctx context.Context, resourceGroupName string, serviceName string, userID string, options *UserClientGetOptions) (UserClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, userID, options) if err != nil { @@ -299,7 +303,7 @@ func (client *UserClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -318,11 +322,12 @@ func (client *UserClient) getHandleResponse(resp *http.Response) (UserClientGetR } // GetEntityTag - Gets the entity state (Etag) version of the user specified by its identifier. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - UserClientGetEntityTagOptions contains the optional parameters for the UserClient.GetEntityTag method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - UserClientGetEntityTagOptions contains the optional parameters for the UserClient.GetEntityTag method. func (client *UserClient) GetEntityTag(ctx context.Context, resourceGroupName string, serviceName string, userID string, options *UserClientGetEntityTagOptions) (UserClientGetEntityTagResponse, error) { req, err := client.getEntityTagCreateRequest(ctx, resourceGroupName, serviceName, userID, options) if err != nil { @@ -362,7 +367,7 @@ func (client *UserClient) getEntityTagCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -380,13 +385,14 @@ func (client *UserClient) getEntityTagHandleResponse(resp *http.Response) (UserC // GetSharedAccessToken - Gets the Shared Access Authorization Token for the User. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// userID - User identifier. Must be unique in the current API Management service instance. -// parameters - Create Authorization Token parameters. -// options - UserClientGetSharedAccessTokenOptions contains the optional parameters for the UserClient.GetSharedAccessToken -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - parameters - Create Authorization Token parameters. +// - options - UserClientGetSharedAccessTokenOptions contains the optional parameters for the UserClient.GetSharedAccessToken +// method. func (client *UserClient) GetSharedAccessToken(ctx context.Context, resourceGroupName string, serviceName string, userID string, parameters UserTokenParameters, options *UserClientGetSharedAccessTokenOptions) (UserClientGetSharedAccessTokenResponse, error) { req, err := client.getSharedAccessTokenCreateRequest(ctx, resourceGroupName, serviceName, userID, parameters, options) if err != nil { @@ -426,7 +432,7 @@ func (client *UserClient) getSharedAccessTokenCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, runtime.MarshalAsJSON(req, parameters) @@ -442,11 +448,11 @@ func (client *UserClient) getSharedAccessTokenHandleResponse(resp *http.Response } // NewListByServicePager - Lists a collection of registered users in the specified service instance. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// options - UserClientListByServiceOptions contains the optional parameters for the UserClient.ListByService method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - options - UserClientListByServiceOptions contains the optional parameters for the UserClient.NewListByServicePager method. func (client *UserClient) NewListByServicePager(resourceGroupName string, serviceName string, options *UserClientListByServiceOptions) *runtime.Pager[UserClientListByServiceResponse] { return runtime.NewPager(runtime.PagingHandler[UserClientListByServiceResponse]{ More: func(page UserClientListByServiceResponse) bool { @@ -507,7 +513,7 @@ func (client *UserClient) listByServiceCreateRequest(ctx context.Context, resour if options != nil && options.ExpandGroups != nil { reqQP.Set("expandGroups", strconv.FormatBool(*options.ExpandGroups)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -524,14 +530,15 @@ func (client *UserClient) listByServiceHandleResponse(resp *http.Response) (User // Update - Updates the details of the user specified by its identifier. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// userID - User identifier. Must be unique in the current API Management service instance. -// ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or -// it should be * for unconditional update. -// parameters - Update parameters. -// options - UserClientUpdateOptions contains the optional parameters for the UserClient.Update method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - ifMatch - ETag of the Entity. ETag should match the current entity state from the header response of the GET request or +// it should be * for unconditional update. +// - parameters - Update parameters. +// - options - UserClientUpdateOptions contains the optional parameters for the UserClient.Update method. func (client *UserClient) Update(ctx context.Context, resourceGroupName string, serviceName string, userID string, ifMatch string, parameters UserUpdateParameters, options *UserClientUpdateOptions) (UserClientUpdateResponse, error) { req, err := client.updateCreateRequest(ctx, resourceGroupName, serviceName, userID, ifMatch, parameters, options) if err != nil { @@ -571,7 +578,7 @@ func (client *UserClient) updateCreateRequest(ctx context.Context, resourceGroup return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["If-Match"] = []string{ifMatch} req.Raw().Header["Accept"] = []string{"application/json"} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_userconfirmationpassword_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/userconfirmationpassword_client.go similarity index 85% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_userconfirmationpassword_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/userconfirmationpassword_client.go index 881502e8865a..61bfb8e4de65 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_userconfirmationpassword_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/userconfirmationpassword_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 armapimanagement @@ -31,10 +32,9 @@ type UserConfirmationPasswordClient struct { } // NewUserConfirmationPasswordClient creates a new instance of UserConfirmationPasswordClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewUserConfirmationPasswordClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserConfirmationPasswordClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,13 @@ func NewUserConfirmationPasswordClient(subscriptionID string, credential azcore. // Send - Sends confirmation // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - UserConfirmationPasswordClientSendOptions contains the optional parameters for the UserConfirmationPasswordClient.Send -// method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - UserConfirmationPasswordClientSendOptions contains the optional parameters for the UserConfirmationPasswordClient.Send +// method. func (client *UserConfirmationPasswordClient) Send(ctx context.Context, resourceGroupName string, serviceName string, userID string, options *UserConfirmationPasswordClientSendOptions) (UserConfirmationPasswordClientSendResponse, error) { req, err := client.sendCreateRequest(ctx, resourceGroupName, serviceName, userID, options) if err != nil { @@ -102,7 +103,7 @@ func (client *UserConfirmationPasswordClient) sendCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") if options != nil && options.AppType != nil { reqQP.Set("appType", string(*options.AppType)) } diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_usergroup_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/usergroup_client.go similarity index 86% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_usergroup_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/usergroup_client.go index 401389b0135e..dac7c9f8ca2f 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_usergroup_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/usergroup_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 armapimanagement @@ -32,10 +33,9 @@ type UserGroupClient struct { } // NewUserGroupClient creates a new instance of UserGroupClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewUserGroupClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserGroupClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -57,12 +57,12 @@ func NewUserGroupClient(subscriptionID string, credential azcore.TokenCredential } // NewListPager - Lists all user groups. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - UserGroupClientListOptions contains the optional parameters for the UserGroupClient.List method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - UserGroupClientListOptions contains the optional parameters for the UserGroupClient.NewListPager method. func (client *UserGroupClient) NewListPager(resourceGroupName string, serviceName string, userID string, options *UserGroupClientListOptions) *runtime.Pager[UserGroupClientListResponse] { return runtime.NewPager(runtime.PagingHandler[UserGroupClientListResponse]{ More: func(page UserGroupClientListResponse) bool { @@ -124,7 +124,7 @@ func (client *UserGroupClient) listCreateRequest(ctx context.Context, resourceGr if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_useridentities_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/useridentities_client.go similarity index 86% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_useridentities_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/useridentities_client.go index 909597a5d521..ba1a3e784174 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_useridentities_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/useridentities_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 armapimanagement @@ -31,10 +32,9 @@ type UserIdentitiesClient struct { } // NewUserIdentitiesClient creates a new instance of UserIdentitiesClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewUserIdentitiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserIdentitiesClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -56,12 +56,12 @@ func NewUserIdentitiesClient(subscriptionID string, credential azcore.TokenCrede } // NewListPager - List of all user identities. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - UserIdentitiesClientListOptions contains the optional parameters for the UserIdentitiesClient.List method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - UserIdentitiesClientListOptions contains the optional parameters for the UserIdentitiesClient.NewListPager method. func (client *UserIdentitiesClient) NewListPager(resourceGroupName string, serviceName string, userID string, options *UserIdentitiesClientListOptions) *runtime.Pager[UserIdentitiesClientListResponse] { return runtime.NewPager(runtime.PagingHandler[UserIdentitiesClientListResponse]{ More: func(page UserIdentitiesClientListResponse) bool { @@ -114,7 +114,7 @@ func (client *UserIdentitiesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_usersubscription_client.go b/sdk/resourcemanager/apimanagement/armapimanagement/usersubscription_client.go similarity index 86% rename from sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_usersubscription_client.go rename to sdk/resourcemanager/apimanagement/armapimanagement/usersubscription_client.go index d5c1626f956d..d94305acac1b 100644 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_usersubscription_client.go +++ b/sdk/resourcemanager/apimanagement/armapimanagement/usersubscription_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 armapimanagement @@ -32,10 +33,9 @@ type UserSubscriptionClient struct { } // NewUserSubscriptionClient creates a new instance of UserSubscriptionClient with the specified values. -// subscriptionID - Subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms -// part of the URI for every service call. -// credential - used to authorize requests. Usually a credential from azidentity. -// options - pass nil to accept the default values. +// - subscriptionID - The ID of the target subscription. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. func NewUserSubscriptionClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserSubscriptionClient, error) { if options == nil { options = &arm.ClientOptions{} @@ -58,12 +58,13 @@ func NewUserSubscriptionClient(subscriptionID string, credential azcore.TokenCre // Get - Gets the specified Subscription entity associated with a particular user. // If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// userID - User identifier. Must be unique in the current API Management service instance. -// sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. -// options - UserSubscriptionClientGetOptions contains the optional parameters for the UserSubscriptionClient.Get method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - sid - Subscription entity Identifier. The entity represents the association between a user and a product in API Management. +// - options - UserSubscriptionClientGetOptions contains the optional parameters for the UserSubscriptionClient.Get method. func (client *UserSubscriptionClient) Get(ctx context.Context, resourceGroupName string, serviceName string, userID string, sid string, options *UserSubscriptionClientGetOptions) (UserSubscriptionClientGetResponse, error) { req, err := client.getCreateRequest(ctx, resourceGroupName, serviceName, userID, sid, options) if err != nil { @@ -107,7 +108,7 @@ func (client *UserSubscriptionClient) getCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -126,12 +127,13 @@ func (client *UserSubscriptionClient) getHandleResponse(resp *http.Response) (Us } // NewListPager - Lists the collection of subscriptions of the specified user. -// If the operation fails it returns an *azcore.ResponseError type. -// Generated from API version 2021-08-01 -// resourceGroupName - The name of the resource group. -// serviceName - The name of the API Management service. -// userID - User identifier. Must be unique in the current API Management service instance. -// options - UserSubscriptionClientListOptions contains the optional parameters for the UserSubscriptionClient.List method. +// +// Generated from API version 2022-08-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - serviceName - The name of the API Management service. +// - userID - User identifier. Must be unique in the current API Management service instance. +// - options - UserSubscriptionClientListOptions contains the optional parameters for the UserSubscriptionClient.NewListPager +// method. func (client *UserSubscriptionClient) NewListPager(resourceGroupName string, serviceName string, userID string, options *UserSubscriptionClientListOptions) *runtime.Pager[UserSubscriptionClientListResponse] { return runtime.NewPager(runtime.PagingHandler[UserSubscriptionClientListResponse]{ More: func(page UserSubscriptionClientListResponse) bool { @@ -193,7 +195,7 @@ func (client *UserSubscriptionClient) listCreateRequest(ctx context.Context, res if options != nil && options.Skip != nil { reqQP.Set("$skip", strconv.FormatInt(int64(*options.Skip), 10)) } - reqQP.Set("api-version", "2021-08-01") + reqQP.Set("api-version", "2022-08-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_api_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_api_client_test.go deleted file mode 100644 index 0942a5d2e3fc..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_api_client_test.go +++ /dev/null @@ -1,224 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApis.json -func ExampleAPIClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.APIClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - Tags: nil, - ExpandAPIVersionSet: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApi.json -func ExampleAPIClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiContract.json -func ExampleAPIClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApi.json -func ExampleAPIClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "apimService1", - "tempgroup", - armapimanagement.APICreateOrUpdateParameter{ - Properties: &armapimanagement.APICreateOrUpdateProperties{ - Description: to.Ptr("apidescription5200"), - AuthenticationSettings: &armapimanagement.AuthenticationSettingsContract{ - OAuth2: &armapimanagement.OAuth2AuthenticationSettingsContract{ - AuthorizationServerID: to.Ptr("authorizationServerId2283"), - Scope: to.Ptr("oauth2scope2580"), - }, - }, - SubscriptionKeyParameterNames: &armapimanagement.SubscriptionKeyParameterNamesContract{ - Header: to.Ptr("header4520"), - Query: to.Ptr("query3037"), - }, - Path: to.Ptr("newapiPath"), - DisplayName: to.Ptr("apiname1463"), - Protocols: []*armapimanagement.Protocol{ - to.Ptr(armapimanagement.ProtocolHTTPS), - to.Ptr(armapimanagement.ProtocolHTTP)}, - ServiceURL: to.Ptr("http://newechoapi.cloudapp.net/api"), - }, - }, - &armapimanagement.APIClientBeginCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApi.json -func ExampleAPIClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "echo-api", - "*", - armapimanagement.APIUpdateContract{ - Properties: &armapimanagement.APIContractUpdateProperties{ - Path: to.Ptr("newecho"), - DisplayName: to.Ptr("Echo API New"), - ServiceURL: to.Ptr("http://echoapi.cloudapp.net/api2"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApi.json -func ExampleAPIClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "echo-api", - "*", - &armapimanagement.APIClientDeleteOptions{DeleteRevisions: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApisByTags.json -func ExampleAPIClient_NewListByTagsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTagsPager("rg1", - "apimService1", - &armapimanagement.APIClientListByTagsOptions{Filter: nil, - Top: nil, - Skip: nil, - IncludeNotTaggedApis: 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/apimanagement/armapimanagement/ze_generated_example_apidiagnostic_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apidiagnostic_client_test.go deleted file mode 100644 index 52e7c5e3a80f..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apidiagnostic_client_test.go +++ /dev/null @@ -1,250 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiDiagnostics.json -func ExampleAPIDiagnosticClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIDiagnosticClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - "echo-api", - &armapimanagement.APIDiagnosticClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiDiagnostic.json -func ExampleAPIDiagnosticClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIDiagnosticClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "applicationinsights", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiDiagnostic.json -func ExampleAPIDiagnosticClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIDiagnosticClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "applicationinsights", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiDiagnostic.json -func ExampleAPIDiagnosticClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIDiagnosticClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "applicationinsights", - armapimanagement.DiagnosticContract{ - Properties: &armapimanagement.DiagnosticContractProperties{ - AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors), - Backend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - Frontend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - LoggerID: to.Ptr("/loggers/applicationinsights"), - Sampling: &armapimanagement.SamplingSettings{ - Percentage: to.Ptr[float64](50), - SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed), - }, - }, - }, - &armapimanagement.APIDiagnosticClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiDiagnostic.json -func ExampleAPIDiagnosticClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIDiagnosticClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "echo-api", - "applicationinsights", - "*", - armapimanagement.DiagnosticContract{ - Properties: &armapimanagement.DiagnosticContractProperties{ - AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors), - Backend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - Frontend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - LoggerID: to.Ptr("/loggers/applicationinsights"), - Sampling: &armapimanagement.SamplingSettings{ - Percentage: to.Ptr[float64](50), - SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed), - }, - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiDiagnostic.json -func ExampleAPIDiagnosticClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIDiagnosticClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "applicationinsights", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiexport_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiexport_client_test.go deleted file mode 100644 index 9edc19e759f8..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiexport_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 armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiExportInOpenApi2dot0.json -func ExampleAPIExportClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIExportClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "echo-api", - armapimanagement.ExportFormatSwagger, - armapimanagement.ExportAPITrue, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissue_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissue_client_test.go deleted file mode 100644 index 067c2bd13d27..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissue_client_test.go +++ /dev/null @@ -1,183 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssues.json -func ExampleAPIIssueClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - &armapimanagement.APIIssueClientListByServiceOptions{Filter: nil, - ExpandCommentsAttachments: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssue.json -func ExampleAPIIssueClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - "57d2ef278aa04f0ad01d6cdc", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssue.json -func ExampleAPIIssueClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - "57d2ef278aa04f0ad01d6cdc", - &armapimanagement.APIIssueClientGetOptions{ExpandCommentsAttachments: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssue.json -func ExampleAPIIssueClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "57d2ef278aa04f0ad01d6cdc", - armapimanagement.IssueContract{ - Properties: &armapimanagement.IssueContractProperties{ - CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t }()), - State: to.Ptr(armapimanagement.StateOpen), - Description: to.Ptr("New API issue description"), - Title: to.Ptr("New API issue"), - UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"), - }, - }, - &armapimanagement.APIIssueClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiIssue.json -func ExampleAPIIssueClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "57d2ef278aa04f0ad01d6cdc", - "*", - armapimanagement.IssueUpdateContract{ - Properties: &armapimanagement.IssueUpdateContractProperties{ - State: to.Ptr(armapimanagement.StateClosed), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssue.json -func ExampleAPIIssueClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "57d2ef278aa04f0ad01d6cdc", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissueattachment_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissueattachment_client_test.go deleted file mode 100644 index 2ecc01bf9b90..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissueattachment_client_test.go +++ /dev/null @@ -1,153 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssueAttachments.json -func ExampleAPIIssueAttachmentClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueAttachmentClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "57d2ef278aa04f0ad01d6cdc", - &armapimanagement.APIIssueAttachmentClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssueAttachment.json -func ExampleAPIIssueAttachmentClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueAttachmentClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - "57d2ef278aa04f0ad01d6cdc", - "57d2ef278aa04f0888cba3f3", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssueAttachment.json -func ExampleAPIIssueAttachmentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueAttachmentClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - "57d2ef278aa04f0ad01d6cdc", - "57d2ef278aa04f0888cba3f3", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssueAttachment.json -func ExampleAPIIssueAttachmentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueAttachmentClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "57d2ef278aa04f0ad01d6cdc", - "57d2ef278aa04f0888cba3f3", - armapimanagement.IssueAttachmentContract{ - Properties: &armapimanagement.IssueAttachmentContractProperties{ - Content: to.Ptr("IEJhc2U2NA=="), - ContentFormat: to.Ptr("image/jpeg"), - Title: to.Ptr("Issue attachment."), - }, - }, - &armapimanagement.APIIssueAttachmentClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssueAttachment.json -func ExampleAPIIssueAttachmentClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueAttachmentClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "57d2ef278aa04f0ad01d6cdc", - "57d2ef278aa04f0888cba3f3", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissuecomment_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissuecomment_client_test.go deleted file mode 100644 index 445717a4c4c8..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiissuecomment_client_test.go +++ /dev/null @@ -1,155 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiIssueComments.json -func ExampleAPIIssueCommentClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueCommentClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "57d2ef278aa04f0ad01d6cdc", - &armapimanagement.APIIssueCommentClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiIssueComment.json -func ExampleAPIIssueCommentClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueCommentClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - "57d2ef278aa04f0ad01d6cdc", - "599e29ab193c3c0bd0b3e2fb", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiIssueComment.json -func ExampleAPIIssueCommentClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueCommentClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - "57d2ef278aa04f0ad01d6cdc", - "599e29ab193c3c0bd0b3e2fb", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiIssueComment.json -func ExampleAPIIssueCommentClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueCommentClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "57d2ef278aa04f0ad01d6cdc", - "599e29ab193c3c0bd0b3e2fb", - armapimanagement.IssueCommentContract{ - Properties: &armapimanagement.IssueCommentContractProperties{ - CreatedDate: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-02-01T22:21:20.467Z"); return t }()), - Text: to.Ptr("Issue comment."), - UserID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/1"), - }, - }, - &armapimanagement.APIIssueCommentClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiIssueComment.json -func ExampleAPIIssueCommentClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIIssueCommentClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "57d2ef278aa04f0ad01d6cdc", - "599e29ab193c3c0bd0b3e2fb", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementclient_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementclient_client_test.go deleted file mode 100644 index 69252dd58a16..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementclient_client_test.go +++ /dev/null @@ -1,67 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPerformConnectivityCheckHttpConnect.json -func ExampleClient_BeginPerformConnectivityCheckAsync() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPerformConnectivityCheckAsync(ctx, - "rg1", - "apimService1", - armapimanagement.ConnectivityCheckRequest{ - Destination: &armapimanagement.ConnectivityCheckRequestDestination{ - Address: to.Ptr("https://microsoft.com"), - Port: to.Ptr[int64](3306), - }, - ProtocolConfiguration: &armapimanagement.ConnectivityCheckRequestProtocolConfiguration{ - HTTPConfiguration: &armapimanagement.ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration{ - Method: to.Ptr(armapimanagement.MethodGET), - Headers: []*armapimanagement.HTTPHeader{ - { - Name: to.Ptr("Authorization"), - Value: to.Ptr("Bearer myPreciousToken"), - }}, - ValidStatusCodes: []*int64{ - to.Ptr[int64](200), - to.Ptr[int64](204)}, - }, - }, - Source: &armapimanagement.ConnectivityCheckRequestSource{ - Region: to.Ptr("northeurope"), - }, - Protocol: to.Ptr(armapimanagement.ConnectivityCheckProtocolHTTPS), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementoperations_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementoperations_client_test.go deleted file mode 100644 index b95c42f2b9ef..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementoperations_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 armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListOperations.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 := armapimanagement.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/apimanagement/armapimanagement/ze_generated_example_apimanagementservice_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementservice_client_test.go deleted file mode 100644 index e2dcf106da14..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementservice_client_test.go +++ /dev/null @@ -1,381 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRestoreWithAccessKey.json -func ExampleServiceClient_BeginRestore() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRestore(ctx, - "rg1", - "apimService1", - armapimanagement.ServiceBackupRestoreParameters{ - AccessKey: to.Ptr("**************************************************"), - AccessType: to.Ptr(armapimanagement.AccessTypeAccessKey), - BackupName: to.Ptr("apimService1backup_2017_03_19"), - ContainerName: to.Ptr("backupContainer"), - StorageAccount: to.Ptr("teststorageaccount"), - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackupWithAccessKey.json -func ExampleServiceClient_BeginBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginBackup(ctx, - "rg1", - "apimService1", - armapimanagement.ServiceBackupRestoreParameters{ - AccessKey: to.Ptr("**************************************************"), - AccessType: to.Ptr(armapimanagement.AccessTypeAccessKey), - BackupName: to.Ptr("apimService1backup_2017_03_19"), - ContainerName: to.Ptr("backupContainer"), - StorageAccount: to.Ptr("teststorageaccount"), - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateMultiRegionServiceWithCustomHostname.json -func ExampleServiceClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "apimService1", - armapimanagement.ServiceResource{ - Tags: map[string]*string{ - "tag1": to.Ptr("value1"), - "tag2": to.Ptr("value2"), - "tag3": to.Ptr("value3"), - }, - Location: to.Ptr("West US"), - Properties: &armapimanagement.ServiceProperties{ - AdditionalLocations: []*armapimanagement.AdditionalLocation{ - { - DisableGateway: to.Ptr(true), - Location: to.Ptr("East US"), - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypePremium), - Capacity: to.Ptr[int32](1), - }, - }}, - APIVersionConstraint: &armapimanagement.APIVersionConstraint{ - MinAPIVersion: to.Ptr("2019-01-01"), - }, - HostnameConfigurations: []*armapimanagement.HostnameConfiguration{ - { - Type: to.Ptr(armapimanagement.HostnameTypeProxy), - CertificatePassword: to.Ptr("Password"), - DefaultSSLBinding: to.Ptr(true), - EncodedCertificate: to.Ptr("****** Base 64 Encoded Certificate ************"), - HostName: to.Ptr("gateway1.msitesting.net"), - }, - { - Type: to.Ptr(armapimanagement.HostnameTypeManagement), - CertificatePassword: to.Ptr("Password"), - EncodedCertificate: to.Ptr("****** Base 64 Encoded Certificate ************"), - HostName: to.Ptr("mgmt.msitesting.net"), - }, - { - Type: to.Ptr(armapimanagement.HostnameTypePortal), - CertificatePassword: to.Ptr("Password"), - EncodedCertificate: to.Ptr("****** Base 64 Encoded Certificate ************"), - HostName: to.Ptr("portal1.msitesting.net"), - }}, - VirtualNetworkType: to.Ptr(armapimanagement.VirtualNetworkTypeNone), - PublisherEmail: to.Ptr("apim@autorestsdk.com"), - PublisherName: to.Ptr("autorestsdk"), - }, - SKU: &armapimanagement.ServiceSKUProperties{ - Name: to.Ptr(armapimanagement.SKUTypePremium), - Capacity: to.Ptr[int32](1), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateServiceDisableTls10.json -func ExampleServiceClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "rg1", - "apimService1", - armapimanagement.ServiceUpdateParameters{ - Properties: &armapimanagement.ServiceUpdateProperties{ - CustomProperties: map[string]*string{ - "Microsoft.WindowsAzure.ApiManagement.Gateway.Security.Protocols.Tls10": to.Ptr("false"), - }, - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetMultiRegionInternalVnet.json -func ExampleServiceClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceDeleteService.json -func ExampleServiceClient_BeginDelete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListServiceBySubscriptionAndResourceGroup.json -func ExampleServiceClient_NewListByResourceGroupPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByResourceGroupPager("rg1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListServiceBySubscription.json -func ExampleServiceClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager(nil) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetSsoToken.json -func ExampleServiceClient_GetSsoToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSsoToken(ctx, - "rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceCheckNameAvailability.json -func ExampleServiceClient_CheckNameAvailability() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CheckNameAvailability(ctx, - armapimanagement.ServiceCheckNameAvailabilityParameters{ - Name: to.Ptr("apimService1"), - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetDomainOwnershipIdentifier.json -func ExampleServiceClient_GetDomainOwnershipIdentifier() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetDomainOwnershipIdentifier(ctx, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementApplyNetworkConfigurationUpdates.json -func ExampleServiceClient_BeginApplyNetworkConfigurationUpdates() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewServiceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginApplyNetworkConfigurationUpdates(ctx, - "rg1", - "apimService1", - &armapimanagement.ServiceClientBeginApplyNetworkConfigurationUpdatesOptions{Parameters: &armapimanagement.ServiceApplyNetworkConfigurationParameters{ - Location: to.Ptr("west us"), - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementserviceskus_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementserviceskus_client_test.go deleted file mode 100644 index b6b01f19fd74..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementserviceskus_client_test.go +++ /dev/null @@ -1,9 +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 armapimanagement_test diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementskus_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementskus_client_test.go deleted file mode 100644 index 5f1cee288323..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apimanagementskus_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 armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSku.json -func ExampleSKUsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSKUsClient("subid", 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/apimanagement/armapimanagement/ze_generated_example_apioperation_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperation_client_test.go deleted file mode 100644 index 0975a532ad4d..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperation_client_test.go +++ /dev/null @@ -1,202 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperation.json -func ExampleAPIOperationClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - "57d2ef278aa04f0ad01d6cdc", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperation.json -func ExampleAPIOperationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - "57d2ef278aa04f0ad01d6cdc", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperation.json -func ExampleAPIOperationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "PetStoreTemplate2", - "newoperations", - armapimanagement.OperationContract{ - Properties: &armapimanagement.OperationContractProperties{ - Description: to.Ptr("This can only be done by the logged in user."), - TemplateParameters: []*armapimanagement.ParameterContract{}, - Request: &armapimanagement.RequestContract{ - Description: to.Ptr("Created user object"), - Headers: []*armapimanagement.ParameterContract{}, - QueryParameters: []*armapimanagement.ParameterContract{}, - Representations: []*armapimanagement.RepresentationContract{ - { - ContentType: to.Ptr("application/json"), - SchemaID: to.Ptr("592f6c1d0af5840ca8897f0c"), - TypeName: to.Ptr("User"), - }}, - }, - Responses: []*armapimanagement.ResponseContract{ - { - Description: to.Ptr("successful operation"), - Headers: []*armapimanagement.ParameterContract{}, - Representations: []*armapimanagement.RepresentationContract{ - { - ContentType: to.Ptr("application/xml"), - }, - { - ContentType: to.Ptr("application/json"), - }}, - StatusCode: to.Ptr[int32](200), - }}, - Method: to.Ptr("POST"), - DisplayName: to.Ptr("createUser2"), - URLTemplate: to.Ptr("/user1"), - }, - }, - &armapimanagement.APIOperationClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiOperation.json -func ExampleAPIOperationClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "echo-api", - "operationId", - "*", - armapimanagement.OperationUpdateContract{ - Properties: &armapimanagement.OperationUpdateContractProperties{ - TemplateParameters: []*armapimanagement.ParameterContract{}, - Request: &armapimanagement.RequestContract{ - QueryParameters: []*armapimanagement.ParameterContract{ - { - Name: to.Ptr("param1"), - Type: to.Ptr("string"), - Description: to.Ptr("A sample parameter that is required and has a default value of \"sample\"."), - DefaultValue: to.Ptr("sample"), - Required: to.Ptr(true), - Values: []*string{ - to.Ptr("sample")}, - }}, - }, - Responses: []*armapimanagement.ResponseContract{ - { - Description: to.Ptr("Returned in all cases."), - Headers: []*armapimanagement.ParameterContract{}, - Representations: []*armapimanagement.RepresentationContract{}, - StatusCode: to.Ptr[int32](200), - }, - { - Description: to.Ptr("Server Error."), - Headers: []*armapimanagement.ParameterContract{}, - Representations: []*armapimanagement.RepresentationContract{}, - StatusCode: to.Ptr[int32](500), - }}, - Method: to.Ptr("GET"), - DisplayName: to.Ptr("Retrieve resource"), - URLTemplate: to.Ptr("/resource"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperation.json -func ExampleAPIOperationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - "57d2ef278aa04f0ad01d6cdc", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperationpolicy_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperationpolicy_client_test.go deleted file mode 100644 index 6a9e4a7ea2cd..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apioperationpolicy_client_test.go +++ /dev/null @@ -1,145 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationPolicies.json -func ExampleAPIOperationPolicyClient_ListByOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByOperation(ctx, - "rg1", - "apimService1", - "599e2953193c3c0bd0b3e2fa", - "599e29ab193c3c0bd0b3e2fb", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperationPolicy.json -func ExampleAPIOperationPolicyClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "5600b539c53f5b0062040001", - "5600b53ac53f5b0062080006", - armapimanagement.PolicyIDNamePolicy, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationPolicy.json -func ExampleAPIOperationPolicyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "5600b539c53f5b0062040001", - "5600b53ac53f5b0062080006", - armapimanagement.PolicyIDNamePolicy, - &armapimanagement.APIOperationPolicyClientGetOptions{Format: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperationPolicy.json -func ExampleAPIOperationPolicyClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "5600b57e7e8880006a040001", - "5600b57e7e8880006a080001", - armapimanagement.PolicyIDNamePolicy, - armapimanagement.PolicyContract{ - Properties: &armapimanagement.PolicyContractProperties{ - Format: to.Ptr(armapimanagement.PolicyContentFormatXML), - Value: to.Ptr(" "), - }, - }, - &armapimanagement.APIOperationPolicyClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")}) - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperationPolicy.json -func ExampleAPIOperationPolicyClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIOperationPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "testapi", - "testoperation", - armapimanagement.PolicyIDNamePolicy, - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apipolicy_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apipolicy_client_test.go deleted file mode 100644 index 5ec17d0b4e8c..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apipolicy_client_test.go +++ /dev/null @@ -1,117 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiPolicy.json -func ExampleAPIPolicyClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - armapimanagement.PolicyIDNamePolicy, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiPolicy.json -func ExampleAPIPolicyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "5600b59475ff190048040001", - armapimanagement.PolicyIDNamePolicy, - &armapimanagement.APIPolicyClientGetOptions{Format: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiPolicy.json -func ExampleAPIPolicyClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "5600b57e7e8880006a040001", - armapimanagement.PolicyIDNamePolicy, - armapimanagement.PolicyContract{ - Properties: &armapimanagement.PolicyContractProperties{ - Format: to.Ptr(armapimanagement.PolicyContentFormatXML), - Value: to.Ptr(" "), - }, - }, - &armapimanagement.APIPolicyClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")}) - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiPolicy.json -func ExampleAPIPolicyClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "loggerId", - armapimanagement.PolicyIDNamePolicy, - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiproduct_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiproduct_client_test.go deleted file mode 100644 index d5d0529077ca..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiproduct_client_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiProducts.json -func ExampleAPIProductClient_NewListByApisPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIProductClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByApisPager("rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - &armapimanagement.APIProductClientListByApisOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirelease_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirelease_client_test.go deleted file mode 100644 index da72cc00d6ee..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirelease_client_test.go +++ /dev/null @@ -1,178 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiReleases.json -func ExampleAPIReleaseClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIReleaseClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - "a1", - &armapimanagement.APIReleaseClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiRelease.json -func ExampleAPIReleaseClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIReleaseClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "a1", - "5a7cb545298324c53224a799", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiRelease.json -func ExampleAPIReleaseClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIReleaseClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "a1", - "5a7cb545298324c53224a799", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiRelease.json -func ExampleAPIReleaseClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIReleaseClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "a1", - "testrev", - armapimanagement.APIReleaseContract{ - Properties: &armapimanagement.APIReleaseContractProperties{ - APIID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1"), - Notes: to.Ptr("yahooagain"), - }, - }, - &armapimanagement.APIReleaseClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiRelease.json -func ExampleAPIReleaseClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIReleaseClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "a1", - "testrev", - "*", - armapimanagement.APIReleaseContract{ - Properties: &armapimanagement.APIReleaseContractProperties{ - APIID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/apis/a1"), - Notes: to.Ptr("yahooagain"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiRelease.json -func ExampleAPIReleaseClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIReleaseClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "5a5fcc09124a7fa9b89f2f1d", - "testrev", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirevision_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirevision_client_test.go deleted file mode 100644 index 88865e39a592..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apirevision_client_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiRevisions.json -func ExampleAPIRevisionClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIRevisionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - &armapimanagement.APIRevisionClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apischema_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apischema_client_test.go deleted file mode 100644 index 3479625c8383..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apischema_client_test.go +++ /dev/null @@ -1,123 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiSchema.json -func ExampleAPISchemaClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPISchemaClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "57d1f7558aa04f15146d9d8a", - "ec12520d-9d48-4e7b-8f39-698ca2ac63f1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiSchema.json -func ExampleAPISchemaClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPISchemaClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "59d6bb8f1f7fab13dc67ec9b", - "ec12520d-9d48-4e7b-8f39-698ca2ac63f1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiSchema.json -func ExampleAPISchemaClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPISchemaClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "apimService1", - "59d6bb8f1f7fab13dc67ec9b", - "ec12520d-9d48-4e7b-8f39-698ca2ac63f1", - armapimanagement.SchemaContract{ - Properties: &armapimanagement.SchemaContractProperties{ - ContentType: to.Ptr("application/vnd.ms-azure-apim.xsd+xml"), - Document: &armapimanagement.SchemaDocumentProperties{ - Value: to.Ptr("\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"), - }, - }, - }, - &armapimanagement.APISchemaClientBeginCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiSchema.json -func ExampleAPISchemaClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPISchemaClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "59d5b28d1f7fab116c282650", - "59d5b28e1f7fab116402044e", - "*", - &armapimanagement.APISchemaClientDeleteOptions{Force: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apitagdescription_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apitagdescription_client_test.go deleted file mode 100644 index 6721114f8484..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apitagdescription_client_test.go +++ /dev/null @@ -1,148 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiTagDescriptions.json -func ExampleAPITagDescriptionClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPITagDescriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - &armapimanagement.APITagDescriptionClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiTagDescription.json -func ExampleAPITagDescriptionClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPITagDescriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "59d6bb8f1f7fab13dc67ec9b", - "59306a29e4bbd510dc24e5f9", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiTagDescription.json -func ExampleAPITagDescriptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPITagDescriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "59d6bb8f1f7fab13dc67ec9b", - "59306a29e4bbd510dc24e5f9", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiTagDescription.json -func ExampleAPITagDescriptionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPITagDescriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "5931a75ae4bbd512a88c680b", - "tagId1", - armapimanagement.TagDescriptionCreateParameters{ - Properties: &armapimanagement.TagDescriptionBaseProperties{ - Description: to.Ptr("Some description that will be displayed for operation's tag if the tag is assigned to operation of the API"), - ExternalDocsDescription: to.Ptr("Description of the external docs resource"), - ExternalDocsURL: to.Ptr("http://some.url/additionaldoc"), - }, - }, - &armapimanagement.APITagDescriptionClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiTagDescription.json -func ExampleAPITagDescriptionClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPITagDescriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "59d5b28d1f7fab116c282650", - "59d5b28e1f7fab116402044e", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiversionset_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiversionset_client_test.go deleted file mode 100644 index 6c5864d533a9..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_apiversionset_client_test.go +++ /dev/null @@ -1,174 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiVersionSets.json -func ExampleAPIVersionSetClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIVersionSetClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.APIVersionSetClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiVersionSet.json -func ExampleAPIVersionSetClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIVersionSetClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "vs1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiVersionSet.json -func ExampleAPIVersionSetClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIVersionSetClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "vs1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiVersionSet.json -func ExampleAPIVersionSetClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIVersionSetClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "api1", - armapimanagement.APIVersionSetContract{ - Properties: &armapimanagement.APIVersionSetContractProperties{ - Description: to.Ptr("Version configuration"), - DisplayName: to.Ptr("api set 1"), - VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeSegment), - }, - }, - &armapimanagement.APIVersionSetClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateApiVersionSet.json -func ExampleAPIVersionSetClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIVersionSetClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "vs1", - "*", - armapimanagement.APIVersionSetUpdateParameters{ - Properties: &armapimanagement.APIVersionSetUpdateParametersProperties{ - Description: to.Ptr("Version configuration"), - DisplayName: to.Ptr("api set 1"), - VersioningScheme: to.Ptr(armapimanagement.VersioningSchemeSegment), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiVersionSet.json -func ExampleAPIVersionSetClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAPIVersionSetClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "a1", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_authorizationserver_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_authorizationserver_client_test.go deleted file mode 100644 index c85ff31d6cca..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_authorizationserver_client_test.go +++ /dev/null @@ -1,211 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListAuthorizationServers.json -func ExampleAuthorizationServerClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.AuthorizationServerClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadAuthorizationServer.json -func ExampleAuthorizationServerClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "newauthServer2", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetAuthorizationServer.json -func ExampleAuthorizationServerClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "newauthServer2", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateAuthorizationServer.json -func ExampleAuthorizationServerClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "newauthServer", - armapimanagement.AuthorizationServerContract{ - Properties: &armapimanagement.AuthorizationServerContractProperties{ - Description: to.Ptr("test server"), - AuthorizationMethods: []*armapimanagement.AuthorizationMethod{ - to.Ptr(armapimanagement.AuthorizationMethodGET)}, - BearerTokenSendingMethods: []*armapimanagement.BearerTokenSendingMethod{ - to.Ptr(armapimanagement.BearerTokenSendingMethodAuthorizationHeader)}, - DefaultScope: to.Ptr("read write"), - ResourceOwnerPassword: to.Ptr("pwd"), - ResourceOwnerUsername: to.Ptr("un"), - SupportState: to.Ptr(true), - TokenEndpoint: to.Ptr("https://www.contoso.com/oauth2/token"), - AuthorizationEndpoint: to.Ptr("https://www.contoso.com/oauth2/auth"), - ClientID: to.Ptr("1"), - ClientRegistrationEndpoint: to.Ptr("https://www.contoso.com/apps"), - ClientSecret: to.Ptr("2"), - DisplayName: to.Ptr("test2"), - GrantTypes: []*armapimanagement.GrantType{ - to.Ptr(armapimanagement.GrantTypeAuthorizationCode), - to.Ptr(armapimanagement.GrantTypeImplicit)}, - }, - }, - &armapimanagement.AuthorizationServerClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateAuthorizationServer.json -func ExampleAuthorizationServerClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "newauthServer", - "*", - armapimanagement.AuthorizationServerUpdateContract{ - Properties: &armapimanagement.AuthorizationServerUpdateContractProperties{ - ClientID: to.Ptr("update"), - ClientSecret: to.Ptr("updated"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteAuthorizationServer.json -func ExampleAuthorizationServerClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "newauthServer2", - "*", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementAuthorizationServerListSecrets.json -func ExampleAuthorizationServerClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewAuthorizationServerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, - "rg1", - "apimService1", - "newauthServer2", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_backend_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_backend_client_test.go deleted file mode 100644 index 98a74c857eea..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_backend_client_test.go +++ /dev/null @@ -1,228 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListBackends.json -func ExampleBackendClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.BackendClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadBackend.json -func ExampleBackendClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "sfbackend", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetBackend.json -func ExampleBackendClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "sfbackend", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateBackendProxyBackend.json -func ExampleBackendClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "proxybackend", - armapimanagement.BackendContract{ - Properties: &armapimanagement.BackendContractProperties{ - Description: to.Ptr("description5308"), - Credentials: &armapimanagement.BackendCredentialsContract{ - Authorization: &armapimanagement.BackendAuthorizationHeaderCredentials{ - Parameter: to.Ptr("opensesma"), - Scheme: to.Ptr("Basic"), - }, - Header: map[string][]*string{ - "x-my-1": { - to.Ptr("val1"), - to.Ptr("val2")}, - }, - Query: map[string][]*string{ - "sv": { - to.Ptr("xx"), - to.Ptr("bb"), - to.Ptr("cc")}, - }, - }, - Proxy: &armapimanagement.BackendProxyContract{ - Password: to.Ptr(""), - URL: to.Ptr("http://192.168.1.1:8080"), - Username: to.Ptr("Contoso\\admin"), - }, - TLS: &armapimanagement.BackendTLSProperties{ - ValidateCertificateChain: to.Ptr(true), - ValidateCertificateName: to.Ptr(true), - }, - URL: to.Ptr("https://backendname2644/"), - Protocol: to.Ptr(armapimanagement.BackendProtocolHTTP), - }, - }, - &armapimanagement.BackendClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateBackend.json -func ExampleBackendClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "proxybackend", - "*", - armapimanagement.BackendUpdateParameters{ - Properties: &armapimanagement.BackendUpdateParameterProperties{ - Description: to.Ptr("description5308"), - TLS: &armapimanagement.BackendTLSProperties{ - ValidateCertificateChain: to.Ptr(false), - ValidateCertificateName: to.Ptr(true), - }, - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteBackend.json -func ExampleBackendClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "sfbackend", - "*", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementBackendReconnect.json -func ExampleBackendClient_Reconnect() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewBackendClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Reconnect(ctx, - "rg1", - "apimService1", - "proxybackend", - &armapimanagement.BackendClientReconnectOptions{Parameters: &armapimanagement.BackendReconnectContract{ - Properties: &armapimanagement.BackendReconnectProperties{ - After: to.Ptr("PT3S"), - }, - }, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_cache_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_cache_client_test.go deleted file mode 100644 index 0bb249bf5d16..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_cache_client_test.go +++ /dev/null @@ -1,172 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListCaches.json -func ExampleCacheClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCacheClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.CacheClientListByServiceOptions{Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadCache.json -func ExampleCacheClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCacheClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "default", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCache.json -func ExampleCacheClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCacheClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "c1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCache.json -func ExampleCacheClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCacheClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "c1", - armapimanagement.CacheContract{ - Properties: &armapimanagement.CacheContractProperties{ - Description: to.Ptr("Redis cache instances in West India"), - ConnectionString: to.Ptr("apim.redis.cache.windows.net:6380,password=xc,ssl=True,abortConnect=False"), - ResourceID: to.Ptr("https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.Cache/redis/apimservice1"), - UseFromLocation: to.Ptr("default"), - }, - }, - &armapimanagement.CacheClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateCache.json -func ExampleCacheClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCacheClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "c1", - "*", - armapimanagement.CacheUpdateParameters{ - Properties: &armapimanagement.CacheUpdateProperties{ - UseFromLocation: to.Ptr("westindia"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteCache.json -func ExampleCacheClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCacheClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "southindia", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_certificate_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_certificate_client_test.go deleted file mode 100644 index 2e22133e10d5..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_certificate_client_test.go +++ /dev/null @@ -1,166 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListCertificates.json -func ExampleCertificateClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCertificateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.CertificateClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - IsKeyVaultRefreshFailed: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadCertificate.json -func ExampleCertificateClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCertificateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "templateCert1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetCertificate.json -func ExampleCertificateClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCertificateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "templateCert1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateCertificate.json -func ExampleCertificateClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCertificateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "tempcert", - armapimanagement.CertificateCreateOrUpdateParameters{ - Properties: &armapimanagement.CertificateCreateOrUpdateProperties{ - Data: to.Ptr("****************Base 64 Encoded Certificate *******************************"), - Password: to.Ptr("****Certificate Password******"), - }, - }, - &armapimanagement.CertificateClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteCertificate.json -func ExampleCertificateClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCertificateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "tempcert", - "*", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRefreshCertificate.json -func ExampleCertificateClient_RefreshSecret() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewCertificateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.RefreshSecret(ctx, - "rg1", - "apimService1", - "templateCertkv", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contentitem_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contentitem_client_test.go deleted file mode 100644 index 4d9b700e4839..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contentitem_client_test.go +++ /dev/null @@ -1,137 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListContentTypeContentItems.json -func ExampleContentItemClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentItemClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - "page", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadContentTypeContentItem.json -func ExampleContentItemClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentItemClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "page", - "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetContentTypeContentItem.json -func ExampleContentItemClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentItemClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "page", - "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateContentTypeContentItem.json -func ExampleContentItemClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentItemClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "page", - "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", - &armapimanagement.ContentItemClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteContentTypeContentItem.json -func ExampleContentItemClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentItemClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "page", - "4e3cf6a5-574a-ba08-1f23-2e7a38faa6d8", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contenttype_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contenttype_client_test.go deleted file mode 100644 index 2aa52fa4c015..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_contenttype_client_test.go +++ /dev/null @@ -1,111 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListContentTypes.json -func ExampleContentTypeClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentTypeClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetContentType.json -func ExampleContentTypeClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentTypeClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "page", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateContentType.json -func ExampleContentTypeClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentTypeClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "page", - &armapimanagement.ContentTypeClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteContentType.json -func ExampleContentTypeClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewContentTypeClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "page", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_delegationsettings_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_delegationsettings_client_test.go deleted file mode 100644 index a8be7456798e..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_delegationsettings_client_test.go +++ /dev/null @@ -1,149 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadDelegationSettings.json -func ExampleDelegationSettingsClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDelegationSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetDelegation.json -func ExampleDelegationSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDelegationSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateDelegation.json -func ExampleDelegationSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDelegationSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "rg1", - "apimService1", - "*", - armapimanagement.PortalDelegationSettings{ - Properties: &armapimanagement.PortalDelegationSettingsProperties{ - Subscriptions: &armapimanagement.SubscriptionsDelegationSettingsProperties{ - Enabled: to.Ptr(true), - }, - URL: to.Ptr("http://contoso.com/delegation"), - UserRegistration: &armapimanagement.RegistrationDelegationSettingsProperties{ - Enabled: to.Ptr(true), - }, - ValidationKey: to.Ptr(""), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutDelegation.json -func ExampleDelegationSettingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDelegationSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - armapimanagement.PortalDelegationSettings{ - Properties: &armapimanagement.PortalDelegationSettingsProperties{ - Subscriptions: &armapimanagement.SubscriptionsDelegationSettingsProperties{ - Enabled: to.Ptr(true), - }, - URL: to.Ptr("http://contoso.com/delegation"), - UserRegistration: &armapimanagement.RegistrationDelegationSettingsProperties{ - Enabled: to.Ptr(true), - }, - ValidationKey: to.Ptr(""), - }, - }, - &armapimanagement.DelegationSettingsClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")}) - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSecretsPortalSettingsValidationKey.json -func ExampleDelegationSettingsClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDelegationSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, - "rg1", - "apimService1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_deletedservices_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_deletedservices_client_test.go deleted file mode 100644 index 8fee99eea523..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_deletedservices_client_test.go +++ /dev/null @@ -1,87 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletedServicesListBySubscription.json -func ExampleDeletedServicesClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDeletedServicesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager(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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetDeletedServiceByName.json -func ExampleDeletedServicesClient_GetByName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDeletedServicesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByName(ctx, - "apimService3", - "westus", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletedServicesPurge.json -func ExampleDeletedServicesClient_BeginPurge() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDeletedServicesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginPurge(ctx, - "apimService3", - "westus", - 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/apimanagement/armapimanagement/ze_generated_example_diagnostic_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_diagnostic_client_test.go deleted file mode 100644 index 1e3572c399da..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_diagnostic_client_test.go +++ /dev/null @@ -1,244 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListDiagnostics.json -func ExampleDiagnosticClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDiagnosticClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.DiagnosticClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadDiagnostic.json -func ExampleDiagnosticClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDiagnosticClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "applicationinsights", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetDiagnostic.json -func ExampleDiagnosticClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDiagnosticClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "applicationinsights", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateDiagnostic.json -func ExampleDiagnosticClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDiagnosticClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "applicationinsights", - armapimanagement.DiagnosticContract{ - Properties: &armapimanagement.DiagnosticContractProperties{ - AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors), - Backend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - Frontend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - LoggerID: to.Ptr("/loggers/azuremonitor"), - Sampling: &armapimanagement.SamplingSettings{ - Percentage: to.Ptr[float64](50), - SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed), - }, - }, - }, - &armapimanagement.DiagnosticClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateDiagnostic.json -func ExampleDiagnosticClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDiagnosticClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "applicationinsights", - "*", - armapimanagement.DiagnosticContract{ - Properties: &armapimanagement.DiagnosticContractProperties{ - AlwaysLog: to.Ptr(armapimanagement.AlwaysLogAllErrors), - Backend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - Frontend: &armapimanagement.PipelineDiagnosticSettings{ - Response: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - Request: &armapimanagement.HTTPMessageDiagnostic{ - Body: &armapimanagement.BodyDiagnosticSettings{ - Bytes: to.Ptr[int32](512), - }, - Headers: []*string{ - to.Ptr("Content-type")}, - }, - }, - LoggerID: to.Ptr("/loggers/applicationinsights"), - Sampling: &armapimanagement.SamplingSettings{ - Percentage: to.Ptr[float64](50), - SamplingType: to.Ptr(armapimanagement.SamplingTypeFixed), - }, - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteDiagnostic.json -func ExampleDiagnosticClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewDiagnosticClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "applicationinsights", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_emailtemplate_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_emailtemplate_client_test.go deleted file mode 100644 index 6c14a1d65acc..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_emailtemplate_client_test.go +++ /dev/null @@ -1,171 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTemplates.json -func ExampleEmailTemplateClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewEmailTemplateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.EmailTemplateClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadEmailTemplate.json -func ExampleEmailTemplateClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewEmailTemplateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - armapimanagement.TemplateNameNewIssueNotificationMessage, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTemplate.json -func ExampleEmailTemplateClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewEmailTemplateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - armapimanagement.TemplateNameNewIssueNotificationMessage, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTemplate.json -func ExampleEmailTemplateClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewEmailTemplateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - armapimanagement.TemplateNameNewIssueNotificationMessage, - armapimanagement.EmailTemplateUpdateParameters{ - Properties: &armapimanagement.EmailTemplateUpdateParameterProperties{ - Subject: to.Ptr("Your request for $IssueName was successfully received."), - }, - }, - &armapimanagement.EmailTemplateClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTemplate.json -func ExampleEmailTemplateClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewEmailTemplateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - armapimanagement.TemplateNameNewIssueNotificationMessage, - "*", - armapimanagement.EmailTemplateUpdateParameters{ - Properties: &armapimanagement.EmailTemplateUpdateParameterProperties{ - Body: to.Ptr("\r\n\r\n \r\n \r\n

Dear $DevFirstName $DevLastName,

\r\n

\r\n We are happy to let you know that your request to publish the $AppName application in the gallery has been approved. Your application has been published and can be viewed here.\r\n

\r\n

Best,

\r\n

The $OrganizationName API Team

\r\n \r\n"), - Subject: to.Ptr("Your request $IssueName was received"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteTemplate.json -func ExampleEmailTemplateClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewEmailTemplateClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - armapimanagement.TemplateNameNewIssueNotificationMessage, - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gateway_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gateway_client_test.go deleted file mode 100644 index e93340dc135e..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gateway_client_test.go +++ /dev/null @@ -1,252 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGateways.json -func ExampleGatewayClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.GatewayClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGateway.json -func ExampleGatewayClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "mygateway", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGateway.json -func ExampleGatewayClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "gw1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGateway.json -func ExampleGatewayClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "gw1", - armapimanagement.GatewayContract{ - Properties: &armapimanagement.GatewayContractProperties{ - Description: to.Ptr("my gateway 1"), - LocationData: &armapimanagement.ResourceLocationDataContract{ - Name: to.Ptr("my location"), - }, - }, - }, - &armapimanagement.GatewayClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateGateway.json -func ExampleGatewayClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "gw1", - "*", - armapimanagement.GatewayContract{ - Properties: &armapimanagement.GatewayContractProperties{ - Description: to.Ptr("my gateway 1"), - LocationData: &armapimanagement.ResourceLocationDataContract{ - Name: to.Ptr("my location"), - }, - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGateway.json -func ExampleGatewayClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "gw1", - "*", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayListKeys.json -func ExampleGatewayClient_ListKeys() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListKeys(ctx, - "rg1", - "apimService1", - "gw1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayRegenerateKey.json -func ExampleGatewayClient_RegenerateKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegenerateKey(ctx, - "rg1", - "apimService1", - "gwId", - armapimanagement.GatewayKeyRegenerationRequestContract{ - KeyType: to.Ptr(armapimanagement.KeyTypePrimary), - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGatewayGenerateToken.json -func ExampleGatewayClient_GenerateToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GenerateToken(ctx, - "rg1", - "apimService1", - "gw1", - armapimanagement.GatewayTokenRequestContract{ - Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-04-21T00:44:24.2845269Z"); return t }()), - KeyType: to.Ptr(armapimanagement.KeyTypePrimary), - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayapi_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayapi_client_test.go deleted file mode 100644 index b087e3681a45..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayapi_client_test.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayApis.json -func ExampleGatewayAPIClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - "gw1", - &armapimanagement.GatewayAPIClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayApi.json -func ExampleGatewayAPIClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "gw1", - "api1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayApi.json -func ExampleGatewayAPIClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "gw1", - "echo-api", - &armapimanagement.GatewayAPIClientCreateOrUpdateOptions{Parameters: &armapimanagement.AssociationContract{ - Properties: &armapimanagement.AssociationContractProperties{ - ProvisioningState: to.Ptr("created"), - }, - }, - }) - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayApi.json -func ExampleGatewayAPIClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "gw1", - "echo-api", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewaycertificateauthority_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewaycertificateauthority_client_test.go deleted file mode 100644 index 35921607e01c..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewaycertificateauthority_client_test.go +++ /dev/null @@ -1,146 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayCertificateAuthorities.json -func ExampleGatewayCertificateAuthorityClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayCertificateAuthorityClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - "gw1", - &armapimanagement.GatewayCertificateAuthorityClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayCertificateAuthority.json -func ExampleGatewayCertificateAuthorityClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayCertificateAuthorityClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "gw1", - "cert1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGatewayCertificateAuthority.json -func ExampleGatewayCertificateAuthorityClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayCertificateAuthorityClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "gw1", - "cert1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayCertificateAuthority.json -func ExampleGatewayCertificateAuthorityClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayCertificateAuthorityClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "gw1", - "cert1", - armapimanagement.GatewayCertificateAuthorityContract{ - Properties: &armapimanagement.GatewayCertificateAuthorityContractProperties{ - IsTrusted: to.Ptr(false), - }, - }, - &armapimanagement.GatewayCertificateAuthorityClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayCertificateAuthority.json -func ExampleGatewayCertificateAuthorityClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayCertificateAuthorityClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "gw1", - "default", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayhostnameconfiguration_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayhostnameconfiguration_client_test.go deleted file mode 100644 index f72beac91b9a..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_gatewayhostnameconfiguration_client_test.go +++ /dev/null @@ -1,151 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGatewayHostnameConfigurations.json -func ExampleGatewayHostnameConfigurationClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayHostnameConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - "gw1", - &armapimanagement.GatewayHostnameConfigurationClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGatewayHostnameConfiguration.json -func ExampleGatewayHostnameConfigurationClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayHostnameConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "gw1", - "default", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGatewayHostnameConfiguration.json -func ExampleGatewayHostnameConfigurationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayHostnameConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "gw1", - "default", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGatewayHostnameConfiguration.json -func ExampleGatewayHostnameConfigurationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayHostnameConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "gw1", - "default", - armapimanagement.GatewayHostnameConfigurationContract{ - Properties: &armapimanagement.GatewayHostnameConfigurationContractProperties{ - CertificateID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/certificates/cert1"), - Hostname: to.Ptr("*"), - HTTP2Enabled: to.Ptr(true), - NegotiateClientCertificate: to.Ptr(false), - Tls10Enabled: to.Ptr(false), - Tls11Enabled: to.Ptr(false), - }, - }, - &armapimanagement.GatewayHostnameConfigurationClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGatewayHostnameConfiguration.json -func ExampleGatewayHostnameConfigurationClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGatewayHostnameConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "gw1", - "default", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_globalschema_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_globalschema_client_test.go deleted file mode 100644 index 1aeca5532634..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_globalschema_client_test.go +++ /dev/null @@ -1,147 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGlobalSchemas.json -func ExampleGlobalSchemaClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGlobalSchemaClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.GlobalSchemaClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGlobalSchema.json -func ExampleGlobalSchemaClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGlobalSchemaClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "myschema", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGlobalSchema1.json -func ExampleGlobalSchemaClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGlobalSchemaClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "schema1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGlobalSchema1.json -func ExampleGlobalSchemaClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGlobalSchemaClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "apimService1", - "schema1", - armapimanagement.GlobalSchemaContract{ - Properties: &armapimanagement.GlobalSchemaContractProperties{ - Description: to.Ptr("sample schema description"), - SchemaType: to.Ptr(armapimanagement.SchemaTypeXML), - Value: "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n", - }, - }, - &armapimanagement.GlobalSchemaClientBeginCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGlobalSchema.json -func ExampleGlobalSchemaClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGlobalSchemaClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "schema1", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_group_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_group_client_test.go deleted file mode 100644 index a65132f2e46d..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_group_client_test.go +++ /dev/null @@ -1,170 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGroups.json -func ExampleGroupClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.GroupClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGroup.json -func ExampleGroupClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "59306a29e4bbd510dc24e5f9", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetGroup.json -func ExampleGroupClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "59306a29e4bbd510dc24e5f9", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroup.json -func ExampleGroupClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "tempgroup", - armapimanagement.GroupCreateParameters{ - Properties: &armapimanagement.GroupCreateParametersProperties{ - DisplayName: to.Ptr("temp group"), - }, - }, - &armapimanagement.GroupClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateGroup.json -func ExampleGroupClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "tempgroup", - "*", - armapimanagement.GroupUpdateParameters{ - Properties: &armapimanagement.GroupUpdateParametersProperties{ - DisplayName: to.Ptr("temp group"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGroup.json -func ExampleGroupClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "aadGroup", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_groupuser_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_groupuser_client_test.go deleted file mode 100644 index ae66b7ebd952..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_groupuser_client_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListGroupUsers.json -func ExampleGroupUserClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - &armapimanagement.GroupUserClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadGroupUser.json -func ExampleGroupUserClient_CheckEntityExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CheckEntityExists(ctx, - "rg1", - "apimService1", - "59306a29e4bbd510dc24e5f9", - "5931a75ae4bbd512a88c680b", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateGroupUser.json -func ExampleGroupUserClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "rg1", - "apimService1", - "tempgroup", - "59307d350af58404d8a26300", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteGroupUser.json -func ExampleGroupUserClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewGroupUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "templategroup", - "59307d350af58404d8a26300", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_identityprovider_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_identityprovider_client_test.go deleted file mode 100644 index 9b305d2ed849..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_identityprovider_client_test.go +++ /dev/null @@ -1,192 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListIdentityProviders.json -func ExampleIdentityProviderClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadIdentityProvider.json -func ExampleIdentityProviderClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - armapimanagement.IdentityProviderTypeAADB2C, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetIdentityProvider.json -func ExampleIdentityProviderClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - armapimanagement.IdentityProviderTypeAADB2C, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateIdentityProvider.json -func ExampleIdentityProviderClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - armapimanagement.IdentityProviderTypeFacebook, - armapimanagement.IdentityProviderCreateContract{ - Properties: &armapimanagement.IdentityProviderCreateContractProperties{ - ClientID: to.Ptr("facebookid"), - ClientSecret: to.Ptr("facebookapplicationsecret"), - }, - }, - &armapimanagement.IdentityProviderClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateIdentityProvider.json -func ExampleIdentityProviderClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - armapimanagement.IdentityProviderTypeFacebook, - "*", - armapimanagement.IdentityProviderUpdateParameters{ - Properties: &armapimanagement.IdentityProviderUpdateProperties{ - ClientID: to.Ptr("updatedfacebookid"), - ClientSecret: to.Ptr("updatedfacebooksecret"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteIdentityProvider.json -func ExampleIdentityProviderClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - armapimanagement.IdentityProviderTypeAAD, - "*", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementIdentityProviderListSecrets.json -func ExampleIdentityProviderClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIdentityProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, - "rg1", - "apimService1", - armapimanagement.IdentityProviderTypeAADB2C, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_issue_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_issue_client_test.go deleted file mode 100644 index ae5242e78af2..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_issue_client_test.go +++ /dev/null @@ -1,69 +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 armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListIssues.json -func ExampleIssueClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIssueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.IssueClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetIssue.json -func ExampleIssueClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewIssueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "57d2ef278aa04f0ad01d6cdc", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_logger_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_logger_client_test.go deleted file mode 100644 index 54b098e925fe..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_logger_client_test.go +++ /dev/null @@ -1,175 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListLoggers.json -func ExampleLoggerClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewLoggerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.LoggerClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadLogger.json -func ExampleLoggerClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewLoggerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "templateLogger", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetLogger.json -func ExampleLoggerClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewLoggerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "templateLogger", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateAILogger.json -func ExampleLoggerClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewLoggerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "loggerId", - armapimanagement.LoggerContract{ - Properties: &armapimanagement.LoggerContractProperties{ - Description: to.Ptr("adding a new logger"), - Credentials: map[string]*string{ - "instrumentationKey": to.Ptr("11................a1"), - }, - LoggerType: to.Ptr(armapimanagement.LoggerTypeApplicationInsights), - }, - }, - &armapimanagement.LoggerClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateLogger.json -func ExampleLoggerClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewLoggerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "eh1", - "*", - armapimanagement.LoggerUpdateContract{ - Properties: &armapimanagement.LoggerUpdateParameters{ - Description: to.Ptr("updating description"), - LoggerType: to.Ptr(armapimanagement.LoggerTypeAzureEventHub), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteLogger.json -func ExampleLoggerClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewLoggerClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "loggerId", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_namedvalue_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_namedvalue_client_test.go deleted file mode 100644 index f2b4a7e83b72..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_namedvalue_client_test.go +++ /dev/null @@ -1,239 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNamedValues.json -func ExampleNamedValueClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.NamedValueClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - IsKeyVaultRefreshFailed: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNamedValue.json -func ExampleNamedValueClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "testarmTemplateproperties2", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNamedValue.json -func ExampleNamedValueClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "testarmTemplateproperties2", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNamedValue.json -func ExampleNamedValueClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "apimService1", - "testprop2", - armapimanagement.NamedValueCreateContract{ - Properties: &armapimanagement.NamedValueCreateContractProperties{ - Secret: to.Ptr(false), - Tags: []*string{ - to.Ptr("foo"), - to.Ptr("bar")}, - DisplayName: to.Ptr("prop3name"), - Value: to.Ptr("propValue"), - }, - }, - &armapimanagement.NamedValueClientBeginCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateNamedValue.json -func ExampleNamedValueClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "rg1", - "apimService1", - "testprop2", - "*", - armapimanagement.NamedValueUpdateParameters{ - Properties: &armapimanagement.NamedValueUpdateParameterProperties{ - Secret: to.Ptr(false), - Tags: []*string{ - to.Ptr("foo"), - to.Ptr("bar2")}, - DisplayName: to.Ptr("prop3name"), - Value: to.Ptr("propValue"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNamedValue.json -func ExampleNamedValueClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "testprop2", - "*", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementNamedValueListValue.json -func ExampleNamedValueClient_ListValue() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListValue(ctx, - "rg1", - "apimService1", - "testarmTemplateproperties2", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementRefreshNamedValue.json -func ExampleNamedValueClient_BeginRefreshSecret() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNamedValueClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginRefreshSecret(ctx, - "rg1", - "apimService1", - "testprop2", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_networkstatus_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_networkstatus_client_test.go deleted file mode 100644 index 015f8ef7e2a6..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_networkstatus_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 armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetNetworkStatus.json -func ExampleNetworkStatusClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNetworkStatusClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByService(ctx, - "rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetNetworkStatusByLocation.json -func ExampleNetworkStatusClient_ListByLocation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNetworkStatusClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByLocation(ctx, - "rg1", - "apimService1", - "North Central US", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notification_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notification_client_test.go deleted file mode 100644 index 4fc26187ae62..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notification_client_test.go +++ /dev/null @@ -1,91 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotifications.json -func ExampleNotificationClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.NotificationClientListByServiceOptions{Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetNotification.json -func ExampleNotificationClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotification.json -func ExampleNotificationClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - &armapimanagement.NotificationClientCreateOrUpdateOptions{IfMatch: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientemail_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientemail_client_test.go deleted file mode 100644 index 794b2a71590d..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientemail_client_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotificationRecipientEmails.json -func ExampleNotificationRecipientEmailClient_ListByNotification() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientEmailClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByNotification(ctx, - "rg1", - "apimService1", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNotificationRecipientEmail.json -func ExampleNotificationRecipientEmailClient_CheckEntityExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientEmailClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CheckEntityExists(ctx, - "rg1", - "apimService1", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - "contoso@live.com", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotificationRecipientEmail.json -func ExampleNotificationRecipientEmailClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientEmailClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - "foobar@live.com", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNotificationRecipientEmail.json -func ExampleNotificationRecipientEmailClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientEmailClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - "contoso@live.com", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientuser_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientuser_client_test.go deleted file mode 100644 index 3becef7d13a0..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_notificationrecipientuser_client_test.go +++ /dev/null @@ -1,108 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListNotificationRecipientUsers.json -func ExampleNotificationRecipientUserClient_ListByNotification() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByNotification(ctx, - "rg1", - "apimService1", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadNotificationRecipientUser.json -func ExampleNotificationRecipientUserClient_CheckEntityExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CheckEntityExists(ctx, - "rg1", - "apimService1", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - "576823d0a40f7e74ec07d642", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateNotificationRecipientUser.json -func ExampleNotificationRecipientUserClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - "576823d0a40f7e74ec07d642", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteNotificationRecipientUser.json -func ExampleNotificationRecipientUserClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewNotificationRecipientUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - armapimanagement.NotificationNameRequestPublisherNotificationMessage, - "576823d0a40f7e74ec07d642", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_openidconnectprovider_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_openidconnectprovider_client_test.go deleted file mode 100644 index b56f665321d6..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_openidconnectprovider_client_test.go +++ /dev/null @@ -1,196 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListOpenIdConnectProviders.json -func ExampleOpenIDConnectProviderClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.OpenIDConnectProviderClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadOpenIdConnectProvider.json -func ExampleOpenIDConnectProviderClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "templateOpenIdConnect2", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetOpenIdConnectProvider.json -func ExampleOpenIDConnectProviderClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "templateOpenIdConnect2", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateOpenIdConnectProvider.json -func ExampleOpenIDConnectProviderClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "templateOpenIdConnect3", - armapimanagement.OpenidConnectProviderContract{ - Properties: &armapimanagement.OpenidConnectProviderContractProperties{ - ClientID: to.Ptr("oidprovidertemplate3"), - ClientSecret: to.Ptr("x"), - DisplayName: to.Ptr("templateoidprovider3"), - MetadataEndpoint: to.Ptr("https://oidprovider-template3.net"), - }, - }, - &armapimanagement.OpenIDConnectProviderClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateOpenIdConnectProvider.json -func ExampleOpenIDConnectProviderClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "templateOpenIdConnect2", - "*", - armapimanagement.OpenidConnectProviderUpdateContract{ - Properties: &armapimanagement.OpenidConnectProviderUpdateContractProperties{ - ClientSecret: to.Ptr("updatedsecret"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteOpenIdConnectProvider.json -func ExampleOpenIDConnectProviderClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "templateOpenIdConnect3", - "*", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementOpenidConnectProviderListSecrets.json -func ExampleOpenIDConnectProviderClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOpenIDConnectProviderClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, - "rg1", - "apimService1", - "templateOpenIdConnect2", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_operation_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_operation_client_test.go deleted file mode 100644 index eddec780bec9..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_operation_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 armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationsByTags.json -func ExampleOperationClient_NewListByTagsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOperationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTagsPager("rg1", - "apimService1", - "a1", - &armapimanagement.OperationClientListByTagsOptions{Filter: nil, - Top: nil, - Skip: nil, - IncludeNotTaggedOperations: 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/apimanagement/armapimanagement/ze_generated_example_outboundnetworkdependenciesendpoints_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_outboundnetworkdependenciesendpoints_client_test.go deleted file mode 100644 index 9b7e335d2e3f..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_outboundnetworkdependenciesendpoints_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementServiceGetOutboundNetworkDependenciesEndpoints.json -func ExampleOutboundNetworkDependenciesEndpointsClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewOutboundNetworkDependenciesEndpointsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByService(ctx, - "rg1", - "apimService1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policy_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policy_client_test.go deleted file mode 100644 index 848dc6316e3b..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policy_client_test.go +++ /dev/null @@ -1,135 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPolicies.json -func ExamplePolicyClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByService(ctx, - "rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadPolicy.json -func ExamplePolicyClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - armapimanagement.PolicyIDNamePolicy, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPolicy.json -func ExamplePolicyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - armapimanagement.PolicyIDNamePolicy, - &armapimanagement.PolicyClientGetOptions{Format: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreatePolicy.json -func ExamplePolicyClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - armapimanagement.PolicyIDNamePolicy, - armapimanagement.PolicyContract{ - Properties: &armapimanagement.PolicyContractProperties{ - Format: to.Ptr(armapimanagement.PolicyContentFormatXML), - Value: to.Ptr("\r\n \r\n \r\n \r\n \r\n \r\n"), - }, - }, - &armapimanagement.PolicyClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletePolicy.json -func ExamplePolicyClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - armapimanagement.PolicyIDNamePolicy, - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policydescription_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policydescription_client_test.go deleted file mode 100644 index a932e21d3d42..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_policydescription_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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPolicyDescriptions.json -func ExamplePolicyDescriptionClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPolicyDescriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByService(ctx, - "rg1", - "apimService1", - &armapimanagement.PolicyDescriptionClientListByServiceOptions{Scope: to.Ptr(armapimanagement.PolicyScopeContractAPI)}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalrevision_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalrevision_client_test.go deleted file mode 100644 index c6e59cf3f54f..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalrevision_client_test.go +++ /dev/null @@ -1,156 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPortalRevisions.json -func ExamplePortalRevisionClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPortalRevisionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.PortalRevisionClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadPortalRevision.json -func ExamplePortalRevisionClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPortalRevisionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "20201112101010", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPortalRevision.json -func ExamplePortalRevisionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPortalRevisionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "20201112101010", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreatePortalRevision.json -func ExamplePortalRevisionClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPortalRevisionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "apimService1", - "20201112101010", - armapimanagement.PortalRevisionContract{ - Properties: &armapimanagement.PortalRevisionContractProperties{ - Description: to.Ptr("portal revision 1"), - IsCurrent: to.Ptr(true), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdatePortalRevision.json -func ExamplePortalRevisionClient_BeginUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPortalRevisionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginUpdate(ctx, - "rg1", - "apimService1", - "20201112101010", - "*", - armapimanagement.PortalRevisionContract{ - Properties: &armapimanagement.PortalRevisionContractProperties{ - Description: to.Ptr("portal revision update"), - IsCurrent: to.Ptr(true), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - res, err := poller.PollUntilDone(ctx, nil) - if err != nil { - log.Fatalf("failed to pull the result: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalsettings_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalsettings_client_test.go deleted file mode 100644 index 735156235dbb..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_portalsettings_client_test.go +++ /dev/null @@ -1,39 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPortalSettings.json -func ExamplePortalSettingsClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPortalSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByService(ctx, - "rg1", - "apimService1", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_privateendpointconnection_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_privateendpointconnection_client_test.go deleted file mode 100644 index 3708d6c22f2e..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_privateendpointconnection_client_test.go +++ /dev/null @@ -1,173 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPrivateEndpointConnections.json -func ExamplePrivateEndpointConnectionClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPrivateEndpointConnectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_GetByName() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPrivateEndpointConnectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByName(ctx, - "rg1", - "apimService1", - "privateEndpointConnectionName", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementApproveOrRejectPrivateEndpointConnection.json -func ExamplePrivateEndpointConnectionClient_BeginCreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPrivateEndpointConnectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginCreateOrUpdate(ctx, - "rg1", - "apimService1", - "privateEndpointConnectionName", - armapimanagement.PrivateEndpointConnectionRequest{ - ID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/privateEndpointConnections/connectionName"), - Properties: &armapimanagement.PrivateEndpointConnectionRequestProperties{ - PrivateLinkServiceConnectionState: &armapimanagement.PrivateLinkServiceConnectionState{ - Description: to.Ptr("The Private Endpoint Connection is approved."), - Status: to.Ptr(armapimanagement.PrivateEndpointServiceConnectionStatusApproved), - }, - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeletePrivateEndpointConnection.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 := armapimanagement.NewPrivateEndpointConnectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDelete(ctx, - "rg1", - "apimService1", - "privateEndpointConnectionName", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListPrivateLinkGroupResources.json -func ExamplePrivateEndpointConnectionClient_ListPrivateLinkResources() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPrivateEndpointConnectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListPrivateLinkResources(ctx, - "rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetPrivateLinkGroupResource.json -func ExamplePrivateEndpointConnectionClient_GetPrivateLinkResource() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewPrivateEndpointConnectionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetPrivateLinkResource(ctx, - "rg1", - "apimService1", - "privateLinkSubResourceName", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_product_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_product_client_test.go deleted file mode 100644 index f0517b1e052a..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_product_client_test.go +++ /dev/null @@ -1,202 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProducts.json -func ExampleProductClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.ProductClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - ExpandGroups: nil, - Tags: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProduct.json -func ExampleProductClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "unlimited", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProduct.json -func ExampleProductClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "unlimited", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProduct.json -func ExampleProductClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "testproduct", - armapimanagement.ProductContract{ - Properties: &armapimanagement.ProductContractProperties{ - DisplayName: to.Ptr("Test Template ProductName 4"), - }, - }, - &armapimanagement.ProductClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateProduct.json -func ExampleProductClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "testproduct", - "*", - armapimanagement.ProductUpdateParameters{ - Properties: &armapimanagement.ProductUpdateProperties{ - DisplayName: to.Ptr("Test Template ProductName 4"), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProduct.json -func ExampleProductClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "testproduct", - "*", - &armapimanagement.ProductClientDeleteOptions{DeleteSubscriptions: to.Ptr(true)}) - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductsByTags.json -func ExampleProductClient_NewListByTagsPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTagsPager("rg1", - "apimService1", - &armapimanagement.ProductClientListByTagsOptions{Filter: nil, - Top: nil, - Skip: nil, - IncludeNotTaggedProducts: 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/apimanagement/armapimanagement/ze_generated_example_productapi_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productapi_client_test.go deleted file mode 100644 index 0ad355f7d1f7..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productapi_client_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductApis.json -func ExampleProductAPIClient_NewListByProductPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProductPager("rg1", - "apimService1", - "5768181ea40f7eb6c49f6ac7", - &armapimanagement.ProductAPIClientListByProductOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductApi.json -func ExampleProductAPIClient_CheckEntityExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CheckEntityExists(ctx, - "rg1", - "apimService1", - "5931a75ae4bbd512a88c680b", - "59306a29e4bbd510dc24e5f9", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductApi.json -func ExampleProductAPIClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "testproduct", - "echo-api", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductApi.json -func ExampleProductAPIClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductAPIClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "testproduct", - "echo-api", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productgroup_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productgroup_client_test.go deleted file mode 100644 index 9413495a96bc..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productgroup_client_test.go +++ /dev/null @@ -1,115 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductGroups.json -func ExampleProductGroupClient_NewListByProductPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProductPager("rg1", - "apimService1", - "5600b57e7e8880006a060002", - &armapimanagement.ProductGroupClientListByProductOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductGroup.json -func ExampleProductGroupClient_CheckEntityExists() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.CheckEntityExists(ctx, - "rg1", - "apimService1", - "5931a75ae4bbd512a88c680b", - "59306a29e4bbd510dc24e5f9", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductGroup.json -func ExampleProductGroupClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "testproduct", - "templateGroup", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductGroup.json -func ExampleProductGroupClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "testproduct", - "templateGroup", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productpolicy_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productpolicy_client_test.go deleted file mode 100644 index 47be11038b88..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productpolicy_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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductPolicies.json -func ExampleProductPolicyClient_ListByProduct() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByProduct(ctx, - "rg1", - "apimService1", - "armTemplateProduct4", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductPolicy.json -func ExampleProductPolicyClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "unlimited", - armapimanagement.PolicyIDNamePolicy, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProductPolicy.json -func ExampleProductPolicyClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "kjoshiarmTemplateProduct4", - armapimanagement.PolicyIDNamePolicy, - &armapimanagement.ProductPolicyClientGetOptions{Format: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductPolicy.json -func ExampleProductPolicyClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "5702e97e5157a50f48dce801", - armapimanagement.PolicyIDNamePolicy, - armapimanagement.PolicyContract{ - Properties: &armapimanagement.PolicyContractProperties{ - Format: to.Ptr(armapimanagement.PolicyContentFormatXML), - Value: to.Ptr("\r\n \r\n \r\n \r\n @( string.Join(\",\", DateTime.UtcNow, context.Deployment.ServiceName, context.RequestId, context.Request.IpAddress, context.Operation.Name) ) \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n"), - }, - }, - &armapimanagement.ProductPolicyClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductPolicy.json -func ExampleProductPolicyClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductPolicyClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "testproduct", - armapimanagement.PolicyIDNamePolicy, - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productsubscriptions_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productsubscriptions_client_test.go deleted file mode 100644 index 8e240b1ea561..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_productsubscriptions_client_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductSubscriptions.json -func ExampleProductSubscriptionsClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewProductSubscriptionsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "apimService1", - "5600b57e7e8880006a060002", - &armapimanagement.ProductSubscriptionsClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabycounterkeys_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabycounterkeys_client_test.go deleted file mode 100644 index 2fabff31da38..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabycounterkeys_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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetQuotaCounterKeys.json -func ExampleQuotaByCounterKeysClient_ListByService() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewQuotaByCounterKeysClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListByService(ctx, - "rg1", - "apimService1", - "ba", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateQuotaCounterKey.json -func ExampleQuotaByCounterKeysClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewQuotaByCounterKeysClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "ba", - armapimanagement.QuotaCounterValueUpdateContract{ - Properties: &armapimanagement.QuotaCounterValueContractProperties{ - CallsCount: to.Ptr[int32](0), - KbTransferred: to.Ptr[float64](2.5630078125), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabyperiodkeys_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabyperiodkeys_client_test.go deleted file mode 100644 index e42a0de4040a..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_quotabyperiodkeys_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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetQuotaCounterKeysByQuotaPeriod.json -func ExampleQuotaByPeriodKeysClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewQuotaByPeriodKeysClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "ba", - "0_P3Y6M4DT12H30M5S", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateQuotaCounterKeyByQuotaPeriod.json -func ExampleQuotaByPeriodKeysClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewQuotaByPeriodKeysClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "ba", - "0_P3Y6M4DT12H30M5S", - armapimanagement.QuotaCounterValueUpdateContract{ - Properties: &armapimanagement.QuotaCounterValueContractProperties{ - CallsCount: to.Ptr[int32](0), - KbTransferred: to.Ptr[float64](0), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_region_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_region_client_test.go deleted file mode 100644 index c60654fd6cbe..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_region_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 armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListRegions.json -func ExampleRegionClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewRegionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - 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/apimanagement/armapimanagement/ze_generated_example_reports_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_reports_client_test.go deleted file mode 100644 index 8c467fd4c249..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_reports_client_test.go +++ /dev/null @@ -1,226 +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 armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByUser.json -func ExampleReportsClient_NewListByUserPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByUserPager("rg1", - "apimService1", - "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", - &armapimanagement.ReportsClientListByUserOptions{Top: nil, - Skip: nil, - Orderby: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByOperation.json -func ExampleReportsClient_NewListByOperationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByOperationPager("rg1", - "apimService1", - "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", - &armapimanagement.ReportsClientListByOperationOptions{Top: nil, - Skip: nil, - Orderby: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByProduct.json -func ExampleReportsClient_NewListByProductPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProductPager("rg1", - "apimService1", - "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", - &armapimanagement.ReportsClientListByProductOptions{Top: nil, - Skip: nil, - Orderby: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByGeo.json -func ExampleReportsClient_NewListByGeoPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByGeoPager("rg1", - "apimService1", - "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", - &armapimanagement.ReportsClientListByGeoOptions{Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsBySubscription.json -func ExampleReportsClient_NewListBySubscriptionPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListBySubscriptionPager("rg1", - "apimService1", - "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", - &armapimanagement.ReportsClientListBySubscriptionOptions{Top: nil, - Skip: nil, - Orderby: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByTime.json -func ExampleReportsClient_NewListByTimePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByTimePager("rg1", - "apimService1", - "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", - "PT15M", - &armapimanagement.ReportsClientListByTimeOptions{Top: nil, - Skip: nil, - Orderby: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetReportsByRequest.json -func ExampleReportsClient_NewListByRequestPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewReportsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByRequestPager("rg1", - "apimService1", - "timestamp ge datetime'2017-06-01T00:00:00' and timestamp le datetime'2017-06-04T00:00:00'", - &armapimanagement.ReportsClientListByRequestOptions{Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signinsettings_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signinsettings_client_test.go deleted file mode 100644 index 019863dad250..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signinsettings_client_test.go +++ /dev/null @@ -1,113 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSignInSettings.json -func ExampleSignInSettingsClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignInSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetSignIn.json -func ExampleSignInSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignInSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateSignIn.json -func ExampleSignInSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignInSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "rg1", - "apimService1", - "*", - armapimanagement.PortalSigninSettings{ - Properties: &armapimanagement.PortalSigninSettingProperties{ - Enabled: to.Ptr(true), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutSignIn.json -func ExampleSignInSettingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignInSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - armapimanagement.PortalSigninSettings{ - Properties: &armapimanagement.PortalSigninSettingProperties{ - Enabled: to.Ptr(true), - }, - }, - &armapimanagement.SignInSettingsClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signupsettings_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signupsettings_client_test.go deleted file mode 100644 index 7a0d025df288..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_signupsettings_client_test.go +++ /dev/null @@ -1,123 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSignUpSettings.json -func ExampleSignUpSettingsClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignUpSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsGetSignUp.json -func ExampleSignUpSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignUpSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsUpdateSignUp.json -func ExampleSignUpSettingsClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignUpSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Update(ctx, - "rg1", - "apimService1", - "*", - armapimanagement.PortalSignupSettings{ - Properties: &armapimanagement.PortalSignupSettingsProperties{ - Enabled: to.Ptr(true), - TermsOfService: &armapimanagement.TermsOfServiceProperties{ - ConsentRequired: to.Ptr(true), - Enabled: to.Ptr(true), - Text: to.Ptr("Terms of service text."), - }, - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementPortalSettingsPutSignUp.json -func ExampleSignUpSettingsClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSignUpSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - armapimanagement.PortalSignupSettings{ - Properties: &armapimanagement.PortalSignupSettingsProperties{ - Enabled: to.Ptr(true), - TermsOfService: &armapimanagement.TermsOfServiceProperties{ - ConsentRequired: to.Ptr(true), - Enabled: to.Ptr(true), - Text: to.Ptr("Terms of service text."), - }, - }, - }, - &armapimanagement.SignUpSettingsClientCreateOrUpdateOptions{IfMatch: to.Ptr("*")}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_subscription_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_subscription_client_test.go deleted file mode 100644 index 21ddad1c153b..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_subscription_client_test.go +++ /dev/null @@ -1,242 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSubscriptions.json -func ExampleSubscriptionClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "apimService1", - &armapimanagement.SubscriptionClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadSubscription.json -func ExampleSubscriptionClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "5931a769d8d14f0ad8ce13b8", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetSubscription.json -func ExampleSubscriptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "5931a769d8d14f0ad8ce13b8", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateSubscription.json -func ExampleSubscriptionClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "testsub", - armapimanagement.SubscriptionCreateParameters{ - Properties: &armapimanagement.SubscriptionCreateParameterProperties{ - DisplayName: to.Ptr("testsub"), - OwnerID: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/users/57127d485157a511ace86ae7"), - Scope: to.Ptr("/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/products/5600b59475ff190048060002"), - }, - }, - &armapimanagement.SubscriptionClientCreateOrUpdateOptions{Notify: nil, - IfMatch: nil, - AppType: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateSubscription.json -func ExampleSubscriptionClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "testsub", - "*", - armapimanagement.SubscriptionUpdateParameters{ - Properties: &armapimanagement.SubscriptionUpdateParameterProperties{ - DisplayName: to.Ptr("testsub"), - }, - }, - &armapimanagement.SubscriptionClientUpdateOptions{Notify: nil, - AppType: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteSubscription.json -func ExampleSubscriptionClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "testsub", - "*", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionRegeneratePrimaryKey.json -func ExampleSubscriptionClient_RegeneratePrimaryKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegeneratePrimaryKey(ctx, - "rg1", - "apimService1", - "testsub", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionRegenerateSecondaryKey.json -func ExampleSubscriptionClient_RegenerateSecondaryKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegenerateSecondaryKey(ctx, - "rg1", - "apimService1", - "testsub", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementSubscriptionListSecrets.json -func ExampleSubscriptionClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewSubscriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, - "rg1", - "apimService1", - "5931a769d8d14f0ad8ce13b8", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tag_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tag_client_test.go deleted file mode 100644 index e0d1aa9676e0..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tag_client_test.go +++ /dev/null @@ -1,420 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListApiOperationTags.json -func ExampleTagClient_NewListByOperationPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByOperationPager("rg1", - "apimService1", - "57d2ef278aa04f0888cba3f3", - "57d2ef278aa04f0888cba3f6", - &armapimanagement.TagClientListByOperationOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadApiOperationTag.json -func ExampleTagClient_GetEntityStateByOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityStateByOperation(ctx, - "rg1", - "apimService1", - "59d6bb8f1f7fab13dc67ec9b", - "59d6bb8f1f7fab13dc67ec9a", - "59306a29e4bbd510dc24e5f9", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetApiOperationTag.json -func ExampleTagClient_GetByOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByOperation(ctx, - "rg1", - "apimService1", - "59d6bb8f1f7fab13dc67ec9b", - "59d6bb8f1f7fab13dc67ec9a", - "59306a29e4bbd510dc24e5f9", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateApiOperationTag.json -func ExampleTagClient_AssignToOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.AssignToOperation(ctx, - "rg1", - "apimService1", - "5931a75ae4bbd512a88c680b", - "5931a75ae4bbd512a88c680a", - "tagId1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteApiOperationTag.json -func ExampleTagClient_DetachFromOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DetachFromOperation(ctx, - "rg1", - "apimService1", - "59d5b28d1f7fab116c282650", - "59d5b28d1f7fab116c282651", - "59d5b28e1f7fab116402044e", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListProductTags.json -func ExampleTagClient_NewListByProductPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByProductPager("rg1", - "apimService1", - "57d2ef278aa04f0888cba3f1", - &armapimanagement.TagClientListByProductOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadProductTag.json -func ExampleTagClient_GetEntityStateByProduct() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityStateByProduct(ctx, - "rg1", - "apimService1", - "59306a29e4bbd510dc24e5f8", - "59306a29e4bbd510dc24e5f9", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetProductTag.json -func ExampleTagClient_GetByProduct() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetByProduct(ctx, - "rg1", - "apimService1", - "59d6bb8f1f7fab13dc67ec9b", - "59306a29e4bbd510dc24e5f9", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateProductTag.json -func ExampleTagClient_AssignToProduct() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.AssignToProduct(ctx, - "rg1", - "apimService1", - "5931a75ae4bbd512a88c680b", - "tagId1", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteProductTag.json -func ExampleTagClient_DetachFromProduct() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.DetachFromProduct(ctx, - "rg1", - "apimService1", - "59d5b28d1f7fab116c282650", - "59d5b28e1f7fab116402044e", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTags.json -func ExampleTagClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.TagClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - Scope: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadTag.json -func ExampleTagClient_GetEntityState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityState(ctx, - "rg1", - "apimService1", - "59306a29e4bbd510dc24e5f9", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTag.json -func ExampleTagClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "59306a29e4bbd510dc24e5f9", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTag.json -func ExampleTagClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "tagId1", - armapimanagement.TagCreateUpdateParameters{ - Properties: &armapimanagement.TagContractProperties{ - DisplayName: to.Ptr("tag1"), - }, - }, - &armapimanagement.TagClientCreateOrUpdateOptions{IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTag.json -func ExampleTagClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "temptag", - "*", - armapimanagement.TagCreateUpdateParameters{ - Properties: &armapimanagement.TagContractProperties{ - DisplayName: to.Ptr("temp tag"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteTag.json -func ExampleTagClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "tagId1", - "*", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tagresource_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tagresource_client_test.go deleted file mode 100644 index 964eeb4dd270..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tagresource_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 armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTagResources.json -func ExampleTagResourceClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTagResourceClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.TagResourceClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccess_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccess_client_test.go deleted file mode 100644 index 3196d5dd87a4..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccess_client_test.go +++ /dev/null @@ -1,211 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTenantAccess.json -func ExampleTenantAccessClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.TenantAccessClientListByServiceOptions{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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadTenantAccess.json -func ExampleTenantAccessClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - armapimanagement.AccessIDNameAccess, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantAccess.json -func ExampleTenantAccessClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - armapimanagement.AccessIDNameAccess, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateTenantAccess.json -func ExampleTenantAccessClient_Create() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Create(ctx, - "rg1", - "apimService1", - armapimanagement.AccessIDNameAccess, - "*", - armapimanagement.AccessInformationCreateParameters{ - Properties: &armapimanagement.AccessInformationCreateParameterProperties{ - Enabled: to.Ptr(true), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateTenantAccess.json -func ExampleTenantAccessClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - armapimanagement.AccessIDNameAccess, - "*", - armapimanagement.AccessInformationUpdateParameters{ - Properties: &armapimanagement.AccessInformationUpdateParameterProperties{ - Enabled: to.Ptr(true), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json -func ExampleTenantAccessClient_RegeneratePrimaryKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegeneratePrimaryKey(ctx, - "rg1", - "apimService1", - armapimanagement.AccessIDNameAccess, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json -func ExampleTenantAccessClient_RegenerateSecondaryKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegenerateSecondaryKey(ctx, - "rg1", - "apimService1", - armapimanagement.AccessIDNameAccess, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListSecretsTenantAccess.json -func ExampleTenantAccessClient_ListSecrets() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.ListSecrets(ctx, - "rg1", - "apimService1", - armapimanagement.AccessIDNameAccess, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccessgit_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccessgit_client_test.go deleted file mode 100644 index 2feb746334b3..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantaccessgit_client_test.go +++ /dev/null @@ -1,59 +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 armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json -func ExampleTenantAccessGitClient_RegeneratePrimaryKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessGitClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegeneratePrimaryKey(ctx, - "rg1", - "apimService1", - armapimanagement.AccessIDNameAccess, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessRegenerateKey.json -func ExampleTenantAccessGitClient_RegenerateSecondaryKey() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantAccessGitClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.RegenerateSecondaryKey(ctx, - "rg1", - "apimService1", - armapimanagement.AccessIDNameAccess, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantconfiguration_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantconfiguration_client_test.go deleted file mode 100644 index f19643d97f45..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantconfiguration_client_test.go +++ /dev/null @@ -1,137 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationDeploy.json -func ExampleTenantConfigurationClient_BeginDeploy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginDeploy(ctx, - "rg1", - "apimService1", - armapimanagement.ConfigurationIDNameConfiguration, - armapimanagement.DeployConfigurationParameters{ - Properties: &armapimanagement.DeployConfigurationParameterProperties{ - Branch: to.Ptr("master"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationSave.json -func ExampleTenantConfigurationClient_BeginSave() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginSave(ctx, - "rg1", - "apimService1", - armapimanagement.ConfigurationIDNameConfiguration, - armapimanagement.SaveConfigurationParameter{ - Properties: &armapimanagement.SaveConfigurationParameterProperties{ - Branch: to.Ptr("master"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantConfigurationValidate.json -func ExampleTenantConfigurationClient_BeginValidate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := client.BeginValidate(ctx, - "rg1", - "apimService1", - armapimanagement.ConfigurationIDNameConfiguration, - armapimanagement.DeployConfigurationParameters{ - Properties: &armapimanagement.DeployConfigurationParameterProperties{ - Branch: to.Ptr("master"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementTenantAccessSyncState.json -func ExampleTenantConfigurationClient_GetSyncState() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantConfigurationClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSyncState(ctx, - "rg1", - "apimService1", - armapimanagement.ConfigurationIDNameConfiguration, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantsettings_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantsettings_client_test.go deleted file mode 100644 index d233caf971eb..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_tenantsettings_client_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListTenantSettings.json -func ExampleTenantSettingsClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.TenantSettingsClientListByServiceOptions{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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetTenantSettings.json -func ExampleTenantSettingsClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewTenantSettingsClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - armapimanagement.SettingsTypeNamePublic, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_user_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_user_client_test.go deleted file mode 100644 index 4a75e3ba6a22..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_user_client_test.go +++ /dev/null @@ -1,212 +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 armapimanagement_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/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUsers.json -func ExampleUserClient_NewListByServicePager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListByServicePager("rg1", - "apimService1", - &armapimanagement.UserClientListByServiceOptions{Filter: nil, - Top: nil, - Skip: nil, - ExpandGroups: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementHeadUser.json -func ExampleUserClient_GetEntityTag() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.GetEntityTag(ctx, - "rg1", - "apimService1", - "5931a75ae4bbd512a88c680b", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetUser.json -func ExampleUserClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "5931a75ae4bbd512a88c680b", - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementCreateUser.json -func ExampleUserClient_CreateOrUpdate() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.CreateOrUpdate(ctx, - "rg1", - "apimService1", - "5931a75ae4bbd512288c680b", - armapimanagement.UserCreateParameters{ - Properties: &armapimanagement.UserCreateParameterProperties{ - Confirmation: to.Ptr(armapimanagement.ConfirmationSignup), - Email: to.Ptr("foobar@outlook.com"), - FirstName: to.Ptr("foo"), - LastName: to.Ptr("bar"), - }, - }, - &armapimanagement.UserClientCreateOrUpdateOptions{Notify: nil, - IfMatch: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUpdateUser.json -func ExampleUserClient_Update() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Update(ctx, - "rg1", - "apimService1", - "5931a75ae4bbd512a88c680b", - "*", - armapimanagement.UserUpdateParameters{ - Properties: &armapimanagement.UserUpdateParametersProperties{ - Email: to.Ptr("foobar@outlook.com"), - FirstName: to.Ptr("foo"), - LastName: to.Ptr("bar"), - }, - }, - 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementDeleteUser.json -func ExampleUserClient_Delete() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Delete(ctx, - "rg1", - "apimService1", - "5931a75ae4bbd512288c680b", - "*", - &armapimanagement.UserClientDeleteOptions{DeleteSubscriptions: nil, - Notify: nil, - AppType: 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/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserToken.json -func ExampleUserClient_GetSharedAccessToken() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.GetSharedAccessToken(ctx, - "rg1", - "apimService1", - "userId1718", - armapimanagement.UserTokenParameters{ - Properties: &armapimanagement.UserTokenParameterProperties{ - Expiry: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-04-21T00:44:24.2845269Z"); return t }()), - KeyType: to.Ptr(armapimanagement.KeyTypePrimary), - }, - }, - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_userconfirmationpassword_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_userconfirmationpassword_client_test.go deleted file mode 100644 index afe35f5bd928..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_userconfirmationpassword_client_test.go +++ /dev/null @@ -1,38 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementUserConfirmationPasswordSend.json -func ExampleUserConfirmationPasswordClient_Send() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserConfirmationPasswordClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = client.Send(ctx, - "rg1", - "apimService1", - "57127d485157a511ace86ae7", - &armapimanagement.UserConfirmationPasswordClientSendOptions{AppType: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usergroup_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usergroup_client_test.go deleted file mode 100644 index c04dcce43c09..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usergroup_client_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. - -package armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserGroups.json -func ExampleUserGroupClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserGroupClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "apimService1", - "57681833a40f7eb6c49f6acf", - &armapimanagement.UserGroupClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_useridentities_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_useridentities_client_test.go deleted file mode 100644 index 899ae9e0a925..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_useridentities_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 armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserIdentities.json -func ExampleUserIdentitiesClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserIdentitiesClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "apimService1", - "57f2af53bb17172280f44057", - 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/apimanagement/armapimanagement/ze_generated_example_usersubscription_client_test.go b/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usersubscription_client_test.go deleted file mode 100644 index 548f5a18da10..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/ze_generated_example_usersubscription_client_test.go +++ /dev/null @@ -1,71 +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 armapimanagement_test - -import ( - "context" - "log" - - "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/apimanagement/armapimanagement" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementListUserSubscriptions.json -func ExampleUserSubscriptionClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserSubscriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := client.NewListPager("rg1", - "apimService1", - "57681833a40f7eb6c49f6acf", - &armapimanagement.UserSubscriptionClientListOptions{Filter: nil, - Top: nil, - Skip: nil, - }) - for pager.More() { - nextResult, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range nextResult.Value { - // TODO: use page item - _ = v - } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/apimanagement/resource-manager/Microsoft.ApiManagement/stable/2021-08-01/examples/ApiManagementGetUserSubscription.json -func ExampleUserSubscriptionClient_Get() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - client, err := armapimanagement.NewUserSubscriptionClient("subid", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := client.Get(ctx, - "rg1", - "apimService1", - "1", - "5fa9b096f3df14003c070001", - nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // TODO: use response item - _ = res -} diff --git a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_models_serde.go b/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_models_serde.go deleted file mode 100644 index 0791e7fdd3cc..000000000000 --- a/sdk/resourcemanager/apimanagement/armapimanagement/zz_generated_models_serde.go +++ /dev/null @@ -1,2330 +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 armapimanagement - -import ( - "encoding/json" - "fmt" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - -// MarshalJSON implements the json.Marshaller interface for type APIContractProperties. -func (a APIContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiRevision", a.APIRevision) - populate(objectMap, "apiRevisionDescription", a.APIRevisionDescription) - populate(objectMap, "type", a.APIType) - populate(objectMap, "apiVersion", a.APIVersion) - populate(objectMap, "apiVersionDescription", a.APIVersionDescription) - populate(objectMap, "apiVersionSet", a.APIVersionSet) - populate(objectMap, "apiVersionSetId", a.APIVersionSetID) - populate(objectMap, "authenticationSettings", a.AuthenticationSettings) - populate(objectMap, "contact", a.Contact) - populate(objectMap, "description", a.Description) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "isCurrent", a.IsCurrent) - populate(objectMap, "isOnline", a.IsOnline) - populate(objectMap, "license", a.License) - populate(objectMap, "path", a.Path) - populate(objectMap, "protocols", a.Protocols) - populate(objectMap, "serviceUrl", a.ServiceURL) - populate(objectMap, "sourceApiId", a.SourceAPIID) - populate(objectMap, "subscriptionKeyParameterNames", a.SubscriptionKeyParameterNames) - populate(objectMap, "subscriptionRequired", a.SubscriptionRequired) - populate(objectMap, "termsOfServiceUrl", a.TermsOfServiceURL) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type APIContractUpdateProperties. -func (a APIContractUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiRevision", a.APIRevision) - populate(objectMap, "apiRevisionDescription", a.APIRevisionDescription) - populate(objectMap, "type", a.APIType) - populate(objectMap, "apiVersion", a.APIVersion) - populate(objectMap, "apiVersionDescription", a.APIVersionDescription) - populate(objectMap, "apiVersionSetId", a.APIVersionSetID) - populate(objectMap, "authenticationSettings", a.AuthenticationSettings) - populate(objectMap, "contact", a.Contact) - populate(objectMap, "description", a.Description) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "isCurrent", a.IsCurrent) - populate(objectMap, "isOnline", a.IsOnline) - populate(objectMap, "license", a.License) - populate(objectMap, "path", a.Path) - populate(objectMap, "protocols", a.Protocols) - populate(objectMap, "serviceUrl", a.ServiceURL) - populate(objectMap, "subscriptionKeyParameterNames", a.SubscriptionKeyParameterNames) - populate(objectMap, "subscriptionRequired", a.SubscriptionRequired) - populate(objectMap, "termsOfServiceUrl", a.TermsOfServiceURL) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type APICreateOrUpdateProperties. -func (a APICreateOrUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiRevision", a.APIRevision) - populate(objectMap, "apiRevisionDescription", a.APIRevisionDescription) - populate(objectMap, "type", a.APIType) - populate(objectMap, "apiVersion", a.APIVersion) - populate(objectMap, "apiVersionDescription", a.APIVersionDescription) - populate(objectMap, "apiVersionSet", a.APIVersionSet) - populate(objectMap, "apiVersionSetId", a.APIVersionSetID) - populate(objectMap, "authenticationSettings", a.AuthenticationSettings) - populate(objectMap, "contact", a.Contact) - populate(objectMap, "description", a.Description) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "format", a.Format) - populate(objectMap, "isCurrent", a.IsCurrent) - populate(objectMap, "isOnline", a.IsOnline) - populate(objectMap, "license", a.License) - populate(objectMap, "path", a.Path) - populate(objectMap, "protocols", a.Protocols) - populate(objectMap, "serviceUrl", a.ServiceURL) - populate(objectMap, "apiType", a.SoapAPIType) - populate(objectMap, "sourceApiId", a.SourceAPIID) - populate(objectMap, "subscriptionKeyParameterNames", a.SubscriptionKeyParameterNames) - populate(objectMap, "subscriptionRequired", a.SubscriptionRequired) - populate(objectMap, "termsOfServiceUrl", a.TermsOfServiceURL) - populate(objectMap, "value", a.Value) - populate(objectMap, "wsdlSelector", a.WsdlSelector) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type APIReleaseContract. -func (a APIReleaseContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type APIReleaseContractProperties. -func (a APIReleaseContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiId", a.APIID) - populateTimeRFC3339(objectMap, "createdDateTime", a.CreatedDateTime) - populate(objectMap, "notes", a.Notes) - populateTimeRFC3339(objectMap, "updatedDateTime", a.UpdatedDateTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type APIReleaseContractProperties. -func (a *APIReleaseContractProperties) UnmarshalJSON(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 "apiId": - err = unpopulate(val, "APIID", &a.APIID) - delete(rawMsg, key) - case "createdDateTime": - err = unpopulateTimeRFC3339(val, "CreatedDateTime", &a.CreatedDateTime) - delete(rawMsg, key) - case "notes": - err = unpopulate(val, "Notes", &a.Notes) - delete(rawMsg, key) - case "updatedDateTime": - err = unpopulateTimeRFC3339(val, "UpdatedDateTime", &a.UpdatedDateTime) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", a, err) - } - } - return nil -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type APIRevisionContract. -func (a *APIRevisionContract) UnmarshalJSON(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 "apiId": - err = unpopulate(val, "APIID", &a.APIID) - delete(rawMsg, key) - case "apiRevision": - err = unpopulate(val, "APIRevision", &a.APIRevision) - delete(rawMsg, key) - case "createdDateTime": - err = unpopulateTimeRFC3339(val, "CreatedDateTime", &a.CreatedDateTime) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &a.Description) - delete(rawMsg, key) - case "isCurrent": - err = unpopulate(val, "IsCurrent", &a.IsCurrent) - delete(rawMsg, key) - case "isOnline": - err = unpopulate(val, "IsOnline", &a.IsOnline) - delete(rawMsg, key) - case "privateUrl": - err = unpopulate(val, "PrivateURL", &a.PrivateURL) - delete(rawMsg, key) - case "updatedDateTime": - err = unpopulateTimeRFC3339(val, "UpdatedDateTime", &a.UpdatedDateTime) - 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 APITagResourceContractProperties. -func (a APITagResourceContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiRevision", a.APIRevision) - populate(objectMap, "apiRevisionDescription", a.APIRevisionDescription) - populate(objectMap, "type", a.APIType) - populate(objectMap, "apiVersion", a.APIVersion) - populate(objectMap, "apiVersionDescription", a.APIVersionDescription) - populate(objectMap, "apiVersionSetId", a.APIVersionSetID) - populate(objectMap, "authenticationSettings", a.AuthenticationSettings) - populate(objectMap, "contact", a.Contact) - populate(objectMap, "description", a.Description) - populate(objectMap, "id", a.ID) - populate(objectMap, "isCurrent", a.IsCurrent) - populate(objectMap, "isOnline", a.IsOnline) - populate(objectMap, "license", a.License) - populate(objectMap, "name", a.Name) - populate(objectMap, "path", a.Path) - populate(objectMap, "protocols", a.Protocols) - populate(objectMap, "serviceUrl", a.ServiceURL) - populate(objectMap, "subscriptionKeyParameterNames", a.SubscriptionKeyParameterNames) - populate(objectMap, "subscriptionRequired", a.SubscriptionRequired) - populate(objectMap, "termsOfServiceUrl", a.TermsOfServiceURL) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type APIUpdateContract. -func (a APIUpdateContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type APIVersionSetUpdateParameters. -func (a APIVersionSetUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AccessInformationUpdateParameters. -func (a AccessInformationUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AdditionalLocation. -func (a AdditionalLocation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "disableGateway", a.DisableGateway) - populate(objectMap, "gatewayRegionalUrl", a.GatewayRegionalURL) - populate(objectMap, "location", a.Location) - populate(objectMap, "platformVersion", a.PlatformVersion) - populate(objectMap, "privateIPAddresses", a.PrivateIPAddresses) - populate(objectMap, "publicIpAddressId", a.PublicIPAddressID) - populate(objectMap, "publicIPAddresses", a.PublicIPAddresses) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "virtualNetworkConfiguration", a.VirtualNetworkConfiguration) - populate(objectMap, "zones", a.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ApimResource. -func (a ApimResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContractBaseProperties. -func (a AuthorizationServerContractBaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorizationMethods", a.AuthorizationMethods) - populate(objectMap, "bearerTokenSendingMethods", a.BearerTokenSendingMethods) - populate(objectMap, "clientAuthenticationMethod", a.ClientAuthenticationMethod) - populate(objectMap, "defaultScope", a.DefaultScope) - populate(objectMap, "description", a.Description) - populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) - populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) - populate(objectMap, "supportState", a.SupportState) - populate(objectMap, "tokenBodyParameters", a.TokenBodyParameters) - populate(objectMap, "tokenEndpoint", a.TokenEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerContractProperties. -func (a AuthorizationServerContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorizationEndpoint", a.AuthorizationEndpoint) - populate(objectMap, "authorizationMethods", a.AuthorizationMethods) - populate(objectMap, "bearerTokenSendingMethods", a.BearerTokenSendingMethods) - populate(objectMap, "clientAuthenticationMethod", a.ClientAuthenticationMethod) - populate(objectMap, "clientId", a.ClientID) - populate(objectMap, "clientRegistrationEndpoint", a.ClientRegistrationEndpoint) - populate(objectMap, "clientSecret", a.ClientSecret) - populate(objectMap, "defaultScope", a.DefaultScope) - populate(objectMap, "description", a.Description) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "grantTypes", a.GrantTypes) - populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) - populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) - populate(objectMap, "supportState", a.SupportState) - populate(objectMap, "tokenBodyParameters", a.TokenBodyParameters) - populate(objectMap, "tokenEndpoint", a.TokenEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerUpdateContract. -func (a AuthorizationServerUpdateContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type AuthorizationServerUpdateContractProperties. -func (a AuthorizationServerUpdateContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorizationEndpoint", a.AuthorizationEndpoint) - populate(objectMap, "authorizationMethods", a.AuthorizationMethods) - populate(objectMap, "bearerTokenSendingMethods", a.BearerTokenSendingMethods) - populate(objectMap, "clientAuthenticationMethod", a.ClientAuthenticationMethod) - populate(objectMap, "clientId", a.ClientID) - populate(objectMap, "clientRegistrationEndpoint", a.ClientRegistrationEndpoint) - populate(objectMap, "clientSecret", a.ClientSecret) - populate(objectMap, "defaultScope", a.DefaultScope) - populate(objectMap, "description", a.Description) - populate(objectMap, "displayName", a.DisplayName) - populate(objectMap, "grantTypes", a.GrantTypes) - populate(objectMap, "resourceOwnerPassword", a.ResourceOwnerPassword) - populate(objectMap, "resourceOwnerUsername", a.ResourceOwnerUsername) - populate(objectMap, "supportState", a.SupportState) - populate(objectMap, "tokenBodyParameters", a.TokenBodyParameters) - populate(objectMap, "tokenEndpoint", a.TokenEndpoint) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackendCredentialsContract. -func (b BackendCredentialsContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorization", b.Authorization) - populate(objectMap, "certificate", b.Certificate) - populate(objectMap, "certificateIds", b.CertificateIDs) - populate(objectMap, "header", b.Header) - populate(objectMap, "query", b.Query) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackendServiceFabricClusterProperties. -func (b BackendServiceFabricClusterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "clientCertificateId", b.ClientCertificateID) - populate(objectMap, "clientCertificatethumbprint", b.ClientCertificatethumbprint) - populate(objectMap, "managementEndpoints", b.ManagementEndpoints) - populate(objectMap, "maxPartitionResolutionRetries", b.MaxPartitionResolutionRetries) - populate(objectMap, "serverCertificateThumbprints", b.ServerCertificateThumbprints) - populate(objectMap, "serverX509Names", b.ServerX509Names) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type BackendUpdateParameters. -func (b BackendUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", b.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CacheUpdateParameters. -func (c CacheUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", c.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type CertificateContractProperties. -func (c CertificateContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "expirationDate", c.ExpirationDate) - populate(objectMap, "keyVault", c.KeyVault) - populate(objectMap, "subject", c.Subject) - populate(objectMap, "thumbprint", c.Thumbprint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateContractProperties. -func (c *CertificateContractProperties) UnmarshalJSON(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 "expirationDate": - err = unpopulateTimeRFC3339(val, "ExpirationDate", &c.ExpirationDate) - delete(rawMsg, key) - case "keyVault": - err = unpopulate(val, "KeyVault", &c.KeyVault) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &c.Subject) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type CertificateInformation. -func (c CertificateInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "expiry", c.Expiry) - populate(objectMap, "subject", c.Subject) - populate(objectMap, "thumbprint", c.Thumbprint) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateInformation. -func (c *CertificateInformation) UnmarshalJSON(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 "expiry": - err = unpopulateTimeRFC3339(val, "Expiry", &c.Expiry) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, "Subject", &c.Subject) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, "Thumbprint", &c.Thumbprint) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration. -func (c ConnectivityCheckRequestProtocolConfigurationHTTPConfiguration) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "headers", c.Headers) - populate(objectMap, "method", c.Method) - populate(objectMap, "validStatusCodes", c.ValidStatusCodes) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ConnectivityStatusContract. -func (c *ConnectivityStatusContract) UnmarshalJSON(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 "error": - err = unpopulate(val, "Error", &c.Error) - delete(rawMsg, key) - case "isOptional": - err = unpopulate(val, "IsOptional", &c.IsOptional) - delete(rawMsg, key) - case "lastStatusChange": - err = unpopulateTimeRFC3339(val, "LastStatusChange", &c.LastStatusChange) - delete(rawMsg, key) - case "lastUpdated": - err = unpopulateTimeRFC3339(val, "LastUpdated", &c.LastUpdated) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &c.Name) - delete(rawMsg, key) - case "resourceType": - err = unpopulate(val, "ResourceType", &c.ResourceType) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &c.Status) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", c, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ContentItemContract. -func (c ContentItemContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", c.ID) - populate(objectMap, "name", c.Name) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "type", c.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DataMasking. -func (d DataMasking) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "headers", d.Headers) - populate(objectMap, "queryParams", d.QueryParams) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type DeletedServiceContractProperties. -func (d DeletedServiceContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "deletionDate", d.DeletionDate) - populateTimeRFC3339(objectMap, "scheduledPurgeDate", d.ScheduledPurgeDate) - populate(objectMap, "serviceId", d.ServiceID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DeletedServiceContractProperties. -func (d *DeletedServiceContractProperties) UnmarshalJSON(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 "deletionDate": - err = unpopulateTimeRFC3339(val, "DeletionDate", &d.DeletionDate) - delete(rawMsg, key) - case "scheduledPurgeDate": - err = unpopulateTimeRFC3339(val, "ScheduledPurgeDate", &d.ScheduledPurgeDate) - delete(rawMsg, key) - case "serviceId": - err = unpopulate(val, "ServiceID", &d.ServiceID) - 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 DiagnosticContract. -func (d DiagnosticContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", d.ID) - populate(objectMap, "name", d.Name) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "type", d.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EmailTemplateContractProperties. -func (e EmailTemplateContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "body", e.Body) - populate(objectMap, "description", e.Description) - populate(objectMap, "isDefault", e.IsDefault) - populate(objectMap, "parameters", e.Parameters) - populate(objectMap, "subject", e.Subject) - populate(objectMap, "title", e.Title) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EmailTemplateUpdateParameterProperties. -func (e EmailTemplateUpdateParameterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "body", e.Body) - populate(objectMap, "description", e.Description) - populate(objectMap, "parameters", e.Parameters) - populate(objectMap, "subject", e.Subject) - populate(objectMap, "title", e.Title) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type EmailTemplateUpdateParameters. -func (e EmailTemplateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", e.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ErrorResponseBody. -func (e ErrorResponseBody) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GatewayContract. -func (g GatewayContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", g.ID) - populate(objectMap, "name", g.Name) - populate(objectMap, "properties", g.Properties) - populate(objectMap, "type", g.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type GatewayTokenRequestContract. -func (g GatewayTokenRequestContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "expiry", g.Expiry) - populate(objectMap, "keyType", g.KeyType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type GatewayTokenRequestContract. -func (g *GatewayTokenRequestContract) UnmarshalJSON(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 "expiry": - err = unpopulateTimeRFC3339(val, "Expiry", &g.Expiry) - delete(rawMsg, key) - case "keyType": - err = unpopulate(val, "KeyType", &g.KeyType) - 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 GroupUpdateParameters. -func (g GroupUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", g.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type HTTPMessageDiagnostic. -func (h HTTPMessageDiagnostic) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "body", h.Body) - populate(objectMap, "dataMasking", h.DataMasking) - populate(objectMap, "headers", h.Headers) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderBaseParameters. -func (i IdentityProviderBaseParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowedTenants", i.AllowedTenants) - populate(objectMap, "authority", i.Authority) - populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) - populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) - populate(objectMap, "signinPolicyName", i.SigninPolicyName) - populate(objectMap, "signinTenant", i.SigninTenant) - populate(objectMap, "signupPolicyName", i.SignupPolicyName) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderContractProperties. -func (i IdentityProviderContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowedTenants", i.AllowedTenants) - populate(objectMap, "authority", i.Authority) - populate(objectMap, "clientId", i.ClientID) - populate(objectMap, "clientSecret", i.ClientSecret) - populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) - populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) - populate(objectMap, "signinPolicyName", i.SigninPolicyName) - populate(objectMap, "signinTenant", i.SigninTenant) - populate(objectMap, "signupPolicyName", i.SignupPolicyName) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderCreateContractProperties. -func (i IdentityProviderCreateContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowedTenants", i.AllowedTenants) - populate(objectMap, "authority", i.Authority) - populate(objectMap, "clientId", i.ClientID) - populate(objectMap, "clientSecret", i.ClientSecret) - populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) - populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) - populate(objectMap, "signinPolicyName", i.SigninPolicyName) - populate(objectMap, "signinTenant", i.SigninTenant) - populate(objectMap, "signupPolicyName", i.SignupPolicyName) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderUpdateParameters. -func (i IdentityProviderUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", i.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type IdentityProviderUpdateProperties. -func (i IdentityProviderUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowedTenants", i.AllowedTenants) - populate(objectMap, "authority", i.Authority) - populate(objectMap, "clientId", i.ClientID) - populate(objectMap, "clientSecret", i.ClientSecret) - populate(objectMap, "passwordResetPolicyName", i.PasswordResetPolicyName) - populate(objectMap, "profileEditingPolicyName", i.ProfileEditingPolicyName) - populate(objectMap, "signinPolicyName", i.SigninPolicyName) - populate(objectMap, "signinTenant", i.SigninTenant) - populate(objectMap, "signupPolicyName", i.SignupPolicyName) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type IssueCommentContractProperties. -func (i IssueCommentContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) - populate(objectMap, "text", i.Text) - populate(objectMap, "userId", i.UserID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueCommentContractProperties. -func (i *IssueCommentContractProperties) UnmarshalJSON(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 "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) - delete(rawMsg, key) - case "text": - err = unpopulate(val, "Text", &i.Text) - delete(rawMsg, key) - case "userId": - err = unpopulate(val, "UserID", &i.UserID) - 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 IssueContractBaseProperties. -func (i IssueContractBaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiId", i.APIID) - populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) - populate(objectMap, "state", i.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueContractBaseProperties. -func (i *IssueContractBaseProperties) UnmarshalJSON(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 "apiId": - err = unpopulate(val, "APIID", &i.APIID) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &i.State) - 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 IssueContractProperties. -func (i IssueContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiId", i.APIID) - populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) - populate(objectMap, "description", i.Description) - populate(objectMap, "state", i.State) - populate(objectMap, "title", i.Title) - populate(objectMap, "userId", i.UserID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueContractProperties. -func (i *IssueContractProperties) UnmarshalJSON(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 "apiId": - err = unpopulate(val, "APIID", &i.APIID) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &i.Description) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &i.State) - delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &i.Title) - delete(rawMsg, key) - case "userId": - err = unpopulate(val, "UserID", &i.UserID) - 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 IssueUpdateContract. -func (i IssueUpdateContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", i.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type IssueUpdateContractProperties. -func (i IssueUpdateContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiId", i.APIID) - populateTimeRFC3339(objectMap, "createdDate", i.CreatedDate) - populate(objectMap, "description", i.Description) - populate(objectMap, "state", i.State) - populate(objectMap, "title", i.Title) - populate(objectMap, "userId", i.UserID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type IssueUpdateContractProperties. -func (i *IssueUpdateContractProperties) UnmarshalJSON(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 "apiId": - err = unpopulate(val, "APIID", &i.APIID) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &i.CreatedDate) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &i.Description) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &i.State) - delete(rawMsg, key) - case "title": - err = unpopulate(val, "Title", &i.Title) - delete(rawMsg, key) - case "userId": - err = unpopulate(val, "UserID", &i.UserID) - 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 KeyVaultLastAccessStatusContractProperties. -func (k KeyVaultLastAccessStatusContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "code", k.Code) - populate(objectMap, "message", k.Message) - populateTimeRFC3339(objectMap, "timeStampUtc", k.TimeStampUTC) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type KeyVaultLastAccessStatusContractProperties. -func (k *KeyVaultLastAccessStatusContractProperties) UnmarshalJSON(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 "code": - err = unpopulate(val, "Code", &k.Code) - delete(rawMsg, key) - case "message": - err = unpopulate(val, "Message", &k.Message) - delete(rawMsg, key) - case "timeStampUtc": - err = unpopulateTimeRFC3339(val, "TimeStampUTC", &k.TimeStampUTC) - 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 LoggerContractProperties. -func (l LoggerContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "credentials", l.Credentials) - populate(objectMap, "description", l.Description) - populate(objectMap, "isBuffered", l.IsBuffered) - populate(objectMap, "loggerType", l.LoggerType) - populate(objectMap, "resourceId", l.ResourceID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LoggerUpdateContract. -func (l LoggerUpdateContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", l.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type LoggerUpdateParameters. -func (l LoggerUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "credentials", l.Credentials) - populate(objectMap, "description", l.Description) - populate(objectMap, "isBuffered", l.IsBuffered) - populate(objectMap, "loggerType", l.LoggerType) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NamedValueContractProperties. -func (n NamedValueContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "displayName", n.DisplayName) - populate(objectMap, "keyVault", n.KeyVault) - populate(objectMap, "secret", n.Secret) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "value", n.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NamedValueCreateContractProperties. -func (n NamedValueCreateContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "displayName", n.DisplayName) - populate(objectMap, "keyVault", n.KeyVault) - populate(objectMap, "secret", n.Secret) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "value", n.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NamedValueEntityBaseParameters. -func (n NamedValueEntityBaseParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "secret", n.Secret) - populate(objectMap, "tags", n.Tags) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NamedValueUpdateParameterProperties. -func (n NamedValueUpdateParameterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "displayName", n.DisplayName) - populate(objectMap, "keyVault", n.KeyVault) - populate(objectMap, "secret", n.Secret) - populate(objectMap, "tags", n.Tags) - populate(objectMap, "value", n.Value) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type NamedValueUpdateParameters. -func (n NamedValueUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", n.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OpenIDAuthenticationSettingsContract. -func (o OpenIDAuthenticationSettingsContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "bearerTokenSendingMethods", o.BearerTokenSendingMethods) - populate(objectMap, "openidProviderId", o.OpenidProviderID) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OpenidConnectProviderUpdateContract. -func (o OpenidConnectProviderUpdateContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", o.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OperationContractProperties. -func (o OperationContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", o.Description) - populate(objectMap, "displayName", o.DisplayName) - populate(objectMap, "method", o.Method) - populate(objectMap, "policies", o.Policies) - populate(objectMap, "request", o.Request) - populate(objectMap, "responses", o.Responses) - populate(objectMap, "templateParameters", o.TemplateParameters) - populate(objectMap, "urlTemplate", o.URLTemplate) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OperationEntityBaseContract. -func (o OperationEntityBaseContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", o.Description) - populate(objectMap, "policies", o.Policies) - populate(objectMap, "request", o.Request) - populate(objectMap, "responses", o.Responses) - populate(objectMap, "templateParameters", o.TemplateParameters) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OperationResultContractProperties. -func (o OperationResultContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "actionLog", o.ActionLog) - populate(objectMap, "error", o.Error) - populate(objectMap, "id", o.ID) - populate(objectMap, "resultInfo", o.ResultInfo) - populateTimeRFC3339(objectMap, "started", o.Started) - populate(objectMap, "status", o.Status) - populateTimeRFC3339(objectMap, "updated", o.Updated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type OperationResultContractProperties. -func (o *OperationResultContractProperties) UnmarshalJSON(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 "actionLog": - err = unpopulate(val, "ActionLog", &o.ActionLog) - 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 "resultInfo": - err = unpopulate(val, "ResultInfo", &o.ResultInfo) - delete(rawMsg, key) - case "started": - err = unpopulateTimeRFC3339(val, "Started", &o.Started) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &o.Status) - delete(rawMsg, key) - case "updated": - err = unpopulateTimeRFC3339(val, "Updated", &o.Updated) - 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 OperationUpdateContract. -func (o OperationUpdateContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", o.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type OperationUpdateContractProperties. -func (o OperationUpdateContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", o.Description) - populate(objectMap, "displayName", o.DisplayName) - populate(objectMap, "method", o.Method) - populate(objectMap, "policies", o.Policies) - populate(objectMap, "request", o.Request) - populate(objectMap, "responses", o.Responses) - populate(objectMap, "templateParameters", o.TemplateParameters) - populate(objectMap, "urlTemplate", o.URLTemplate) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ParameterContract. -func (p ParameterContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "defaultValue", p.DefaultValue) - populate(objectMap, "description", p.Description) - populate(objectMap, "examples", p.Examples) - populate(objectMap, "name", p.Name) - populate(objectMap, "required", p.Required) - populate(objectMap, "schemaId", p.SchemaID) - populate(objectMap, "type", p.Type) - populate(objectMap, "typeName", p.TypeName) - populate(objectMap, "values", p.Values) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PortalDelegationSettings. -func (p PortalDelegationSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PortalRevisionContract. -func (p PortalRevisionContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PortalRevisionContractProperties. -func (p PortalRevisionContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdDateTime", p.CreatedDateTime) - populate(objectMap, "description", p.Description) - populate(objectMap, "isCurrent", p.IsCurrent) - populate(objectMap, "status", p.Status) - populate(objectMap, "statusDetails", p.StatusDetails) - populateTimeRFC3339(objectMap, "updatedDateTime", p.UpdatedDateTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type PortalRevisionContractProperties. -func (p *PortalRevisionContractProperties) UnmarshalJSON(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 "createdDateTime": - err = unpopulateTimeRFC3339(val, "CreatedDateTime", &p.CreatedDateTime) - delete(rawMsg, key) - case "description": - err = unpopulate(val, "Description", &p.Description) - delete(rawMsg, key) - case "isCurrent": - err = unpopulate(val, "IsCurrent", &p.IsCurrent) - delete(rawMsg, key) - case "status": - err = unpopulate(val, "Status", &p.Status) - delete(rawMsg, key) - case "statusDetails": - err = unpopulate(val, "StatusDetails", &p.StatusDetails) - delete(rawMsg, key) - case "updatedDateTime": - err = unpopulateTimeRFC3339(val, "UpdatedDateTime", &p.UpdatedDateTime) - 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 PortalSigninSettings. -func (p PortalSigninSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PortalSignupSettings. -func (p PortalSignupSettings) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "name", p.Name) - populate(objectMap, "properties", p.Properties) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionWrapperProperties. -func (p PrivateEndpointConnectionWrapperProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupIds", p.GroupIDs) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ProductUpdateParameters. -func (p ProductUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", p.Properties) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type QuotaCounterContract. -func (q *QuotaCounterContract) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "counterKey": - err = unpopulate(val, "CounterKey", &q.CounterKey) - delete(rawMsg, key) - case "periodEndTime": - err = unpopulateTimeRFC3339(val, "PeriodEndTime", &q.PeriodEndTime) - delete(rawMsg, key) - case "periodKey": - err = unpopulate(val, "PeriodKey", &q.PeriodKey) - delete(rawMsg, key) - case "periodStartTime": - err = unpopulateTimeRFC3339(val, "PeriodStartTime", &q.PeriodStartTime) - delete(rawMsg, key) - case "value": - err = unpopulate(val, "Value", &q.Value) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", q, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type QuotaCounterValueUpdateContract. -func (q QuotaCounterValueUpdateContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", q.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RecipientsContractProperties. -func (r RecipientsContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "emails", r.Emails) - populate(objectMap, "users", r.Users) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ReportRecordContract. -func (r *ReportRecordContract) UnmarshalJSON(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 "apiId": - err = unpopulate(val, "APIID", &r.APIID) - delete(rawMsg, key) - case "apiRegion": - err = unpopulate(val, "APIRegion", &r.APIRegion) - delete(rawMsg, key) - case "apiTimeAvg": - err = unpopulate(val, "APITimeAvg", &r.APITimeAvg) - delete(rawMsg, key) - case "apiTimeMax": - err = unpopulate(val, "APITimeMax", &r.APITimeMax) - delete(rawMsg, key) - case "apiTimeMin": - err = unpopulate(val, "APITimeMin", &r.APITimeMin) - delete(rawMsg, key) - case "bandwidth": - err = unpopulate(val, "Bandwidth", &r.Bandwidth) - delete(rawMsg, key) - case "cacheHitCount": - err = unpopulate(val, "CacheHitCount", &r.CacheHitCount) - delete(rawMsg, key) - case "cacheMissCount": - err = unpopulate(val, "CacheMissCount", &r.CacheMissCount) - delete(rawMsg, key) - case "callCountBlocked": - err = unpopulate(val, "CallCountBlocked", &r.CallCountBlocked) - delete(rawMsg, key) - case "callCountFailed": - err = unpopulate(val, "CallCountFailed", &r.CallCountFailed) - delete(rawMsg, key) - case "callCountOther": - err = unpopulate(val, "CallCountOther", &r.CallCountOther) - delete(rawMsg, key) - case "callCountSuccess": - err = unpopulate(val, "CallCountSuccess", &r.CallCountSuccess) - delete(rawMsg, key) - case "callCountTotal": - err = unpopulate(val, "CallCountTotal", &r.CallCountTotal) - delete(rawMsg, key) - case "country": - err = unpopulate(val, "Country", &r.Country) - delete(rawMsg, key) - case "interval": - err = unpopulate(val, "Interval", &r.Interval) - delete(rawMsg, key) - case "name": - err = unpopulate(val, "Name", &r.Name) - delete(rawMsg, key) - case "operationId": - err = unpopulate(val, "OperationID", &r.OperationID) - delete(rawMsg, key) - case "productId": - err = unpopulate(val, "ProductID", &r.ProductID) - delete(rawMsg, key) - case "region": - err = unpopulate(val, "Region", &r.Region) - delete(rawMsg, key) - case "serviceTimeAvg": - err = unpopulate(val, "ServiceTimeAvg", &r.ServiceTimeAvg) - delete(rawMsg, key) - case "serviceTimeMax": - err = unpopulate(val, "ServiceTimeMax", &r.ServiceTimeMax) - delete(rawMsg, key) - case "serviceTimeMin": - err = unpopulate(val, "ServiceTimeMin", &r.ServiceTimeMin) - delete(rawMsg, key) - case "subscriptionId": - err = unpopulate(val, "SubscriptionID", &r.SubscriptionID) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &r.Timestamp) - delete(rawMsg, key) - case "userId": - err = unpopulate(val, "UserID", &r.UserID) - delete(rawMsg, key) - case "zip": - err = unpopulate(val, "Zip", &r.Zip) - 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 RepresentationContract. -func (r RepresentationContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "contentType", r.ContentType) - populate(objectMap, "examples", r.Examples) - populate(objectMap, "formParameters", r.FormParameters) - populate(objectMap, "schemaId", r.SchemaID) - populate(objectMap, "typeName", r.TypeName) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type RequestContract. -func (r RequestContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", r.Description) - populate(objectMap, "headers", r.Headers) - populate(objectMap, "queryParameters", r.QueryParameters) - populate(objectMap, "representations", r.Representations) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RequestReportRecordContract. -func (r *RequestReportRecordContract) UnmarshalJSON(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 "apiId": - err = unpopulate(val, "APIID", &r.APIID) - delete(rawMsg, key) - case "apiRegion": - err = unpopulate(val, "APIRegion", &r.APIRegion) - delete(rawMsg, key) - case "apiTime": - err = unpopulate(val, "APITime", &r.APITime) - delete(rawMsg, key) - case "backendResponseCode": - err = unpopulate(val, "BackendResponseCode", &r.BackendResponseCode) - delete(rawMsg, key) - case "cache": - err = unpopulate(val, "Cache", &r.Cache) - delete(rawMsg, key) - case "ipAddress": - err = unpopulate(val, "IPAddress", &r.IPAddress) - delete(rawMsg, key) - case "method": - err = unpopulate(val, "Method", &r.Method) - delete(rawMsg, key) - case "operationId": - err = unpopulate(val, "OperationID", &r.OperationID) - delete(rawMsg, key) - case "productId": - err = unpopulate(val, "ProductID", &r.ProductID) - delete(rawMsg, key) - case "requestId": - err = unpopulate(val, "RequestID", &r.RequestID) - delete(rawMsg, key) - case "requestSize": - err = unpopulate(val, "RequestSize", &r.RequestSize) - delete(rawMsg, key) - case "responseCode": - err = unpopulate(val, "ResponseCode", &r.ResponseCode) - delete(rawMsg, key) - case "responseSize": - err = unpopulate(val, "ResponseSize", &r.ResponseSize) - delete(rawMsg, key) - case "serviceTime": - err = unpopulate(val, "ServiceTime", &r.ServiceTime) - delete(rawMsg, key) - case "subscriptionId": - err = unpopulate(val, "SubscriptionID", &r.SubscriptionID) - delete(rawMsg, key) - case "timestamp": - err = unpopulateTimeRFC3339(val, "Timestamp", &r.Timestamp) - delete(rawMsg, key) - case "url": - err = unpopulate(val, "URL", &r.URL) - delete(rawMsg, key) - case "userId": - err = unpopulate(val, "UserID", &r.UserID) - 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 ResponseContract. -func (r ResponseContract) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", r.Description) - populate(objectMap, "headers", r.Headers) - populate(objectMap, "representations", r.Representations) - populate(objectMap, "statusCode", r.StatusCode) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceBaseProperties. -func (s ServiceBaseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiVersionConstraint", s.APIVersionConstraint) - populate(objectMap, "additionalLocations", s.AdditionalLocations) - populate(objectMap, "certificates", s.Certificates) - populateTimeRFC3339(objectMap, "createdAtUtc", s.CreatedAtUTC) - populate(objectMap, "customProperties", s.CustomProperties) - populate(objectMap, "developerPortalUrl", s.DeveloperPortalURL) - populate(objectMap, "disableGateway", s.DisableGateway) - populate(objectMap, "enableClientCertificate", s.EnableClientCertificate) - populate(objectMap, "gatewayRegionalUrl", s.GatewayRegionalURL) - populate(objectMap, "gatewayUrl", s.GatewayURL) - populate(objectMap, "hostnameConfigurations", s.HostnameConfigurations) - populate(objectMap, "managementApiUrl", s.ManagementAPIURL) - populate(objectMap, "notificationSenderEmail", s.NotificationSenderEmail) - populate(objectMap, "platformVersion", s.PlatformVersion) - populate(objectMap, "portalUrl", s.PortalURL) - populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) - populate(objectMap, "privateIPAddresses", s.PrivateIPAddresses) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "publicIpAddressId", s.PublicIPAddressID) - populate(objectMap, "publicIPAddresses", s.PublicIPAddresses) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "restore", s.Restore) - populate(objectMap, "scmUrl", s.ScmURL) - populate(objectMap, "targetProvisioningState", s.TargetProvisioningState) - populate(objectMap, "virtualNetworkConfiguration", s.VirtualNetworkConfiguration) - populate(objectMap, "virtualNetworkType", s.VirtualNetworkType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceBaseProperties. -func (s *ServiceBaseProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "apiVersionConstraint": - err = unpopulate(val, "APIVersionConstraint", &s.APIVersionConstraint) - delete(rawMsg, key) - case "additionalLocations": - err = unpopulate(val, "AdditionalLocations", &s.AdditionalLocations) - delete(rawMsg, key) - case "certificates": - err = unpopulate(val, "Certificates", &s.Certificates) - delete(rawMsg, key) - case "createdAtUtc": - err = unpopulateTimeRFC3339(val, "CreatedAtUTC", &s.CreatedAtUTC) - delete(rawMsg, key) - case "customProperties": - err = unpopulate(val, "CustomProperties", &s.CustomProperties) - delete(rawMsg, key) - case "developerPortalUrl": - err = unpopulate(val, "DeveloperPortalURL", &s.DeveloperPortalURL) - delete(rawMsg, key) - case "disableGateway": - err = unpopulate(val, "DisableGateway", &s.DisableGateway) - delete(rawMsg, key) - case "enableClientCertificate": - err = unpopulate(val, "EnableClientCertificate", &s.EnableClientCertificate) - delete(rawMsg, key) - case "gatewayRegionalUrl": - err = unpopulate(val, "GatewayRegionalURL", &s.GatewayRegionalURL) - delete(rawMsg, key) - case "gatewayUrl": - err = unpopulate(val, "GatewayURL", &s.GatewayURL) - delete(rawMsg, key) - case "hostnameConfigurations": - err = unpopulate(val, "HostnameConfigurations", &s.HostnameConfigurations) - delete(rawMsg, key) - case "managementApiUrl": - err = unpopulate(val, "ManagementAPIURL", &s.ManagementAPIURL) - delete(rawMsg, key) - case "notificationSenderEmail": - err = unpopulate(val, "NotificationSenderEmail", &s.NotificationSenderEmail) - delete(rawMsg, key) - case "platformVersion": - err = unpopulate(val, "PlatformVersion", &s.PlatformVersion) - delete(rawMsg, key) - case "portalUrl": - err = unpopulate(val, "PortalURL", &s.PortalURL) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) - delete(rawMsg, key) - case "privateIPAddresses": - err = unpopulate(val, "PrivateIPAddresses", &s.PrivateIPAddresses) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "publicIpAddressId": - err = unpopulate(val, "PublicIPAddressID", &s.PublicIPAddressID) - delete(rawMsg, key) - case "publicIPAddresses": - err = unpopulate(val, "PublicIPAddresses", &s.PublicIPAddresses) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "restore": - err = unpopulate(val, "Restore", &s.Restore) - delete(rawMsg, key) - case "scmUrl": - err = unpopulate(val, "ScmURL", &s.ScmURL) - delete(rawMsg, key) - case "targetProvisioningState": - err = unpopulate(val, "TargetProvisioningState", &s.TargetProvisioningState) - delete(rawMsg, key) - case "virtualNetworkConfiguration": - err = unpopulate(val, "VirtualNetworkConfiguration", &s.VirtualNetworkConfiguration) - delete(rawMsg, key) - case "virtualNetworkType": - err = unpopulate(val, "VirtualNetworkType", &s.VirtualNetworkType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceIdentity. -func (s ServiceIdentity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "principalId", s.PrincipalID) - populate(objectMap, "tenantId", s.TenantID) - populate(objectMap, "type", s.Type) - populate(objectMap, "userAssignedIdentities", s.UserAssignedIdentities) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceProperties. -func (s ServiceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiVersionConstraint", s.APIVersionConstraint) - populate(objectMap, "additionalLocations", s.AdditionalLocations) - populate(objectMap, "certificates", s.Certificates) - populateTimeRFC3339(objectMap, "createdAtUtc", s.CreatedAtUTC) - populate(objectMap, "customProperties", s.CustomProperties) - populate(objectMap, "developerPortalUrl", s.DeveloperPortalURL) - populate(objectMap, "disableGateway", s.DisableGateway) - populate(objectMap, "enableClientCertificate", s.EnableClientCertificate) - populate(objectMap, "gatewayRegionalUrl", s.GatewayRegionalURL) - populate(objectMap, "gatewayUrl", s.GatewayURL) - populate(objectMap, "hostnameConfigurations", s.HostnameConfigurations) - populate(objectMap, "managementApiUrl", s.ManagementAPIURL) - populate(objectMap, "notificationSenderEmail", s.NotificationSenderEmail) - populate(objectMap, "platformVersion", s.PlatformVersion) - populate(objectMap, "portalUrl", s.PortalURL) - populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) - populate(objectMap, "privateIPAddresses", s.PrivateIPAddresses) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "publicIpAddressId", s.PublicIPAddressID) - populate(objectMap, "publicIPAddresses", s.PublicIPAddresses) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "publisherEmail", s.PublisherEmail) - populate(objectMap, "publisherName", s.PublisherName) - populate(objectMap, "restore", s.Restore) - populate(objectMap, "scmUrl", s.ScmURL) - populate(objectMap, "targetProvisioningState", s.TargetProvisioningState) - populate(objectMap, "virtualNetworkConfiguration", s.VirtualNetworkConfiguration) - populate(objectMap, "virtualNetworkType", s.VirtualNetworkType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceProperties. -func (s *ServiceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "apiVersionConstraint": - err = unpopulate(val, "APIVersionConstraint", &s.APIVersionConstraint) - delete(rawMsg, key) - case "additionalLocations": - err = unpopulate(val, "AdditionalLocations", &s.AdditionalLocations) - delete(rawMsg, key) - case "certificates": - err = unpopulate(val, "Certificates", &s.Certificates) - delete(rawMsg, key) - case "createdAtUtc": - err = unpopulateTimeRFC3339(val, "CreatedAtUTC", &s.CreatedAtUTC) - delete(rawMsg, key) - case "customProperties": - err = unpopulate(val, "CustomProperties", &s.CustomProperties) - delete(rawMsg, key) - case "developerPortalUrl": - err = unpopulate(val, "DeveloperPortalURL", &s.DeveloperPortalURL) - delete(rawMsg, key) - case "disableGateway": - err = unpopulate(val, "DisableGateway", &s.DisableGateway) - delete(rawMsg, key) - case "enableClientCertificate": - err = unpopulate(val, "EnableClientCertificate", &s.EnableClientCertificate) - delete(rawMsg, key) - case "gatewayRegionalUrl": - err = unpopulate(val, "GatewayRegionalURL", &s.GatewayRegionalURL) - delete(rawMsg, key) - case "gatewayUrl": - err = unpopulate(val, "GatewayURL", &s.GatewayURL) - delete(rawMsg, key) - case "hostnameConfigurations": - err = unpopulate(val, "HostnameConfigurations", &s.HostnameConfigurations) - delete(rawMsg, key) - case "managementApiUrl": - err = unpopulate(val, "ManagementAPIURL", &s.ManagementAPIURL) - delete(rawMsg, key) - case "notificationSenderEmail": - err = unpopulate(val, "NotificationSenderEmail", &s.NotificationSenderEmail) - delete(rawMsg, key) - case "platformVersion": - err = unpopulate(val, "PlatformVersion", &s.PlatformVersion) - delete(rawMsg, key) - case "portalUrl": - err = unpopulate(val, "PortalURL", &s.PortalURL) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) - delete(rawMsg, key) - case "privateIPAddresses": - err = unpopulate(val, "PrivateIPAddresses", &s.PrivateIPAddresses) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "publicIpAddressId": - err = unpopulate(val, "PublicIPAddressID", &s.PublicIPAddressID) - delete(rawMsg, key) - case "publicIPAddresses": - err = unpopulate(val, "PublicIPAddresses", &s.PublicIPAddresses) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "publisherEmail": - err = unpopulate(val, "PublisherEmail", &s.PublisherEmail) - delete(rawMsg, key) - case "publisherName": - err = unpopulate(val, "PublisherName", &s.PublisherName) - delete(rawMsg, key) - case "restore": - err = unpopulate(val, "Restore", &s.Restore) - delete(rawMsg, key) - case "scmUrl": - err = unpopulate(val, "ScmURL", &s.ScmURL) - delete(rawMsg, key) - case "targetProvisioningState": - err = unpopulate(val, "TargetProvisioningState", &s.TargetProvisioningState) - delete(rawMsg, key) - case "virtualNetworkConfiguration": - err = unpopulate(val, "VirtualNetworkConfiguration", &s.VirtualNetworkConfiguration) - delete(rawMsg, key) - case "virtualNetworkType": - err = unpopulate(val, "VirtualNetworkType", &s.VirtualNetworkType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceResource. -func (s ServiceResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "location", s.Location) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - populate(objectMap, "zones", s.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceUpdateParameters. -func (s ServiceUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "name", s.Name) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - populate(objectMap, "zones", s.Zones) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type ServiceUpdateProperties. -func (s ServiceUpdateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "apiVersionConstraint", s.APIVersionConstraint) - populate(objectMap, "additionalLocations", s.AdditionalLocations) - populate(objectMap, "certificates", s.Certificates) - populateTimeRFC3339(objectMap, "createdAtUtc", s.CreatedAtUTC) - populate(objectMap, "customProperties", s.CustomProperties) - populate(objectMap, "developerPortalUrl", s.DeveloperPortalURL) - populate(objectMap, "disableGateway", s.DisableGateway) - populate(objectMap, "enableClientCertificate", s.EnableClientCertificate) - populate(objectMap, "gatewayRegionalUrl", s.GatewayRegionalURL) - populate(objectMap, "gatewayUrl", s.GatewayURL) - populate(objectMap, "hostnameConfigurations", s.HostnameConfigurations) - populate(objectMap, "managementApiUrl", s.ManagementAPIURL) - populate(objectMap, "notificationSenderEmail", s.NotificationSenderEmail) - populate(objectMap, "platformVersion", s.PlatformVersion) - populate(objectMap, "portalUrl", s.PortalURL) - populate(objectMap, "privateEndpointConnections", s.PrivateEndpointConnections) - populate(objectMap, "privateIPAddresses", s.PrivateIPAddresses) - populate(objectMap, "provisioningState", s.ProvisioningState) - populate(objectMap, "publicIpAddressId", s.PublicIPAddressID) - populate(objectMap, "publicIPAddresses", s.PublicIPAddresses) - populate(objectMap, "publicNetworkAccess", s.PublicNetworkAccess) - populate(objectMap, "publisherEmail", s.PublisherEmail) - populate(objectMap, "publisherName", s.PublisherName) - populate(objectMap, "restore", s.Restore) - populate(objectMap, "scmUrl", s.ScmURL) - populate(objectMap, "targetProvisioningState", s.TargetProvisioningState) - populate(objectMap, "virtualNetworkConfiguration", s.VirtualNetworkConfiguration) - populate(objectMap, "virtualNetworkType", s.VirtualNetworkType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ServiceUpdateProperties. -func (s *ServiceUpdateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "apiVersionConstraint": - err = unpopulate(val, "APIVersionConstraint", &s.APIVersionConstraint) - delete(rawMsg, key) - case "additionalLocations": - err = unpopulate(val, "AdditionalLocations", &s.AdditionalLocations) - delete(rawMsg, key) - case "certificates": - err = unpopulate(val, "Certificates", &s.Certificates) - delete(rawMsg, key) - case "createdAtUtc": - err = unpopulateTimeRFC3339(val, "CreatedAtUTC", &s.CreatedAtUTC) - delete(rawMsg, key) - case "customProperties": - err = unpopulate(val, "CustomProperties", &s.CustomProperties) - delete(rawMsg, key) - case "developerPortalUrl": - err = unpopulate(val, "DeveloperPortalURL", &s.DeveloperPortalURL) - delete(rawMsg, key) - case "disableGateway": - err = unpopulate(val, "DisableGateway", &s.DisableGateway) - delete(rawMsg, key) - case "enableClientCertificate": - err = unpopulate(val, "EnableClientCertificate", &s.EnableClientCertificate) - delete(rawMsg, key) - case "gatewayRegionalUrl": - err = unpopulate(val, "GatewayRegionalURL", &s.GatewayRegionalURL) - delete(rawMsg, key) - case "gatewayUrl": - err = unpopulate(val, "GatewayURL", &s.GatewayURL) - delete(rawMsg, key) - case "hostnameConfigurations": - err = unpopulate(val, "HostnameConfigurations", &s.HostnameConfigurations) - delete(rawMsg, key) - case "managementApiUrl": - err = unpopulate(val, "ManagementAPIURL", &s.ManagementAPIURL) - delete(rawMsg, key) - case "notificationSenderEmail": - err = unpopulate(val, "NotificationSenderEmail", &s.NotificationSenderEmail) - delete(rawMsg, key) - case "platformVersion": - err = unpopulate(val, "PlatformVersion", &s.PlatformVersion) - delete(rawMsg, key) - case "portalUrl": - err = unpopulate(val, "PortalURL", &s.PortalURL) - delete(rawMsg, key) - case "privateEndpointConnections": - err = unpopulate(val, "PrivateEndpointConnections", &s.PrivateEndpointConnections) - delete(rawMsg, key) - case "privateIPAddresses": - err = unpopulate(val, "PrivateIPAddresses", &s.PrivateIPAddresses) - delete(rawMsg, key) - case "provisioningState": - err = unpopulate(val, "ProvisioningState", &s.ProvisioningState) - delete(rawMsg, key) - case "publicIpAddressId": - err = unpopulate(val, "PublicIPAddressID", &s.PublicIPAddressID) - delete(rawMsg, key) - case "publicIPAddresses": - err = unpopulate(val, "PublicIPAddresses", &s.PublicIPAddresses) - delete(rawMsg, key) - case "publicNetworkAccess": - err = unpopulate(val, "PublicNetworkAccess", &s.PublicNetworkAccess) - delete(rawMsg, key) - case "publisherEmail": - err = unpopulate(val, "PublisherEmail", &s.PublisherEmail) - delete(rawMsg, key) - case "publisherName": - err = unpopulate(val, "PublisherName", &s.PublisherName) - delete(rawMsg, key) - case "restore": - err = unpopulate(val, "Restore", &s.Restore) - delete(rawMsg, key) - case "scmUrl": - err = unpopulate(val, "ScmURL", &s.ScmURL) - delete(rawMsg, key) - case "targetProvisioningState": - err = unpopulate(val, "TargetProvisioningState", &s.TargetProvisioningState) - delete(rawMsg, key) - case "virtualNetworkConfiguration": - err = unpopulate(val, "VirtualNetworkConfiguration", &s.VirtualNetworkConfiguration) - delete(rawMsg, key) - case "virtualNetworkType": - err = unpopulate(val, "VirtualNetworkType", &s.VirtualNetworkType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubscriptionContractProperties. -func (s SubscriptionContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowTracing", s.AllowTracing) - populateTimeRFC3339(objectMap, "createdDate", s.CreatedDate) - populate(objectMap, "displayName", s.DisplayName) - populateTimeRFC3339(objectMap, "endDate", s.EndDate) - populateTimeRFC3339(objectMap, "expirationDate", s.ExpirationDate) - populateTimeRFC3339(objectMap, "notificationDate", s.NotificationDate) - populate(objectMap, "ownerId", s.OwnerID) - populate(objectMap, "primaryKey", s.PrimaryKey) - populate(objectMap, "scope", s.Scope) - populate(objectMap, "secondaryKey", s.SecondaryKey) - populateTimeRFC3339(objectMap, "startDate", s.StartDate) - populate(objectMap, "state", s.State) - populate(objectMap, "stateComment", s.StateComment) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionContractProperties. -func (s *SubscriptionContractProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowTracing": - err = unpopulate(val, "AllowTracing", &s.AllowTracing) - delete(rawMsg, key) - case "createdDate": - err = unpopulateTimeRFC3339(val, "CreatedDate", &s.CreatedDate) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &s.DisplayName) - delete(rawMsg, key) - case "endDate": - err = unpopulateTimeRFC3339(val, "EndDate", &s.EndDate) - delete(rawMsg, key) - case "expirationDate": - err = unpopulateTimeRFC3339(val, "ExpirationDate", &s.ExpirationDate) - delete(rawMsg, key) - case "notificationDate": - err = unpopulateTimeRFC3339(val, "NotificationDate", &s.NotificationDate) - delete(rawMsg, key) - case "ownerId": - err = unpopulate(val, "OwnerID", &s.OwnerID) - delete(rawMsg, key) - case "primaryKey": - err = unpopulate(val, "PrimaryKey", &s.PrimaryKey) - delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &s.Scope) - delete(rawMsg, key) - case "secondaryKey": - err = unpopulate(val, "SecondaryKey", &s.SecondaryKey) - delete(rawMsg, key) - case "startDate": - err = unpopulateTimeRFC3339(val, "StartDate", &s.StartDate) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - case "stateComment": - err = unpopulate(val, "StateComment", &s.StateComment) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubscriptionUpdateParameterProperties. -func (s SubscriptionUpdateParameterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allowTracing", s.AllowTracing) - populate(objectMap, "displayName", s.DisplayName) - populateTimeRFC3339(objectMap, "expirationDate", s.ExpirationDate) - populate(objectMap, "ownerId", s.OwnerID) - populate(objectMap, "primaryKey", s.PrimaryKey) - populate(objectMap, "scope", s.Scope) - populate(objectMap, "secondaryKey", s.SecondaryKey) - populate(objectMap, "state", s.State) - populate(objectMap, "stateComment", s.StateComment) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SubscriptionUpdateParameterProperties. -func (s *SubscriptionUpdateParameterProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "allowTracing": - err = unpopulate(val, "AllowTracing", &s.AllowTracing) - delete(rawMsg, key) - case "displayName": - err = unpopulate(val, "DisplayName", &s.DisplayName) - delete(rawMsg, key) - case "expirationDate": - err = unpopulateTimeRFC3339(val, "ExpirationDate", &s.ExpirationDate) - delete(rawMsg, key) - case "ownerId": - err = unpopulate(val, "OwnerID", &s.OwnerID) - delete(rawMsg, key) - case "primaryKey": - err = unpopulate(val, "PrimaryKey", &s.PrimaryKey) - delete(rawMsg, key) - case "scope": - err = unpopulate(val, "Scope", &s.Scope) - delete(rawMsg, key) - case "secondaryKey": - err = unpopulate(val, "SecondaryKey", &s.SecondaryKey) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &s.State) - delete(rawMsg, key) - case "stateComment": - err = unpopulate(val, "StateComment", &s.StateComment) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type SubscriptionUpdateParameters. -func (s SubscriptionUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", s.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type SystemData. -func (s SystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "createdAt", s.CreatedAt) - populate(objectMap, "createdBy", s.CreatedBy) - populate(objectMap, "createdByType", s.CreatedByType) - populateTimeRFC3339(objectMap, "lastModifiedAt", s.LastModifiedAt) - populate(objectMap, "lastModifiedBy", s.LastModifiedBy) - populate(objectMap, "lastModifiedByType", s.LastModifiedByType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SystemData. -func (s *SystemData) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, "CreatedAt", &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, "CreatedBy", &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, "CreatedByType", &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, "LastModifiedAt", &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, "LastModifiedBy", &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, "LastModifiedByType", &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", s, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TagCreateUpdateParameters. -func (t TagCreateUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", t.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type TenantConfigurationSyncStateContractProperties. -func (t TenantConfigurationSyncStateContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "branch", t.Branch) - populate(objectMap, "commitId", t.CommitID) - populateTimeRFC3339(objectMap, "configurationChangeDate", t.ConfigurationChangeDate) - populate(objectMap, "isExport", t.IsExport) - populate(objectMap, "isGitEnabled", t.IsGitEnabled) - populate(objectMap, "isSynced", t.IsSynced) - populate(objectMap, "lastOperationId", t.LastOperationID) - populateTimeRFC3339(objectMap, "syncDate", t.SyncDate) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type TenantConfigurationSyncStateContractProperties. -func (t *TenantConfigurationSyncStateContractProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - for key, val := range rawMsg { - var err error - switch key { - case "branch": - err = unpopulate(val, "Branch", &t.Branch) - delete(rawMsg, key) - case "commitId": - err = unpopulate(val, "CommitID", &t.CommitID) - delete(rawMsg, key) - case "configurationChangeDate": - err = unpopulateTimeRFC3339(val, "ConfigurationChangeDate", &t.ConfigurationChangeDate) - delete(rawMsg, key) - case "isExport": - err = unpopulate(val, "IsExport", &t.IsExport) - delete(rawMsg, key) - case "isGitEnabled": - err = unpopulate(val, "IsGitEnabled", &t.IsGitEnabled) - delete(rawMsg, key) - case "isSynced": - err = unpopulate(val, "IsSynced", &t.IsSynced) - delete(rawMsg, key) - case "lastOperationId": - err = unpopulate(val, "LastOperationID", &t.LastOperationID) - delete(rawMsg, key) - case "syncDate": - err = unpopulateTimeRFC3339(val, "SyncDate", &t.SyncDate) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", t, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type TenantSettingsContractProperties. -func (t TenantSettingsContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "settings", t.Settings) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type UserContractProperties. -func (u UserContractProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "email", u.Email) - populate(objectMap, "firstName", u.FirstName) - populate(objectMap, "groups", u.Groups) - populate(objectMap, "identities", u.Identities) - populate(objectMap, "lastName", u.LastName) - populate(objectMap, "note", u.Note) - populateTimeRFC3339(objectMap, "registrationDate", u.RegistrationDate) - populate(objectMap, "state", u.State) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserContractProperties. -func (u *UserContractProperties) UnmarshalJSON(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 "email": - err = unpopulate(val, "Email", &u.Email) - delete(rawMsg, key) - case "firstName": - err = unpopulate(val, "FirstName", &u.FirstName) - delete(rawMsg, key) - case "groups": - err = unpopulate(val, "Groups", &u.Groups) - delete(rawMsg, key) - case "identities": - err = unpopulate(val, "Identities", &u.Identities) - delete(rawMsg, key) - case "lastName": - err = unpopulate(val, "LastName", &u.LastName) - delete(rawMsg, key) - case "note": - err = unpopulate(val, "Note", &u.Note) - delete(rawMsg, key) - case "registrationDate": - err = unpopulateTimeRFC3339(val, "RegistrationDate", &u.RegistrationDate) - delete(rawMsg, key) - case "state": - err = unpopulate(val, "State", &u.State) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserCreateParameterProperties. -func (u UserCreateParameterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "appType", u.AppType) - populate(objectMap, "confirmation", u.Confirmation) - populate(objectMap, "email", u.Email) - populate(objectMap, "firstName", u.FirstName) - populate(objectMap, "identities", u.Identities) - populate(objectMap, "lastName", u.LastName) - populate(objectMap, "note", u.Note) - populate(objectMap, "password", u.Password) - populate(objectMap, "state", u.State) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type UserEntityBaseParameters. -func (u UserEntityBaseParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identities", u.Identities) - populate(objectMap, "note", u.Note) - populate(objectMap, "state", u.State) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type UserTokenParameterProperties. -func (u UserTokenParameterProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "expiry", u.Expiry) - populate(objectMap, "keyType", u.KeyType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserTokenParameterProperties. -func (u *UserTokenParameterProperties) UnmarshalJSON(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 "expiry": - err = unpopulateTimeRFC3339(val, "Expiry", &u.Expiry) - delete(rawMsg, key) - case "keyType": - err = unpopulate(val, "KeyType", &u.KeyType) - delete(rawMsg, key) - } - if err != nil { - return fmt.Errorf("unmarshalling type %T: %v", u, err) - } - } - return nil -} - -// MarshalJSON implements the json.Marshaller interface for type UserUpdateParameters. -func (u UserUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", u.Properties) - return json.Marshal(objectMap) -} - -// MarshalJSON implements the json.Marshaller interface for type UserUpdateParametersProperties. -func (u UserUpdateParametersProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "email", u.Email) - populate(objectMap, "firstName", u.FirstName) - populate(objectMap, "identities", u.Identities) - populate(objectMap, "lastName", u.LastName) - populate(objectMap, "note", u.Note) - populate(objectMap, "password", u.Password) - populate(objectMap, "state", u.State) - return json.Marshal(objectMap) -} - -func populate(m map[string]interface{}, k string, v interface{}) { - if v == nil { - return - } else if azcore.IsNullValue(v) { - m[k] = nil - } else if !reflect.ValueOf(v).IsNil() { - m[k] = v - } -} - -func unpopulate(data json.RawMessage, fn string, v interface{}) error { - if data == nil { - return nil - } - if err := json.Unmarshal(data, v); err != nil { - return fmt.Errorf("struct field %s: %v", fn, err) - } - return nil -}