From d2c9632581436e52f7113e5286fc93e6b233a556 Mon Sep 17 00:00:00 2001 From: Chenjie Shi Date: Fri, 10 Mar 2023 22:57:46 +0800 Subject: [PATCH] Fix for the preview.46 (#938) * fix redundant comma when no client params for client factory and pump version * use moduleName instead of hard code pkg name --- src/generator/clientFactory.ts | 4 ++-- src/generator/operations.ts | 2 +- src/package.json | 2 +- .../2019-12-01/armcompute/zz_availabilitysets_client.go | 2 +- test/compute/2019-12-01/armcompute/zz_client_factory.go | 2 +- .../2019-12-01/armcompute/zz_containerservices_client.go | 2 +- .../2019-12-01/armcompute/zz_dedicatedhostgroups_client.go | 2 +- .../compute/2019-12-01/armcompute/zz_dedicatedhosts_client.go | 2 +- .../2019-12-01/armcompute/zz_diskencryptionsets_client.go | 2 +- test/compute/2019-12-01/armcompute/zz_disks_client.go | 2 +- test/compute/2019-12-01/armcompute/zz_galleries_client.go | 2 +- .../2019-12-01/armcompute/zz_galleryapplications_client.go | 2 +- .../armcompute/zz_galleryapplicationversions_client.go | 2 +- test/compute/2019-12-01/armcompute/zz_galleryimages_client.go | 2 +- .../2019-12-01/armcompute/zz_galleryimageversions_client.go | 2 +- test/compute/2019-12-01/armcompute/zz_images_client.go | 2 +- test/compute/2019-12-01/armcompute/zz_loganalytics_client.go | 2 +- test/compute/2019-12-01/armcompute/zz_operations_client.go | 2 +- .../armcompute/zz_proximityplacementgroups_client.go | 2 +- test/compute/2019-12-01/armcompute/zz_resourceskus_client.go | 2 +- test/compute/2019-12-01/armcompute/zz_snapshots_client.go | 2 +- test/compute/2019-12-01/armcompute/zz_sshpublickeys_client.go | 2 +- test/compute/2019-12-01/armcompute/zz_usage_client.go | 2 +- .../armcompute/zz_virtualmachineextensionimages_client.go | 2 +- .../armcompute/zz_virtualmachineextensions_client.go | 2 +- .../2019-12-01/armcompute/zz_virtualmachineimages_client.go | 2 +- .../armcompute/zz_virtualmachineruncommands_client.go | 2 +- .../2019-12-01/armcompute/zz_virtualmachines_client.go | 2 +- .../armcompute/zz_virtualmachinescalesetextensions_client.go | 2 +- .../zz_virtualmachinescalesetrollingupgrades_client.go | 2 +- .../armcompute/zz_virtualmachinescalesets_client.go | 2 +- .../zz_virtualmachinescalesetvmextensions_client.go | 2 +- .../armcompute/zz_virtualmachinescalesetvms_client.go | 2 +- .../2019-12-01/armcompute/zz_virtualmachinesizes_client.go | 2 +- .../2019-10-01/armconsumption/zz_aggregatedcost_client.go | 2 +- .../2019-10-01/armconsumption/zz_balances_client.go | 2 +- .../2019-10-01/armconsumption/zz_budgets_client.go | 2 +- .../2019-10-01/armconsumption/zz_charges_client.go | 2 +- .../2019-10-01/armconsumption/zz_client_factory.go | 2 +- .../2019-10-01/armconsumption/zz_credits_client.go | 2 +- .../consumption/2019-10-01/armconsumption/zz_events_client.go | 2 +- .../2019-10-01/armconsumption/zz_forecasts_client.go | 2 +- test/consumption/2019-10-01/armconsumption/zz_lots_client.go | 2 +- .../2019-10-01/armconsumption/zz_marketplaces_client.go | 2 +- .../2019-10-01/armconsumption/zz_operations_client.go | 2 +- .../2019-10-01/armconsumption/zz_pricesheet_client.go | 2 +- .../zz_reservationrecommendationdetails_client.go | 2 +- .../armconsumption/zz_reservationrecommendations_client.go | 2 +- .../armconsumption/zz_reservationsdetails_client.go | 2 +- .../armconsumption/zz_reservationssummaries_client.go | 2 +- .../armconsumption/zz_reservationtransactions_client.go | 2 +- test/consumption/2019-10-01/armconsumption/zz_tags_client.go | 2 +- .../2019-10-01/armconsumption/zz_usagedetails_client.go | 2 +- .../databoxedge/2021-02-01/armdataboxedge/zz_addons_client.go | 2 +- .../databoxedge/2021-02-01/armdataboxedge/zz_alerts_client.go | 2 +- .../2021-02-01/armdataboxedge/zz_availableskus_client.go | 2 +- .../2021-02-01/armdataboxedge/zz_bandwidthschedules_client.go | 2 +- .../2021-02-01/armdataboxedge/zz_client_factory.go | 2 +- .../2021-02-01/armdataboxedge/zz_containers_client.go | 2 +- .../2021-02-01/armdataboxedge/zz_devices_client.go | 2 +- .../2021-02-01/armdataboxedge/zz_diagnosticsettings_client.go | 2 +- test/databoxedge/2021-02-01/armdataboxedge/zz_jobs_client.go | 2 +- .../2021-02-01/armdataboxedge/zz_monitoringconfig_client.go | 2 +- test/databoxedge/2021-02-01/armdataboxedge/zz_nodes_client.go | 2 +- .../2021-02-01/armdataboxedge/zz_operations_client.go | 2 +- .../2021-02-01/armdataboxedge/zz_operationsstatus_client.go | 2 +- .../databoxedge/2021-02-01/armdataboxedge/zz_orders_client.go | 2 +- test/databoxedge/2021-02-01/armdataboxedge/zz_roles_client.go | 2 +- .../databoxedge/2021-02-01/armdataboxedge/zz_shares_client.go | 2 +- .../armdataboxedge/zz_storageaccountcredentials_client.go | 2 +- .../2021-02-01/armdataboxedge/zz_storageaccounts_client.go | 2 +- .../2021-02-01/armdataboxedge/zz_supportpackages_client.go | 2 +- .../2021-02-01/armdataboxedge/zz_triggers_client.go | 2 +- test/databoxedge/2021-02-01/armdataboxedge/zz_users_client.go | 2 +- .../2020-03-01/armnetwork/zz_applicationgateways_client.go | 2 +- .../armnetwork/zz_applicationsecuritygroups_client.go | 2 +- .../2020-03-01/armnetwork/zz_availabledelegations_client.go | 2 +- .../armnetwork/zz_availableendpointservices_client.go | 2 +- .../armnetwork/zz_availableprivateendpointtypes_client.go | 2 +- .../armnetwork/zz_availableresourcegroupdelegations_client.go | 2 +- .../armnetwork/zz_availableservicealiases_client.go | 2 +- .../2020-03-01/armnetwork/zz_azurefirewallfqdntags_client.go | 2 +- .../network/2020-03-01/armnetwork/zz_azurefirewalls_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_bastionhosts_client.go | 2 +- .../2020-03-01/armnetwork/zz_bgpservicecommunities_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_client_factory.go | 2 +- .../2020-03-01/armnetwork/zz_connectionmonitors_client.go | 2 +- .../2020-03-01/armnetwork/zz_ddoscustompolicies_client.go | 2 +- .../2020-03-01/armnetwork/zz_ddosprotectionplans_client.go | 2 +- .../2020-03-01/armnetwork/zz_defaultsecurityrules_client.go | 2 +- .../armnetwork/zz_expressroutecircuitauthorizations_client.go | 2 +- .../armnetwork/zz_expressroutecircuitconnections_client.go | 2 +- .../armnetwork/zz_expressroutecircuitpeerings_client.go | 2 +- .../2020-03-01/armnetwork/zz_expressroutecircuits_client.go | 2 +- .../armnetwork/zz_expressrouteconnections_client.go | 2 +- .../zz_expressroutecrossconnectionpeerings_client.go | 2 +- .../armnetwork/zz_expressroutecrossconnections_client.go | 2 +- .../2020-03-01/armnetwork/zz_expressroutegateways_client.go | 2 +- .../2020-03-01/armnetwork/zz_expressroutelinks_client.go | 2 +- .../2020-03-01/armnetwork/zz_expressrouteports_client.go | 2 +- .../armnetwork/zz_expressrouteportslocations_client.go | 2 +- .../armnetwork/zz_expressrouteserviceproviders_client.go | 2 +- .../2020-03-01/armnetwork/zz_firewallpolicies_client.go | 2 +- .../armnetwork/zz_firewallpolicyrulegroups_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_flowlogs_client.go | 2 +- .../armnetwork/zz_hubvirtualnetworkconnections_client.go | 2 +- .../2020-03-01/armnetwork/zz_inboundnatrules_client.go | 2 +- .../armnetwork/zz_interfaceipconfigurations_client.go | 2 +- .../2020-03-01/armnetwork/zz_interfaceloadbalancers_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_interfaces_client.go | 2 +- .../armnetwork/zz_interfacetapconfigurations_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_ipallocations_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_ipgroups_client.go | 2 +- .../armnetwork/zz_loadbalancerbackendaddresspools_client.go | 2 +- .../zz_loadbalancerfrontendipconfigurations_client.go | 2 +- .../armnetwork/zz_loadbalancerloadbalancingrules_client.go | 2 +- .../armnetwork/zz_loadbalancernetworkinterfaces_client.go | 2 +- .../armnetwork/zz_loadbalanceroutboundrules_client.go | 2 +- .../2020-03-01/armnetwork/zz_loadbalancerprobes_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_loadbalancers_client.go | 2 +- .../2020-03-01/armnetwork/zz_localnetworkgateways_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_management_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_natgateways_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_operations_client.go | 2 +- .../network/2020-03-01/armnetwork/zz_p2svpngateways_client.go | 2 +- .../network/2020-03-01/armnetwork/zz_packetcaptures_client.go | 2 +- .../zz_peerexpressroutecircuitconnections_client.go | 2 +- .../2020-03-01/armnetwork/zz_privatednszonegroups_client.go | 2 +- .../2020-03-01/armnetwork/zz_privateendpoints_client.go | 2 +- .../2020-03-01/armnetwork/zz_privatelinkservices_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_profiles_client.go | 2 +- .../2020-03-01/armnetwork/zz_publicipaddresses_client.go | 2 +- .../2020-03-01/armnetwork/zz_publicipprefixes_client.go | 2 +- .../armnetwork/zz_resourcenavigationlinks_client.go | 2 +- .../2020-03-01/armnetwork/zz_routefilterrules_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_routefilters_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_routes_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_routetables_client.go | 2 +- .../network/2020-03-01/armnetwork/zz_securitygroups_client.go | 2 +- .../armnetwork/zz_securitypartnerproviders_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_securityrules_client.go | 2 +- .../armnetwork/zz_serviceassociationlinks_client.go | 2 +- .../armnetwork/zz_serviceendpointpolicies_client.go | 2 +- .../armnetwork/zz_serviceendpointpolicydefinitions_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_servicetags_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_subnets_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_usages_client.go | 2 +- .../2020-03-01/armnetwork/zz_virtualappliances_client.go | 2 +- .../armnetwork/zz_virtualhubroutetablev2s_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_virtualhubs_client.go | 2 +- .../armnetwork/zz_virtualnetworkgatewayconnections_client.go | 2 +- .../2020-03-01/armnetwork/zz_virtualnetworkgateways_client.go | 2 +- .../2020-03-01/armnetwork/zz_virtualnetworkpeerings_client.go | 2 +- .../2020-03-01/armnetwork/zz_virtualnetworks_client.go | 2 +- .../2020-03-01/armnetwork/zz_virtualnetworktaps_client.go | 2 +- .../2020-03-01/armnetwork/zz_virtualrouterpeerings_client.go | 2 +- .../network/2020-03-01/armnetwork/zz_virtualrouters_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_virtualwans_client.go | 2 +- .../network/2020-03-01/armnetwork/zz_vpnconnections_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_vpngateways_client.go | 2 +- .../2020-03-01/armnetwork/zz_vpnlinkconnections_client.go | 2 +- .../armnetwork/zz_vpnserverconfigurations_client.go | 2 +- ..._vpnserverconfigurationsassociatedwithvirtualwan_client.go | 2 +- .../2020-03-01/armnetwork/zz_vpnsitelinkconnections_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_vpnsitelinks_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_vpnsites_client.go | 2 +- .../2020-03-01/armnetwork/zz_vpnsitesconfiguration_client.go | 2 +- test/network/2020-03-01/armnetwork/zz_watchers_client.go | 2 +- .../armnetwork/zz_webapplicationfirewallpolicies_client.go | 2 +- 169 files changed, 170 insertions(+), 170 deletions(-) diff --git a/src/generator/clientFactory.ts b/src/generator/clientFactory.ts index 9c861fd2b..228119497 100644 --- a/src/generator/clientFactory.ts +++ b/src/generator/clientFactory.ts @@ -56,8 +56,8 @@ export async function generateClientFactory(session: Session): Promis result += `${formatCommentAsBulletItem('credential - used to authorize requests. Usually a credential from azidentity.')}\n`; result += `${formatCommentAsBulletItem('options - pass nil to accept the default values.')}\n`; - result += `func NewClientFactory(${allClientParams.map(p => {return `${p.language.go!.name} ${formatParameterTypeName(p)}`;}).join(', ')}, credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {\n`; - result += '\t_, err := arm.NewClient("armcompute.ClientFactory", moduleVersion, credential, options)\n'; + result += `func NewClientFactory(${allClientParams.map(p => {return `${p.language.go!.name} ${formatParameterTypeName(p)}`;}).join(', ')}${allClientParams.length>0 ? ',' : ''} credential azcore.TokenCredential, options *arm.ClientOptions) (*ClientFactory, error) {\n`; + result += '\t_, err := arm.NewClient(moduleName+".ClientFactory", moduleVersion, credential, options)\n'; result += '\tif err != nil {\n'; result += '\t\treturn nil, err\n'; result += '\t}\n'; diff --git a/src/generator/operations.ts b/src/generator/operations.ts index cb07ef7a5..98d476929 100644 --- a/src/generator/operations.ts +++ b/src/generator/operations.ts @@ -141,7 +141,7 @@ export async function generateOperations(session: Session): Promise