From b97468893c4b33e34b422456e68a06159218aa7b Mon Sep 17 00:00:00 2001 From: Jonathan Cardenas Date: Tue, 21 Dec 2021 15:54:24 -0600 Subject: [PATCH 1/7] Upgrading prettier to version 2.5.1 --- src/generators/static/packageFileGenerator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generators/static/packageFileGenerator.ts b/src/generators/static/packageFileGenerator.ts index d38358ff93..9d4681cff6 100644 --- a/src/generators/static/packageFileGenerator.ts +++ b/src/generators/static/packageFileGenerator.ts @@ -106,7 +106,7 @@ function restLevelPackage(packageDetails: PackageDetails) { "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", dotenv: "^8.2.0", - prettier: "^2.2.1", + prettier: "^2.5.1", "ts-node": "^9.1.1", typescript: "~4.2.4", mkdirp: "^1.0.4", From 90069c106544fc1dda9e97fd087c3dea985b9ed8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20C=C3=A1rdenas?= Date: Mon, 3 Jan 2022 20:44:10 +0000 Subject: [PATCH 2/7] Regen integration tests --- test/integration/generated/additionalProperties/LICENSE | 2 +- test/integration/generated/appconfiguration/LICENSE | 2 +- test/integration/generated/appconfigurationexport/LICENSE | 2 +- test/integration/generated/arrayConstraints/LICENSE | 2 +- test/integration/generated/attestation/LICENSE | 2 +- test/integration/generated/azureParameterGrouping/LICENSE | 2 +- test/integration/generated/azureReport/LICENSE | 2 +- test/integration/generated/azureSpecialProperties/LICENSE | 2 +- test/integration/generated/bodyArray/LICENSE | 2 +- test/integration/generated/bodyBoolean/LICENSE | 2 +- test/integration/generated/bodyBooleanQuirks/LICENSE | 2 +- test/integration/generated/bodyByte/LICENSE | 2 +- test/integration/generated/bodyComplex/LICENSE | 2 +- test/integration/generated/bodyComplexRest/LICENSE | 2 +- test/integration/generated/bodyComplexRest/package.json | 2 +- test/integration/generated/bodyComplexWithTracing/LICENSE | 2 +- test/integration/generated/bodyDate/LICENSE | 2 +- test/integration/generated/bodyDateTime/LICENSE | 2 +- test/integration/generated/bodyDateTimeRfc1123/LICENSE | 2 +- test/integration/generated/bodyDictionary/LICENSE | 2 +- test/integration/generated/bodyDuration/LICENSE | 2 +- test/integration/generated/bodyFile/LICENSE | 2 +- test/integration/generated/bodyFileRest/LICENSE | 2 +- test/integration/generated/bodyFileRest/package.json | 2 +- test/integration/generated/bodyFormData/LICENSE | 2 +- test/integration/generated/bodyFormDataRest/LICENSE | 2 +- test/integration/generated/bodyFormDataRest/package.json | 2 +- test/integration/generated/bodyInteger/LICENSE | 2 +- test/integration/generated/bodyNumber/LICENSE | 2 +- test/integration/generated/bodyString/LICENSE | 2 +- test/integration/generated/bodyStringRest/LICENSE | 2 +- test/integration/generated/bodyStringRest/package.json | 2 +- test/integration/generated/bodyTime/LICENSE | 2 +- test/integration/generated/constantParam/LICENSE | 2 +- test/integration/generated/customUrl/LICENSE | 2 +- test/integration/generated/customUrlMoreOptions/LICENSE | 2 +- test/integration/generated/customUrlPaging/LICENSE | 2 +- test/integration/generated/datalakestorage/LICENSE | 2 +- test/integration/generated/extensibleEnums/LICENSE | 2 +- test/integration/generated/header/LICENSE | 2 +- test/integration/generated/headerRest/LICENSE | 2 +- test/integration/generated/headerRest/package.json | 2 +- test/integration/generated/httpInfrastructure/LICENSE | 2 +- test/integration/generated/iotspaces/LICENSE | 2 +- test/integration/generated/licenseHeader/LICENSE | 2 +- test/integration/generated/lro/LICENSE | 2 +- test/integration/generated/lroParametrizedEndpoints/LICENSE | 2 +- test/integration/generated/lroRest/LICENSE | 2 +- test/integration/generated/lroRest/package.json | 2 +- test/integration/generated/mapperrequired/LICENSE | 2 +- test/integration/generated/mediaTypes/LICENSE | 2 +- test/integration/generated/mediaTypesRest/LICENSE | 2 +- test/integration/generated/mediaTypesRest/package.json | 2 +- test/integration/generated/mediaTypesV3/LICENSE | 2 +- test/integration/generated/mediaTypesV3Lro/LICENSE | 2 +- test/integration/generated/mediaTypesWithTracing/LICENSE | 2 +- test/integration/generated/modelFlattening/LICENSE | 2 +- test/integration/generated/multipleInheritance/LICENSE | 2 +- test/integration/generated/multipleInheritanceRest/LICENSE | 2 +- test/integration/generated/multipleInheritanceRest/package.json | 2 +- test/integration/generated/noMappers/LICENSE | 2 +- test/integration/generated/noOperation/LICENSE | 2 +- test/integration/generated/nonStringEnum/LICENSE | 2 +- test/integration/generated/objectType/LICENSE | 2 +- test/integration/generated/odataDiscriminator/LICENSE | 2 +- test/integration/generated/paging/LICENSE | 2 +- test/integration/generated/pagingNoIterators/LICENSE | 2 +- test/integration/generated/pagingRest/LICENSE | 2 +- test/integration/generated/pagingRest/package.json | 2 +- test/integration/generated/regexConstraint/LICENSE | 2 +- test/integration/generated/report/LICENSE | 2 +- test/integration/generated/requiredOptional/LICENSE | 2 +- test/integration/generated/resources/LICENSE | 2 +- test/integration/generated/sealedchoice/LICENSE | 2 +- test/integration/generated/subscriptionIdApiVersion/LICENSE | 2 +- test/integration/generated/textanalytics/LICENSE | 2 +- test/integration/generated/url/LICENSE | 2 +- test/integration/generated/url2/LICENSE | 2 +- test/integration/generated/urlMulti/LICENSE | 2 +- test/integration/generated/urlRest/LICENSE | 2 +- test/integration/generated/urlRest/package.json | 2 +- test/integration/generated/useragentcorev1/LICENSE | 2 +- test/integration/generated/useragentcorev2/LICENSE | 2 +- test/integration/generated/uuid/LICENSE | 2 +- test/integration/generated/validation/LICENSE | 2 +- test/integration/generated/xmlservice/LICENSE | 2 +- test/integration/generated/xmsErrorResponses/LICENSE | 2 +- 87 files changed, 87 insertions(+), 87 deletions(-) diff --git a/test/integration/generated/additionalProperties/LICENSE b/test/integration/generated/additionalProperties/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/additionalProperties/LICENSE +++ b/test/integration/generated/additionalProperties/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/appconfiguration/LICENSE b/test/integration/generated/appconfiguration/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/appconfiguration/LICENSE +++ b/test/integration/generated/appconfiguration/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/appconfigurationexport/LICENSE b/test/integration/generated/appconfigurationexport/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/appconfigurationexport/LICENSE +++ b/test/integration/generated/appconfigurationexport/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/arrayConstraints/LICENSE b/test/integration/generated/arrayConstraints/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/arrayConstraints/LICENSE +++ b/test/integration/generated/arrayConstraints/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/attestation/LICENSE b/test/integration/generated/attestation/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/attestation/LICENSE +++ b/test/integration/generated/attestation/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/azureParameterGrouping/LICENSE b/test/integration/generated/azureParameterGrouping/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/azureParameterGrouping/LICENSE +++ b/test/integration/generated/azureParameterGrouping/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/azureReport/LICENSE b/test/integration/generated/azureReport/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/azureReport/LICENSE +++ b/test/integration/generated/azureReport/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/azureSpecialProperties/LICENSE b/test/integration/generated/azureSpecialProperties/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/azureSpecialProperties/LICENSE +++ b/test/integration/generated/azureSpecialProperties/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyArray/LICENSE b/test/integration/generated/bodyArray/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyArray/LICENSE +++ b/test/integration/generated/bodyArray/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyBoolean/LICENSE b/test/integration/generated/bodyBoolean/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyBoolean/LICENSE +++ b/test/integration/generated/bodyBoolean/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyBooleanQuirks/LICENSE b/test/integration/generated/bodyBooleanQuirks/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyBooleanQuirks/LICENSE +++ b/test/integration/generated/bodyBooleanQuirks/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyByte/LICENSE b/test/integration/generated/bodyByte/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyByte/LICENSE +++ b/test/integration/generated/bodyByte/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyComplex/LICENSE b/test/integration/generated/bodyComplex/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyComplex/LICENSE +++ b/test/integration/generated/bodyComplex/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyComplexRest/LICENSE b/test/integration/generated/bodyComplexRest/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/integration/generated/bodyComplexRest/LICENSE +++ b/test/integration/generated/bodyComplexRest/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyComplexRest/package.json b/test/integration/generated/bodyComplexRest/package.json index f3fbc4abb3..1f5e242dd3 100644 --- a/test/integration/generated/bodyComplexRest/package.json +++ b/test/integration/generated/bodyComplexRest/package.json @@ -44,7 +44,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/integration/generated/bodyComplexWithTracing/LICENSE b/test/integration/generated/bodyComplexWithTracing/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyComplexWithTracing/LICENSE +++ b/test/integration/generated/bodyComplexWithTracing/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyDate/LICENSE b/test/integration/generated/bodyDate/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyDate/LICENSE +++ b/test/integration/generated/bodyDate/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyDateTime/LICENSE b/test/integration/generated/bodyDateTime/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyDateTime/LICENSE +++ b/test/integration/generated/bodyDateTime/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyDateTimeRfc1123/LICENSE b/test/integration/generated/bodyDateTimeRfc1123/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyDateTimeRfc1123/LICENSE +++ b/test/integration/generated/bodyDateTimeRfc1123/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyDictionary/LICENSE b/test/integration/generated/bodyDictionary/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyDictionary/LICENSE +++ b/test/integration/generated/bodyDictionary/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyDuration/LICENSE b/test/integration/generated/bodyDuration/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyDuration/LICENSE +++ b/test/integration/generated/bodyDuration/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyFile/LICENSE b/test/integration/generated/bodyFile/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyFile/LICENSE +++ b/test/integration/generated/bodyFile/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyFileRest/LICENSE b/test/integration/generated/bodyFileRest/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/integration/generated/bodyFileRest/LICENSE +++ b/test/integration/generated/bodyFileRest/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyFileRest/package.json b/test/integration/generated/bodyFileRest/package.json index 094aadaa9b..84323e4f2d 100644 --- a/test/integration/generated/bodyFileRest/package.json +++ b/test/integration/generated/bodyFileRest/package.json @@ -44,7 +44,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/integration/generated/bodyFormData/LICENSE b/test/integration/generated/bodyFormData/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyFormData/LICENSE +++ b/test/integration/generated/bodyFormData/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyFormDataRest/LICENSE b/test/integration/generated/bodyFormDataRest/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/integration/generated/bodyFormDataRest/LICENSE +++ b/test/integration/generated/bodyFormDataRest/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyFormDataRest/package.json b/test/integration/generated/bodyFormDataRest/package.json index c5a3e71916..05e75dd034 100644 --- a/test/integration/generated/bodyFormDataRest/package.json +++ b/test/integration/generated/bodyFormDataRest/package.json @@ -44,7 +44,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/integration/generated/bodyInteger/LICENSE b/test/integration/generated/bodyInteger/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyInteger/LICENSE +++ b/test/integration/generated/bodyInteger/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyNumber/LICENSE b/test/integration/generated/bodyNumber/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyNumber/LICENSE +++ b/test/integration/generated/bodyNumber/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyString/LICENSE b/test/integration/generated/bodyString/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyString/LICENSE +++ b/test/integration/generated/bodyString/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyStringRest/LICENSE b/test/integration/generated/bodyStringRest/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/integration/generated/bodyStringRest/LICENSE +++ b/test/integration/generated/bodyStringRest/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/bodyStringRest/package.json b/test/integration/generated/bodyStringRest/package.json index 75a0ab9574..c26187583d 100644 --- a/test/integration/generated/bodyStringRest/package.json +++ b/test/integration/generated/bodyStringRest/package.json @@ -44,7 +44,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/integration/generated/bodyTime/LICENSE b/test/integration/generated/bodyTime/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/bodyTime/LICENSE +++ b/test/integration/generated/bodyTime/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/constantParam/LICENSE b/test/integration/generated/constantParam/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/constantParam/LICENSE +++ b/test/integration/generated/constantParam/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/customUrl/LICENSE b/test/integration/generated/customUrl/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/customUrl/LICENSE +++ b/test/integration/generated/customUrl/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/customUrlMoreOptions/LICENSE b/test/integration/generated/customUrlMoreOptions/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/customUrlMoreOptions/LICENSE +++ b/test/integration/generated/customUrlMoreOptions/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/customUrlPaging/LICENSE b/test/integration/generated/customUrlPaging/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/customUrlPaging/LICENSE +++ b/test/integration/generated/customUrlPaging/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/datalakestorage/LICENSE b/test/integration/generated/datalakestorage/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/datalakestorage/LICENSE +++ b/test/integration/generated/datalakestorage/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/extensibleEnums/LICENSE b/test/integration/generated/extensibleEnums/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/extensibleEnums/LICENSE +++ b/test/integration/generated/extensibleEnums/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/header/LICENSE b/test/integration/generated/header/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/header/LICENSE +++ b/test/integration/generated/header/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/headerRest/LICENSE b/test/integration/generated/headerRest/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/integration/generated/headerRest/LICENSE +++ b/test/integration/generated/headerRest/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/headerRest/package.json b/test/integration/generated/headerRest/package.json index b33b840c26..5178094b36 100644 --- a/test/integration/generated/headerRest/package.json +++ b/test/integration/generated/headerRest/package.json @@ -44,7 +44,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/integration/generated/httpInfrastructure/LICENSE b/test/integration/generated/httpInfrastructure/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/httpInfrastructure/LICENSE +++ b/test/integration/generated/httpInfrastructure/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/iotspaces/LICENSE b/test/integration/generated/iotspaces/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/iotspaces/LICENSE +++ b/test/integration/generated/iotspaces/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/licenseHeader/LICENSE b/test/integration/generated/licenseHeader/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/licenseHeader/LICENSE +++ b/test/integration/generated/licenseHeader/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/lro/LICENSE b/test/integration/generated/lro/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/lro/LICENSE +++ b/test/integration/generated/lro/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/lroParametrizedEndpoints/LICENSE b/test/integration/generated/lroParametrizedEndpoints/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/lroParametrizedEndpoints/LICENSE +++ b/test/integration/generated/lroParametrizedEndpoints/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/lroRest/LICENSE b/test/integration/generated/lroRest/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/integration/generated/lroRest/LICENSE +++ b/test/integration/generated/lroRest/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/lroRest/package.json b/test/integration/generated/lroRest/package.json index 29a6416a4e..71ddd92753 100644 --- a/test/integration/generated/lroRest/package.json +++ b/test/integration/generated/lroRest/package.json @@ -45,7 +45,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/integration/generated/mapperrequired/LICENSE b/test/integration/generated/mapperrequired/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/mapperrequired/LICENSE +++ b/test/integration/generated/mapperrequired/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/mediaTypes/LICENSE b/test/integration/generated/mediaTypes/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/mediaTypes/LICENSE +++ b/test/integration/generated/mediaTypes/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/mediaTypesRest/LICENSE b/test/integration/generated/mediaTypesRest/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/integration/generated/mediaTypesRest/LICENSE +++ b/test/integration/generated/mediaTypesRest/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/mediaTypesRest/package.json b/test/integration/generated/mediaTypesRest/package.json index 3279c84d35..19ff93e415 100644 --- a/test/integration/generated/mediaTypesRest/package.json +++ b/test/integration/generated/mediaTypesRest/package.json @@ -44,7 +44,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/integration/generated/mediaTypesV3/LICENSE b/test/integration/generated/mediaTypesV3/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/mediaTypesV3/LICENSE +++ b/test/integration/generated/mediaTypesV3/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/mediaTypesV3Lro/LICENSE b/test/integration/generated/mediaTypesV3Lro/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/mediaTypesV3Lro/LICENSE +++ b/test/integration/generated/mediaTypesV3Lro/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/mediaTypesWithTracing/LICENSE b/test/integration/generated/mediaTypesWithTracing/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/mediaTypesWithTracing/LICENSE +++ b/test/integration/generated/mediaTypesWithTracing/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/modelFlattening/LICENSE b/test/integration/generated/modelFlattening/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/modelFlattening/LICENSE +++ b/test/integration/generated/modelFlattening/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/multipleInheritance/LICENSE b/test/integration/generated/multipleInheritance/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/multipleInheritance/LICENSE +++ b/test/integration/generated/multipleInheritance/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/multipleInheritanceRest/LICENSE b/test/integration/generated/multipleInheritanceRest/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/integration/generated/multipleInheritanceRest/LICENSE +++ b/test/integration/generated/multipleInheritanceRest/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/multipleInheritanceRest/package.json b/test/integration/generated/multipleInheritanceRest/package.json index ac9002467f..769c5a004d 100644 --- a/test/integration/generated/multipleInheritanceRest/package.json +++ b/test/integration/generated/multipleInheritanceRest/package.json @@ -44,7 +44,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/integration/generated/noMappers/LICENSE b/test/integration/generated/noMappers/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/noMappers/LICENSE +++ b/test/integration/generated/noMappers/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/noOperation/LICENSE b/test/integration/generated/noOperation/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/noOperation/LICENSE +++ b/test/integration/generated/noOperation/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/nonStringEnum/LICENSE b/test/integration/generated/nonStringEnum/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/nonStringEnum/LICENSE +++ b/test/integration/generated/nonStringEnum/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/objectType/LICENSE b/test/integration/generated/objectType/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/objectType/LICENSE +++ b/test/integration/generated/objectType/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/odataDiscriminator/LICENSE b/test/integration/generated/odataDiscriminator/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/odataDiscriminator/LICENSE +++ b/test/integration/generated/odataDiscriminator/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/paging/LICENSE b/test/integration/generated/paging/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/paging/LICENSE +++ b/test/integration/generated/paging/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/pagingNoIterators/LICENSE b/test/integration/generated/pagingNoIterators/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/pagingNoIterators/LICENSE +++ b/test/integration/generated/pagingNoIterators/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/pagingRest/LICENSE b/test/integration/generated/pagingRest/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/integration/generated/pagingRest/LICENSE +++ b/test/integration/generated/pagingRest/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/pagingRest/package.json b/test/integration/generated/pagingRest/package.json index fee61101e1..c81988f825 100644 --- a/test/integration/generated/pagingRest/package.json +++ b/test/integration/generated/pagingRest/package.json @@ -46,7 +46,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/integration/generated/regexConstraint/LICENSE b/test/integration/generated/regexConstraint/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/regexConstraint/LICENSE +++ b/test/integration/generated/regexConstraint/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/report/LICENSE b/test/integration/generated/report/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/report/LICENSE +++ b/test/integration/generated/report/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/requiredOptional/LICENSE b/test/integration/generated/requiredOptional/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/requiredOptional/LICENSE +++ b/test/integration/generated/requiredOptional/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/resources/LICENSE b/test/integration/generated/resources/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/resources/LICENSE +++ b/test/integration/generated/resources/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/sealedchoice/LICENSE b/test/integration/generated/sealedchoice/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/sealedchoice/LICENSE +++ b/test/integration/generated/sealedchoice/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/subscriptionIdApiVersion/LICENSE b/test/integration/generated/subscriptionIdApiVersion/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/subscriptionIdApiVersion/LICENSE +++ b/test/integration/generated/subscriptionIdApiVersion/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/textanalytics/LICENSE b/test/integration/generated/textanalytics/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/textanalytics/LICENSE +++ b/test/integration/generated/textanalytics/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/url/LICENSE b/test/integration/generated/url/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/url/LICENSE +++ b/test/integration/generated/url/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/url2/LICENSE b/test/integration/generated/url2/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/url2/LICENSE +++ b/test/integration/generated/url2/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/urlMulti/LICENSE b/test/integration/generated/urlMulti/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/urlMulti/LICENSE +++ b/test/integration/generated/urlMulti/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/urlRest/LICENSE b/test/integration/generated/urlRest/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/integration/generated/urlRest/LICENSE +++ b/test/integration/generated/urlRest/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/urlRest/package.json b/test/integration/generated/urlRest/package.json index 18990e9700..7c332f5a21 100644 --- a/test/integration/generated/urlRest/package.json +++ b/test/integration/generated/urlRest/package.json @@ -44,7 +44,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/integration/generated/useragentcorev1/LICENSE b/test/integration/generated/useragentcorev1/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/useragentcorev1/LICENSE +++ b/test/integration/generated/useragentcorev1/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/useragentcorev2/LICENSE b/test/integration/generated/useragentcorev2/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/useragentcorev2/LICENSE +++ b/test/integration/generated/useragentcorev2/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/uuid/LICENSE b/test/integration/generated/uuid/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/uuid/LICENSE +++ b/test/integration/generated/uuid/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/validation/LICENSE b/test/integration/generated/validation/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/validation/LICENSE +++ b/test/integration/generated/validation/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/xmlservice/LICENSE b/test/integration/generated/xmlservice/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/xmlservice/LICENSE +++ b/test/integration/generated/xmlservice/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/integration/generated/xmsErrorResponses/LICENSE b/test/integration/generated/xmsErrorResponses/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/integration/generated/xmsErrorResponses/LICENSE +++ b/test/integration/generated/xmsErrorResponses/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From 7104ce696805d38b12f7632cf0510336f5bfe4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20C=C3=A1rdenas?= Date: Mon, 3 Jan 2022 20:44:18 +0000 Subject: [PATCH 3/7] Regen smoke tests --- test/smoke/generated/agrifood-data-plane/LICENSE | 2 +- test/smoke/generated/agrifood-data-plane/package.json | 2 +- .../arm-package-deploymentscripts-2019-10-preview/LICENSE | 2 +- test/smoke/generated/arm-package-features-2015-12/LICENSE | 2 +- test/smoke/generated/arm-package-links-2016-09/LICENSE | 2 +- test/smoke/generated/arm-package-locks-2016-09/LICENSE | 2 +- .../generated/arm-package-managedapplications-2018-06/LICENSE | 2 +- test/smoke/generated/arm-package-policy-2019-09/LICENSE | 2 +- test/smoke/generated/arm-package-resources-2019-08/LICENSE | 2 +- test/smoke/generated/arm-package-subscriptions-2019-06/LICENSE | 2 +- test/smoke/generated/compute-resource-manager/LICENSE | 2 +- test/smoke/generated/cosmos-db-resource-manager/LICENSE | 2 +- test/smoke/generated/graphrbac-data-plane/LICENSE | 2 +- test/smoke/generated/keyvault-resource-manager/LICENSE | 2 +- test/smoke/generated/monitor-data-plane/LICENSE | 2 +- test/smoke/generated/msi-resource-manager/LICENSE | 2 +- test/smoke/generated/network-resource-manager/LICENSE | 2 +- test/smoke/generated/sql-resource-manager/LICENSE | 2 +- test/smoke/generated/storage-resource-manager/LICENSE | 2 +- test/smoke/generated/web-resource-manager/LICENSE | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/test/smoke/generated/agrifood-data-plane/LICENSE b/test/smoke/generated/agrifood-data-plane/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/smoke/generated/agrifood-data-plane/LICENSE +++ b/test/smoke/generated/agrifood-data-plane/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/agrifood-data-plane/package.json b/test/smoke/generated/agrifood-data-plane/package.json index f3c2a12dc7..fa730ed84d 100644 --- a/test/smoke/generated/agrifood-data-plane/package.json +++ b/test/smoke/generated/agrifood-data-plane/package.json @@ -48,7 +48,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/smoke/generated/arm-package-deploymentscripts-2019-10-preview/LICENSE b/test/smoke/generated/arm-package-deploymentscripts-2019-10-preview/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/arm-package-deploymentscripts-2019-10-preview/LICENSE +++ b/test/smoke/generated/arm-package-deploymentscripts-2019-10-preview/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/arm-package-features-2015-12/LICENSE b/test/smoke/generated/arm-package-features-2015-12/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/arm-package-features-2015-12/LICENSE +++ b/test/smoke/generated/arm-package-features-2015-12/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/arm-package-links-2016-09/LICENSE b/test/smoke/generated/arm-package-links-2016-09/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/arm-package-links-2016-09/LICENSE +++ b/test/smoke/generated/arm-package-links-2016-09/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/arm-package-locks-2016-09/LICENSE b/test/smoke/generated/arm-package-locks-2016-09/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/arm-package-locks-2016-09/LICENSE +++ b/test/smoke/generated/arm-package-locks-2016-09/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/arm-package-managedapplications-2018-06/LICENSE b/test/smoke/generated/arm-package-managedapplications-2018-06/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/arm-package-managedapplications-2018-06/LICENSE +++ b/test/smoke/generated/arm-package-managedapplications-2018-06/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/arm-package-policy-2019-09/LICENSE b/test/smoke/generated/arm-package-policy-2019-09/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/arm-package-policy-2019-09/LICENSE +++ b/test/smoke/generated/arm-package-policy-2019-09/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/arm-package-resources-2019-08/LICENSE b/test/smoke/generated/arm-package-resources-2019-08/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/arm-package-resources-2019-08/LICENSE +++ b/test/smoke/generated/arm-package-resources-2019-08/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/arm-package-subscriptions-2019-06/LICENSE b/test/smoke/generated/arm-package-subscriptions-2019-06/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/arm-package-subscriptions-2019-06/LICENSE +++ b/test/smoke/generated/arm-package-subscriptions-2019-06/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/compute-resource-manager/LICENSE b/test/smoke/generated/compute-resource-manager/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/compute-resource-manager/LICENSE +++ b/test/smoke/generated/compute-resource-manager/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/cosmos-db-resource-manager/LICENSE b/test/smoke/generated/cosmos-db-resource-manager/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/cosmos-db-resource-manager/LICENSE +++ b/test/smoke/generated/cosmos-db-resource-manager/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/graphrbac-data-plane/LICENSE b/test/smoke/generated/graphrbac-data-plane/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/graphrbac-data-plane/LICENSE +++ b/test/smoke/generated/graphrbac-data-plane/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/keyvault-resource-manager/LICENSE b/test/smoke/generated/keyvault-resource-manager/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/keyvault-resource-manager/LICENSE +++ b/test/smoke/generated/keyvault-resource-manager/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/monitor-data-plane/LICENSE b/test/smoke/generated/monitor-data-plane/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/monitor-data-plane/LICENSE +++ b/test/smoke/generated/monitor-data-plane/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/msi-resource-manager/LICENSE b/test/smoke/generated/msi-resource-manager/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/msi-resource-manager/LICENSE +++ b/test/smoke/generated/msi-resource-manager/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/network-resource-manager/LICENSE b/test/smoke/generated/network-resource-manager/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/network-resource-manager/LICENSE +++ b/test/smoke/generated/network-resource-manager/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/sql-resource-manager/LICENSE b/test/smoke/generated/sql-resource-manager/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/sql-resource-manager/LICENSE +++ b/test/smoke/generated/sql-resource-manager/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/storage-resource-manager/LICENSE b/test/smoke/generated/storage-resource-manager/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/storage-resource-manager/LICENSE +++ b/test/smoke/generated/storage-resource-manager/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/smoke/generated/web-resource-manager/LICENSE b/test/smoke/generated/web-resource-manager/LICENSE index ccb63b1667..5d1d36e0af 100644 --- a/test/smoke/generated/web-resource-manager/LICENSE +++ b/test/smoke/generated/web-resource-manager/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From e25c276445a8e129cfb0b816311f905b16b1a38c Mon Sep 17 00:00:00 2001 From: Jonathan Cardenas Date: Mon, 3 Jan 2022 16:29:38 -0600 Subject: [PATCH 4/7] Regen integration tests swaggers --- .../additionalProperties/package.json | 3 +- .../src/additionalPropertiesClient.ts | 33 +- .../src/additionalPropertiesClientContext.ts | 47 ++ .../additionalProperties/src/index.ts | 1 + .../src/operations/pets.ts | 6 +- .../generated/appconfiguration/package.json | 3 +- .../src/appConfigurationClient.ts | 40 +- .../src/appConfigurationClientContext.ts | 59 ++ .../generated/appconfiguration/src/index.ts | 1 + .../appconfigurationexport/package.json | 3 +- .../src/appConfigurationClient.ts | 40 +- .../src/appConfigurationClientContext.ts | 60 ++ .../appconfigurationexport/src/index.ts | 1 + .../generated/arrayConstraints/package.json | 3 +- .../src/arrayConstraintsClient.ts | 42 +- .../src/arrayConstraintsClientContext.ts | 61 ++ .../generated/arrayConstraints/src/index.ts | 1 + .../generated/attestation/package.json | 3 +- .../attestation/src/generatedClient.ts | 40 +- .../attestation/src/generatedClientContext.ts | 56 ++ .../generated/attestation/src/index.ts | 1 + .../attestation/src/operations/policy.ts | 6 +- .../azureParameterGrouping/package.json | 3 +- .../src/azureParameterGroupingClient.ts | 33 +- .../azureParameterGroupingClientContext.ts | 47 ++ .../azureParameterGrouping/src/index.ts | 1 + .../src/operations/parameterGrouping.ts | 6 +- .../generated/azureReport/package.json | 3 +- .../generated/azureReport/src/index.ts | 1 + .../generated/azureReport/src/reportClient.ts | 32 +- .../azureReport/src/reportClientContext.ts | 47 ++ .../azureSpecialProperties/package.json | 3 +- .../src/azureSpecialPropertiesClient.ts | 52 +- .../azureSpecialPropertiesClientContext.ts | 74 ++ .../azureSpecialProperties/src/index.ts | 1 + .../src/operations/apiVersionDefault.ts | 6 +- .../src/operations/apiVersionLocal.ts | 6 +- .../src/operations/header.ts | 6 +- .../src/operations/odata.ts | 6 +- .../src/operations/skipUrlEncoding.ts | 6 +- .../operations/subscriptionInCredentials.ts | 6 +- .../src/operations/subscriptionInMethod.ts | 6 +- .../src/operations/xMsClientRequestId.ts | 6 +- .../generated/bodyArray/package.json | 3 +- .../bodyArray/src/bodyArrayClient.ts | 33 +- .../bodyArray/src/bodyArrayClientContext.ts | 47 ++ .../generated/bodyArray/src/index.ts | 1 + .../bodyArray/src/operations/array.ts | 6 +- .../generated/bodyBoolean/package.json | 3 +- .../bodyBoolean/src/bodyBooleanClient.ts | 33 +- .../src/bodyBooleanClientContext.ts | 47 ++ .../generated/bodyBoolean/src/index.ts | 1 + .../bodyBoolean/src/operations/bool.ts | 6 +- .../generated/bodyBooleanQuirks/package.json | 3 +- .../src/bodyBooleanQuirksClient.ts | 33 +- .../src/bodyBooleanQuirksClientContext.ts | 47 ++ .../generated/bodyBooleanQuirks/src/index.ts | 1 + .../bodyBooleanQuirks/src/operations/bool.ts | 6 +- .../generated/bodyByte/package.json | 3 +- .../generated/bodyByte/src/bodyByteClient.ts | 33 +- .../bodyByte/src/bodyByteClientContext.ts | 47 ++ .../generated/bodyByte/src/index.ts | 1 + .../generated/bodyByte/src/operations/byte.ts | 6 +- .../generated/bodyComplex/package.json | 3 +- .../bodyComplex/src/bodyComplexClient.ts | 35 +- .../src/bodyComplexClientContext.ts | 49 ++ .../generated/bodyComplex/src/index.ts | 1 + .../bodyComplex/src/operations/array.ts | 6 +- .../bodyComplex/src/operations/basic.ts | 6 +- .../bodyComplex/src/operations/dictionary.ts | 6 +- .../src/operations/flattencomplex.ts | 6 +- .../bodyComplex/src/operations/inheritance.ts | 6 +- .../src/operations/polymorphicrecursive.ts | 6 +- .../src/operations/polymorphism.ts | 6 +- .../bodyComplex/src/operations/primitive.ts | 6 +- .../src/operations/readonlyproperty.ts | 6 +- .../generated/bodyComplexRest/package.json | 2 +- .../src/bodyComplexRestClient.ts | 6 +- .../generated/bodyComplexRest/tsconfig.json | 10 +- .../bodyComplexWithTracing/package.json | 3 +- .../src/bodyComplexWithTracing.ts | 35 +- .../src/bodyComplexWithTracingContext.ts | 49 ++ .../bodyComplexWithTracing/src/index.ts | 1 + .../src/operations/array.ts | 6 +- .../src/operations/basic.ts | 6 +- .../src/operations/dictionary.ts | 6 +- .../src/operations/flattencomplex.ts | 6 +- .../src/operations/inheritance.ts | 6 +- .../src/operations/polymorphicrecursive.ts | 6 +- .../src/operations/polymorphism.ts | 6 +- .../src/operations/primitive.ts | 6 +- .../src/operations/readonlyproperty.ts | 6 +- .../generated/bodyDate/package.json | 3 +- .../generated/bodyDate/src/bodyDateClient.ts | 33 +- .../bodyDate/src/bodyDateClientContext.ts | 47 ++ .../generated/bodyDate/src/index.ts | 1 + .../generated/bodyDate/src/operations/date.ts | 6 +- .../generated/bodyDateTime/package.json | 3 +- .../bodyDateTime/src/bodyDateTimeClient.ts | 33 +- .../src/bodyDateTimeClientContext.ts | 47 ++ .../generated/bodyDateTime/src/index.ts | 1 + .../bodyDateTime/src/operations/datetime.ts | 6 +- .../bodyDateTimeRfc1123/package.json | 3 +- .../src/bodyDateTimeRfc1123Client.ts | 33 +- .../src/bodyDateTimeRfc1123ClientContext.ts | 47 ++ .../bodyDateTimeRfc1123/src/index.ts | 1 + .../src/operations/datetimerfc1123.ts | 6 +- .../generated/bodyDictionary/package.json | 3 +- .../src/bodyDictionaryClient.ts | 33 +- .../src/bodyDictionaryClientContext.ts | 47 ++ .../generated/bodyDictionary/src/index.ts | 1 + .../src/operations/dictionary.ts | 6 +- .../generated/bodyDuration/package.json | 3 +- .../bodyDuration/src/bodyDurationClient.ts | 33 +- .../src/bodyDurationClientContext.ts | 47 ++ .../generated/bodyDuration/src/index.ts | 1 + .../bodyDuration/src/operations/duration.ts | 6 +- .../generated/bodyFile/package.json | 3 +- .../generated/bodyFile/src/bodyFileClient.ts | 33 +- .../bodyFile/src/bodyFileClientContext.ts | 47 ++ .../generated/bodyFile/src/index.ts | 1 + .../bodyFile/src/operations/files.ts | 6 +- .../generated/bodyFileRest/package.json | 2 +- .../generated/bodyFileRest/src/bodyFile.ts | 6 +- .../generated/bodyFileRest/src/responses.ts | 9 +- .../generated/bodyFileRest/tsconfig.json | 10 +- .../generated/bodyFormData/package.json | 3 +- .../bodyFormData/src/bodyFormDataClient.ts | 33 +- .../src/bodyFormDataClientContext.ts | 47 ++ .../generated/bodyFormData/src/index.ts | 1 + .../bodyFormData/src/operations/formdata.ts | 6 +- .../generated/bodyFormDataRest/package.json | 2 +- .../bodyFormDataRest/src/bodyFormData.ts | 6 +- .../bodyFormDataRest/src/parameters.ts | 16 +- .../bodyFormDataRest/src/responses.ts | 9 +- .../generated/bodyFormDataRest/tsconfig.json | 10 +- .../generated/bodyInteger/package.json | 3 +- .../bodyInteger/src/bodyIntegerClient.ts | 33 +- .../src/bodyIntegerClientContext.ts | 47 ++ .../generated/bodyInteger/src/index.ts | 1 + .../bodyInteger/src/operations/int.ts | 6 +- .../generated/bodyNumber/package.json | 3 +- .../bodyNumber/src/bodyNumberClient.ts | 33 +- .../bodyNumber/src/bodyNumberClientContext.ts | 47 ++ .../generated/bodyNumber/src/index.ts | 1 + .../bodyNumber/src/operations/number.ts | 6 +- .../generated/bodyString/package.json | 3 +- .../bodyString/src/bodyStringClient.ts | 33 +- .../bodyString/src/bodyStringClientContext.ts | 47 ++ .../generated/bodyString/src/index.ts | 1 + .../bodyString/src/operations/enum.ts | 6 +- .../bodyString/src/operations/string.ts | 6 +- .../generated/bodyStringRest/karma.conf.js | 153 ---- .../generated/bodyStringRest/package.json | 52 +- .../bodyStringRest/src/bodyStringRest.ts | 6 +- .../test/public/sampleTest.spec.ts | 22 - .../test/public/utils/env.browser.ts | 2 - .../bodyStringRest/test/public/utils/env.ts | 6 - .../test/public/utils/recordedClient.ts | 46 -- .../generated/bodyStringRest/tsconfig.json | 10 +- .../generated/bodyTime/package.json | 3 +- .../generated/bodyTime/src/bodyTimeClient.ts | 33 +- .../bodyTime/src/bodyTimeClientContext.ts | 47 ++ .../generated/bodyTime/src/index.ts | 1 + .../generated/bodyTime/src/operations/time.ts | 6 +- .../generated/constantParam/package.json | 3 +- .../constantParam/src/generatedClient.ts | 39 +- .../src/generatedClientContext.ts | 57 ++ .../generated/constantParam/src/index.ts | 1 + .../generated/customUrl/package.json | 3 +- .../customUrl/src/customUrlClient.ts | 33 +- .../customUrl/src/customUrlClientContext.ts | 47 ++ .../generated/customUrl/src/index.ts | 1 + .../customUrl/src/operations/paths.ts | 6 +- .../customUrlMoreOptions/package.json | 3 +- .../src/customUrlMoreOptionsClient.ts | 40 +- .../src/customUrlMoreOptionsClientContext.ts | 58 ++ .../customUrlMoreOptions/src/index.ts | 1 + .../src/operations/paths.ts | 6 +- .../generated/customUrlPaging/package.json | 3 +- .../src/customUrlPagingClient.ts | 33 +- .../src/customUrlPagingClientContext.ts | 47 ++ .../generated/customUrlPaging/src/index.ts | 1 + .../customUrlPaging/src/operations/paging.ts | 6 +- .../generated/datafactory/package.json | 3 +- .../datafactory/src/dataFactoryClient.ts | 42 +- .../src/dataFactoryClientContext.ts | 52 ++ .../generated/datafactory/src/index.ts | 1 + .../src/operations/activityRuns.ts | 6 +- .../src/operations/dataFlowDebugSession.ts | 6 +- .../datafactory/src/operations/dataFlows.ts | 6 +- .../datafactory/src/operations/datasets.ts | 6 +- .../src/operations/exposureControl.ts | 6 +- .../datafactory/src/operations/factories.ts | 6 +- .../src/operations/integrationRuntimeNodes.ts | 6 +- .../integrationRuntimeObjectMetadata.ts | 6 +- .../src/operations/integrationRuntimes.ts | 6 +- .../src/operations/linkedServices.ts | 6 +- .../src/operations/managedPrivateEndpoints.ts | 6 +- .../src/operations/managedVirtualNetworks.ts | 6 +- .../datafactory/src/operations/operations.ts | 6 +- .../src/operations/pipelineRuns.ts | 6 +- .../datafactory/src/operations/pipelines.ts | 6 +- .../operations/privateEndPointConnections.ts | 6 +- .../operations/privateEndpointConnection.ts | 6 +- .../src/operations/privateLinkResources.ts | 6 +- .../datafactory/src/operations/triggerRuns.ts | 6 +- .../datafactory/src/operations/triggers.ts | 6 +- .../generated/datalakestorage/package.json | 3 +- .../src/dataLakeStorageClient.ts | 50 +- .../src/dataLakeStorageClientContext.ts | 73 ++ .../generated/datalakestorage/src/index.ts | 1 + .../src/operations/pathOperations.ts | 6 +- .../deviceprovisioningservice/package.json | 3 +- .../src/deviceProvisioningClient.ts | 42 +- .../src/deviceProvisioningClientContext.ts | 52 ++ .../deviceprovisioningservice/src/index.ts | 1 + .../src/operations/dpsCertificate.ts | 6 +- .../src/operations/iotDpsResource.ts | 6 +- .../src/operations/operations.ts | 6 +- .../generated/domainservices/package.json | 3 +- .../src/domainServicesClient.ts | 42 +- .../src/domainServicesClientContext.ts | 53 ++ .../generated/domainservices/src/index.ts | 1 + .../src/operations/domainServiceOperations.ts | 6 +- .../src/operations/domainServices.ts | 6 +- .../src/operations/ouContainerOperationGrp.ts | 6 +- .../src/operations/ouContainerOperations.ts | 6 +- .../generated/extensibleEnums/package.json | 3 +- .../src/extensibleEnumsClient.ts | 33 +- .../src/extensibleEnumsClientContext.ts | 47 ++ .../generated/extensibleEnums/src/index.ts | 1 + .../extensibleEnums/src/operations/pet.ts | 6 +- .../integration/generated/header/package.json | 3 +- .../generated/header/src/headerClient.ts | 33 +- .../header/src/headerClientContext.ts | 47 ++ .../integration/generated/header/src/index.ts | 1 + .../generated/header/src/operations/header.ts | 6 +- .../generated/headerRest/package.json | 2 +- .../headerRest/src/headerRestClient.ts | 6 +- .../generated/headerRest/tsconfig.json | 10 +- .../generated/headerprefix/package.json | 3 +- .../headerprefix/src/headerPrefixClient.ts | 36 +- .../src/headerPrefixClientContext.ts | 43 + .../generated/headerprefix/src/index.ts | 1 + .../headerprefix/src/operations/queue.ts | 6 +- .../generated/healthcareapis/package.json | 3 +- .../src/healthCareApisClient.ts | 45 +- .../src/healthCareApisClientContext.ts | 55 ++ .../generated/healthcareapis/src/index.ts | 1 + .../src/operations/dicomServices.ts | 6 +- .../src/operations/fhirDestinations.ts | 6 +- .../src/operations/fhirServices.ts | 6 +- .../operations/iotConnectorFhirDestination.ts | 6 +- .../src/operations/iotConnectors.ts | 6 +- .../src/operations/operationResults.ts | 6 +- .../src/operations/operations.ts | 6 +- .../operations/privateEndpointConnections.ts | 6 +- .../src/operations/privateLinkResources.ts | 6 +- .../healthcareapis/src/operations/services.ts | 6 +- .../src/operations/workspaces.ts | 6 +- .../generated/httpInfrastructure/package.json | 3 +- .../src/httpInfrastructureClient.ts | 33 +- .../src/httpInfrastructureClientContext.ts | 47 ++ .../generated/httpInfrastructure/src/index.ts | 1 + .../src/operations/httpClientFailure.ts | 6 +- .../src/operations/httpFailure.ts | 6 +- .../src/operations/httpRedirects.ts | 6 +- .../src/operations/httpRetry.ts | 6 +- .../src/operations/httpServerFailure.ts | 6 +- .../src/operations/httpSuccess.ts | 6 +- .../src/operations/multipleResponses.ts | 6 +- .../generated/iotspaces/package.json | 3 +- .../generated/iotspaces/src/index.ts | 1 + .../iotspaces/src/ioTSpacesClient.ts | 33 +- .../iotspaces/src/ioTSpacesClientContext.ts | 52 ++ .../generated/licenseHeader/package.json | 3 +- .../generated/licenseHeader/src/index.ts | 1 + .../licenseHeader/src/licenseHeaderClient.ts | 42 +- .../src/licenseHeaderClientContext.ts | 61 ++ test/integration/generated/lro/package.json | 3 +- test/integration/generated/lro/src/index.ts | 1 + .../generated/lro/src/lROClient.ts | 33 +- .../generated/lro/src/lROClientContext.ts | 47 ++ .../generated/lro/src/operations/lRORetrys.ts | 6 +- .../generated/lro/src/operations/lROs.ts | 6 +- .../lro/src/operations/lROsCustomHeader.ts | 6 +- .../generated/lro/src/operations/lrosaDs.ts | 6 +- .../lroParametrizedEndpoints/package.json | 3 +- .../lroParametrizedEndpoints/src/index.ts | 1 + .../src/lroParametrizedEndpointsClient.ts | 32 +- .../lroParametrizedEndpointsClientContext.ts | 47 ++ .../generated/lroRest/package.json | 2 +- .../generated/lroRest/src/lRORestClient.ts | 6 +- .../generated/lroRest/tsconfig.json | 10 +- .../generated/mapperrequired/package.json | 3 +- .../generated/mapperrequired/src/index.ts | 1 + .../src/mapperRequiredClient.ts | 35 +- .../src/mapperRequiredClientContext.ts | 51 ++ .../generated/mediaTypes/package.json | 3 +- .../generated/mediaTypes/src/index.ts | 1 + .../mediaTypes/src/mediaTypesClient.ts | 32 +- .../mediaTypes/src/mediaTypesClientContext.ts | 47 ++ .../generated/mediaTypesRest/package.json | 2 +- .../mediaTypesRest/src/mediaTypes.ts | 6 +- .../mediaTypesRest/src/parameters.ts | 8 +- .../generated/mediaTypesRest/tsconfig.json | 10 +- .../generated/mediaTypesV3/package.json | 3 +- .../generated/mediaTypesV3/src/index.ts | 1 + .../mediaTypesV3/src/mediaTypesV3Client.ts | 36 +- .../src/mediaTypesV3ClientContext.ts | 51 ++ .../mediaTypesV3/src/operations/barApi.ts | 6 +- .../mediaTypesV3/src/operations/fooApi.ts | 6 +- .../generated/mediaTypesV3Lro/package.json | 3 +- .../generated/mediaTypesV3Lro/src/index.ts | 1 + .../src/mediaTypesV3LROClient.ts | 35 +- .../src/mediaTypesV3LROClientContext.ts | 51 ++ .../mediaTypesWithTracing/package.json | 3 +- .../mediaTypesWithTracing/src/index.ts | 1 + .../src/mediaTypesWithTracingClient.ts | 32 +- .../src/mediaTypesWithTracingClientContext.ts | 47 ++ .../generated/modelFlattening/package.json | 3 +- .../generated/modelFlattening/src/index.ts | 1 + .../src/modelFlatteningClient.ts | 32 +- .../src/modelFlatteningClientContext.ts | 47 ++ .../multipleInheritance/package.json | 3 +- .../multipleInheritance/src/index.ts | 1 + .../src/multipleInheritanceClient.ts | 32 +- .../src/multipleInheritanceClientContext.ts | 47 ++ .../multipleInheritanceRest/package.json | 2 +- .../src/multipleInheritanceRestClient.ts | 75 +- .../multipleInheritanceRest/tsconfig.json | 10 +- .../generated/nameChecker/package.json | 3 +- .../generated/nameChecker/src/index.ts | 1 + .../nameChecker/src/operations/documents.ts | 6 +- .../generated/nameChecker/src/searchClient.ts | 45 +- .../nameChecker/src/searchClientContext.ts | 57 ++ .../generated/noLicenseHeader/package.json | 3 +- .../generated/noLicenseHeader/src/index.ts | 1 + .../src/noLicenseHeaderClient.ts | 42 +- .../src/noLicenseHeaderClientContext.ts | 53 ++ .../generated/noMappers/package.json | 3 +- .../generated/noMappers/src/index.ts | 1 + .../noMappers/src/noMappersClient.ts | 42 +- .../noMappers/src/noMappersClientContext.ts | 61 ++ .../generated/noOperation/package.json | 3 +- .../generated/noOperation/src/index.ts | 1 + .../noOperation/src/noOperationsClient.ts | 28 +- .../src/noOperationsClientContext.ts | 42 + .../generated/nonStringEnum/package.json | 3 +- .../generated/nonStringEnum/src/index.ts | 1 + .../nonStringEnum/src/nonStringEnumClient.ts | 33 +- .../src/nonStringEnumClientContext.ts | 47 ++ .../nonStringEnum/src/operations/float.ts | 6 +- .../nonStringEnum/src/operations/int.ts | 6 +- .../generated/objectType/package.json | 3 +- .../generated/objectType/src/index.ts | 1 + .../objectType/src/objectTypeClient.ts | 32 +- .../objectType/src/objectTypeClientContext.ts | 47 ++ .../generated/odataDiscriminator/package.json | 3 +- .../generated/odataDiscriminator/src/index.ts | 1 + .../src/oDataDiscriminatorClient.ts | 42 +- .../src/oDataDiscriminatorClientContext.ts | 61 ++ .../operationgroupclash/package.json | 3 +- .../operationgroupclash/src/index.ts | 1 + .../src/operationGroupClashClient.ts | 43 +- .../src/operationGroupClashClientContext.ts | 53 ++ .../src/operations/pipelineOperations.ts | 6 +- .../src/operations/productOperations.ts | 6 +- .../generated/optionalnull/package.json | 3 +- .../generated/optionalnull/src/index.ts | 1 + .../optionalnull/src/operations/documents.ts | 6 +- .../optionalnull/src/optionalNullClient.ts | 36 +- .../src/optionalNullClientContext.ts | 43 + .../integration/generated/paging/package.json | 3 +- .../integration/generated/paging/src/index.ts | 1 + .../generated/paging/src/operations/paging.ts | 6 +- .../generated/paging/src/pagingClient.ts | 33 +- .../paging/src/pagingClientContext.ts | 47 ++ .../generated/pagingNoIterators/package.json | 3 +- .../generated/pagingNoIterators/src/index.ts | 1 + .../src/operations/paging.ts | 6 +- .../src/pagingNoIteratorsClient.ts | 33 +- .../src/pagingNoIteratorsClientContext.ts | 47 ++ .../generated/pagingRest/package.json | 2 +- .../generated/pagingRest/src/paging.ts | 6 +- .../generated/pagingRest/tsconfig.json | 10 +- .../generated/petstore/package.json | 3 +- .../generated/petstore/src/index.ts | 1 + .../generated/petstore/src/petStore.ts | 32 +- .../generated/petstore/src/petStoreContext.ts | 39 + .../src/generated/index.ts | 1 + .../src/generated/mediaServicesClient.ts | 28 +- .../generated/mediaServicesClientContext.ts | 34 + .../generated/readmeFileChecker/package.json | 3 +- .../generated/readmeFileChecker/src/index.ts | 1 + .../readmeFileChecker/src/keyVaultClient.ts | 37 +- .../src/keyVaultClientContext.ts | 47 ++ .../generated/regexConstraint/package.json | 3 +- .../generated/regexConstraint/src/index.ts | 1 + .../regexConstraint/src/regexConstraint.ts | 35 +- .../src/regexConstraintContext.ts | 51 ++ .../integration/generated/report/package.json | 3 +- .../integration/generated/report/src/index.ts | 1 + .../generated/report/src/reportClient.ts | 32 +- .../report/src/reportClientContext.ts | 47 ++ .../generated/requiredOptional/package.json | 3 +- .../generated/requiredOptional/src/index.ts | 1 + .../src/operations/explicit.ts | 6 +- .../src/operations/implicit.ts | 6 +- .../src/requiredOptionalClient.ts | 46 +- .../src/requiredOptionalClientContext.ts | 66 ++ .../generated/resources/package.json | 3 +- .../generated/resources/src/index.ts | 1 + .../src/operations/resourceGroups.ts | 6 +- .../resources/src/resourcesClient.ts | 46 +- .../resources/src/resourcesClientContext.ts | 67 ++ .../generated/sealedchoice/package.json | 3 +- .../generated/sealedchoice/src/index.ts | 1 + .../src/operations/authentication.ts | 6 +- .../sealedchoice/src/sealedChoiceClient.ts | 36 +- .../src/sealedChoiceClientContext.ts | 51 ++ .../generated/storageblob/package.json | 3 +- .../generated/storageblob/src/index.ts | 1 + .../storageblob/src/operations/appendBlob.ts | 6 +- .../storageblob/src/operations/blockBlob.ts | 6 +- .../storageblob/src/operations/pageBlob.ts | 6 +- .../storageblob/src/storageBlobClient.ts | 40 +- .../src/storageBlobClientContext.ts | 48 ++ .../generated/storagefileshare/package.json | 3 +- .../generated/storagefileshare/src/index.ts | 1 + .../storagefileshare/src/operations/file.ts | 6 +- .../src/storageFileShareClient.ts | 42 +- .../src/storageFileShareClientContext.ts | 50 ++ .../subscriptionIdApiVersion/package.json | 3 +- .../subscriptionIdApiVersion/src/index.ts | 1 + .../src/operations/group.ts | 6 +- .../src/subscriptionIdApiVersionClient.ts | 42 +- .../subscriptionIdApiVersionClientContext.ts | 60 ++ .../generated/textanalytics/package.json | 3 +- .../textanalytics/src/generatedClient.ts | 35 +- .../src/generatedClientContext.ts | 53 ++ .../generated/textanalytics/src/index.ts | 1 + test/integration/generated/url/package.json | 3 +- test/integration/generated/url/src/index.ts | 1 + .../generated/url/src/operations/pathItems.ts | 6 +- .../generated/url/src/operations/paths.ts | 6 +- .../generated/url/src/operations/queries.ts | 6 +- .../generated/url/src/urlClient.ts | 41 +- .../generated/url/src/urlClientContext.ts | 56 ++ test/integration/generated/url2/package.json | 3 +- test/integration/generated/url2/src/index.ts | 1 + .../generated/url2/src/operations/get.ts | 6 +- .../generated/url2/src/urlClient.ts | 36 +- .../generated/url2/src/urlClientContext.ts | 51 ++ .../generated/urlMulti/package.json | 3 +- .../generated/urlMulti/src/index.ts | 1 + .../urlMulti/src/operations/queries.ts | 6 +- .../generated/urlMulti/src/urlMultiClient.ts | 33 +- .../urlMulti/src/urlMultiClientContext.ts | 47 ++ .../generated/urlRest/package.json | 2 +- .../generated/urlRest/src/urlRestClient.ts | 751 +----------------- .../generated/urlRest/tsconfig.json | 10 +- .../generated/useragentcorev1/package.json | 3 +- .../generated/useragentcorev1/src/index.ts | 1 + .../useragentcorev1/src/operations/group.ts | 6 +- .../src/userAgentCoreV1Client.ts | 41 +- .../src/userAgentCoreV1ClientContext.ts | 59 ++ .../generated/useragentcorev2/package.json | 3 +- .../generated/useragentcorev2/src/index.ts | 1 + .../useragentcorev2/src/operations/group.ts | 6 +- .../src/userAgentCoreV2Client.ts | 42 +- .../src/userAgentCoreV2ClientContext.ts | 60 ++ test/integration/generated/uuid/package.json | 3 +- test/integration/generated/uuid/src/index.ts | 1 + .../generated/uuid/src/operations/get.ts | 6 +- .../generated/uuid/src/uuidClient.ts | 36 +- .../generated/uuid/src/uuidClientContext.ts | 51 ++ .../generated/validation/package.json | 3 +- .../generated/validation/src/index.ts | 1 + .../validation/src/validationClient.ts | 41 +- .../validation/src/validationClientContext.ts | 60 ++ .../generated/xmlservice/package.json | 3 +- .../generated/xmlservice/src/index.ts | 1 + .../xmlservice/src/operations/xml.ts | 6 +- .../xmlservice/src/xmlServiceClient.ts | 33 +- .../xmlservice/src/xmlServiceClientContext.ts | 47 ++ .../generated/xmsErrorResponses/package.json | 3 +- .../generated/xmsErrorResponses/src/index.ts | 1 + .../xmsErrorResponses/src/operations/pet.ts | 6 +- .../src/xmsErrorResponsesClient.ts | 33 +- .../src/xmsErrorResponsesClientContext.ts | 47 ++ 492 files changed, 5095 insertions(+), 4398 deletions(-) create mode 100644 test/integration/generated/additionalProperties/src/additionalPropertiesClientContext.ts create mode 100644 test/integration/generated/appconfiguration/src/appConfigurationClientContext.ts create mode 100644 test/integration/generated/appconfigurationexport/src/appConfigurationClientContext.ts create mode 100644 test/integration/generated/arrayConstraints/src/arrayConstraintsClientContext.ts create mode 100644 test/integration/generated/attestation/src/generatedClientContext.ts create mode 100644 test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClientContext.ts create mode 100644 test/integration/generated/azureReport/src/reportClientContext.ts create mode 100644 test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClientContext.ts create mode 100644 test/integration/generated/bodyArray/src/bodyArrayClientContext.ts create mode 100644 test/integration/generated/bodyBoolean/src/bodyBooleanClientContext.ts create mode 100644 test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClientContext.ts create mode 100644 test/integration/generated/bodyByte/src/bodyByteClientContext.ts create mode 100644 test/integration/generated/bodyComplex/src/bodyComplexClientContext.ts create mode 100644 test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracingContext.ts create mode 100644 test/integration/generated/bodyDate/src/bodyDateClientContext.ts create mode 100644 test/integration/generated/bodyDateTime/src/bodyDateTimeClientContext.ts create mode 100644 test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123ClientContext.ts create mode 100644 test/integration/generated/bodyDictionary/src/bodyDictionaryClientContext.ts create mode 100644 test/integration/generated/bodyDuration/src/bodyDurationClientContext.ts create mode 100644 test/integration/generated/bodyFile/src/bodyFileClientContext.ts create mode 100644 test/integration/generated/bodyFormData/src/bodyFormDataClientContext.ts create mode 100644 test/integration/generated/bodyInteger/src/bodyIntegerClientContext.ts create mode 100644 test/integration/generated/bodyNumber/src/bodyNumberClientContext.ts create mode 100644 test/integration/generated/bodyString/src/bodyStringClientContext.ts delete mode 100644 test/integration/generated/bodyStringRest/karma.conf.js delete mode 100644 test/integration/generated/bodyStringRest/test/public/sampleTest.spec.ts delete mode 100644 test/integration/generated/bodyStringRest/test/public/utils/env.browser.ts delete mode 100644 test/integration/generated/bodyStringRest/test/public/utils/env.ts delete mode 100644 test/integration/generated/bodyStringRest/test/public/utils/recordedClient.ts create mode 100644 test/integration/generated/bodyTime/src/bodyTimeClientContext.ts create mode 100644 test/integration/generated/constantParam/src/generatedClientContext.ts create mode 100644 test/integration/generated/customUrl/src/customUrlClientContext.ts create mode 100644 test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClientContext.ts create mode 100644 test/integration/generated/customUrlPaging/src/customUrlPagingClientContext.ts create mode 100644 test/integration/generated/datafactory/src/dataFactoryClientContext.ts create mode 100644 test/integration/generated/datalakestorage/src/dataLakeStorageClientContext.ts create mode 100644 test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClientContext.ts create mode 100644 test/integration/generated/domainservices/src/domainServicesClientContext.ts create mode 100644 test/integration/generated/extensibleEnums/src/extensibleEnumsClientContext.ts create mode 100644 test/integration/generated/header/src/headerClientContext.ts create mode 100644 test/integration/generated/headerprefix/src/headerPrefixClientContext.ts create mode 100644 test/integration/generated/healthcareapis/src/healthCareApisClientContext.ts create mode 100644 test/integration/generated/httpInfrastructure/src/httpInfrastructureClientContext.ts create mode 100644 test/integration/generated/iotspaces/src/ioTSpacesClientContext.ts create mode 100644 test/integration/generated/licenseHeader/src/licenseHeaderClientContext.ts create mode 100644 test/integration/generated/lro/src/lROClientContext.ts create mode 100644 test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClientContext.ts create mode 100644 test/integration/generated/mapperrequired/src/mapperRequiredClientContext.ts create mode 100644 test/integration/generated/mediaTypes/src/mediaTypesClientContext.ts create mode 100644 test/integration/generated/mediaTypesV3/src/mediaTypesV3ClientContext.ts create mode 100644 test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClientContext.ts create mode 100644 test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClientContext.ts create mode 100644 test/integration/generated/modelFlattening/src/modelFlatteningClientContext.ts create mode 100644 test/integration/generated/multipleInheritance/src/multipleInheritanceClientContext.ts create mode 100644 test/integration/generated/nameChecker/src/searchClientContext.ts create mode 100644 test/integration/generated/noLicenseHeader/src/noLicenseHeaderClientContext.ts create mode 100644 test/integration/generated/noMappers/src/noMappersClientContext.ts create mode 100644 test/integration/generated/noOperation/src/noOperationsClientContext.ts create mode 100644 test/integration/generated/nonStringEnum/src/nonStringEnumClientContext.ts create mode 100644 test/integration/generated/objectType/src/objectTypeClientContext.ts create mode 100644 test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClientContext.ts create mode 100644 test/integration/generated/operationgroupclash/src/operationGroupClashClientContext.ts create mode 100644 test/integration/generated/optionalnull/src/optionalNullClientContext.ts create mode 100644 test/integration/generated/paging/src/pagingClientContext.ts create mode 100644 test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClientContext.ts create mode 100644 test/integration/generated/petstore/src/petStoreContext.ts create mode 100644 test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClientContext.ts create mode 100644 test/integration/generated/readmeFileChecker/src/keyVaultClientContext.ts create mode 100644 test/integration/generated/regexConstraint/src/regexConstraintContext.ts create mode 100644 test/integration/generated/report/src/reportClientContext.ts create mode 100644 test/integration/generated/requiredOptional/src/requiredOptionalClientContext.ts create mode 100644 test/integration/generated/resources/src/resourcesClientContext.ts create mode 100644 test/integration/generated/sealedchoice/src/sealedChoiceClientContext.ts create mode 100644 test/integration/generated/storageblob/src/storageBlobClientContext.ts create mode 100644 test/integration/generated/storagefileshare/src/storageFileShareClientContext.ts create mode 100644 test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClientContext.ts create mode 100644 test/integration/generated/textanalytics/src/generatedClientContext.ts create mode 100644 test/integration/generated/url/src/urlClientContext.ts create mode 100644 test/integration/generated/url2/src/urlClientContext.ts create mode 100644 test/integration/generated/urlMulti/src/urlMultiClientContext.ts create mode 100644 test/integration/generated/useragentcorev1/src/userAgentCoreV1ClientContext.ts create mode 100644 test/integration/generated/useragentcorev2/src/userAgentCoreV2ClientContext.ts create mode 100644 test/integration/generated/uuid/src/uuidClientContext.ts create mode 100644 test/integration/generated/validation/src/validationClientContext.ts create mode 100644 test/integration/generated/xmlservice/src/xmlServiceClientContext.ts create mode 100644 test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClientContext.ts diff --git a/test/integration/generated/additionalProperties/package.json b/test/integration/generated/additionalProperties/package.json index fc0c835b33..63b35927f8 100644 --- a/test/integration/generated/additionalProperties/package.json +++ b/test/integration/generated/additionalProperties/package.json @@ -26,7 +26,6 @@ "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^1.0.0", "mocha": "^7.1.1", @@ -79,7 +78,7 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts", "integration-test:browser": "echo skipped", "docs": "echo skipped" }, diff --git a/test/integration/generated/additionalProperties/src/additionalPropertiesClient.ts b/test/integration/generated/additionalProperties/src/additionalPropertiesClient.ts index 992c69cc69..197c6052b5 100644 --- a/test/integration/generated/additionalProperties/src/additionalPropertiesClient.ts +++ b/test/integration/generated/additionalProperties/src/additionalPropertiesClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { PetsImpl } from "./operations"; import { Pets } from "./operationsInterfaces"; +import { AdditionalPropertiesClientContext } from "./additionalPropertiesClientContext"; import { AdditionalPropertiesClientOptionalParams } from "./models"; -export class AdditionalPropertiesClient extends coreClient.ServiceClient { - $host: string; - +export class AdditionalPropertiesClient extends AdditionalPropertiesClientContext { /** * Initializes a new instance of the AdditionalPropertiesClient class. * @param options The parameter options */ constructor(options?: AdditionalPropertiesClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: AdditionalPropertiesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-additional-properties/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.pets = new PetsImpl(this); } diff --git a/test/integration/generated/additionalProperties/src/additionalPropertiesClientContext.ts b/test/integration/generated/additionalProperties/src/additionalPropertiesClientContext.ts new file mode 100644 index 0000000000..44f819ca51 --- /dev/null +++ b/test/integration/generated/additionalProperties/src/additionalPropertiesClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { AdditionalPropertiesClientOptionalParams } from "./models"; + +export class AdditionalPropertiesClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the AdditionalPropertiesClientContext class. + * @param options The parameter options + */ + constructor(options?: AdditionalPropertiesClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AdditionalPropertiesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-additional-properties/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/additionalProperties/src/index.ts b/test/integration/generated/additionalProperties/src/index.ts index 1e65507bb3..27e7c36b41 100644 --- a/test/integration/generated/additionalProperties/src/index.ts +++ b/test/integration/generated/additionalProperties/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { AdditionalPropertiesClient } from "./additionalPropertiesClient"; +export { AdditionalPropertiesClientContext } from "./additionalPropertiesClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/additionalProperties/src/operations/pets.ts b/test/integration/generated/additionalProperties/src/operations/pets.ts index 352bad2c9f..4e16d2f7f1 100644 --- a/test/integration/generated/additionalProperties/src/operations/pets.ts +++ b/test/integration/generated/additionalProperties/src/operations/pets.ts @@ -10,7 +10,7 @@ import { Pets } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AdditionalPropertiesClient } from "../additionalPropertiesClient"; +import { AdditionalPropertiesClientContext } from "../additionalPropertiesClientContext"; import { PetAPTrue, PetsCreateAPTrueOptionalParams, @@ -34,13 +34,13 @@ import { /** Class containing Pets operations. */ export class PetsImpl implements Pets { - private readonly client: AdditionalPropertiesClient; + private readonly client: AdditionalPropertiesClientContext; /** * Initialize a new instance of the class Pets class. * @param client Reference to the service client */ - constructor(client: AdditionalPropertiesClient) { + constructor(client: AdditionalPropertiesClientContext) { this.client = client; } diff --git a/test/integration/generated/appconfiguration/package.json b/test/integration/generated/appconfiguration/package.json index 7b771b375b..7bbcc7bc8a 100644 --- a/test/integration/generated/appconfiguration/package.json +++ b/test/integration/generated/appconfiguration/package.json @@ -26,8 +26,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/appconfiguration/src/appConfigurationClient.ts b/test/integration/generated/appconfiguration/src/appConfigurationClient.ts index 92fbb174ad..fb504da7a1 100644 --- a/test/integration/generated/appconfiguration/src/appConfigurationClient.ts +++ b/test/integration/generated/appconfiguration/src/appConfigurationClient.ts @@ -10,6 +10,7 @@ import * as coreClient from "@azure/core-client"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { AppConfigurationClientContext } from "./appConfigurationClientContext"; import { AppConfigurationClientOptionalParams, Key, @@ -54,11 +55,7 @@ import { } from "./models"; /// -export class AppConfigurationClient extends coreClient.ServiceClient { - endpoint: string; - syncToken?: string; - apiVersion: string; - +export class AppConfigurationClient extends AppConfigurationClientContext { /** * Initializes a new instance of the AppConfigurationClient class. * @param endpoint The endpoint of the App Configuration instance to send requests to. @@ -68,38 +65,7 @@ export class AppConfigurationClient extends coreClient.ServiceClient { endpoint: string, options?: AppConfigurationClientOptionalParams ) { - if (endpoint === undefined) { - throw new Error("'endpoint' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: AppConfigurationClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-appconfiguration/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{endpoint}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.endpoint = endpoint; - - // Assigning values to Constant parameters - this.apiVersion = options.apiVersion || "1.0"; + super(endpoint, options); } /** diff --git a/test/integration/generated/appconfiguration/src/appConfigurationClientContext.ts b/test/integration/generated/appconfiguration/src/appConfigurationClientContext.ts new file mode 100644 index 0000000000..772e816c74 --- /dev/null +++ b/test/integration/generated/appconfiguration/src/appConfigurationClientContext.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { AppConfigurationClientOptionalParams } from "./models"; + +export class AppConfigurationClientContext extends coreClient.ServiceClient { + endpoint: string; + syncToken?: string; + apiVersion: string; + + /** + * Initializes a new instance of the AppConfigurationClientContext class. + * @param endpoint The endpoint of the App Configuration instance to send requests to. + * @param options The parameter options + */ + constructor( + endpoint: string, + options?: AppConfigurationClientOptionalParams + ) { + if (endpoint === undefined) { + throw new Error("'endpoint' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AppConfigurationClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-appconfiguration/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{endpoint}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.endpoint = endpoint; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "1.0"; + } +} diff --git a/test/integration/generated/appconfiguration/src/index.ts b/test/integration/generated/appconfiguration/src/index.ts index de43cce385..f4f4cc420a 100644 --- a/test/integration/generated/appconfiguration/src/index.ts +++ b/test/integration/generated/appconfiguration/src/index.ts @@ -9,3 +9,4 @@ /// export * from "./models"; export { AppConfigurationClient } from "./appConfigurationClient"; +export { AppConfigurationClientContext } from "./appConfigurationClientContext"; diff --git a/test/integration/generated/appconfigurationexport/package.json b/test/integration/generated/appconfigurationexport/package.json index 7b771b375b..7bbcc7bc8a 100644 --- a/test/integration/generated/appconfigurationexport/package.json +++ b/test/integration/generated/appconfigurationexport/package.json @@ -26,8 +26,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/appconfigurationexport/src/appConfigurationClient.ts b/test/integration/generated/appconfigurationexport/src/appConfigurationClient.ts index 678834664b..2929a210e7 100644 --- a/test/integration/generated/appconfigurationexport/src/appConfigurationClient.ts +++ b/test/integration/generated/appconfigurationexport/src/appConfigurationClient.ts @@ -10,6 +10,7 @@ import * as coreClient from "@azure/core-client"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { AppConfigurationClientContext } from "./appConfigurationClientContext"; import { AppConfigurationClientOptionalParams, Key, @@ -55,11 +56,7 @@ import { /// /** @internal */ -export class AppConfigurationClient extends coreClient.ServiceClient { - endpoint: string; - syncToken?: string; - apiVersion: string; - +export class AppConfigurationClient extends AppConfigurationClientContext { /** * Initializes a new instance of the AppConfigurationClient class. * @param endpoint The endpoint of the App Configuration instance to send requests to. @@ -69,38 +66,7 @@ export class AppConfigurationClient extends coreClient.ServiceClient { endpoint: string, options?: AppConfigurationClientOptionalParams ) { - if (endpoint === undefined) { - throw new Error("'endpoint' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: AppConfigurationClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-appconfiguration/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{endpoint}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.endpoint = endpoint; - - // Assigning values to Constant parameters - this.apiVersion = options.apiVersion || "1.0"; + super(endpoint, options); } /** diff --git a/test/integration/generated/appconfigurationexport/src/appConfigurationClientContext.ts b/test/integration/generated/appconfigurationexport/src/appConfigurationClientContext.ts new file mode 100644 index 0000000000..9095f25830 --- /dev/null +++ b/test/integration/generated/appconfigurationexport/src/appConfigurationClientContext.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { AppConfigurationClientOptionalParams } from "./models"; + +/** @internal */ +export class AppConfigurationClientContext extends coreClient.ServiceClient { + endpoint: string; + syncToken?: string; + apiVersion: string; + + /** + * Initializes a new instance of the AppConfigurationClientContext class. + * @param endpoint The endpoint of the App Configuration instance to send requests to. + * @param options The parameter options + */ + constructor( + endpoint: string, + options?: AppConfigurationClientOptionalParams + ) { + if (endpoint === undefined) { + throw new Error("'endpoint' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AppConfigurationClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-appconfiguration/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{endpoint}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.endpoint = endpoint; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "1.0"; + } +} diff --git a/test/integration/generated/appconfigurationexport/src/index.ts b/test/integration/generated/appconfigurationexport/src/index.ts index de43cce385..f4f4cc420a 100644 --- a/test/integration/generated/appconfigurationexport/src/index.ts +++ b/test/integration/generated/appconfigurationexport/src/index.ts @@ -9,3 +9,4 @@ /// export * from "./models"; export { AppConfigurationClient } from "./appConfigurationClient"; +export { AppConfigurationClientContext } from "./appConfigurationClientContext"; diff --git a/test/integration/generated/arrayConstraints/package.json b/test/integration/generated/arrayConstraints/package.json index 15d3569b1e..46bf9eddce 100644 --- a/test/integration/generated/arrayConstraints/package.json +++ b/test/integration/generated/arrayConstraints/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/arrayConstraints/src/arrayConstraintsClient.ts b/test/integration/generated/arrayConstraints/src/arrayConstraintsClient.ts index 09dc3de587..02ff61db0c 100644 --- a/test/integration/generated/arrayConstraints/src/arrayConstraintsClient.ts +++ b/test/integration/generated/arrayConstraints/src/arrayConstraintsClient.ts @@ -9,9 +9,10 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { ArrayConstraintsClientContext } from "./arrayConstraintsClientContext"; import { - Enum0, ArrayConstraintsClientOptionalParams, + Enum0, Product, PostValueOptionalParams, PostValueResponse, @@ -19,10 +20,7 @@ import { ApiV1ValueGetResponse } from "./models"; -export class ArrayConstraintsClient extends coreClient.ServiceClient { - $host: string; - apiVersion: Enum0; - +export class ArrayConstraintsClient extends ArrayConstraintsClientContext { /** * Initializes a new instance of the ArrayConstraintsClient class. * @param $host server parameter @@ -34,39 +32,7 @@ export class ArrayConstraintsClient extends coreClient.ServiceClient { apiVersion: Enum0, options?: ArrayConstraintsClientOptionalParams ) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ArrayConstraintsClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-array-constraints-client/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - this.apiVersion = apiVersion; + super($host, apiVersion, options); } /** diff --git a/test/integration/generated/arrayConstraints/src/arrayConstraintsClientContext.ts b/test/integration/generated/arrayConstraints/src/arrayConstraintsClientContext.ts new file mode 100644 index 0000000000..39f895daf9 --- /dev/null +++ b/test/integration/generated/arrayConstraints/src/arrayConstraintsClientContext.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { Enum0, ArrayConstraintsClientOptionalParams } from "./models"; + +export class ArrayConstraintsClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: Enum0; + + /** + * Initializes a new instance of the ArrayConstraintsClientContext class. + * @param $host server parameter + * @param apiVersion + * @param options The parameter options + */ + constructor( + $host: string, + apiVersion: Enum0, + options?: ArrayConstraintsClientOptionalParams + ) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ArrayConstraintsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-array-constraints-client/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + this.apiVersion = apiVersion; + } +} diff --git a/test/integration/generated/arrayConstraints/src/index.ts b/test/integration/generated/arrayConstraints/src/index.ts index dd642ba343..1b3254ede2 100644 --- a/test/integration/generated/arrayConstraints/src/index.ts +++ b/test/integration/generated/arrayConstraints/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { ArrayConstraintsClient } from "./arrayConstraintsClient"; +export { ArrayConstraintsClientContext } from "./arrayConstraintsClientContext"; diff --git a/test/integration/generated/attestation/package.json b/test/integration/generated/attestation/package.json index c9002fd337..ea28192dc5 100644 --- a/test/integration/generated/attestation/package.json +++ b/test/integration/generated/attestation/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/attestation/src/generatedClient.ts b/test/integration/generated/attestation/src/generatedClient.ts index 56ee62e27e..385cb6afca 100644 --- a/test/integration/generated/attestation/src/generatedClient.ts +++ b/test/integration/generated/attestation/src/generatedClient.ts @@ -6,54 +6,20 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { PolicyImpl } from "./operations"; import { Policy } from "./operationsInterfaces"; +import { GeneratedClientContext } from "./generatedClientContext"; import { GeneratedClientOptionalParams } from "./models"; /** @internal */ -export class GeneratedClient extends coreClient.ServiceClient { - instanceUrl: string; - apiVersion: string; - +export class GeneratedClient extends GeneratedClientContext { /** * Initializes a new instance of the GeneratedClient class. * @param instanceUrl The attestation instance base URI, for example https://mytenant.attest.azure.net. * @param options The parameter options */ constructor(instanceUrl: string, options?: GeneratedClientOptionalParams) { - if (instanceUrl === undefined) { - throw new Error("'instanceUrl' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: GeneratedClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-attestation/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{instanceUrl}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.instanceUrl = instanceUrl; - - // Assigning values to Constant parameters - this.apiVersion = options.apiVersion || "2020-10-01"; + super(instanceUrl, options); this.policy = new PolicyImpl(this); } diff --git a/test/integration/generated/attestation/src/generatedClientContext.ts b/test/integration/generated/attestation/src/generatedClientContext.ts new file mode 100644 index 0000000000..427f261447 --- /dev/null +++ b/test/integration/generated/attestation/src/generatedClientContext.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { GeneratedClientOptionalParams } from "./models"; + +/** @internal */ +export class GeneratedClientContext extends coreClient.ServiceClient { + instanceUrl: string; + apiVersion: string; + + /** + * Initializes a new instance of the GeneratedClientContext class. + * @param instanceUrl The attestation instance base URI, for example https://mytenant.attest.azure.net. + * @param options The parameter options + */ + constructor(instanceUrl: string, options?: GeneratedClientOptionalParams) { + if (instanceUrl === undefined) { + throw new Error("'instanceUrl' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: GeneratedClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-attestation/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{instanceUrl}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.instanceUrl = instanceUrl; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "2020-10-01"; + } +} diff --git a/test/integration/generated/attestation/src/index.ts b/test/integration/generated/attestation/src/index.ts index db5d703d07..707d58f011 100644 --- a/test/integration/generated/attestation/src/index.ts +++ b/test/integration/generated/attestation/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { GeneratedClient } from "./generatedClient"; +export { GeneratedClientContext } from "./generatedClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/attestation/src/operations/policy.ts b/test/integration/generated/attestation/src/operations/policy.ts index fc614fdf05..1514312853 100644 --- a/test/integration/generated/attestation/src/operations/policy.ts +++ b/test/integration/generated/attestation/src/operations/policy.ts @@ -10,7 +10,7 @@ import { Policy } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { GeneratedClient } from "../generatedClient"; +import { GeneratedClientContext } from "../generatedClientContext"; import { AttestationType, PolicyGetOptionalParams, @@ -23,13 +23,13 @@ import { /** Class containing Policy operations. */ export class PolicyImpl implements Policy { - private readonly client: GeneratedClient; + private readonly client: GeneratedClientContext; /** * Initialize a new instance of the class Policy class. * @param client Reference to the service client */ - constructor(client: GeneratedClient) { + constructor(client: GeneratedClientContext) { this.client = client; } diff --git a/test/integration/generated/azureParameterGrouping/package.json b/test/integration/generated/azureParameterGrouping/package.json index 774aec2ea5..019a2c5a73 100644 --- a/test/integration/generated/azureParameterGrouping/package.json +++ b/test/integration/generated/azureParameterGrouping/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClient.ts b/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClient.ts index b1fcc04f05..eacb40c2c6 100644 --- a/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClient.ts +++ b/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { ParameterGroupingImpl } from "./operations"; import { ParameterGrouping } from "./operationsInterfaces"; +import { AzureParameterGroupingClientContext } from "./azureParameterGroupingClientContext"; import { AzureParameterGroupingClientOptionalParams } from "./models"; -export class AzureParameterGroupingClient extends coreClient.ServiceClient { - $host: string; - +export class AzureParameterGroupingClient extends AzureParameterGroupingClientContext { /** * Initializes a new instance of the AzureParameterGroupingClient class. * @param options The parameter options */ constructor(options?: AzureParameterGroupingClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: AzureParameterGroupingClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-azure-parameter-grouping/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.parameterGrouping = new ParameterGroupingImpl(this); } diff --git a/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClientContext.ts b/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClientContext.ts new file mode 100644 index 0000000000..b3b7294fb4 --- /dev/null +++ b/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { AzureParameterGroupingClientOptionalParams } from "./models"; + +export class AzureParameterGroupingClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the AzureParameterGroupingClientContext class. + * @param options The parameter options + */ + constructor(options?: AzureParameterGroupingClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AzureParameterGroupingClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-azure-parameter-grouping/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/azureParameterGrouping/src/index.ts b/test/integration/generated/azureParameterGrouping/src/index.ts index 81a8b12231..89becd64b0 100644 --- a/test/integration/generated/azureParameterGrouping/src/index.ts +++ b/test/integration/generated/azureParameterGrouping/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { AzureParameterGroupingClient } from "./azureParameterGroupingClient"; +export { AzureParameterGroupingClientContext } from "./azureParameterGroupingClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/azureParameterGrouping/src/operations/parameterGrouping.ts b/test/integration/generated/azureParameterGrouping/src/operations/parameterGrouping.ts index a2d7dc8550..e54e593e61 100644 --- a/test/integration/generated/azureParameterGrouping/src/operations/parameterGrouping.ts +++ b/test/integration/generated/azureParameterGrouping/src/operations/parameterGrouping.ts @@ -10,7 +10,7 @@ import { ParameterGrouping } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureParameterGroupingClient } from "../azureParameterGroupingClient"; +import { AzureParameterGroupingClientContext } from "../azureParameterGroupingClientContext"; import { ParameterGroupingPostRequiredParameters, ParameterGroupingPostRequiredOptionalParams, @@ -22,13 +22,13 @@ import { /** Class containing ParameterGrouping operations. */ export class ParameterGroupingImpl implements ParameterGrouping { - private readonly client: AzureParameterGroupingClient; + private readonly client: AzureParameterGroupingClientContext; /** * Initialize a new instance of the class ParameterGrouping class. * @param client Reference to the service client */ - constructor(client: AzureParameterGroupingClient) { + constructor(client: AzureParameterGroupingClientContext) { this.client = client; } diff --git a/test/integration/generated/azureReport/package.json b/test/integration/generated/azureReport/package.json index 2e522ea81d..0964d316ba 100644 --- a/test/integration/generated/azureReport/package.json +++ b/test/integration/generated/azureReport/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/azureReport/src/index.ts b/test/integration/generated/azureReport/src/index.ts index 597f974fe7..5a2e464d52 100644 --- a/test/integration/generated/azureReport/src/index.ts +++ b/test/integration/generated/azureReport/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { ReportClient } from "./reportClient"; +export { ReportClientContext } from "./reportClientContext"; diff --git a/test/integration/generated/azureReport/src/reportClient.ts b/test/integration/generated/azureReport/src/reportClient.ts index 4238a6d2be..84fc34fbfc 100644 --- a/test/integration/generated/azureReport/src/reportClient.ts +++ b/test/integration/generated/azureReport/src/reportClient.ts @@ -9,46 +9,20 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { ReportClientContext } from "./reportClientContext"; import { ReportClientOptionalParams, GetReportOptionalParams, GetReportResponse } from "./models"; -export class ReportClient extends coreClient.ServiceClient { - $host: string; - +export class ReportClient extends ReportClientContext { /** * Initializes a new instance of the ReportClient class. * @param options The parameter options */ constructor(options?: ReportClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ReportClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-zzzAzureReport/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); } /** diff --git a/test/integration/generated/azureReport/src/reportClientContext.ts b/test/integration/generated/azureReport/src/reportClientContext.ts new file mode 100644 index 0000000000..a42d66a2ab --- /dev/null +++ b/test/integration/generated/azureReport/src/reportClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { ReportClientOptionalParams } from "./models"; + +export class ReportClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the ReportClientContext class. + * @param options The parameter options + */ + constructor(options?: ReportClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ReportClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-zzzAzureReport/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/azureSpecialProperties/package.json b/test/integration/generated/azureSpecialProperties/package.json index 55df262957..7b88dd3b01 100644 --- a/test/integration/generated/azureSpecialProperties/package.json +++ b/test/integration/generated/azureSpecialProperties/package.json @@ -26,8 +26,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClient.ts b/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClient.ts index 5a150afc11..85d7dd8998 100644 --- a/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClient.ts +++ b/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClient.ts @@ -6,7 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import * as coreAuth from "@azure/core-auth"; import { XMsClientRequestIdImpl, @@ -28,13 +27,10 @@ import { Odata, Header } from "./operationsInterfaces"; +import { AzureSpecialPropertiesClientContext } from "./azureSpecialPropertiesClientContext"; import { AzureSpecialPropertiesClientOptionalParams } from "./models"; -export class AzureSpecialPropertiesClient extends coreClient.ServiceClient { - $host: string; - subscriptionId: string; - apiVersion: string; - +export class AzureSpecialPropertiesClient extends AzureSpecialPropertiesClientContext { /** * Initializes a new instance of the AzureSpecialPropertiesClient class. * @param credentials Subscription credentials which uniquely identify client subscription. @@ -47,49 +43,7 @@ export class AzureSpecialPropertiesClient extends coreClient.ServiceClient { subscriptionId: string, options?: AzureSpecialPropertiesClientOptionalParams ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: AzureSpecialPropertiesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials - }; - - const packageDetails = `azsdk-js-azure-special-properties/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - if (!options.credentialScopes) { - options.credentialScopes = [ - "https://microsoft.com/.default", - "http://microsoft.com/.default" - ]; - } - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "2015-07-01-preview"; + super(credentials, subscriptionId, options); this.xMsClientRequestId = new XMsClientRequestIdImpl(this); this.subscriptionInCredentials = new SubscriptionInCredentialsImpl(this); this.subscriptionInMethod = new SubscriptionInMethodImpl(this); diff --git a/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClientContext.ts b/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClientContext.ts new file mode 100644 index 0000000000..2bf7f4a3b2 --- /dev/null +++ b/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClientContext.ts @@ -0,0 +1,74 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { AzureSpecialPropertiesClientOptionalParams } from "./models"; + +export class AzureSpecialPropertiesClientContext extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the AzureSpecialPropertiesClientContext class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The subscription id, which appears in the path, always modeled in credentials. + * The value is always '1234-5678-9012-3456' + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: AzureSpecialPropertiesClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AzureSpecialPropertiesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-azure-special-properties/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = [ + "https://microsoft.com/.default", + "http://microsoft.com/.default" + ]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "2015-07-01-preview"; + } +} diff --git a/test/integration/generated/azureSpecialProperties/src/index.ts b/test/integration/generated/azureSpecialProperties/src/index.ts index e96237bae4..67661dc286 100644 --- a/test/integration/generated/azureSpecialProperties/src/index.ts +++ b/test/integration/generated/azureSpecialProperties/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { AzureSpecialPropertiesClient } from "./azureSpecialPropertiesClient"; +export { AzureSpecialPropertiesClientContext } from "./azureSpecialPropertiesClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/azureSpecialProperties/src/operations/apiVersionDefault.ts b/test/integration/generated/azureSpecialProperties/src/operations/apiVersionDefault.ts index 9a1dab5a8f..c79b71e874 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/apiVersionDefault.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/apiVersionDefault.ts @@ -10,7 +10,7 @@ import { ApiVersionDefault } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; +import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; import { ApiVersionDefaultGetMethodGlobalValidOptionalParams, ApiVersionDefaultGetMethodGlobalNotProvidedValidOptionalParams, @@ -20,13 +20,13 @@ import { /** Class containing ApiVersionDefault operations. */ export class ApiVersionDefaultImpl implements ApiVersionDefault { - private readonly client: AzureSpecialPropertiesClient; + private readonly client: AzureSpecialPropertiesClientContext; /** * Initialize a new instance of the class ApiVersionDefault class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClient) { + constructor(client: AzureSpecialPropertiesClientContext) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/apiVersionLocal.ts b/test/integration/generated/azureSpecialProperties/src/operations/apiVersionLocal.ts index 539c6557a5..b61b58af0a 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/apiVersionLocal.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/apiVersionLocal.ts @@ -10,7 +10,7 @@ import { ApiVersionLocal } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; +import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; import { ApiVersionLocalGetMethodLocalValidOptionalParams, ApiVersionLocalGetMethodLocalNullOptionalParams, @@ -20,13 +20,13 @@ import { /** Class containing ApiVersionLocal operations. */ export class ApiVersionLocalImpl implements ApiVersionLocal { - private readonly client: AzureSpecialPropertiesClient; + private readonly client: AzureSpecialPropertiesClientContext; /** * Initialize a new instance of the class ApiVersionLocal class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClient) { + constructor(client: AzureSpecialPropertiesClientContext) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/header.ts b/test/integration/generated/azureSpecialProperties/src/operations/header.ts index cd7cb2b60e..e270eb406e 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/header.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/header.ts @@ -10,7 +10,7 @@ import { Header } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; +import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; import { HeaderCustomNamedRequestIdOptionalParams, HeaderCustomNamedRequestIdResponse, @@ -23,13 +23,13 @@ import { /** Class containing Header operations. */ export class HeaderImpl implements Header { - private readonly client: AzureSpecialPropertiesClient; + private readonly client: AzureSpecialPropertiesClientContext; /** * Initialize a new instance of the class Header class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClient) { + constructor(client: AzureSpecialPropertiesClientContext) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/odata.ts b/test/integration/generated/azureSpecialProperties/src/operations/odata.ts index c3f6334d31..55fde31b2b 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/odata.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/odata.ts @@ -10,18 +10,18 @@ import { Odata } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; +import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; import { OdataGetWithFilterOptionalParams } from "../models"; /** Class containing Odata operations. */ export class OdataImpl implements Odata { - private readonly client: AzureSpecialPropertiesClient; + private readonly client: AzureSpecialPropertiesClientContext; /** * Initialize a new instance of the class Odata class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClient) { + constructor(client: AzureSpecialPropertiesClientContext) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/skipUrlEncoding.ts b/test/integration/generated/azureSpecialProperties/src/operations/skipUrlEncoding.ts index a576fda5d1..268157843d 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/skipUrlEncoding.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/skipUrlEncoding.ts @@ -10,7 +10,7 @@ import { SkipUrlEncoding } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; +import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; import { SkipUrlEncodingGetMethodPathValidOptionalParams, SkipUrlEncodingGetPathValidOptionalParams, @@ -23,13 +23,13 @@ import { /** Class containing SkipUrlEncoding operations. */ export class SkipUrlEncodingImpl implements SkipUrlEncoding { - private readonly client: AzureSpecialPropertiesClient; + private readonly client: AzureSpecialPropertiesClientContext; /** * Initialize a new instance of the class SkipUrlEncoding class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClient) { + constructor(client: AzureSpecialPropertiesClientContext) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInCredentials.ts b/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInCredentials.ts index 832a11f80e..9817175e31 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInCredentials.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInCredentials.ts @@ -10,7 +10,7 @@ import { SubscriptionInCredentials } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; +import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; import { SubscriptionInCredentialsPostMethodGlobalValidOptionalParams, SubscriptionInCredentialsPostMethodGlobalNullOptionalParams, @@ -22,13 +22,13 @@ import { /** Class containing SubscriptionInCredentials operations. */ export class SubscriptionInCredentialsImpl implements SubscriptionInCredentials { - private readonly client: AzureSpecialPropertiesClient; + private readonly client: AzureSpecialPropertiesClientContext; /** * Initialize a new instance of the class SubscriptionInCredentials class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClient) { + constructor(client: AzureSpecialPropertiesClientContext) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInMethod.ts b/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInMethod.ts index 83ddfc9830..5168d65744 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInMethod.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInMethod.ts @@ -10,7 +10,7 @@ import { SubscriptionInMethod } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; +import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; import { SubscriptionInMethodPostMethodLocalValidOptionalParams, SubscriptionInMethodPostMethodLocalNullOptionalParams, @@ -20,13 +20,13 @@ import { /** Class containing SubscriptionInMethod operations. */ export class SubscriptionInMethodImpl implements SubscriptionInMethod { - private readonly client: AzureSpecialPropertiesClient; + private readonly client: AzureSpecialPropertiesClientContext; /** * Initialize a new instance of the class SubscriptionInMethod class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClient) { + constructor(client: AzureSpecialPropertiesClientContext) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/xMsClientRequestId.ts b/test/integration/generated/azureSpecialProperties/src/operations/xMsClientRequestId.ts index 8093a9865c..c423a5b6f7 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/xMsClientRequestId.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/xMsClientRequestId.ts @@ -10,7 +10,7 @@ import { XMsClientRequestId } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; +import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; import { XMsClientRequestIdGetOptionalParams, XMsClientRequestIdParamGetOptionalParams @@ -18,13 +18,13 @@ import { /** Class containing XMsClientRequestId operations. */ export class XMsClientRequestIdImpl implements XMsClientRequestId { - private readonly client: AzureSpecialPropertiesClient; + private readonly client: AzureSpecialPropertiesClientContext; /** * Initialize a new instance of the class XMsClientRequestId class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClient) { + constructor(client: AzureSpecialPropertiesClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyArray/package.json b/test/integration/generated/bodyArray/package.json index b2e9ec3e50..0e883c0312 100644 --- a/test/integration/generated/bodyArray/package.json +++ b/test/integration/generated/bodyArray/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyArray/src/bodyArrayClient.ts b/test/integration/generated/bodyArray/src/bodyArrayClient.ts index 8abf3d71eb..cb5a7477f6 100644 --- a/test/integration/generated/bodyArray/src/bodyArrayClient.ts +++ b/test/integration/generated/bodyArray/src/bodyArrayClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { ArrayImpl } from "./operations"; import { Array } from "./operationsInterfaces"; +import { BodyArrayClientContext } from "./bodyArrayClientContext"; import { BodyArrayClientOptionalParams } from "./models"; -export class BodyArrayClient extends coreClient.ServiceClient { - $host: string; - +export class BodyArrayClient extends BodyArrayClientContext { /** * Initializes a new instance of the BodyArrayClient class. * @param options The parameter options */ constructor(options?: BodyArrayClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyArrayClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-array/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.array = new ArrayImpl(this); } diff --git a/test/integration/generated/bodyArray/src/bodyArrayClientContext.ts b/test/integration/generated/bodyArray/src/bodyArrayClientContext.ts new file mode 100644 index 0000000000..a4563aa7bd --- /dev/null +++ b/test/integration/generated/bodyArray/src/bodyArrayClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyArrayClientOptionalParams } from "./models"; + +export class BodyArrayClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyArrayClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyArrayClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyArrayClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-array/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyArray/src/index.ts b/test/integration/generated/bodyArray/src/index.ts index 6c1db93646..008ea24110 100644 --- a/test/integration/generated/bodyArray/src/index.ts +++ b/test/integration/generated/bodyArray/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyArrayClient } from "./bodyArrayClient"; +export { BodyArrayClientContext } from "./bodyArrayClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyArray/src/operations/array.ts b/test/integration/generated/bodyArray/src/operations/array.ts index d28393fc90..ae7aae9bd4 100644 --- a/test/integration/generated/bodyArray/src/operations/array.ts +++ b/test/integration/generated/bodyArray/src/operations/array.ts @@ -10,7 +10,7 @@ import { Array } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyArrayClient } from "../bodyArrayClient"; +import { BodyArrayClientContext } from "../bodyArrayClientContext"; import { ArrayGetNullOptionalParams, ArrayGetNullResponse, @@ -139,13 +139,13 @@ import { /** Class containing Array operations. */ export class ArrayImpl implements Array { - private readonly client: BodyArrayClient; + private readonly client: BodyArrayClientContext; /** * Initialize a new instance of the class Array class. * @param client Reference to the service client */ - constructor(client: BodyArrayClient) { + constructor(client: BodyArrayClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyBoolean/package.json b/test/integration/generated/bodyBoolean/package.json index df7a65559d..a66f664550 100644 --- a/test/integration/generated/bodyBoolean/package.json +++ b/test/integration/generated/bodyBoolean/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyBoolean/src/bodyBooleanClient.ts b/test/integration/generated/bodyBoolean/src/bodyBooleanClient.ts index d9139fafa0..baa84ceae4 100644 --- a/test/integration/generated/bodyBoolean/src/bodyBooleanClient.ts +++ b/test/integration/generated/bodyBoolean/src/bodyBooleanClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { BoolImpl } from "./operations"; import { Bool } from "./operationsInterfaces"; +import { BodyBooleanClientContext } from "./bodyBooleanClientContext"; import { BodyBooleanClientOptionalParams } from "./models"; -export class BodyBooleanClient extends coreClient.ServiceClient { - $host: string; - +export class BodyBooleanClient extends BodyBooleanClientContext { /** * Initializes a new instance of the BodyBooleanClient class. * @param options The parameter options */ constructor(options?: BodyBooleanClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyBooleanClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-boolean/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.bool = new BoolImpl(this); } diff --git a/test/integration/generated/bodyBoolean/src/bodyBooleanClientContext.ts b/test/integration/generated/bodyBoolean/src/bodyBooleanClientContext.ts new file mode 100644 index 0000000000..2838b08726 --- /dev/null +++ b/test/integration/generated/bodyBoolean/src/bodyBooleanClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyBooleanClientOptionalParams } from "./models"; + +export class BodyBooleanClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyBooleanClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyBooleanClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyBooleanClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-boolean/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyBoolean/src/index.ts b/test/integration/generated/bodyBoolean/src/index.ts index 4ccee4090c..4836a95b44 100644 --- a/test/integration/generated/bodyBoolean/src/index.ts +++ b/test/integration/generated/bodyBoolean/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyBooleanClient } from "./bodyBooleanClient"; +export { BodyBooleanClientContext } from "./bodyBooleanClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyBoolean/src/operations/bool.ts b/test/integration/generated/bodyBoolean/src/operations/bool.ts index 47509979e8..d0a6267175 100644 --- a/test/integration/generated/bodyBoolean/src/operations/bool.ts +++ b/test/integration/generated/bodyBoolean/src/operations/bool.ts @@ -10,7 +10,7 @@ import { Bool } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyBooleanClient } from "../bodyBooleanClient"; +import { BodyBooleanClientContext } from "../bodyBooleanClientContext"; import { BoolGetTrueOptionalParams, BoolGetTrueResponse, @@ -26,13 +26,13 @@ import { /** Class containing Bool operations. */ export class BoolImpl implements Bool { - private readonly client: BodyBooleanClient; + private readonly client: BodyBooleanClientContext; /** * Initialize a new instance of the class Bool class. * @param client Reference to the service client */ - constructor(client: BodyBooleanClient) { + constructor(client: BodyBooleanClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyBooleanQuirks/package.json b/test/integration/generated/bodyBooleanQuirks/package.json index 1f0e151999..82fc5d52bd 100644 --- a/test/integration/generated/bodyBooleanQuirks/package.json +++ b/test/integration/generated/bodyBooleanQuirks/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClient.ts b/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClient.ts index 40df991aa1..562e9c0cdd 100644 --- a/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClient.ts +++ b/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { BoolImpl } from "./operations"; import { Bool } from "./operationsInterfaces"; +import { BodyBooleanQuirksClientContext } from "./bodyBooleanQuirksClientContext"; import { BodyBooleanQuirksClientOptionalParams } from "./models"; -export class BodyBooleanQuirksClient extends coreClient.ServiceClient { - $host: string; - +export class BodyBooleanQuirksClient extends BodyBooleanQuirksClientContext { /** * Initializes a new instance of the BodyBooleanQuirksClient class. * @param options The parameter options */ constructor(options?: BodyBooleanQuirksClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyBooleanQuirksClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-boolean-quirks/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.bool = new BoolImpl(this); } diff --git a/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClientContext.ts b/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClientContext.ts new file mode 100644 index 0000000000..7dbc364fe4 --- /dev/null +++ b/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyBooleanQuirksClientOptionalParams } from "./models"; + +export class BodyBooleanQuirksClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyBooleanQuirksClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyBooleanQuirksClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyBooleanQuirksClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-boolean-quirks/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyBooleanQuirks/src/index.ts b/test/integration/generated/bodyBooleanQuirks/src/index.ts index c2fd7fd6d7..cba80478c1 100644 --- a/test/integration/generated/bodyBooleanQuirks/src/index.ts +++ b/test/integration/generated/bodyBooleanQuirks/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyBooleanQuirksClient } from "./bodyBooleanQuirksClient"; +export { BodyBooleanQuirksClientContext } from "./bodyBooleanQuirksClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyBooleanQuirks/src/operations/bool.ts b/test/integration/generated/bodyBooleanQuirks/src/operations/bool.ts index 7738992abf..39ac4d75c0 100644 --- a/test/integration/generated/bodyBooleanQuirks/src/operations/bool.ts +++ b/test/integration/generated/bodyBooleanQuirks/src/operations/bool.ts @@ -10,7 +10,7 @@ import { Bool } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyBooleanQuirksClient } from "../bodyBooleanQuirksClient"; +import { BodyBooleanQuirksClientContext } from "../bodyBooleanQuirksClientContext"; import { BoolGetTrueOptionalParams, BoolGetTrueResponse, @@ -26,13 +26,13 @@ import { /** Class containing Bool operations. */ export class BoolImpl implements Bool { - private readonly client: BodyBooleanQuirksClient; + private readonly client: BodyBooleanQuirksClientContext; /** * Initialize a new instance of the class Bool class. * @param client Reference to the service client */ - constructor(client: BodyBooleanQuirksClient) { + constructor(client: BodyBooleanQuirksClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyByte/package.json b/test/integration/generated/bodyByte/package.json index 7e0de94823..390d3c0c15 100644 --- a/test/integration/generated/bodyByte/package.json +++ b/test/integration/generated/bodyByte/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyByte/src/bodyByteClient.ts b/test/integration/generated/bodyByte/src/bodyByteClient.ts index 7ebf8e7903..9802ab077c 100644 --- a/test/integration/generated/bodyByte/src/bodyByteClient.ts +++ b/test/integration/generated/bodyByte/src/bodyByteClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { ByteImpl } from "./operations"; import { Byte } from "./operationsInterfaces"; +import { BodyByteClientContext } from "./bodyByteClientContext"; import { BodyByteClientOptionalParams } from "./models"; -export class BodyByteClient extends coreClient.ServiceClient { - $host: string; - +export class BodyByteClient extends BodyByteClientContext { /** * Initializes a new instance of the BodyByteClient class. * @param options The parameter options */ constructor(options?: BodyByteClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyByteClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-byte/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.byte = new ByteImpl(this); } diff --git a/test/integration/generated/bodyByte/src/bodyByteClientContext.ts b/test/integration/generated/bodyByte/src/bodyByteClientContext.ts new file mode 100644 index 0000000000..1b9cdaa669 --- /dev/null +++ b/test/integration/generated/bodyByte/src/bodyByteClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyByteClientOptionalParams } from "./models"; + +export class BodyByteClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyByteClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyByteClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyByteClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-byte/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyByte/src/index.ts b/test/integration/generated/bodyByte/src/index.ts index a1c296dd4d..cacab8eef6 100644 --- a/test/integration/generated/bodyByte/src/index.ts +++ b/test/integration/generated/bodyByte/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyByteClient } from "./bodyByteClient"; +export { BodyByteClientContext } from "./bodyByteClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyByte/src/operations/byte.ts b/test/integration/generated/bodyByte/src/operations/byte.ts index 0c6d5d71df..c0cb774389 100644 --- a/test/integration/generated/bodyByte/src/operations/byte.ts +++ b/test/integration/generated/bodyByte/src/operations/byte.ts @@ -10,7 +10,7 @@ import { Byte } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyByteClient } from "../bodyByteClient"; +import { BodyByteClientContext } from "../bodyByteClientContext"; import { ByteGetNullOptionalParams, ByteGetNullResponse, @@ -25,13 +25,13 @@ import { /** Class containing Byte operations. */ export class ByteImpl implements Byte { - private readonly client: BodyByteClient; + private readonly client: BodyByteClientContext; /** * Initialize a new instance of the class Byte class. * @param client Reference to the service client */ - constructor(client: BodyByteClient) { + constructor(client: BodyByteClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/package.json b/test/integration/generated/bodyComplex/package.json index 17f594207d..fecd94b340 100644 --- a/test/integration/generated/bodyComplex/package.json +++ b/test/integration/generated/bodyComplex/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyComplex/src/bodyComplexClient.ts b/test/integration/generated/bodyComplex/src/bodyComplexClient.ts index 1c492990c5..96b7bbd56f 100644 --- a/test/integration/generated/bodyComplex/src/bodyComplexClient.ts +++ b/test/integration/generated/bodyComplex/src/bodyComplexClient.ts @@ -6,7 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { BasicImpl, PrimitiveImpl, @@ -29,44 +28,16 @@ import { Readonlyproperty, Flattencomplex } from "./operationsInterfaces"; +import { BodyComplexClientContext } from "./bodyComplexClientContext"; import { BodyComplexClientOptionalParams } from "./models"; -export class BodyComplexClient extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - +export class BodyComplexClient extends BodyComplexClientContext { /** * Initializes a new instance of the BodyComplexClient class. * @param options The parameter options */ constructor(options?: BodyComplexClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyComplexClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-complex/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "2016-02-29"; + super(options); this.basic = new BasicImpl(this); this.primitive = new PrimitiveImpl(this); this.array = new ArrayImpl(this); diff --git a/test/integration/generated/bodyComplex/src/bodyComplexClientContext.ts b/test/integration/generated/bodyComplex/src/bodyComplexClientContext.ts new file mode 100644 index 0000000000..58d2ce6a43 --- /dev/null +++ b/test/integration/generated/bodyComplex/src/bodyComplexClientContext.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyComplexClientOptionalParams } from "./models"; + +export class BodyComplexClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + + /** + * Initializes a new instance of the BodyComplexClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyComplexClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyComplexClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-complex/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "2016-02-29"; + } +} diff --git a/test/integration/generated/bodyComplex/src/index.ts b/test/integration/generated/bodyComplex/src/index.ts index cc8998cfbd..6790646e3a 100644 --- a/test/integration/generated/bodyComplex/src/index.ts +++ b/test/integration/generated/bodyComplex/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyComplexClient } from "./bodyComplexClient"; +export { BodyComplexClientContext } from "./bodyComplexClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyComplex/src/operations/array.ts b/test/integration/generated/bodyComplex/src/operations/array.ts index c7241262df..de5fcade99 100644 --- a/test/integration/generated/bodyComplex/src/operations/array.ts +++ b/test/integration/generated/bodyComplex/src/operations/array.ts @@ -10,7 +10,7 @@ import { Array } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClient } from "../bodyComplexClient"; +import { BodyComplexClientContext } from "../bodyComplexClientContext"; import { ArrayGetValidOptionalParams, ArrayGetValidResponse, @@ -25,13 +25,13 @@ import { /** Class containing Array operations. */ export class ArrayImpl implements Array { - private readonly client: BodyComplexClient; + private readonly client: BodyComplexClientContext; /** * Initialize a new instance of the class Array class. * @param client Reference to the service client */ - constructor(client: BodyComplexClient) { + constructor(client: BodyComplexClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/basic.ts b/test/integration/generated/bodyComplex/src/operations/basic.ts index 36ff28a7ea..cd5506860c 100644 --- a/test/integration/generated/bodyComplex/src/operations/basic.ts +++ b/test/integration/generated/bodyComplex/src/operations/basic.ts @@ -10,7 +10,7 @@ import { Basic } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClient } from "../bodyComplexClient"; +import { BodyComplexClientContext } from "../bodyComplexClientContext"; import { BasicGetValidOptionalParams, BasicGetValidResponse, @@ -28,13 +28,13 @@ import { /** Class containing Basic operations. */ export class BasicImpl implements Basic { - private readonly client: BodyComplexClient; + private readonly client: BodyComplexClientContext; /** * Initialize a new instance of the class Basic class. * @param client Reference to the service client */ - constructor(client: BodyComplexClient) { + constructor(client: BodyComplexClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/dictionary.ts b/test/integration/generated/bodyComplex/src/operations/dictionary.ts index 3881a54e89..ef233bc8f3 100644 --- a/test/integration/generated/bodyComplex/src/operations/dictionary.ts +++ b/test/integration/generated/bodyComplex/src/operations/dictionary.ts @@ -10,7 +10,7 @@ import { Dictionary } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClient } from "../bodyComplexClient"; +import { BodyComplexClientContext } from "../bodyComplexClientContext"; import { DictionaryGetValidOptionalParams, DictionaryGetValidResponse, @@ -27,13 +27,13 @@ import { /** Class containing Dictionary operations. */ export class DictionaryImpl implements Dictionary { - private readonly client: BodyComplexClient; + private readonly client: BodyComplexClientContext; /** * Initialize a new instance of the class Dictionary class. * @param client Reference to the service client */ - constructor(client: BodyComplexClient) { + constructor(client: BodyComplexClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/flattencomplex.ts b/test/integration/generated/bodyComplex/src/operations/flattencomplex.ts index 58d042f1f8..859b6cec75 100644 --- a/test/integration/generated/bodyComplex/src/operations/flattencomplex.ts +++ b/test/integration/generated/bodyComplex/src/operations/flattencomplex.ts @@ -10,7 +10,7 @@ import { Flattencomplex } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClient } from "../bodyComplexClient"; +import { BodyComplexClientContext } from "../bodyComplexClientContext"; import { FlattencomplexGetValidOptionalParams, FlattencomplexGetValidResponse @@ -18,13 +18,13 @@ import { /** Class containing Flattencomplex operations. */ export class FlattencomplexImpl implements Flattencomplex { - private readonly client: BodyComplexClient; + private readonly client: BodyComplexClientContext; /** * Initialize a new instance of the class Flattencomplex class. * @param client Reference to the service client */ - constructor(client: BodyComplexClient) { + constructor(client: BodyComplexClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/inheritance.ts b/test/integration/generated/bodyComplex/src/operations/inheritance.ts index 92275d528e..b3c1438444 100644 --- a/test/integration/generated/bodyComplex/src/operations/inheritance.ts +++ b/test/integration/generated/bodyComplex/src/operations/inheritance.ts @@ -10,7 +10,7 @@ import { Inheritance } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClient } from "../bodyComplexClient"; +import { BodyComplexClientContext } from "../bodyComplexClientContext"; import { InheritanceGetValidOptionalParams, InheritanceGetValidResponse, @@ -20,13 +20,13 @@ import { /** Class containing Inheritance operations. */ export class InheritanceImpl implements Inheritance { - private readonly client: BodyComplexClient; + private readonly client: BodyComplexClientContext; /** * Initialize a new instance of the class Inheritance class. * @param client Reference to the service client */ - constructor(client: BodyComplexClient) { + constructor(client: BodyComplexClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/polymorphicrecursive.ts b/test/integration/generated/bodyComplex/src/operations/polymorphicrecursive.ts index d566c049a0..e2d32eb92b 100644 --- a/test/integration/generated/bodyComplex/src/operations/polymorphicrecursive.ts +++ b/test/integration/generated/bodyComplex/src/operations/polymorphicrecursive.ts @@ -10,7 +10,7 @@ import { Polymorphicrecursive } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClient } from "../bodyComplexClient"; +import { BodyComplexClientContext } from "../bodyComplexClientContext"; import { PolymorphicrecursiveGetValidOptionalParams, PolymorphicrecursiveGetValidResponse, @@ -20,13 +20,13 @@ import { /** Class containing Polymorphicrecursive operations. */ export class PolymorphicrecursiveImpl implements Polymorphicrecursive { - private readonly client: BodyComplexClient; + private readonly client: BodyComplexClientContext; /** * Initialize a new instance of the class Polymorphicrecursive class. * @param client Reference to the service client */ - constructor(client: BodyComplexClient) { + constructor(client: BodyComplexClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/polymorphism.ts b/test/integration/generated/bodyComplex/src/operations/polymorphism.ts index ce74db51c8..a540ddc03a 100644 --- a/test/integration/generated/bodyComplex/src/operations/polymorphism.ts +++ b/test/integration/generated/bodyComplex/src/operations/polymorphism.ts @@ -10,7 +10,7 @@ import { Polymorphism } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClient } from "../bodyComplexClient"; +import { BodyComplexClientContext } from "../bodyComplexClientContext"; import { PolymorphismGetValidOptionalParams, PolymorphismGetValidResponse, @@ -33,13 +33,13 @@ import { /** Class containing Polymorphism operations. */ export class PolymorphismImpl implements Polymorphism { - private readonly client: BodyComplexClient; + private readonly client: BodyComplexClientContext; /** * Initialize a new instance of the class Polymorphism class. * @param client Reference to the service client */ - constructor(client: BodyComplexClient) { + constructor(client: BodyComplexClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/primitive.ts b/test/integration/generated/bodyComplex/src/operations/primitive.ts index f662d19011..a830cf7f50 100644 --- a/test/integration/generated/bodyComplex/src/operations/primitive.ts +++ b/test/integration/generated/bodyComplex/src/operations/primitive.ts @@ -10,7 +10,7 @@ import { Primitive } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClient } from "../bodyComplexClient"; +import { BodyComplexClientContext } from "../bodyComplexClientContext"; import { PrimitiveGetIntOptionalParams, PrimitiveGetIntResponse, @@ -60,13 +60,13 @@ import { /** Class containing Primitive operations. */ export class PrimitiveImpl implements Primitive { - private readonly client: BodyComplexClient; + private readonly client: BodyComplexClientContext; /** * Initialize a new instance of the class Primitive class. * @param client Reference to the service client */ - constructor(client: BodyComplexClient) { + constructor(client: BodyComplexClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/readonlyproperty.ts b/test/integration/generated/bodyComplex/src/operations/readonlyproperty.ts index a2e9b21d8b..39f7c8b2e3 100644 --- a/test/integration/generated/bodyComplex/src/operations/readonlyproperty.ts +++ b/test/integration/generated/bodyComplex/src/operations/readonlyproperty.ts @@ -10,7 +10,7 @@ import { Readonlyproperty } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClient } from "../bodyComplexClient"; +import { BodyComplexClientContext } from "../bodyComplexClientContext"; import { ReadonlypropertyGetValidOptionalParams, ReadonlypropertyGetValidResponse, @@ -20,13 +20,13 @@ import { /** Class containing Readonlyproperty operations. */ export class ReadonlypropertyImpl implements Readonlyproperty { - private readonly client: BodyComplexClient; + private readonly client: BodyComplexClientContext; /** * Initialize a new instance of the class Readonlyproperty class. * @param client Reference to the service client */ - constructor(client: BodyComplexClient) { + constructor(client: BodyComplexClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplexRest/package.json b/test/integration/generated/bodyComplexRest/package.json index 1f5e242dd3..3c83cd182b 100644 --- a/test/integration/generated/bodyComplexRest/package.json +++ b/test/integration/generated/bodyComplexRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "MIT", + "license": "ISC", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/bodyComplexRest/src/bodyComplexRestClient.ts b/test/integration/generated/bodyComplexRest/src/bodyComplexRestClient.ts index 5db3479164..4fc13cdb2c 100644 --- a/test/integration/generated/bodyComplexRest/src/bodyComplexRestClient.ts +++ b/test/integration/generated/bodyComplexRest/src/bodyComplexRestClient.ts @@ -644,7 +644,9 @@ export default function BodyComplexRestClient( const baseUrl = options.baseUrl ?? "http://localhost:3000"; options.apiVersion = options.apiVersion ?? "2016-02-29"; - const client = getClient(baseUrl, options) as BodyComplexRestClientRestClient; + return getClient( + baseUrl, - return client; + options + ) as BodyComplexRestClientRestClient; } diff --git a/test/integration/generated/bodyComplexRest/tsconfig.json b/test/integration/generated/bodyComplexRest/tsconfig.json index 0202cc6570..965341beea 100644 --- a/test/integration/generated/bodyComplexRest/tsconfig.json +++ b/test/integration/generated/bodyComplexRest/tsconfig.json @@ -7,5 +7,13 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "include": ["src/**/*.ts"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } diff --git a/test/integration/generated/bodyComplexWithTracing/package.json b/test/integration/generated/bodyComplexWithTracing/package.json index 446c8846de..118c55f9ca 100644 --- a/test/integration/generated/bodyComplexWithTracing/package.json +++ b/test/integration/generated/bodyComplexWithTracing/package.json @@ -27,8 +27,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracing.ts b/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracing.ts index 867d6f6ace..ea5bda4f6a 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracing.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracing.ts @@ -6,7 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { BasicImpl, PrimitiveImpl, @@ -29,44 +28,16 @@ import { Readonlyproperty, Flattencomplex } from "./operationsInterfaces"; +import { BodyComplexWithTracingContext } from "./bodyComplexWithTracingContext"; import { BodyComplexWithTracingOptionalParams } from "./models"; -export class BodyComplexWithTracing extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - +export class BodyComplexWithTracing extends BodyComplexWithTracingContext { /** * Initializes a new instance of the BodyComplexWithTracing class. * @param options The parameter options */ constructor(options?: BodyComplexWithTracingOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyComplexWithTracingOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-complex-tracing/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "2016-02-29"; + super(options); this.basic = new BasicImpl(this); this.primitive = new PrimitiveImpl(this); this.array = new ArrayImpl(this); diff --git a/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracingContext.ts b/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracingContext.ts new file mode 100644 index 0000000000..c0e58324df --- /dev/null +++ b/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracingContext.ts @@ -0,0 +1,49 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyComplexWithTracingOptionalParams } from "./models"; + +export class BodyComplexWithTracingContext extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + + /** + * Initializes a new instance of the BodyComplexWithTracingContext class. + * @param options The parameter options + */ + constructor(options?: BodyComplexWithTracingOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyComplexWithTracingOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-complex-tracing/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "2016-02-29"; + } +} diff --git a/test/integration/generated/bodyComplexWithTracing/src/index.ts b/test/integration/generated/bodyComplexWithTracing/src/index.ts index ee387fe83f..521fcdb3a8 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/index.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyComplexWithTracing } from "./bodyComplexWithTracing"; +export { BodyComplexWithTracingContext } from "./bodyComplexWithTracingContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/array.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/array.ts index 403e1ce979..1bfdf6f2d0 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/array.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/array.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; +import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; import { ArrayGetValidOptionalParams, ArrayGetValidResponse, @@ -27,13 +27,13 @@ import { /** Class containing Array operations. */ export class ArrayImpl implements Array { - private readonly client: BodyComplexWithTracing; + private readonly client: BodyComplexWithTracingContext; /** * Initialize a new instance of the class Array class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracing) { + constructor(client: BodyComplexWithTracingContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/basic.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/basic.ts index 6f26ad496e..b5d58de2ed 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/basic.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/basic.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; +import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; import { BasicGetValidOptionalParams, BasicGetValidResponse, @@ -30,13 +30,13 @@ import { /** Class containing Basic operations. */ export class BasicImpl implements Basic { - private readonly client: BodyComplexWithTracing; + private readonly client: BodyComplexWithTracingContext; /** * Initialize a new instance of the class Basic class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracing) { + constructor(client: BodyComplexWithTracingContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/dictionary.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/dictionary.ts index 739152a014..3dee6b748c 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/dictionary.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/dictionary.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; +import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; import { DictionaryGetValidOptionalParams, DictionaryGetValidResponse, @@ -29,13 +29,13 @@ import { /** Class containing Dictionary operations. */ export class DictionaryImpl implements Dictionary { - private readonly client: BodyComplexWithTracing; + private readonly client: BodyComplexWithTracingContext; /** * Initialize a new instance of the class Dictionary class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracing) { + constructor(client: BodyComplexWithTracingContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/flattencomplex.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/flattencomplex.ts index a97c48c5e8..1760d7413b 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/flattencomplex.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/flattencomplex.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; +import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; import { FlattencomplexGetValidOptionalParams, FlattencomplexGetValidResponse @@ -20,13 +20,13 @@ import { /** Class containing Flattencomplex operations. */ export class FlattencomplexImpl implements Flattencomplex { - private readonly client: BodyComplexWithTracing; + private readonly client: BodyComplexWithTracingContext; /** * Initialize a new instance of the class Flattencomplex class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracing) { + constructor(client: BodyComplexWithTracingContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/inheritance.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/inheritance.ts index b105135eb1..f6bf2e7866 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/inheritance.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/inheritance.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; +import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; import { InheritanceGetValidOptionalParams, InheritanceGetValidResponse, @@ -22,13 +22,13 @@ import { /** Class containing Inheritance operations. */ export class InheritanceImpl implements Inheritance { - private readonly client: BodyComplexWithTracing; + private readonly client: BodyComplexWithTracingContext; /** * Initialize a new instance of the class Inheritance class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracing) { + constructor(client: BodyComplexWithTracingContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphicrecursive.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphicrecursive.ts index 9aa801ea2f..a32fec43e1 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphicrecursive.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphicrecursive.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; +import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; import { PolymorphicrecursiveGetValidOptionalParams, PolymorphicrecursiveGetValidResponse, @@ -22,13 +22,13 @@ import { /** Class containing Polymorphicrecursive operations. */ export class PolymorphicrecursiveImpl implements Polymorphicrecursive { - private readonly client: BodyComplexWithTracing; + private readonly client: BodyComplexWithTracingContext; /** * Initialize a new instance of the class Polymorphicrecursive class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracing) { + constructor(client: BodyComplexWithTracingContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphism.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphism.ts index 2235f6ece2..0827a91aa3 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphism.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphism.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; +import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; import { PolymorphismGetValidOptionalParams, PolymorphismGetValidResponse, @@ -35,13 +35,13 @@ import { /** Class containing Polymorphism operations. */ export class PolymorphismImpl implements Polymorphism { - private readonly client: BodyComplexWithTracing; + private readonly client: BodyComplexWithTracingContext; /** * Initialize a new instance of the class Polymorphism class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracing) { + constructor(client: BodyComplexWithTracingContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/primitive.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/primitive.ts index 78b0629be3..792eec3355 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/primitive.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/primitive.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; +import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; import { PrimitiveGetIntOptionalParams, PrimitiveGetIntResponse, @@ -62,13 +62,13 @@ import { /** Class containing Primitive operations. */ export class PrimitiveImpl implements Primitive { - private readonly client: BodyComplexWithTracing; + private readonly client: BodyComplexWithTracingContext; /** * Initialize a new instance of the class Primitive class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracing) { + constructor(client: BodyComplexWithTracingContext) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/readonlyproperty.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/readonlyproperty.ts index f86e46987e..52f64eadde 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/readonlyproperty.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/readonlyproperty.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; +import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; import { ReadonlypropertyGetValidOptionalParams, ReadonlypropertyGetValidResponse, @@ -22,13 +22,13 @@ import { /** Class containing Readonlyproperty operations. */ export class ReadonlypropertyImpl implements Readonlyproperty { - private readonly client: BodyComplexWithTracing; + private readonly client: BodyComplexWithTracingContext; /** * Initialize a new instance of the class Readonlyproperty class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracing) { + constructor(client: BodyComplexWithTracingContext) { this.client = client; } diff --git a/test/integration/generated/bodyDate/package.json b/test/integration/generated/bodyDate/package.json index a565cc2ad2..e261c2dfa5 100644 --- a/test/integration/generated/bodyDate/package.json +++ b/test/integration/generated/bodyDate/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyDate/src/bodyDateClient.ts b/test/integration/generated/bodyDate/src/bodyDateClient.ts index cf0855cacf..bf173c5a9a 100644 --- a/test/integration/generated/bodyDate/src/bodyDateClient.ts +++ b/test/integration/generated/bodyDate/src/bodyDateClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { DateOperationsImpl } from "./operations"; import { DateOperations } from "./operationsInterfaces"; +import { BodyDateClientContext } from "./bodyDateClientContext"; import { BodyDateClientOptionalParams } from "./models"; -export class BodyDateClient extends coreClient.ServiceClient { - $host: string; - +export class BodyDateClient extends BodyDateClientContext { /** * Initializes a new instance of the BodyDateClient class. * @param options The parameter options */ constructor(options?: BodyDateClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyDateClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-date/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.date = new DateOperationsImpl(this); } diff --git a/test/integration/generated/bodyDate/src/bodyDateClientContext.ts b/test/integration/generated/bodyDate/src/bodyDateClientContext.ts new file mode 100644 index 0000000000..2451e0ee63 --- /dev/null +++ b/test/integration/generated/bodyDate/src/bodyDateClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyDateClientOptionalParams } from "./models"; + +export class BodyDateClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyDateClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyDateClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyDateClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-date/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyDate/src/index.ts b/test/integration/generated/bodyDate/src/index.ts index cca5dcbe5b..c642206a0a 100644 --- a/test/integration/generated/bodyDate/src/index.ts +++ b/test/integration/generated/bodyDate/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyDateClient } from "./bodyDateClient"; +export { BodyDateClientContext } from "./bodyDateClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyDate/src/operations/date.ts b/test/integration/generated/bodyDate/src/operations/date.ts index 21ad2a932d..de9d94964f 100644 --- a/test/integration/generated/bodyDate/src/operations/date.ts +++ b/test/integration/generated/bodyDate/src/operations/date.ts @@ -10,7 +10,7 @@ import { DateOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyDateClient } from "../bodyDateClient"; +import { BodyDateClientContext } from "../bodyDateClientContext"; import { DateGetNullOptionalParams, DateGetNullResponse, @@ -30,13 +30,13 @@ import { /** Class containing DateOperations operations. */ export class DateOperationsImpl implements DateOperations { - private readonly client: BodyDateClient; + private readonly client: BodyDateClientContext; /** * Initialize a new instance of the class DateOperations class. * @param client Reference to the service client */ - constructor(client: BodyDateClient) { + constructor(client: BodyDateClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyDateTime/package.json b/test/integration/generated/bodyDateTime/package.json index 3fc428d48f..b33e683a71 100644 --- a/test/integration/generated/bodyDateTime/package.json +++ b/test/integration/generated/bodyDateTime/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyDateTime/src/bodyDateTimeClient.ts b/test/integration/generated/bodyDateTime/src/bodyDateTimeClient.ts index a7b45fb804..29edda21d0 100644 --- a/test/integration/generated/bodyDateTime/src/bodyDateTimeClient.ts +++ b/test/integration/generated/bodyDateTime/src/bodyDateTimeClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { DatetimeImpl } from "./operations"; import { Datetime } from "./operationsInterfaces"; +import { BodyDateTimeClientContext } from "./bodyDateTimeClientContext"; import { BodyDateTimeClientOptionalParams } from "./models"; -export class BodyDateTimeClient extends coreClient.ServiceClient { - $host: string; - +export class BodyDateTimeClient extends BodyDateTimeClientContext { /** * Initializes a new instance of the BodyDateTimeClient class. * @param options The parameter options */ constructor(options?: BodyDateTimeClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyDateTimeClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-datetime/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.datetime = new DatetimeImpl(this); } diff --git a/test/integration/generated/bodyDateTime/src/bodyDateTimeClientContext.ts b/test/integration/generated/bodyDateTime/src/bodyDateTimeClientContext.ts new file mode 100644 index 0000000000..e108fb4f36 --- /dev/null +++ b/test/integration/generated/bodyDateTime/src/bodyDateTimeClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyDateTimeClientOptionalParams } from "./models"; + +export class BodyDateTimeClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyDateTimeClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyDateTimeClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyDateTimeClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-datetime/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyDateTime/src/index.ts b/test/integration/generated/bodyDateTime/src/index.ts index ab6f074916..072308135f 100644 --- a/test/integration/generated/bodyDateTime/src/index.ts +++ b/test/integration/generated/bodyDateTime/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyDateTimeClient } from "./bodyDateTimeClient"; +export { BodyDateTimeClientContext } from "./bodyDateTimeClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyDateTime/src/operations/datetime.ts b/test/integration/generated/bodyDateTime/src/operations/datetime.ts index a82e1259d9..10799fa9ac 100644 --- a/test/integration/generated/bodyDateTime/src/operations/datetime.ts +++ b/test/integration/generated/bodyDateTime/src/operations/datetime.ts @@ -10,7 +10,7 @@ import { Datetime } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyDateTimeClient } from "../bodyDateTimeClient"; +import { BodyDateTimeClientContext } from "../bodyDateTimeClientContext"; import { DatetimeGetNullOptionalParams, DatetimeGetNullResponse, @@ -53,13 +53,13 @@ import { /** Class containing Datetime operations. */ export class DatetimeImpl implements Datetime { - private readonly client: BodyDateTimeClient; + private readonly client: BodyDateTimeClientContext; /** * Initialize a new instance of the class Datetime class. * @param client Reference to the service client */ - constructor(client: BodyDateTimeClient) { + constructor(client: BodyDateTimeClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyDateTimeRfc1123/package.json b/test/integration/generated/bodyDateTimeRfc1123/package.json index 5e4b2d57c4..c4f43edfe3 100644 --- a/test/integration/generated/bodyDateTimeRfc1123/package.json +++ b/test/integration/generated/bodyDateTimeRfc1123/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123Client.ts b/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123Client.ts index 06dfcad726..1194ad6582 100644 --- a/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123Client.ts +++ b/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123Client.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { Datetimerfc1123Impl } from "./operations"; import { Datetimerfc1123 } from "./operationsInterfaces"; +import { BodyDateTimeRfc1123ClientContext } from "./bodyDateTimeRfc1123ClientContext"; import { BodyDateTimeRfc1123ClientOptionalParams } from "./models"; -export class BodyDateTimeRfc1123Client extends coreClient.ServiceClient { - $host: string; - +export class BodyDateTimeRfc1123Client extends BodyDateTimeRfc1123ClientContext { /** * Initializes a new instance of the BodyDateTimeRfc1123Client class. * @param options The parameter options */ constructor(options?: BodyDateTimeRfc1123ClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyDateTimeRfc1123ClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-datetime-rfc1123/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.datetimerfc1123 = new Datetimerfc1123Impl(this); } diff --git a/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123ClientContext.ts b/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123ClientContext.ts new file mode 100644 index 0000000000..072dac7139 --- /dev/null +++ b/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123ClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyDateTimeRfc1123ClientOptionalParams } from "./models"; + +export class BodyDateTimeRfc1123ClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyDateTimeRfc1123ClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyDateTimeRfc1123ClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyDateTimeRfc1123ClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-datetime-rfc1123/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyDateTimeRfc1123/src/index.ts b/test/integration/generated/bodyDateTimeRfc1123/src/index.ts index dc25430372..6fec891866 100644 --- a/test/integration/generated/bodyDateTimeRfc1123/src/index.ts +++ b/test/integration/generated/bodyDateTimeRfc1123/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyDateTimeRfc1123Client } from "./bodyDateTimeRfc1123Client"; +export { BodyDateTimeRfc1123ClientContext } from "./bodyDateTimeRfc1123ClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyDateTimeRfc1123/src/operations/datetimerfc1123.ts b/test/integration/generated/bodyDateTimeRfc1123/src/operations/datetimerfc1123.ts index 10f9615918..ad84399b80 100644 --- a/test/integration/generated/bodyDateTimeRfc1123/src/operations/datetimerfc1123.ts +++ b/test/integration/generated/bodyDateTimeRfc1123/src/operations/datetimerfc1123.ts @@ -10,7 +10,7 @@ import { Datetimerfc1123 } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyDateTimeRfc1123Client } from "../bodyDateTimeRfc1123Client"; +import { BodyDateTimeRfc1123ClientContext } from "../bodyDateTimeRfc1123ClientContext"; import { Datetimerfc1123GetNullOptionalParams, Datetimerfc1123GetNullResponse, @@ -32,13 +32,13 @@ import { /** Class containing Datetimerfc1123 operations. */ export class Datetimerfc1123Impl implements Datetimerfc1123 { - private readonly client: BodyDateTimeRfc1123Client; + private readonly client: BodyDateTimeRfc1123ClientContext; /** * Initialize a new instance of the class Datetimerfc1123 class. * @param client Reference to the service client */ - constructor(client: BodyDateTimeRfc1123Client) { + constructor(client: BodyDateTimeRfc1123ClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyDictionary/package.json b/test/integration/generated/bodyDictionary/package.json index 07ca27ebac..076d99551b 100644 --- a/test/integration/generated/bodyDictionary/package.json +++ b/test/integration/generated/bodyDictionary/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyDictionary/src/bodyDictionaryClient.ts b/test/integration/generated/bodyDictionary/src/bodyDictionaryClient.ts index 2dc6201f86..fdf02d81e0 100644 --- a/test/integration/generated/bodyDictionary/src/bodyDictionaryClient.ts +++ b/test/integration/generated/bodyDictionary/src/bodyDictionaryClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { DictionaryImpl } from "./operations"; import { Dictionary } from "./operationsInterfaces"; +import { BodyDictionaryClientContext } from "./bodyDictionaryClientContext"; import { BodyDictionaryClientOptionalParams } from "./models"; -export class BodyDictionaryClient extends coreClient.ServiceClient { - $host: string; - +export class BodyDictionaryClient extends BodyDictionaryClientContext { /** * Initializes a new instance of the BodyDictionaryClient class. * @param options The parameter options */ constructor(options?: BodyDictionaryClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyDictionaryClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-dictionary/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.dictionary = new DictionaryImpl(this); } diff --git a/test/integration/generated/bodyDictionary/src/bodyDictionaryClientContext.ts b/test/integration/generated/bodyDictionary/src/bodyDictionaryClientContext.ts new file mode 100644 index 0000000000..8105d8961c --- /dev/null +++ b/test/integration/generated/bodyDictionary/src/bodyDictionaryClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyDictionaryClientOptionalParams } from "./models"; + +export class BodyDictionaryClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyDictionaryClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyDictionaryClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyDictionaryClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-dictionary/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyDictionary/src/index.ts b/test/integration/generated/bodyDictionary/src/index.ts index a2c84db556..267ce5e4db 100644 --- a/test/integration/generated/bodyDictionary/src/index.ts +++ b/test/integration/generated/bodyDictionary/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyDictionaryClient } from "./bodyDictionaryClient"; +export { BodyDictionaryClientContext } from "./bodyDictionaryClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyDictionary/src/operations/dictionary.ts b/test/integration/generated/bodyDictionary/src/operations/dictionary.ts index 6b0f10b2fb..6682dba9b5 100644 --- a/test/integration/generated/bodyDictionary/src/operations/dictionary.ts +++ b/test/integration/generated/bodyDictionary/src/operations/dictionary.ts @@ -10,7 +10,7 @@ import { Dictionary } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyDictionaryClient } from "../bodyDictionaryClient"; +import { BodyDictionaryClientContext } from "../bodyDictionaryClientContext"; import { DictionaryGetNullOptionalParams, DictionaryGetNullResponse, @@ -132,13 +132,13 @@ import { /** Class containing Dictionary operations. */ export class DictionaryImpl implements Dictionary { - private readonly client: BodyDictionaryClient; + private readonly client: BodyDictionaryClientContext; /** * Initialize a new instance of the class Dictionary class. * @param client Reference to the service client */ - constructor(client: BodyDictionaryClient) { + constructor(client: BodyDictionaryClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyDuration/package.json b/test/integration/generated/bodyDuration/package.json index 09dad1296d..29bb7abce2 100644 --- a/test/integration/generated/bodyDuration/package.json +++ b/test/integration/generated/bodyDuration/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyDuration/src/bodyDurationClient.ts b/test/integration/generated/bodyDuration/src/bodyDurationClient.ts index 14d9062896..b770a26cd8 100644 --- a/test/integration/generated/bodyDuration/src/bodyDurationClient.ts +++ b/test/integration/generated/bodyDuration/src/bodyDurationClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { DurationImpl } from "./operations"; import { Duration } from "./operationsInterfaces"; +import { BodyDurationClientContext } from "./bodyDurationClientContext"; import { BodyDurationClientOptionalParams } from "./models"; -export class BodyDurationClient extends coreClient.ServiceClient { - $host: string; - +export class BodyDurationClient extends BodyDurationClientContext { /** * Initializes a new instance of the BodyDurationClient class. * @param options The parameter options */ constructor(options?: BodyDurationClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyDurationClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-duration/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.duration = new DurationImpl(this); } diff --git a/test/integration/generated/bodyDuration/src/bodyDurationClientContext.ts b/test/integration/generated/bodyDuration/src/bodyDurationClientContext.ts new file mode 100644 index 0000000000..852fb67903 --- /dev/null +++ b/test/integration/generated/bodyDuration/src/bodyDurationClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyDurationClientOptionalParams } from "./models"; + +export class BodyDurationClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyDurationClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyDurationClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyDurationClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-duration/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyDuration/src/index.ts b/test/integration/generated/bodyDuration/src/index.ts index 1b4ce3d845..f85142fd75 100644 --- a/test/integration/generated/bodyDuration/src/index.ts +++ b/test/integration/generated/bodyDuration/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyDurationClient } from "./bodyDurationClient"; +export { BodyDurationClientContext } from "./bodyDurationClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyDuration/src/operations/duration.ts b/test/integration/generated/bodyDuration/src/operations/duration.ts index 15cbf91347..2c9db02b23 100644 --- a/test/integration/generated/bodyDuration/src/operations/duration.ts +++ b/test/integration/generated/bodyDuration/src/operations/duration.ts @@ -10,7 +10,7 @@ import { Duration } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyDurationClient } from "../bodyDurationClient"; +import { BodyDurationClientContext } from "../bodyDurationClientContext"; import { DurationGetNullOptionalParams, DurationGetNullResponse, @@ -23,13 +23,13 @@ import { /** Class containing Duration operations. */ export class DurationImpl implements Duration { - private readonly client: BodyDurationClient; + private readonly client: BodyDurationClientContext; /** * Initialize a new instance of the class Duration class. * @param client Reference to the service client */ - constructor(client: BodyDurationClient) { + constructor(client: BodyDurationClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyFile/package.json b/test/integration/generated/bodyFile/package.json index a5c9144183..28d97bf1dd 100644 --- a/test/integration/generated/bodyFile/package.json +++ b/test/integration/generated/bodyFile/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyFile/src/bodyFileClient.ts b/test/integration/generated/bodyFile/src/bodyFileClient.ts index 3caea44a15..f3c77d354d 100644 --- a/test/integration/generated/bodyFile/src/bodyFileClient.ts +++ b/test/integration/generated/bodyFile/src/bodyFileClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { FilesImpl } from "./operations"; import { Files } from "./operationsInterfaces"; +import { BodyFileClientContext } from "./bodyFileClientContext"; import { BodyFileClientOptionalParams } from "./models"; -export class BodyFileClient extends coreClient.ServiceClient { - $host: string; - +export class BodyFileClient extends BodyFileClientContext { /** * Initializes a new instance of the BodyFileClient class. * @param options The parameter options */ constructor(options?: BodyFileClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyFileClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-file/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.files = new FilesImpl(this); } diff --git a/test/integration/generated/bodyFile/src/bodyFileClientContext.ts b/test/integration/generated/bodyFile/src/bodyFileClientContext.ts new file mode 100644 index 0000000000..48269a2f66 --- /dev/null +++ b/test/integration/generated/bodyFile/src/bodyFileClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyFileClientOptionalParams } from "./models"; + +export class BodyFileClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyFileClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyFileClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyFileClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-file/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyFile/src/index.ts b/test/integration/generated/bodyFile/src/index.ts index 4413d9ba09..642c73ea74 100644 --- a/test/integration/generated/bodyFile/src/index.ts +++ b/test/integration/generated/bodyFile/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyFileClient } from "./bodyFileClient"; +export { BodyFileClientContext } from "./bodyFileClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyFile/src/operations/files.ts b/test/integration/generated/bodyFile/src/operations/files.ts index 69c39becb8..45927dcc40 100644 --- a/test/integration/generated/bodyFile/src/operations/files.ts +++ b/test/integration/generated/bodyFile/src/operations/files.ts @@ -10,7 +10,7 @@ import { Files } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyFileClient } from "../bodyFileClient"; +import { BodyFileClientContext } from "../bodyFileClientContext"; import { FilesGetFileOptionalParams, FilesGetFileResponse, @@ -22,13 +22,13 @@ import { /** Class containing Files operations. */ export class FilesImpl implements Files { - private readonly client: BodyFileClient; + private readonly client: BodyFileClientContext; /** * Initialize a new instance of the class Files class. * @param client Reference to the service client */ - constructor(client: BodyFileClient) { + constructor(client: BodyFileClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyFileRest/package.json b/test/integration/generated/bodyFileRest/package.json index 84323e4f2d..f4a8d8ef3d 100644 --- a/test/integration/generated/bodyFileRest/package.json +++ b/test/integration/generated/bodyFileRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "MIT", + "license": "ISC", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/bodyFileRest/src/bodyFile.ts b/test/integration/generated/bodyFileRest/src/bodyFile.ts index e85a9d74fd..769448ab40 100644 --- a/test/integration/generated/bodyFileRest/src/bodyFile.ts +++ b/test/integration/generated/bodyFileRest/src/bodyFile.ts @@ -56,7 +56,9 @@ export default function BodyFile( ): BodyFileRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - const client = getClient(baseUrl, options) as BodyFileRestClient; + return getClient( + baseUrl, - return client; + options + ) as BodyFileRestClient; } diff --git a/test/integration/generated/bodyFileRest/src/responses.ts b/test/integration/generated/bodyFileRest/src/responses.ts index 0be0a15ade..4f404d2ccc 100644 --- a/test/integration/generated/bodyFileRest/src/responses.ts +++ b/test/integration/generated/bodyFileRest/src/responses.ts @@ -7,8 +7,7 @@ import { ErrorModelOutput } from "./outputModels"; /** Get file */ export interface GetFile200Response extends HttpResponse { status: "200"; - /** Value may contain any sequence of octets */ - body: Uint8Array; + body: Record; } /** Get file */ @@ -20,8 +19,7 @@ export interface GetFiledefaultResponse extends HttpResponse { /** Get a large file */ export interface GetFileLarge200Response extends HttpResponse { status: "200"; - /** Value may contain any sequence of octets */ - body: Uint8Array; + body: Record; } /** Get a large file */ @@ -33,8 +31,7 @@ export interface GetFileLargedefaultResponse extends HttpResponse { /** Get empty file */ export interface GetEmptyFile200Response extends HttpResponse { status: "200"; - /** Value may contain any sequence of octets */ - body: Uint8Array; + body: Record; } /** Get empty file */ diff --git a/test/integration/generated/bodyFileRest/tsconfig.json b/test/integration/generated/bodyFileRest/tsconfig.json index 0202cc6570..965341beea 100644 --- a/test/integration/generated/bodyFileRest/tsconfig.json +++ b/test/integration/generated/bodyFileRest/tsconfig.json @@ -7,5 +7,13 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "include": ["src/**/*.ts"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } diff --git a/test/integration/generated/bodyFormData/package.json b/test/integration/generated/bodyFormData/package.json index 8bbf2c1001..c6ffdccee6 100644 --- a/test/integration/generated/bodyFormData/package.json +++ b/test/integration/generated/bodyFormData/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyFormData/src/bodyFormDataClient.ts b/test/integration/generated/bodyFormData/src/bodyFormDataClient.ts index e154a48fa0..6548d03b4d 100644 --- a/test/integration/generated/bodyFormData/src/bodyFormDataClient.ts +++ b/test/integration/generated/bodyFormData/src/bodyFormDataClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { FormdataImpl } from "./operations"; import { Formdata } from "./operationsInterfaces"; +import { BodyFormDataClientContext } from "./bodyFormDataClientContext"; import { BodyFormDataClientOptionalParams } from "./models"; -export class BodyFormDataClient extends coreClient.ServiceClient { - $host: string; - +export class BodyFormDataClient extends BodyFormDataClientContext { /** * Initializes a new instance of the BodyFormDataClient class. * @param options The parameter options */ constructor(options?: BodyFormDataClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyFormDataClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-formdata/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.formdata = new FormdataImpl(this); } diff --git a/test/integration/generated/bodyFormData/src/bodyFormDataClientContext.ts b/test/integration/generated/bodyFormData/src/bodyFormDataClientContext.ts new file mode 100644 index 0000000000..f18d81ea5e --- /dev/null +++ b/test/integration/generated/bodyFormData/src/bodyFormDataClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyFormDataClientOptionalParams } from "./models"; + +export class BodyFormDataClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyFormDataClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyFormDataClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyFormDataClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-formdata/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyFormData/src/index.ts b/test/integration/generated/bodyFormData/src/index.ts index 88e36d7ab0..75cd9f1fc3 100644 --- a/test/integration/generated/bodyFormData/src/index.ts +++ b/test/integration/generated/bodyFormData/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyFormDataClient } from "./bodyFormDataClient"; +export { BodyFormDataClientContext } from "./bodyFormDataClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyFormData/src/operations/formdata.ts b/test/integration/generated/bodyFormData/src/operations/formdata.ts index 08682edb50..ee94c976ff 100644 --- a/test/integration/generated/bodyFormData/src/operations/formdata.ts +++ b/test/integration/generated/bodyFormData/src/operations/formdata.ts @@ -11,7 +11,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyFormDataClient } from "../bodyFormDataClient"; +import { BodyFormDataClientContext } from "../bodyFormDataClientContext"; import { FormdataUploadFileOptionalParams, FormdataUploadFileResponse, @@ -23,13 +23,13 @@ import { /** Class containing Formdata operations. */ export class FormdataImpl implements Formdata { - private readonly client: BodyFormDataClient; + private readonly client: BodyFormDataClientContext; /** * Initialize a new instance of the class Formdata class. * @param client Reference to the service client */ - constructor(client: BodyFormDataClient) { + constructor(client: BodyFormDataClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyFormDataRest/package.json b/test/integration/generated/bodyFormDataRest/package.json index 05e75dd034..e6b5dcac0a 100644 --- a/test/integration/generated/bodyFormDataRest/package.json +++ b/test/integration/generated/bodyFormDataRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "MIT", + "license": "ISC", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/bodyFormDataRest/src/bodyFormData.ts b/test/integration/generated/bodyFormDataRest/src/bodyFormData.ts index 861c2400ad..c88e441f04 100644 --- a/test/integration/generated/bodyFormDataRest/src/bodyFormData.ts +++ b/test/integration/generated/bodyFormDataRest/src/bodyFormData.ts @@ -51,7 +51,9 @@ export default function BodyFormData( ): BodyFormDataRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - const client = getClient(baseUrl, options) as BodyFormDataRestClient; + return getClient( + baseUrl, - return client; + options + ) as BodyFormDataRestClient; } diff --git a/test/integration/generated/bodyFormDataRest/src/parameters.ts b/test/integration/generated/bodyFormDataRest/src/parameters.ts index 25733e0f85..f364bb1aa1 100644 --- a/test/integration/generated/bodyFormDataRest/src/parameters.ts +++ b/test/integration/generated/bodyFormDataRest/src/parameters.ts @@ -4,18 +4,12 @@ import { RequestParameters } from "@azure-rest/core-client"; export interface UploadFileBodyParam { - body: UploadFileFormBody; -} - -export interface UploadFileFormBody { /** * File to upload. * * Value may contain any sequence of octets */ - fileContent: string | Uint8Array; - /** File name to upload. Name has to be spelled exactly as written here. */ - fileName: string; + body: string; } export interface UploadFileMediaTypesParam { @@ -33,7 +27,7 @@ export interface UploadFileViaBodyBodyParam { * * Value may contain any sequence of octets */ - body: string | Uint8Array; + body: string; } export interface UploadFileViaBodyMediaTypesParam { @@ -46,12 +40,8 @@ export type UploadFileViaBodyParameters = UploadFileViaBodyMediaTypesParam & RequestParameters; export interface UploadFilesBodyParam { - body: UploadFilesFormBody; -} - -export interface UploadFilesFormBody { /** Files to upload. */ - fileContent: Array; + body: Array; } export interface UploadFilesMediaTypesParam { diff --git a/test/integration/generated/bodyFormDataRest/src/responses.ts b/test/integration/generated/bodyFormDataRest/src/responses.ts index 817be0b806..0c93c8187f 100644 --- a/test/integration/generated/bodyFormDataRest/src/responses.ts +++ b/test/integration/generated/bodyFormDataRest/src/responses.ts @@ -7,8 +7,7 @@ import { ErrorModelOutput } from "./outputModels"; /** Upload file */ export interface UploadFile200Response extends HttpResponse { status: "200"; - /** Value may contain any sequence of octets */ - body: Uint8Array; + body: Record; } /** Upload file */ @@ -20,8 +19,7 @@ export interface UploadFiledefaultResponse extends HttpResponse { /** Upload file */ export interface UploadFileViaBody200Response extends HttpResponse { status: "200"; - /** Value may contain any sequence of octets */ - body: Uint8Array; + body: Record; } /** Upload file */ @@ -33,8 +31,7 @@ export interface UploadFileViaBodydefaultResponse extends HttpResponse { /** Upload multiple files */ export interface UploadFiles200Response extends HttpResponse { status: "200"; - /** Value may contain any sequence of octets */ - body: Uint8Array; + body: Record; } /** Upload multiple files */ diff --git a/test/integration/generated/bodyFormDataRest/tsconfig.json b/test/integration/generated/bodyFormDataRest/tsconfig.json index 0202cc6570..965341beea 100644 --- a/test/integration/generated/bodyFormDataRest/tsconfig.json +++ b/test/integration/generated/bodyFormDataRest/tsconfig.json @@ -7,5 +7,13 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "include": ["src/**/*.ts"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } diff --git a/test/integration/generated/bodyInteger/package.json b/test/integration/generated/bodyInteger/package.json index fc1c4f0fb8..d4bb5b2a3e 100644 --- a/test/integration/generated/bodyInteger/package.json +++ b/test/integration/generated/bodyInteger/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyInteger/src/bodyIntegerClient.ts b/test/integration/generated/bodyInteger/src/bodyIntegerClient.ts index b9e79c0c46..e9fe0f99c2 100644 --- a/test/integration/generated/bodyInteger/src/bodyIntegerClient.ts +++ b/test/integration/generated/bodyInteger/src/bodyIntegerClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { IntImpl } from "./operations"; import { Int } from "./operationsInterfaces"; +import { BodyIntegerClientContext } from "./bodyIntegerClientContext"; import { BodyIntegerClientOptionalParams } from "./models"; -export class BodyIntegerClient extends coreClient.ServiceClient { - $host: string; - +export class BodyIntegerClient extends BodyIntegerClientContext { /** * Initializes a new instance of the BodyIntegerClient class. * @param options The parameter options */ constructor(options?: BodyIntegerClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyIntegerClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-integer/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.int = new IntImpl(this); } diff --git a/test/integration/generated/bodyInteger/src/bodyIntegerClientContext.ts b/test/integration/generated/bodyInteger/src/bodyIntegerClientContext.ts new file mode 100644 index 0000000000..0ea90f4043 --- /dev/null +++ b/test/integration/generated/bodyInteger/src/bodyIntegerClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyIntegerClientOptionalParams } from "./models"; + +export class BodyIntegerClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyIntegerClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyIntegerClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyIntegerClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-integer/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyInteger/src/index.ts b/test/integration/generated/bodyInteger/src/index.ts index 0b69679705..7364e58eb9 100644 --- a/test/integration/generated/bodyInteger/src/index.ts +++ b/test/integration/generated/bodyInteger/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyIntegerClient } from "./bodyIntegerClient"; +export { BodyIntegerClientContext } from "./bodyIntegerClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyInteger/src/operations/int.ts b/test/integration/generated/bodyInteger/src/operations/int.ts index 145c150293..77369cc378 100644 --- a/test/integration/generated/bodyInteger/src/operations/int.ts +++ b/test/integration/generated/bodyInteger/src/operations/int.ts @@ -10,7 +10,7 @@ import { Int } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyIntegerClient } from "../bodyIntegerClient"; +import { BodyIntegerClientContext } from "../bodyIntegerClientContext"; import { IntGetNullOptionalParams, IntGetNullResponse, @@ -39,13 +39,13 @@ import { /** Class containing Int operations. */ export class IntImpl implements Int { - private readonly client: BodyIntegerClient; + private readonly client: BodyIntegerClientContext; /** * Initialize a new instance of the class Int class. * @param client Reference to the service client */ - constructor(client: BodyIntegerClient) { + constructor(client: BodyIntegerClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyNumber/package.json b/test/integration/generated/bodyNumber/package.json index c9c7219c29..b81831f6fe 100644 --- a/test/integration/generated/bodyNumber/package.json +++ b/test/integration/generated/bodyNumber/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyNumber/src/bodyNumberClient.ts b/test/integration/generated/bodyNumber/src/bodyNumberClient.ts index 880b4fd93d..28083f6a5d 100644 --- a/test/integration/generated/bodyNumber/src/bodyNumberClient.ts +++ b/test/integration/generated/bodyNumber/src/bodyNumberClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { NumberOperationsImpl } from "./operations"; import { NumberOperations } from "./operationsInterfaces"; +import { BodyNumberClientContext } from "./bodyNumberClientContext"; import { BodyNumberClientOptionalParams } from "./models"; -export class BodyNumberClient extends coreClient.ServiceClient { - $host: string; - +export class BodyNumberClient extends BodyNumberClientContext { /** * Initializes a new instance of the BodyNumberClient class. * @param options The parameter options */ constructor(options?: BodyNumberClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyNumberClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-number/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.number = new NumberOperationsImpl(this); } diff --git a/test/integration/generated/bodyNumber/src/bodyNumberClientContext.ts b/test/integration/generated/bodyNumber/src/bodyNumberClientContext.ts new file mode 100644 index 0000000000..20b58fd833 --- /dev/null +++ b/test/integration/generated/bodyNumber/src/bodyNumberClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyNumberClientOptionalParams } from "./models"; + +export class BodyNumberClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyNumberClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyNumberClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyNumberClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-number/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyNumber/src/index.ts b/test/integration/generated/bodyNumber/src/index.ts index 20c5862034..8b4c86296d 100644 --- a/test/integration/generated/bodyNumber/src/index.ts +++ b/test/integration/generated/bodyNumber/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyNumberClient } from "./bodyNumberClient"; +export { BodyNumberClientContext } from "./bodyNumberClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyNumber/src/operations/number.ts b/test/integration/generated/bodyNumber/src/operations/number.ts index 157a0c7abd..00ec423071 100644 --- a/test/integration/generated/bodyNumber/src/operations/number.ts +++ b/test/integration/generated/bodyNumber/src/operations/number.ts @@ -10,7 +10,7 @@ import { NumberOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyNumberClient } from "../bodyNumberClient"; +import { BodyNumberClientContext } from "../bodyNumberClientContext"; import { NumberGetNullOptionalParams, NumberGetNullResponse, @@ -54,13 +54,13 @@ import { /** Class containing NumberOperations operations. */ export class NumberOperationsImpl implements NumberOperations { - private readonly client: BodyNumberClient; + private readonly client: BodyNumberClientContext; /** * Initialize a new instance of the class NumberOperations class. * @param client Reference to the service client */ - constructor(client: BodyNumberClient) { + constructor(client: BodyNumberClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyString/package.json b/test/integration/generated/bodyString/package.json index 3f45a5fe17..1d54a229d0 100644 --- a/test/integration/generated/bodyString/package.json +++ b/test/integration/generated/bodyString/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyString/src/bodyStringClient.ts b/test/integration/generated/bodyString/src/bodyStringClient.ts index b0c5b167ed..cd7d6999c5 100644 --- a/test/integration/generated/bodyString/src/bodyStringClient.ts +++ b/test/integration/generated/bodyString/src/bodyStringClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { StringOperationsImpl, EnumImpl } from "./operations"; import { StringOperations, Enum } from "./operationsInterfaces"; +import { BodyStringClientContext } from "./bodyStringClientContext"; import { BodyStringClientOptionalParams } from "./models"; -export class BodyStringClient extends coreClient.ServiceClient { - $host: string; - +export class BodyStringClient extends BodyStringClientContext { /** * Initializes a new instance of the BodyStringClient class. * @param options The parameter options */ constructor(options?: BodyStringClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyStringClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-string/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.string = new StringOperationsImpl(this); this.enum = new EnumImpl(this); } diff --git a/test/integration/generated/bodyString/src/bodyStringClientContext.ts b/test/integration/generated/bodyString/src/bodyStringClientContext.ts new file mode 100644 index 0000000000..74024d8db5 --- /dev/null +++ b/test/integration/generated/bodyString/src/bodyStringClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyStringClientOptionalParams } from "./models"; + +export class BodyStringClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyStringClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyStringClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyStringClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-string/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyString/src/index.ts b/test/integration/generated/bodyString/src/index.ts index e26188374f..6806f529d8 100644 --- a/test/integration/generated/bodyString/src/index.ts +++ b/test/integration/generated/bodyString/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyStringClient } from "./bodyStringClient"; +export { BodyStringClientContext } from "./bodyStringClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyString/src/operations/enum.ts b/test/integration/generated/bodyString/src/operations/enum.ts index e2a7a48f12..5ca0b4ca9b 100644 --- a/test/integration/generated/bodyString/src/operations/enum.ts +++ b/test/integration/generated/bodyString/src/operations/enum.ts @@ -10,7 +10,7 @@ import { Enum } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyStringClient } from "../bodyStringClient"; +import { BodyStringClientContext } from "../bodyStringClientContext"; import { EnumGetNotExpandableOptionalParams, EnumGetNotExpandableResponse, @@ -27,13 +27,13 @@ import { /** Class containing Enum operations. */ export class EnumImpl implements Enum { - private readonly client: BodyStringClient; + private readonly client: BodyStringClientContext; /** * Initialize a new instance of the class Enum class. * @param client Reference to the service client */ - constructor(client: BodyStringClient) { + constructor(client: BodyStringClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyString/src/operations/string.ts b/test/integration/generated/bodyString/src/operations/string.ts index 75361b1410..bbc83bd9b5 100644 --- a/test/integration/generated/bodyString/src/operations/string.ts +++ b/test/integration/generated/bodyString/src/operations/string.ts @@ -10,7 +10,7 @@ import { StringOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyStringClient } from "../bodyStringClient"; +import { BodyStringClientContext } from "../bodyStringClientContext"; import { StringGetNullOptionalParams, StringGetNullResponse, @@ -37,13 +37,13 @@ import { /** Class containing StringOperations operations. */ export class StringOperationsImpl implements StringOperations { - private readonly client: BodyStringClient; + private readonly client: BodyStringClientContext; /** * Initialize a new instance of the class StringOperations class. * @param client Reference to the service client */ - constructor(client: BodyStringClient) { + constructor(client: BodyStringClientContext) { this.client = client; } diff --git a/test/integration/generated/bodyStringRest/karma.conf.js b/test/integration/generated/bodyStringRest/karma.conf.js deleted file mode 100644 index 5610b7bb06..0000000000 --- a/test/integration/generated/bodyStringRest/karma.conf.js +++ /dev/null @@ -1,153 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -// https://github.com/karma-runner/karma-chrome-launcher -process.env.CHROME_BIN = require("puppeteer").executablePath(); -require("dotenv").config(); -const { - jsonRecordingFilterFunction, - isPlaybackMode, - isSoftRecordMode, - isRecordMode -} = require("@azure-tools/test-recorder"); - -module.exports = function(config) { - config.set({ - // base path that will be used to resolve all patterns (eg. files, exclude) - basePath: "./", - - // frameworks to use - // available frameworks: https://npmjs.org/browse/keyword/karma-adapter - frameworks: ["source-map-support", "mocha"], - - plugins: [ - "karma-mocha", - "karma-mocha-reporter", - "karma-chrome-launcher", - "karma-edge-launcher", - "karma-firefox-launcher", - "karma-ie-launcher", - "karma-env-preprocessor", - "karma-coverage", - "karma-sourcemap-loader", - "karma-junit-reporter", - "karma-json-to-file-reporter", - "karma-source-map-support", - "karma-json-preprocessor" - ], - - // list of files / patterns to load in the browser - files: [ - "dist-test/index.browser.js", - { - pattern: "dist-test/index.browser.js.map", - type: "html", - included: false, - served: true - } - ].concat( - isPlaybackMode() || isSoftRecordMode() - ? ["recordings/browsers/**/*.json"] - : [] - ), - - // list of files / patterns to exclude - exclude: [], - - // preprocess matching files before serving them to the browser - // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor - preprocessors: { - "**/*.js": ["sourcemap", "env"], - "recordings/browsers/**/*.json": ["json"] - // IMPORTANT: COMMENT following line if you want to debug in your browsers!! - // Preprocess source file to calculate code coverage, however this will make source file unreadable - // "dist-test/index.js": ["coverage"] - }, - - envPreprocessor: [ - "TEST_MODE", - "ENDPOINT", - "AZURE_CLIENT_SECRET", - "AZURE_CLIENT_ID", - "AZURE_TENANT_ID", - "SUBSCRIPTION_ID" - ], - - // test results reporter to use - // possible values: 'dots', 'progress' - // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ["mocha", "coverage", "junit", "json-to-file"], - - coverageReporter: { - // specify a common output directory - dir: "coverage-browser/", - reporters: [ - { type: "json", subdir: ".", file: "coverage.json" }, - { type: "lcovonly", subdir: ".", file: "lcov.info" }, - { type: "html", subdir: "html" }, - { type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" } - ] - }, - - junitReporter: { - outputDir: "", // results will be saved as $outputDir/$browserName.xml - outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile - suite: "", // suite will become the package name attribute in xml testsuite element - useBrowserName: false, // add browser name to report and classes names - nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element - classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element - properties: {} // key value pair of properties to add to the section of the report - }, - - jsonToFileReporter: { - filter: jsonRecordingFilterFunction, - outputPath: "." - }, - - // web server port - port: 9876, - - // enable / disable colors in the output (reporters and logs) - colors: true, - - // level of logging - // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG - logLevel: config.LOG_INFO, - - // enable / disable watching file and executing tests whenever any file changes - autoWatch: false, - - // --no-sandbox allows our tests to run in Linux without having to change the system. - // --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex. - browsers: ["ChromeHeadlessNoSandbox"], - customLaunchers: { - ChromeHeadlessNoSandbox: { - base: "ChromeHeadless", - flags: ["--no-sandbox", "--disable-web-security"] - } - }, - - // Continuous Integration mode - // if true, Karma captures browsers, runs the tests and exits - singleRun: false, - - // Concurrency level - // how many browser should be started simultaneous - concurrency: 1, - - browserNoActivityTimeout: 60000000, - browserDisconnectTimeout: 10000, - browserDisconnectTolerance: 3, - browserConsoleLogOptions: { - terminal: !isRecordMode() - }, - - client: { - mocha: { - // change Karma's debug.html to the mocha web reporter - reporter: "html", - timeout: "600000" - } - } - }); -}; diff --git a/test/integration/generated/bodyStringRest/package.json b/test/integration/generated/bodyStringRest/package.json index c26187583d..0ca186f83d 100644 --- a/test/integration/generated/bodyStringRest/package.json +++ b/test/integration/generated/bodyStringRest/package.json @@ -6,7 +6,7 @@ "main": "dist-esm/index.js", "types": "./types/body-string-rest.d.ts", "scripts": { - "test": "npm run clean && npm run build:test && npm run unit-test", + "test": "echo \"Error: no test specified\" && exit 1", "build": "npm run clean && tsc --build && npm run extract-api", "extract-api": "mkdirp ./review && api-extractor run --local", "pack": "npm pack 2>&1", @@ -15,24 +15,24 @@ "clean": "echo skipped", "build:node": "echo skipped", "build:browser": "echo skipped", - "build:test": "tsc -p . && rollup -c 2>&1", + "build:test": "echo skipped", "build:samples": "echo skipped.", "check-format": "echo skipped", "execute:samples": "echo skipped", "format": "echo skipped", - "test:node": "npm run clean && npm run build:test && npm run unit-test:node", - "test:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", - "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:node": "mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}*.spec.ts\"", - "unit-test:browser": "karma start --single-run", - "integration-test:browser": "karma start --single-run", - "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}*.spec.js\"", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "test:node": "echo skipped", + "test:browser": "echo skipped", + "unit-test": "echo skipped", + "unit-test:node": "echo skipped", + "unit-test:browser": "echo skipped", + "integration-test:browser": "echo skipped", + "integration-test:node": "echo skipped", + "integration-test": "echo skipped", "docs": "echo skipped" }, "keywords": [], "author": "", - "license": "MIT", + "license": "ISC", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", @@ -48,34 +48,8 @@ "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", - "rimraf": "^3.0.0", - "@azure/identity": "^2.0.1", - "@azure-tools/test-recorder": "^1.0.0", - "mocha": "^7.1.1", - "mocha-junit-reporter": "^1.18.0", - "cross-env": "^7.0.2", - "chai": "^4.2.0", - "karma-chrome-launcher": "^3.0.0", - "karma-coverage": "^2.0.0", - "karma-edge-launcher": "^0.4.2", - "karma-env-preprocessor": "^0.1.1", - "karma-firefox-launcher": "^1.1.0", - "karma-ie-launcher": "^1.0.0", - "karma-json-preprocessor": "^0.3.3", - "karma-json-to-file-reporter": "^1.0.1", - "karma-junit-reporter": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-mocha": "^2.0.1", - "karma-source-map-support": "~1.4.0", - "karma-sourcemap-loader": "^0.3.8", - "karma": "^6.2.0", - "nyc": "^14.0.0", - "source-map-support": "^0.5.9" + "rimraf": "^3.0.0" }, "sideEffects": false, - "autoPublish": true, - "module": "./dist-esm/src/index.js", - "browser": { - "./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js" - } + "autoPublish": true } diff --git a/test/integration/generated/bodyStringRest/src/bodyStringRest.ts b/test/integration/generated/bodyStringRest/src/bodyStringRest.ts index 6d3d0af4b7..fa10ad9f60 100644 --- a/test/integration/generated/bodyStringRest/src/bodyStringRest.ts +++ b/test/integration/generated/bodyStringRest/src/bodyStringRest.ts @@ -235,7 +235,9 @@ export default function BodyStringRest( ): BodyStringRestRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - const client = getClient(baseUrl, options) as BodyStringRestRestClient; + return getClient( + baseUrl, - return client; + options + ) as BodyStringRestRestClient; } diff --git a/test/integration/generated/bodyStringRest/test/public/sampleTest.spec.ts b/test/integration/generated/bodyStringRest/test/public/sampleTest.spec.ts deleted file mode 100644 index 5a71b56861..0000000000 --- a/test/integration/generated/bodyStringRest/test/public/sampleTest.spec.ts +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { Recorder } from "@azure-tools/test-recorder"; -import * as assert from "assert"; -import { createRecorder } from "./utils/recordedClient"; - -describe("My test", () => { - let recorder: Recorder; - - beforeEach(async function() { - recorder = createRecorder(this); - }); - - afterEach(async function() { - await recorder.stop(); - }); - - it("sample test", async function() { - console.log("Hi, I'm a test!"); - }); -}); diff --git a/test/integration/generated/bodyStringRest/test/public/utils/env.browser.ts b/test/integration/generated/bodyStringRest/test/public/utils/env.browser.ts deleted file mode 100644 index fd2aca680c..0000000000 --- a/test/integration/generated/bodyStringRest/test/public/utils/env.browser.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. diff --git a/test/integration/generated/bodyStringRest/test/public/utils/env.ts b/test/integration/generated/bodyStringRest/test/public/utils/env.ts deleted file mode 100644 index 0e06855b73..0000000000 --- a/test/integration/generated/bodyStringRest/test/public/utils/env.ts +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import * as dotenv from "dotenv"; - -dotenv.config(); diff --git a/test/integration/generated/bodyStringRest/test/public/utils/recordedClient.ts b/test/integration/generated/bodyStringRest/test/public/utils/recordedClient.ts deleted file mode 100644 index b090e6c7d0..0000000000 --- a/test/integration/generated/bodyStringRest/test/public/utils/recordedClient.ts +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) Microsoft Corporation. -// Licensed under the MIT license. - -import { Context } from "mocha"; -import { - env, - record, - RecorderEnvironmentSetup, - Recorder -} from "@azure-tools/test-recorder"; -import "./env"; - -const recorderEnvSetup: RecorderEnvironmentSetup = { - replaceableVariables: { - ENDPOINT: "https://endpoint", - AZURE_CLIENT_ID: "azure_client_id", - AZURE_CLIENT_SECRET: "azure_client_secret", - AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", - SUBSCRIPTION_ID: "azure_subscription_id" - }, - customizationsOnRecordings: [ - (recording: any): any => - recording.replace( - /"access_token":"[^"]*"/g, - `"access_token":"access_token"` - ), - // If we put ENDPOINT in replaceableVariables above, it will not capture - // the endpoint string used with nock, which will be expanded to - // https://:443/ and therefore will not match, so we have to do - // this instead. - (recording: string): string => { - const replaced = recording.replace("endpoint:443", "endpoint"); - return replaced; - } - ], - queryParametersToSkip: [] -}; - -/** - * creates the recorder and reads the environment variables from the `.env` file. - * Should be called first in the test suite to make sure environment variables are - * read before they are being used. - */ -export function createRecorder(context: Context): Recorder { - return record(context, recorderEnvSetup); -} diff --git a/test/integration/generated/bodyStringRest/tsconfig.json b/test/integration/generated/bodyStringRest/tsconfig.json index 3819483a36..965341beea 100644 --- a/test/integration/generated/bodyStringRest/tsconfig.json +++ b/test/integration/generated/bodyStringRest/tsconfig.json @@ -7,5 +7,13 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "include": ["src/**/*.ts", "./test/**/*.ts"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } diff --git a/test/integration/generated/bodyTime/package.json b/test/integration/generated/bodyTime/package.json index 82180a39cf..ee098fb82c 100644 --- a/test/integration/generated/bodyTime/package.json +++ b/test/integration/generated/bodyTime/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyTime/src/bodyTimeClient.ts b/test/integration/generated/bodyTime/src/bodyTimeClient.ts index ec6a407fd3..07a31e1ab2 100644 --- a/test/integration/generated/bodyTime/src/bodyTimeClient.ts +++ b/test/integration/generated/bodyTime/src/bodyTimeClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { TimeImpl } from "./operations"; import { Time } from "./operationsInterfaces"; +import { BodyTimeClientContext } from "./bodyTimeClientContext"; import { BodyTimeClientOptionalParams } from "./models"; -export class BodyTimeClient extends coreClient.ServiceClient { - $host: string; - +export class BodyTimeClient extends BodyTimeClientContext { /** * Initializes a new instance of the BodyTimeClient class. * @param options The parameter options */ constructor(options?: BodyTimeClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyTimeClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-time/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.time = new TimeImpl(this); } diff --git a/test/integration/generated/bodyTime/src/bodyTimeClientContext.ts b/test/integration/generated/bodyTime/src/bodyTimeClientContext.ts new file mode 100644 index 0000000000..f6dbe759e7 --- /dev/null +++ b/test/integration/generated/bodyTime/src/bodyTimeClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { BodyTimeClientOptionalParams } from "./models"; + +export class BodyTimeClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the BodyTimeClientContext class. + * @param options The parameter options + */ + constructor(options?: BodyTimeClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyTimeClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-time/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/bodyTime/src/index.ts b/test/integration/generated/bodyTime/src/index.ts index ea4f18ef00..8b5b0475d6 100644 --- a/test/integration/generated/bodyTime/src/index.ts +++ b/test/integration/generated/bodyTime/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { BodyTimeClient } from "./bodyTimeClient"; +export { BodyTimeClientContext } from "./bodyTimeClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyTime/src/operations/time.ts b/test/integration/generated/bodyTime/src/operations/time.ts index fcb71f082a..558d0f792a 100644 --- a/test/integration/generated/bodyTime/src/operations/time.ts +++ b/test/integration/generated/bodyTime/src/operations/time.ts @@ -10,7 +10,7 @@ import { Time } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyTimeClient } from "../bodyTimeClient"; +import { BodyTimeClientContext } from "../bodyTimeClientContext"; import { TimeGetOptionalParams, TimeGetResponse, @@ -20,13 +20,13 @@ import { /** Class containing Time operations. */ export class TimeImpl implements Time { - private readonly client: BodyTimeClient; + private readonly client: BodyTimeClientContext; /** * Initialize a new instance of the class Time class. * @param client Reference to the service client */ - constructor(client: BodyTimeClient) { + constructor(client: BodyTimeClientContext) { this.client = client; } diff --git a/test/integration/generated/constantParam/package.json b/test/integration/generated/constantParam/package.json index ceef21430d..5fd55dce86 100644 --- a/test/integration/generated/constantParam/package.json +++ b/test/integration/generated/constantParam/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/constantParam/src/generatedClient.ts b/test/integration/generated/constantParam/src/generatedClient.ts index 9597796dfc..29e4c26ca0 100644 --- a/test/integration/generated/constantParam/src/generatedClient.ts +++ b/test/integration/generated/constantParam/src/generatedClient.ts @@ -9,6 +9,7 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { GeneratedClientContext } from "./generatedClientContext"; import { GeneratedClientOptionalParams, LanguageBatchInput, @@ -17,10 +18,7 @@ import { } from "./models"; /** @internal */ -export class GeneratedClient extends coreClient.ServiceClient { - endpoint: string; - apiVersion: string; - +export class GeneratedClient extends GeneratedClientContext { /** * Initializes a new instance of the GeneratedClient class. * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: @@ -28,38 +26,7 @@ export class GeneratedClient extends coreClient.ServiceClient { * @param options The parameter options */ constructor(endpoint: string, options?: GeneratedClientOptionalParams) { - if (endpoint === undefined) { - throw new Error("'endpoint' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: GeneratedClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-constantParam/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{Endpoint}/text/analytics/{ApiVersion}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.endpoint = endpoint; - - // Assigning values to Constant parameters - this.apiVersion = options.apiVersion || "v3.1"; + super(endpoint, options); } /** diff --git a/test/integration/generated/constantParam/src/generatedClientContext.ts b/test/integration/generated/constantParam/src/generatedClientContext.ts new file mode 100644 index 0000000000..7add4b74d8 --- /dev/null +++ b/test/integration/generated/constantParam/src/generatedClientContext.ts @@ -0,0 +1,57 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { GeneratedClientOptionalParams } from "./models"; + +/** @internal */ +export class GeneratedClientContext extends coreClient.ServiceClient { + endpoint: string; + apiVersion: string; + + /** + * Initializes a new instance of the GeneratedClientContext class. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus.api.cognitive.microsoft.com). + * @param options The parameter options + */ + constructor(endpoint: string, options?: GeneratedClientOptionalParams) { + if (endpoint === undefined) { + throw new Error("'endpoint' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: GeneratedClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-constantParam/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{Endpoint}/text/analytics/{ApiVersion}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.endpoint = endpoint; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "v3.1"; + } +} diff --git a/test/integration/generated/constantParam/src/index.ts b/test/integration/generated/constantParam/src/index.ts index 657fb6d642..3aebf3c9a5 100644 --- a/test/integration/generated/constantParam/src/index.ts +++ b/test/integration/generated/constantParam/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { GeneratedClient } from "./generatedClient"; +export { GeneratedClientContext } from "./generatedClientContext"; diff --git a/test/integration/generated/customUrl/package.json b/test/integration/generated/customUrl/package.json index e4f0710513..ede2ae1e12 100644 --- a/test/integration/generated/customUrl/package.json +++ b/test/integration/generated/customUrl/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/customUrl/src/customUrlClient.ts b/test/integration/generated/customUrl/src/customUrlClient.ts index f09de24f3e..bdbe110917 100644 --- a/test/integration/generated/customUrl/src/customUrlClient.ts +++ b/test/integration/generated/customUrl/src/customUrlClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { PathsImpl } from "./operations"; import { Paths } from "./operationsInterfaces"; +import { CustomUrlClientContext } from "./customUrlClientContext"; import { CustomUrlClientOptionalParams } from "./models"; -export class CustomUrlClient extends coreClient.ServiceClient { - host: string; - +export class CustomUrlClient extends CustomUrlClientContext { /** * Initializes a new instance of the CustomUrlClient class. * @param options The parameter options */ constructor(options?: CustomUrlClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: CustomUrlClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-custom-url/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://{accountName}{host}" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.host = options.host || "host"; + super(options); this.paths = new PathsImpl(this); } diff --git a/test/integration/generated/customUrl/src/customUrlClientContext.ts b/test/integration/generated/customUrl/src/customUrlClientContext.ts new file mode 100644 index 0000000000..593612639b --- /dev/null +++ b/test/integration/generated/customUrl/src/customUrlClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { CustomUrlClientOptionalParams } from "./models"; + +export class CustomUrlClientContext extends coreClient.ServiceClient { + host: string; + + /** + * Initializes a new instance of the CustomUrlClientContext class. + * @param options The parameter options + */ + constructor(options?: CustomUrlClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: CustomUrlClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-custom-url/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://{accountName}{host}" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.host = options.host || "host"; + } +} diff --git a/test/integration/generated/customUrl/src/index.ts b/test/integration/generated/customUrl/src/index.ts index 96499ffc46..7156c26a93 100644 --- a/test/integration/generated/customUrl/src/index.ts +++ b/test/integration/generated/customUrl/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { CustomUrlClient } from "./customUrlClient"; +export { CustomUrlClientContext } from "./customUrlClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/customUrl/src/operations/paths.ts b/test/integration/generated/customUrl/src/operations/paths.ts index e182ccdfb6..754b326a07 100644 --- a/test/integration/generated/customUrl/src/operations/paths.ts +++ b/test/integration/generated/customUrl/src/operations/paths.ts @@ -10,18 +10,18 @@ import { Paths } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { CustomUrlClient } from "../customUrlClient"; +import { CustomUrlClientContext } from "../customUrlClientContext"; import { PathsGetEmptyOptionalParams } from "../models"; /** Class containing Paths operations. */ export class PathsImpl implements Paths { - private readonly client: CustomUrlClient; + private readonly client: CustomUrlClientContext; /** * Initialize a new instance of the class Paths class. * @param client Reference to the service client */ - constructor(client: CustomUrlClient) { + constructor(client: CustomUrlClientContext) { this.client = client; } diff --git a/test/integration/generated/customUrlMoreOptions/package.json b/test/integration/generated/customUrlMoreOptions/package.json index 4c38c82527..08a96049cf 100644 --- a/test/integration/generated/customUrlMoreOptions/package.json +++ b/test/integration/generated/customUrlMoreOptions/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClient.ts b/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClient.ts index 535c0868c9..aed2b7e64b 100644 --- a/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClient.ts +++ b/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClient.ts @@ -6,15 +6,12 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { PathsImpl } from "./operations"; import { Paths } from "./operationsInterfaces"; +import { CustomUrlMoreOptionsClientContext } from "./customUrlMoreOptionsClientContext"; import { CustomUrlMoreOptionsClientOptionalParams } from "./models"; -export class CustomUrlMoreOptionsClient extends coreClient.ServiceClient { - dnsSuffix: string; - subscriptionId: string; - +export class CustomUrlMoreOptionsClient extends CustomUrlMoreOptionsClientContext { /** * Initializes a new instance of the CustomUrlMoreOptionsClient class. * @param subscriptionId The subscription id with value 'test12'. @@ -24,38 +21,7 @@ export class CustomUrlMoreOptionsClient extends coreClient.ServiceClient { subscriptionId: string, options?: CustomUrlMoreOptionsClientOptionalParams ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: CustomUrlMoreOptionsClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-custom-url-MoreOptions/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{vault}{secret}{dnsSuffix}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.dnsSuffix = options.dnsSuffix || "host"; + super(subscriptionId, options); this.paths = new PathsImpl(this); } diff --git a/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClientContext.ts b/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClientContext.ts new file mode 100644 index 0000000000..05ddcb1ab1 --- /dev/null +++ b/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClientContext.ts @@ -0,0 +1,58 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { CustomUrlMoreOptionsClientOptionalParams } from "./models"; + +export class CustomUrlMoreOptionsClientContext extends coreClient.ServiceClient { + dnsSuffix: string; + subscriptionId: string; + + /** + * Initializes a new instance of the CustomUrlMoreOptionsClientContext class. + * @param subscriptionId The subscription id with value 'test12'. + * @param options The parameter options + */ + constructor( + subscriptionId: string, + options?: CustomUrlMoreOptionsClientOptionalParams + ) { + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: CustomUrlMoreOptionsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-custom-url-MoreOptions/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{vault}{secret}{dnsSuffix}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.dnsSuffix = options.dnsSuffix || "host"; + } +} diff --git a/test/integration/generated/customUrlMoreOptions/src/index.ts b/test/integration/generated/customUrlMoreOptions/src/index.ts index a399d58aa8..535fef5a9a 100644 --- a/test/integration/generated/customUrlMoreOptions/src/index.ts +++ b/test/integration/generated/customUrlMoreOptions/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { CustomUrlMoreOptionsClient } from "./customUrlMoreOptionsClient"; +export { CustomUrlMoreOptionsClientContext } from "./customUrlMoreOptionsClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/customUrlMoreOptions/src/operations/paths.ts b/test/integration/generated/customUrlMoreOptions/src/operations/paths.ts index 5befb8bfdf..d0a0434a61 100644 --- a/test/integration/generated/customUrlMoreOptions/src/operations/paths.ts +++ b/test/integration/generated/customUrlMoreOptions/src/operations/paths.ts @@ -10,18 +10,18 @@ import { Paths } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { CustomUrlMoreOptionsClient } from "../customUrlMoreOptionsClient"; +import { CustomUrlMoreOptionsClientContext } from "../customUrlMoreOptionsClientContext"; import { PathsGetEmptyOptionalParams } from "../models"; /** Class containing Paths operations. */ export class PathsImpl implements Paths { - private readonly client: CustomUrlMoreOptionsClient; + private readonly client: CustomUrlMoreOptionsClientContext; /** * Initialize a new instance of the class Paths class. * @param client Reference to the service client */ - constructor(client: CustomUrlMoreOptionsClient) { + constructor(client: CustomUrlMoreOptionsClientContext) { this.client = client; } diff --git a/test/integration/generated/customUrlPaging/package.json b/test/integration/generated/customUrlPaging/package.json index a0c22fc5c1..401a15be00 100644 --- a/test/integration/generated/customUrlPaging/package.json +++ b/test/integration/generated/customUrlPaging/package.json @@ -26,8 +26,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/customUrlPaging/src/customUrlPagingClient.ts b/test/integration/generated/customUrlPaging/src/customUrlPagingClient.ts index 1ecd4c74fb..7beb261cdc 100644 --- a/test/integration/generated/customUrlPaging/src/customUrlPagingClient.ts +++ b/test/integration/generated/customUrlPaging/src/customUrlPagingClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { PagingImpl } from "./operations"; import { Paging } from "./operationsInterfaces"; +import { CustomUrlPagingClientContext } from "./customUrlPagingClientContext"; import { CustomUrlPagingClientOptionalParams } from "./models"; -export class CustomUrlPagingClient extends coreClient.ServiceClient { - host: string; - +export class CustomUrlPagingClient extends CustomUrlPagingClientContext { /** * Initializes a new instance of the CustomUrlPagingClient class. * @param options The parameter options */ constructor(options?: CustomUrlPagingClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: CustomUrlPagingClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-custom-url-paging/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://{accountName}{host}" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.host = options.host || "host"; + super(options); this.paging = new PagingImpl(this); } diff --git a/test/integration/generated/customUrlPaging/src/customUrlPagingClientContext.ts b/test/integration/generated/customUrlPaging/src/customUrlPagingClientContext.ts new file mode 100644 index 0000000000..84ec2c0e75 --- /dev/null +++ b/test/integration/generated/customUrlPaging/src/customUrlPagingClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { CustomUrlPagingClientOptionalParams } from "./models"; + +export class CustomUrlPagingClientContext extends coreClient.ServiceClient { + host: string; + + /** + * Initializes a new instance of the CustomUrlPagingClientContext class. + * @param options The parameter options + */ + constructor(options?: CustomUrlPagingClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: CustomUrlPagingClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-custom-url-paging/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://{accountName}{host}" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.host = options.host || "host"; + } +} diff --git a/test/integration/generated/customUrlPaging/src/index.ts b/test/integration/generated/customUrlPaging/src/index.ts index 2e737de63e..4a177cdd47 100644 --- a/test/integration/generated/customUrlPaging/src/index.ts +++ b/test/integration/generated/customUrlPaging/src/index.ts @@ -9,4 +9,5 @@ /// export * from "./models"; export { CustomUrlPagingClient } from "./customUrlPagingClient"; +export { CustomUrlPagingClientContext } from "./customUrlPagingClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/customUrlPaging/src/operations/paging.ts b/test/integration/generated/customUrlPaging/src/operations/paging.ts index d18ef00bf2..57b917e37c 100644 --- a/test/integration/generated/customUrlPaging/src/operations/paging.ts +++ b/test/integration/generated/customUrlPaging/src/operations/paging.ts @@ -11,7 +11,7 @@ import { Paging } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { CustomUrlPagingClient } from "../customUrlPagingClient"; +import { CustomUrlPagingClientContext } from "../customUrlPagingClientContext"; import { Product, PagingGetPagesPartialUrlNextOptionalParams, @@ -27,13 +27,13 @@ import { /// /** Class containing Paging operations. */ export class PagingImpl implements Paging { - private readonly client: CustomUrlPagingClient; + private readonly client: CustomUrlPagingClientContext; /** * Initialize a new instance of the class Paging class. * @param client Reference to the service client */ - constructor(client: CustomUrlPagingClient) { + constructor(client: CustomUrlPagingClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/package.json b/test/integration/generated/datafactory/package.json index 1076614019..1b040a8a4b 100644 --- a/test/integration/generated/datafactory/package.json +++ b/test/integration/generated/datafactory/package.json @@ -28,8 +28,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/datafactory/src/dataFactoryClient.ts b/test/integration/generated/datafactory/src/dataFactoryClient.ts index 4b30663005..efb38b36d4 100644 --- a/test/integration/generated/datafactory/src/dataFactoryClient.ts +++ b/test/integration/generated/datafactory/src/dataFactoryClient.ts @@ -1,4 +1,3 @@ -import * as coreClient from "@azure/core-client"; import { OperationsImpl, FactoriesImpl, @@ -43,13 +42,10 @@ import { PrivateEndpointConnection, PrivateLinkResources } from "./operationsInterfaces"; +import { DataFactoryClientContext } from "./dataFactoryClientContext"; import { DataFactoryClientOptionalParams } from "./models"; -export class DataFactoryClient extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - +export class DataFactoryClient extends DataFactoryClientContext { /** * Initializes a new instance of the DataFactoryClient class. * @param subscriptionId The subscription identifier. @@ -59,39 +55,7 @@ export class DataFactoryClient extends coreClient.ServiceClient { subscriptionId: string, options?: DataFactoryClientOptionalParams ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: DataFactoryClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-datafactory/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "https://management.azure.com" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2018-06-01"; + super(subscriptionId, options); this.operations = new OperationsImpl(this); this.factories = new FactoriesImpl(this); this.exposureControl = new ExposureControlImpl(this); diff --git a/test/integration/generated/datafactory/src/dataFactoryClientContext.ts b/test/integration/generated/datafactory/src/dataFactoryClientContext.ts new file mode 100644 index 0000000000..4847b359f0 --- /dev/null +++ b/test/integration/generated/datafactory/src/dataFactoryClientContext.ts @@ -0,0 +1,52 @@ +import * as coreClient from "@azure/core-client"; +import { DataFactoryClientOptionalParams } from "./models"; + +export class DataFactoryClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the DataFactoryClientContext class. + * @param subscriptionId The subscription identifier. + * @param options The parameter options + */ + constructor( + subscriptionId: string, + options?: DataFactoryClientOptionalParams + ) { + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: DataFactoryClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-datafactory/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2018-06-01"; + } +} diff --git a/test/integration/generated/datafactory/src/index.ts b/test/integration/generated/datafactory/src/index.ts index 677f5d970d..5016490640 100644 --- a/test/integration/generated/datafactory/src/index.ts +++ b/test/integration/generated/datafactory/src/index.ts @@ -1,4 +1,5 @@ /// export * from "./models"; export { DataFactoryClient } from "./dataFactoryClient"; +export { DataFactoryClientContext } from "./dataFactoryClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/datafactory/src/operations/activityRuns.ts b/test/integration/generated/datafactory/src/operations/activityRuns.ts index d5cd57009e..39ebbe72f4 100644 --- a/test/integration/generated/datafactory/src/operations/activityRuns.ts +++ b/test/integration/generated/datafactory/src/operations/activityRuns.ts @@ -2,7 +2,7 @@ import { ActivityRuns } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { RunFilterParameters, ActivityRunsQueryByPipelineRunOptionalParams, @@ -11,13 +11,13 @@ import { /** Class containing ActivityRuns operations. */ export class ActivityRunsImpl implements ActivityRuns { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class ActivityRuns class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/dataFlowDebugSession.ts b/test/integration/generated/datafactory/src/operations/dataFlowDebugSession.ts index 1c4766085b..f35513567e 100644 --- a/test/integration/generated/datafactory/src/operations/dataFlowDebugSession.ts +++ b/test/integration/generated/datafactory/src/operations/dataFlowDebugSession.ts @@ -3,7 +3,7 @@ import { DataFlowDebugSession } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -28,13 +28,13 @@ import { /// /** Class containing DataFlowDebugSession operations. */ export class DataFlowDebugSessionImpl implements DataFlowDebugSession { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class DataFlowDebugSession class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/dataFlows.ts b/test/integration/generated/datafactory/src/operations/dataFlows.ts index 6989ebd829..10099134dc 100644 --- a/test/integration/generated/datafactory/src/operations/dataFlows.ts +++ b/test/integration/generated/datafactory/src/operations/dataFlows.ts @@ -3,7 +3,7 @@ import { DataFlows } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { DataFlowResource, DataFlowsListByFactoryNextOptionalParams, @@ -20,13 +20,13 @@ import { /// /** Class containing DataFlows operations. */ export class DataFlowsImpl implements DataFlows { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class DataFlows class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/datasets.ts b/test/integration/generated/datafactory/src/operations/datasets.ts index c254687803..0e49745c88 100644 --- a/test/integration/generated/datafactory/src/operations/datasets.ts +++ b/test/integration/generated/datafactory/src/operations/datasets.ts @@ -3,7 +3,7 @@ import { Datasets } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { DatasetResource, DatasetsListByFactoryNextOptionalParams, @@ -20,13 +20,13 @@ import { /// /** Class containing Datasets operations. */ export class DatasetsImpl implements Datasets { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class Datasets class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/exposureControl.ts b/test/integration/generated/datafactory/src/operations/exposureControl.ts index 6594acc53e..d331f72f6e 100644 --- a/test/integration/generated/datafactory/src/operations/exposureControl.ts +++ b/test/integration/generated/datafactory/src/operations/exposureControl.ts @@ -2,7 +2,7 @@ import { ExposureControl } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { ExposureControlRequest, ExposureControlGetFeatureValueOptionalParams, @@ -16,13 +16,13 @@ import { /** Class containing ExposureControl operations. */ export class ExposureControlImpl implements ExposureControl { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class ExposureControl class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/factories.ts b/test/integration/generated/datafactory/src/operations/factories.ts index e36641a208..3ea68fc3ee 100644 --- a/test/integration/generated/datafactory/src/operations/factories.ts +++ b/test/integration/generated/datafactory/src/operations/factories.ts @@ -3,7 +3,7 @@ import { Factories } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { Factory, FactoriesListNextOptionalParams, @@ -36,13 +36,13 @@ import { /// /** Class containing Factories operations. */ export class FactoriesImpl implements Factories { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class Factories class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/integrationRuntimeNodes.ts b/test/integration/generated/datafactory/src/operations/integrationRuntimeNodes.ts index 0f9c356d55..8525435ab1 100644 --- a/test/integration/generated/datafactory/src/operations/integrationRuntimeNodes.ts +++ b/test/integration/generated/datafactory/src/operations/integrationRuntimeNodes.ts @@ -2,7 +2,7 @@ import { IntegrationRuntimeNodes } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { IntegrationRuntimeNodesGetOptionalParams, IntegrationRuntimeNodesGetResponse, @@ -16,13 +16,13 @@ import { /** Class containing IntegrationRuntimeNodes operations. */ export class IntegrationRuntimeNodesImpl implements IntegrationRuntimeNodes { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class IntegrationRuntimeNodes class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/integrationRuntimeObjectMetadata.ts b/test/integration/generated/datafactory/src/operations/integrationRuntimeObjectMetadata.ts index af9a23ef6d..afbc5f5a05 100644 --- a/test/integration/generated/datafactory/src/operations/integrationRuntimeObjectMetadata.ts +++ b/test/integration/generated/datafactory/src/operations/integrationRuntimeObjectMetadata.ts @@ -2,7 +2,7 @@ import { IntegrationRuntimeObjectMetadata } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -15,13 +15,13 @@ import { /** Class containing IntegrationRuntimeObjectMetadata operations. */ export class IntegrationRuntimeObjectMetadataImpl implements IntegrationRuntimeObjectMetadata { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class IntegrationRuntimeObjectMetadata class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/integrationRuntimes.ts b/test/integration/generated/datafactory/src/operations/integrationRuntimes.ts index b3e68462ea..2c3be4b489 100644 --- a/test/integration/generated/datafactory/src/operations/integrationRuntimes.ts +++ b/test/integration/generated/datafactory/src/operations/integrationRuntimes.ts @@ -3,7 +3,7 @@ import { IntegrationRuntimes } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -48,13 +48,13 @@ import { /// /** Class containing IntegrationRuntimes operations. */ export class IntegrationRuntimesImpl implements IntegrationRuntimes { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class IntegrationRuntimes class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/linkedServices.ts b/test/integration/generated/datafactory/src/operations/linkedServices.ts index c86c3899e1..d203e61414 100644 --- a/test/integration/generated/datafactory/src/operations/linkedServices.ts +++ b/test/integration/generated/datafactory/src/operations/linkedServices.ts @@ -3,7 +3,7 @@ import { LinkedServices } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { LinkedServiceResource, LinkedServicesListByFactoryNextOptionalParams, @@ -20,13 +20,13 @@ import { /// /** Class containing LinkedServices operations. */ export class LinkedServicesImpl implements LinkedServices { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class LinkedServices class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/managedPrivateEndpoints.ts b/test/integration/generated/datafactory/src/operations/managedPrivateEndpoints.ts index 2c491c1bd5..822e169e07 100644 --- a/test/integration/generated/datafactory/src/operations/managedPrivateEndpoints.ts +++ b/test/integration/generated/datafactory/src/operations/managedPrivateEndpoints.ts @@ -3,7 +3,7 @@ import { ManagedPrivateEndpoints } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { ManagedPrivateEndpointResource, ManagedPrivateEndpointsListByFactoryNextOptionalParams, @@ -20,13 +20,13 @@ import { /// /** Class containing ManagedPrivateEndpoints operations. */ export class ManagedPrivateEndpointsImpl implements ManagedPrivateEndpoints { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class ManagedPrivateEndpoints class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/managedVirtualNetworks.ts b/test/integration/generated/datafactory/src/operations/managedVirtualNetworks.ts index 63d2e3c021..5f6d33e118 100644 --- a/test/integration/generated/datafactory/src/operations/managedVirtualNetworks.ts +++ b/test/integration/generated/datafactory/src/operations/managedVirtualNetworks.ts @@ -3,7 +3,7 @@ import { ManagedVirtualNetworks } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { ManagedVirtualNetworkResource, ManagedVirtualNetworksListByFactoryNextOptionalParams, @@ -19,13 +19,13 @@ import { /// /** Class containing ManagedVirtualNetworks operations. */ export class ManagedVirtualNetworksImpl implements ManagedVirtualNetworks { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class ManagedVirtualNetworks class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/operations.ts b/test/integration/generated/datafactory/src/operations/operations.ts index f0bf046971..9290b3b17c 100644 --- a/test/integration/generated/datafactory/src/operations/operations.ts +++ b/test/integration/generated/datafactory/src/operations/operations.ts @@ -3,7 +3,7 @@ import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { Operation, OperationsListNextOptionalParams, @@ -15,13 +15,13 @@ import { /// /** Class containing Operations operations. */ export class OperationsImpl implements Operations { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class Operations class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/pipelineRuns.ts b/test/integration/generated/datafactory/src/operations/pipelineRuns.ts index 6f2c46e2cd..9da7b12ca8 100644 --- a/test/integration/generated/datafactory/src/operations/pipelineRuns.ts +++ b/test/integration/generated/datafactory/src/operations/pipelineRuns.ts @@ -2,7 +2,7 @@ import { PipelineRuns } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { RunFilterParameters, PipelineRunsQueryByFactoryOptionalParams, @@ -14,13 +14,13 @@ import { /** Class containing PipelineRuns operations. */ export class PipelineRunsImpl implements PipelineRuns { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class PipelineRuns class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/pipelines.ts b/test/integration/generated/datafactory/src/operations/pipelines.ts index 2c39f3fa27..d72bded4d5 100644 --- a/test/integration/generated/datafactory/src/operations/pipelines.ts +++ b/test/integration/generated/datafactory/src/operations/pipelines.ts @@ -3,7 +3,7 @@ import { Pipelines } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { PipelineResource, PipelinesListByFactoryNextOptionalParams, @@ -22,13 +22,13 @@ import { /// /** Class containing Pipelines operations. */ export class PipelinesImpl implements Pipelines { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class Pipelines class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/privateEndPointConnections.ts b/test/integration/generated/datafactory/src/operations/privateEndPointConnections.ts index a0722c785c..56a53beb0d 100644 --- a/test/integration/generated/datafactory/src/operations/privateEndPointConnections.ts +++ b/test/integration/generated/datafactory/src/operations/privateEndPointConnections.ts @@ -3,7 +3,7 @@ import { PrivateEndPointConnections } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { PrivateEndpointConnectionResource, PrivateEndPointConnectionsListByFactoryNextOptionalParams, @@ -16,13 +16,13 @@ import { /** Class containing PrivateEndPointConnections operations. */ export class PrivateEndPointConnectionsImpl implements PrivateEndPointConnections { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class PrivateEndPointConnections class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/privateEndpointConnection.ts b/test/integration/generated/datafactory/src/operations/privateEndpointConnection.ts index 08ab18c321..36fb15888f 100644 --- a/test/integration/generated/datafactory/src/operations/privateEndpointConnection.ts +++ b/test/integration/generated/datafactory/src/operations/privateEndpointConnection.ts @@ -2,7 +2,7 @@ import { PrivateEndpointConnection } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { PrivateLinkConnectionApprovalRequestResource, PrivateEndpointConnectionCreateOrUpdateOptionalParams, @@ -15,13 +15,13 @@ import { /** Class containing PrivateEndpointConnection operations. */ export class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class PrivateEndpointConnection class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/privateLinkResources.ts b/test/integration/generated/datafactory/src/operations/privateLinkResources.ts index bec49080bb..856aa2bf80 100644 --- a/test/integration/generated/datafactory/src/operations/privateLinkResources.ts +++ b/test/integration/generated/datafactory/src/operations/privateLinkResources.ts @@ -2,7 +2,7 @@ import { PrivateLinkResources } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { PrivateLinkResourcesGetOptionalParams, PrivateLinkResourcesGetResponse @@ -10,13 +10,13 @@ import { /** Class containing PrivateLinkResources operations. */ export class PrivateLinkResourcesImpl implements PrivateLinkResources { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class PrivateLinkResources class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/triggerRuns.ts b/test/integration/generated/datafactory/src/operations/triggerRuns.ts index 1ef9078f7e..47a2e17947 100644 --- a/test/integration/generated/datafactory/src/operations/triggerRuns.ts +++ b/test/integration/generated/datafactory/src/operations/triggerRuns.ts @@ -2,7 +2,7 @@ import { TriggerRuns } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { TriggerRunsRerunOptionalParams, TriggerRunsCancelOptionalParams, @@ -13,13 +13,13 @@ import { /** Class containing TriggerRuns operations. */ export class TriggerRunsImpl implements TriggerRuns { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class TriggerRuns class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/triggers.ts b/test/integration/generated/datafactory/src/operations/triggers.ts index c1d3ef583b..fa12875467 100644 --- a/test/integration/generated/datafactory/src/operations/triggers.ts +++ b/test/integration/generated/datafactory/src/operations/triggers.ts @@ -3,7 +3,7 @@ import { Triggers } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClient } from "../dataFactoryClient"; +import { DataFactoryClientContext } from "../dataFactoryClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -33,13 +33,13 @@ import { /// /** Class containing Triggers operations. */ export class TriggersImpl implements Triggers { - private readonly client: DataFactoryClient; + private readonly client: DataFactoryClientContext; /** * Initialize a new instance of the class Triggers class. * @param client Reference to the service client */ - constructor(client: DataFactoryClient) { + constructor(client: DataFactoryClientContext) { this.client = client; } diff --git a/test/integration/generated/datalakestorage/package.json b/test/integration/generated/datalakestorage/package.json index a50faee751..81683460e6 100644 --- a/test/integration/generated/datalakestorage/package.json +++ b/test/integration/generated/datalakestorage/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/datalakestorage/src/dataLakeStorageClient.ts b/test/integration/generated/datalakestorage/src/dataLakeStorageClient.ts index 8c9d796331..a184c0d931 100644 --- a/test/integration/generated/datalakestorage/src/dataLakeStorageClient.ts +++ b/test/integration/generated/datalakestorage/src/dataLakeStorageClient.ts @@ -6,17 +6,12 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { PathOperationsImpl } from "./operations"; import { PathOperations } from "./operationsInterfaces"; +import { DataLakeStorageClientContext } from "./dataLakeStorageClientContext"; import { DataLakeStorageClientOptionalParams } from "./models"; -export class DataLakeStorageClient extends coreClient.ServiceClient { - url: string; - fileSystem: string; - path: string; - version: string; - +export class DataLakeStorageClient extends DataLakeStorageClientContext { /** * Initializes a new instance of the DataLakeStorageClient class. * @param url The URL of the service account, container, or blob that is the target of the desired @@ -31,46 +26,7 @@ export class DataLakeStorageClient extends coreClient.ServiceClient { path: string, options?: DataLakeStorageClientOptionalParams ) { - if (url === undefined) { - throw new Error("'url' cannot be null"); - } - if (fileSystem === undefined) { - throw new Error("'fileSystem' cannot be null"); - } - if (path === undefined) { - throw new Error("'path' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: DataLakeStorageClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-datalakestorage/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{url}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.url = url; - this.fileSystem = fileSystem; - this.path = path; - - // Assigning values to Constant parameters - this.version = options.version || "2020-06-12"; + super(url, fileSystem, path, options); this.pathOperations = new PathOperationsImpl(this); } diff --git a/test/integration/generated/datalakestorage/src/dataLakeStorageClientContext.ts b/test/integration/generated/datalakestorage/src/dataLakeStorageClientContext.ts new file mode 100644 index 0000000000..14b4b5323f --- /dev/null +++ b/test/integration/generated/datalakestorage/src/dataLakeStorageClientContext.ts @@ -0,0 +1,73 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { DataLakeStorageClientOptionalParams } from "./models"; + +export class DataLakeStorageClientContext extends coreClient.ServiceClient { + url: string; + fileSystem: string; + path: string; + version: string; + + /** + * Initializes a new instance of the DataLakeStorageClientContext class. + * @param url The URL of the service account, container, or blob that is the target of the desired + * operation. + * @param fileSystem The filesystem identifier. + * @param path The file or directory path. + * @param options The parameter options + */ + constructor( + url: string, + fileSystem: string, + path: string, + options?: DataLakeStorageClientOptionalParams + ) { + if (url === undefined) { + throw new Error("'url' cannot be null"); + } + if (fileSystem === undefined) { + throw new Error("'fileSystem' cannot be null"); + } + if (path === undefined) { + throw new Error("'path' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: DataLakeStorageClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-datalakestorage/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{url}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.url = url; + this.fileSystem = fileSystem; + this.path = path; + + // Assigning values to Constant parameters + this.version = options.version || "2020-06-12"; + } +} diff --git a/test/integration/generated/datalakestorage/src/index.ts b/test/integration/generated/datalakestorage/src/index.ts index 86ed91eb8d..07caa4aea1 100644 --- a/test/integration/generated/datalakestorage/src/index.ts +++ b/test/integration/generated/datalakestorage/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { DataLakeStorageClient } from "./dataLakeStorageClient"; +export { DataLakeStorageClientContext } from "./dataLakeStorageClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/datalakestorage/src/operations/pathOperations.ts b/test/integration/generated/datalakestorage/src/operations/pathOperations.ts index 42ca61e490..828b96d1b3 100644 --- a/test/integration/generated/datalakestorage/src/operations/pathOperations.ts +++ b/test/integration/generated/datalakestorage/src/operations/pathOperations.ts @@ -11,7 +11,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataLakeStorageClient } from "../dataLakeStorageClient"; +import { DataLakeStorageClientContext } from "../dataLakeStorageClientContext"; import { PathCreateOptionalParams, PathCreateResponse, @@ -32,13 +32,13 @@ import { /** Class containing PathOperations operations. */ export class PathOperationsImpl implements PathOperations { - private readonly client: DataLakeStorageClient; + private readonly client: DataLakeStorageClientContext; /** * Initialize a new instance of the class PathOperations class. * @param client Reference to the service client */ - constructor(client: DataLakeStorageClient) { + constructor(client: DataLakeStorageClientContext) { this.client = client; } diff --git a/test/integration/generated/deviceprovisioningservice/package.json b/test/integration/generated/deviceprovisioningservice/package.json index ee28c2b8cb..8f9ad49eb5 100644 --- a/test/integration/generated/deviceprovisioningservice/package.json +++ b/test/integration/generated/deviceprovisioningservice/package.json @@ -28,8 +28,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClient.ts b/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClient.ts index 27323a9fd9..8cb7597144 100644 --- a/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClient.ts +++ b/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClient.ts @@ -1,4 +1,3 @@ -import * as coreClient from "@azure/core-client"; import { OperationsImpl, DpsCertificateImpl, @@ -9,13 +8,10 @@ import { DpsCertificate, IotDpsResource } from "./operationsInterfaces"; +import { DeviceProvisioningClientContext } from "./deviceProvisioningClientContext"; import { DeviceProvisioningClientOptionalParams } from "./models"; -export class DeviceProvisioningClient extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - +export class DeviceProvisioningClient extends DeviceProvisioningClientContext { /** * Initializes a new instance of the DeviceProvisioningClient class. * @param subscriptionId The subscription identifier. @@ -25,39 +21,7 @@ export class DeviceProvisioningClient extends coreClient.ServiceClient { subscriptionId: string, options?: DeviceProvisioningClientOptionalParams ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: DeviceProvisioningClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-deviceprovisioning/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "https://management.azure.com" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2020-03-01"; + super(subscriptionId, options); this.operations = new OperationsImpl(this); this.dpsCertificate = new DpsCertificateImpl(this); this.iotDpsResource = new IotDpsResourceImpl(this); diff --git a/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClientContext.ts b/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClientContext.ts new file mode 100644 index 0000000000..259062c40d --- /dev/null +++ b/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClientContext.ts @@ -0,0 +1,52 @@ +import * as coreClient from "@azure/core-client"; +import { DeviceProvisioningClientOptionalParams } from "./models"; + +export class DeviceProvisioningClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the DeviceProvisioningClientContext class. + * @param subscriptionId The subscription identifier. + * @param options The parameter options + */ + constructor( + subscriptionId: string, + options?: DeviceProvisioningClientOptionalParams + ) { + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: DeviceProvisioningClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-deviceprovisioning/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2020-03-01"; + } +} diff --git a/test/integration/generated/deviceprovisioningservice/src/index.ts b/test/integration/generated/deviceprovisioningservice/src/index.ts index f5f2b8298f..a929c661c4 100644 --- a/test/integration/generated/deviceprovisioningservice/src/index.ts +++ b/test/integration/generated/deviceprovisioningservice/src/index.ts @@ -1,4 +1,5 @@ /// export * from "./models"; export { DeviceProvisioningClient } from "./deviceProvisioningClient"; +export { DeviceProvisioningClientContext } from "./deviceProvisioningClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/deviceprovisioningservice/src/operations/dpsCertificate.ts b/test/integration/generated/deviceprovisioningservice/src/operations/dpsCertificate.ts index 7019560a01..ccc321a60f 100644 --- a/test/integration/generated/deviceprovisioningservice/src/operations/dpsCertificate.ts +++ b/test/integration/generated/deviceprovisioningservice/src/operations/dpsCertificate.ts @@ -2,7 +2,7 @@ import { DpsCertificate } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DeviceProvisioningClient } from "../deviceProvisioningClient"; +import { DeviceProvisioningClientContext } from "../deviceProvisioningClientContext"; import { DpsCertificateGetOptionalParams, DpsCertificateGetResponse, @@ -21,13 +21,13 @@ import { /** Class containing DpsCertificate operations. */ export class DpsCertificateImpl implements DpsCertificate { - private readonly client: DeviceProvisioningClient; + private readonly client: DeviceProvisioningClientContext; /** * Initialize a new instance of the class DpsCertificate class. * @param client Reference to the service client */ - constructor(client: DeviceProvisioningClient) { + constructor(client: DeviceProvisioningClientContext) { this.client = client; } diff --git a/test/integration/generated/deviceprovisioningservice/src/operations/iotDpsResource.ts b/test/integration/generated/deviceprovisioningservice/src/operations/iotDpsResource.ts index dd9eca6d7b..5d745e2596 100644 --- a/test/integration/generated/deviceprovisioningservice/src/operations/iotDpsResource.ts +++ b/test/integration/generated/deviceprovisioningservice/src/operations/iotDpsResource.ts @@ -3,7 +3,7 @@ import { IotDpsResource } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DeviceProvisioningClient } from "../deviceProvisioningClient"; +import { DeviceProvisioningClientContext } from "../deviceProvisioningClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -59,13 +59,13 @@ import { /// /** Class containing IotDpsResource operations. */ export class IotDpsResourceImpl implements IotDpsResource { - private readonly client: DeviceProvisioningClient; + private readonly client: DeviceProvisioningClientContext; /** * Initialize a new instance of the class IotDpsResource class. * @param client Reference to the service client */ - constructor(client: DeviceProvisioningClient) { + constructor(client: DeviceProvisioningClientContext) { this.client = client; } diff --git a/test/integration/generated/deviceprovisioningservice/src/operations/operations.ts b/test/integration/generated/deviceprovisioningservice/src/operations/operations.ts index ceaf55b582..72d0151c41 100644 --- a/test/integration/generated/deviceprovisioningservice/src/operations/operations.ts +++ b/test/integration/generated/deviceprovisioningservice/src/operations/operations.ts @@ -3,7 +3,7 @@ import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DeviceProvisioningClient } from "../deviceProvisioningClient"; +import { DeviceProvisioningClientContext } from "../deviceProvisioningClientContext"; import { Operation, OperationsListNextOptionalParams, @@ -15,13 +15,13 @@ import { /// /** Class containing Operations operations. */ export class OperationsImpl implements Operations { - private readonly client: DeviceProvisioningClient; + private readonly client: DeviceProvisioningClientContext; /** * Initialize a new instance of the class Operations class. * @param client Reference to the service client */ - constructor(client: DeviceProvisioningClient) { + constructor(client: DeviceProvisioningClientContext) { this.client = client; } diff --git a/test/integration/generated/domainservices/package.json b/test/integration/generated/domainservices/package.json index ba2d3839f4..81c6f15e69 100644 --- a/test/integration/generated/domainservices/package.json +++ b/test/integration/generated/domainservices/package.json @@ -28,8 +28,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/domainservices/src/domainServicesClient.ts b/test/integration/generated/domainservices/src/domainServicesClient.ts index 6985cb7ad8..eee04e0d3c 100644 --- a/test/integration/generated/domainservices/src/domainServicesClient.ts +++ b/test/integration/generated/domainservices/src/domainServicesClient.ts @@ -1,4 +1,3 @@ -import * as coreClient from "@azure/core-client"; import { DomainServiceOperationsImpl, DomainServicesImpl, @@ -11,13 +10,10 @@ import { OuContainerOperations, OuContainerOperationGrp } from "./operationsInterfaces"; +import { DomainServicesClientContext } from "./domainServicesClientContext"; import { DomainServicesClientOptionalParams } from "./models"; -export class DomainServicesClient extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - +export class DomainServicesClient extends DomainServicesClientContext { /** * Initializes a new instance of the DomainServicesClient class. * @param subscriptionId Gets subscription credentials which uniquely identify the Microsoft Azure @@ -28,39 +24,7 @@ export class DomainServicesClient extends coreClient.ServiceClient { subscriptionId: string, options?: DomainServicesClientOptionalParams ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: DomainServicesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-domainservices/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "https://management.azure.com" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-05-01"; + super(subscriptionId, options); this.domainServiceOperations = new DomainServiceOperationsImpl(this); this.domainServices = new DomainServicesImpl(this); this.ouContainerOperations = new OuContainerOperationsImpl(this); diff --git a/test/integration/generated/domainservices/src/domainServicesClientContext.ts b/test/integration/generated/domainservices/src/domainServicesClientContext.ts new file mode 100644 index 0000000000..daec055c22 --- /dev/null +++ b/test/integration/generated/domainservices/src/domainServicesClientContext.ts @@ -0,0 +1,53 @@ +import * as coreClient from "@azure/core-client"; +import { DomainServicesClientOptionalParams } from "./models"; + +export class DomainServicesClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the DomainServicesClientContext class. + * @param subscriptionId Gets subscription credentials which uniquely identify the Microsoft Azure + * subscription. The subscription ID forms part of the URI for every service call. + * @param options The parameter options + */ + constructor( + subscriptionId: string, + options?: DomainServicesClientOptionalParams + ) { + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: DomainServicesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-domainservices/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-05-01"; + } +} diff --git a/test/integration/generated/domainservices/src/index.ts b/test/integration/generated/domainservices/src/index.ts index e3344d212a..31102af5b9 100644 --- a/test/integration/generated/domainservices/src/index.ts +++ b/test/integration/generated/domainservices/src/index.ts @@ -1,4 +1,5 @@ /// export * from "./models"; export { DomainServicesClient } from "./domainServicesClient"; +export { DomainServicesClientContext } from "./domainServicesClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/domainservices/src/operations/domainServiceOperations.ts b/test/integration/generated/domainservices/src/operations/domainServiceOperations.ts index f25d89735d..52c5e39a65 100644 --- a/test/integration/generated/domainservices/src/operations/domainServiceOperations.ts +++ b/test/integration/generated/domainservices/src/operations/domainServiceOperations.ts @@ -3,7 +3,7 @@ import { DomainServiceOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DomainServicesClient } from "../domainServicesClient"; +import { DomainServicesClientContext } from "../domainServicesClientContext"; import { OperationEntity, DomainServiceOperationsListNextOptionalParams, @@ -15,13 +15,13 @@ import { /// /** Class containing DomainServiceOperations operations. */ export class DomainServiceOperationsImpl implements DomainServiceOperations { - private readonly client: DomainServicesClient; + private readonly client: DomainServicesClientContext; /** * Initialize a new instance of the class DomainServiceOperations class. * @param client Reference to the service client */ - constructor(client: DomainServicesClient) { + constructor(client: DomainServicesClientContext) { this.client = client; } diff --git a/test/integration/generated/domainservices/src/operations/domainServices.ts b/test/integration/generated/domainservices/src/operations/domainServices.ts index 79bd80bca7..c910962f9d 100644 --- a/test/integration/generated/domainservices/src/operations/domainServices.ts +++ b/test/integration/generated/domainservices/src/operations/domainServices.ts @@ -3,7 +3,7 @@ import { DomainServices } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DomainServicesClient } from "../domainServicesClient"; +import { DomainServicesClientContext } from "../domainServicesClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -28,13 +28,13 @@ import { /// /** Class containing DomainServices operations. */ export class DomainServicesImpl implements DomainServices { - private readonly client: DomainServicesClient; + private readonly client: DomainServicesClientContext; /** * Initialize a new instance of the class DomainServices class. * @param client Reference to the service client */ - constructor(client: DomainServicesClient) { + constructor(client: DomainServicesClientContext) { this.client = client; } diff --git a/test/integration/generated/domainservices/src/operations/ouContainerOperationGrp.ts b/test/integration/generated/domainservices/src/operations/ouContainerOperationGrp.ts index 68fcc1eda3..30bd2cbe4a 100644 --- a/test/integration/generated/domainservices/src/operations/ouContainerOperationGrp.ts +++ b/test/integration/generated/domainservices/src/operations/ouContainerOperationGrp.ts @@ -3,7 +3,7 @@ import { OuContainerOperationGrp } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DomainServicesClient } from "../domainServicesClient"; +import { DomainServicesClientContext } from "../domainServicesClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -25,13 +25,13 @@ import { /// /** Class containing OuContainerOperationGrp operations. */ export class OuContainerOperationGrpImpl implements OuContainerOperationGrp { - private readonly client: DomainServicesClient; + private readonly client: DomainServicesClientContext; /** * Initialize a new instance of the class OuContainerOperationGrp class. * @param client Reference to the service client */ - constructor(client: DomainServicesClient) { + constructor(client: DomainServicesClientContext) { this.client = client; } diff --git a/test/integration/generated/domainservices/src/operations/ouContainerOperations.ts b/test/integration/generated/domainservices/src/operations/ouContainerOperations.ts index 2d5f8e8c9e..19c20591c7 100644 --- a/test/integration/generated/domainservices/src/operations/ouContainerOperations.ts +++ b/test/integration/generated/domainservices/src/operations/ouContainerOperations.ts @@ -3,7 +3,7 @@ import { OuContainerOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DomainServicesClient } from "../domainServicesClient"; +import { DomainServicesClientContext } from "../domainServicesClientContext"; import { OperationEntity, OuContainerOperationsListNextOptionalParams, @@ -15,13 +15,13 @@ import { /// /** Class containing OuContainerOperations operations. */ export class OuContainerOperationsImpl implements OuContainerOperations { - private readonly client: DomainServicesClient; + private readonly client: DomainServicesClientContext; /** * Initialize a new instance of the class OuContainerOperations class. * @param client Reference to the service client */ - constructor(client: DomainServicesClient) { + constructor(client: DomainServicesClientContext) { this.client = client; } diff --git a/test/integration/generated/extensibleEnums/package.json b/test/integration/generated/extensibleEnums/package.json index 9e82c30418..0e8c5cf64d 100644 --- a/test/integration/generated/extensibleEnums/package.json +++ b/test/integration/generated/extensibleEnums/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/extensibleEnums/src/extensibleEnumsClient.ts b/test/integration/generated/extensibleEnums/src/extensibleEnumsClient.ts index 00ac9a1e71..e41c95b194 100644 --- a/test/integration/generated/extensibleEnums/src/extensibleEnumsClient.ts +++ b/test/integration/generated/extensibleEnums/src/extensibleEnumsClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { PetImpl } from "./operations"; import { Pet } from "./operationsInterfaces"; +import { ExtensibleEnumsClientContext } from "./extensibleEnumsClientContext"; import { ExtensibleEnumsClientOptionalParams } from "./models"; -export class ExtensibleEnumsClient extends coreClient.ServiceClient { - $host: string; - +export class ExtensibleEnumsClient extends ExtensibleEnumsClientContext { /** * Initializes a new instance of the ExtensibleEnumsClient class. * @param options The parameter options */ constructor(options?: ExtensibleEnumsClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ExtensibleEnumsClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-extensible-enums/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.pet = new PetImpl(this); } diff --git a/test/integration/generated/extensibleEnums/src/extensibleEnumsClientContext.ts b/test/integration/generated/extensibleEnums/src/extensibleEnumsClientContext.ts new file mode 100644 index 0000000000..ba54981e06 --- /dev/null +++ b/test/integration/generated/extensibleEnums/src/extensibleEnumsClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { ExtensibleEnumsClientOptionalParams } from "./models"; + +export class ExtensibleEnumsClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the ExtensibleEnumsClientContext class. + * @param options The parameter options + */ + constructor(options?: ExtensibleEnumsClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ExtensibleEnumsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-extensible-enums/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/extensibleEnums/src/index.ts b/test/integration/generated/extensibleEnums/src/index.ts index f83c5a384b..f2c01f11e9 100644 --- a/test/integration/generated/extensibleEnums/src/index.ts +++ b/test/integration/generated/extensibleEnums/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { ExtensibleEnumsClient } from "./extensibleEnumsClient"; +export { ExtensibleEnumsClientContext } from "./extensibleEnumsClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/extensibleEnums/src/operations/pet.ts b/test/integration/generated/extensibleEnums/src/operations/pet.ts index d7899adfe6..7532940efa 100644 --- a/test/integration/generated/extensibleEnums/src/operations/pet.ts +++ b/test/integration/generated/extensibleEnums/src/operations/pet.ts @@ -10,7 +10,7 @@ import { Pet } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ExtensibleEnumsClient } from "../extensibleEnumsClient"; +import { ExtensibleEnumsClientContext } from "../extensibleEnumsClientContext"; import { PetGetByPetIdOptionalParams, PetGetByPetIdResponse, @@ -20,13 +20,13 @@ import { /** Class containing Pet operations. */ export class PetImpl implements Pet { - private readonly client: ExtensibleEnumsClient; + private readonly client: ExtensibleEnumsClientContext; /** * Initialize a new instance of the class Pet class. * @param client Reference to the service client */ - constructor(client: ExtensibleEnumsClient) { + constructor(client: ExtensibleEnumsClientContext) { this.client = client; } diff --git a/test/integration/generated/header/package.json b/test/integration/generated/header/package.json index 088c06e90a..6da966a730 100644 --- a/test/integration/generated/header/package.json +++ b/test/integration/generated/header/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/header/src/headerClient.ts b/test/integration/generated/header/src/headerClient.ts index a7c9539531..4961d84ae6 100644 --- a/test/integration/generated/header/src/headerClient.ts +++ b/test/integration/generated/header/src/headerClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { HeaderImpl } from "./operations"; import { Header } from "./operationsInterfaces"; +import { HeaderClientContext } from "./headerClientContext"; import { HeaderClientOptionalParams } from "./models"; -export class HeaderClient extends coreClient.ServiceClient { - $host: string; - +export class HeaderClient extends HeaderClientContext { /** * Initializes a new instance of the HeaderClient class. * @param options The parameter options */ constructor(options?: HeaderClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: HeaderClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-header/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.header = new HeaderImpl(this); } diff --git a/test/integration/generated/header/src/headerClientContext.ts b/test/integration/generated/header/src/headerClientContext.ts new file mode 100644 index 0000000000..006744976e --- /dev/null +++ b/test/integration/generated/header/src/headerClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { HeaderClientOptionalParams } from "./models"; + +export class HeaderClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the HeaderClientContext class. + * @param options The parameter options + */ + constructor(options?: HeaderClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: HeaderClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-header/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/header/src/index.ts b/test/integration/generated/header/src/index.ts index 1b243561aa..c2de3665b6 100644 --- a/test/integration/generated/header/src/index.ts +++ b/test/integration/generated/header/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { HeaderClient } from "./headerClient"; +export { HeaderClientContext } from "./headerClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/header/src/operations/header.ts b/test/integration/generated/header/src/operations/header.ts index e2c1bc6f49..95c99291bd 100644 --- a/test/integration/generated/header/src/operations/header.ts +++ b/test/integration/generated/header/src/operations/header.ts @@ -10,7 +10,7 @@ import { Header } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HeaderClient } from "../headerClient"; +import { HeaderClientContext } from "../headerClientContext"; import { HeaderParamExistingKeyOptionalParams, HeaderResponseExistingKeyOptionalParams, @@ -59,13 +59,13 @@ import { /** Class containing Header operations. */ export class HeaderImpl implements Header { - private readonly client: HeaderClient; + private readonly client: HeaderClientContext; /** * Initialize a new instance of the class Header class. * @param client Reference to the service client */ - constructor(client: HeaderClient) { + constructor(client: HeaderClientContext) { this.client = client; } diff --git a/test/integration/generated/headerRest/package.json b/test/integration/generated/headerRest/package.json index 5178094b36..3f41cd67aa 100644 --- a/test/integration/generated/headerRest/package.json +++ b/test/integration/generated/headerRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "MIT", + "license": "ISC", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/headerRest/src/headerRestClient.ts b/test/integration/generated/headerRest/src/headerRestClient.ts index 5a4a468891..2fc94280da 100644 --- a/test/integration/generated/headerRest/src/headerRestClient.ts +++ b/test/integration/generated/headerRest/src/headerRestClient.ts @@ -378,7 +378,9 @@ export default function HeaderRestClient( ): HeaderRestClientRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - const client = getClient(baseUrl, options) as HeaderRestClientRestClient; + return getClient( + baseUrl, - return client; + options + ) as HeaderRestClientRestClient; } diff --git a/test/integration/generated/headerRest/tsconfig.json b/test/integration/generated/headerRest/tsconfig.json index 0202cc6570..965341beea 100644 --- a/test/integration/generated/headerRest/tsconfig.json +++ b/test/integration/generated/headerRest/tsconfig.json @@ -7,5 +7,13 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "include": ["src/**/*.ts"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } diff --git a/test/integration/generated/headerprefix/package.json b/test/integration/generated/headerprefix/package.json index 49a418981e..ce17373449 100644 --- a/test/integration/generated/headerprefix/package.json +++ b/test/integration/generated/headerprefix/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/headerprefix/src/headerPrefixClient.ts b/test/integration/generated/headerprefix/src/headerPrefixClient.ts index 7fbc8c420c..4ada0be49c 100644 --- a/test/integration/generated/headerprefix/src/headerPrefixClient.ts +++ b/test/integration/generated/headerprefix/src/headerPrefixClient.ts @@ -1,46 +1,16 @@ -import * as coreClient from "@azure/core-client"; import { QueueImpl } from "./operations"; import { Queue } from "./operationsInterfaces"; +import { HeaderPrefixClientContext } from "./headerPrefixClientContext"; import { HeaderPrefixClientOptionalParams } from "./models"; -export class HeaderPrefixClient extends coreClient.ServiceClient { - $host: string; - +export class HeaderPrefixClient extends HeaderPrefixClientContext { /** * Initializes a new instance of the HeaderPrefixClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: HeaderPrefixClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: HeaderPrefixClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-headerprefix/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; + super($host, options); this.queue = new QueueImpl(this); } diff --git a/test/integration/generated/headerprefix/src/headerPrefixClientContext.ts b/test/integration/generated/headerprefix/src/headerPrefixClientContext.ts new file mode 100644 index 0000000000..56475ed25c --- /dev/null +++ b/test/integration/generated/headerprefix/src/headerPrefixClientContext.ts @@ -0,0 +1,43 @@ +import * as coreClient from "@azure/core-client"; +import { HeaderPrefixClientOptionalParams } from "./models"; + +export class HeaderPrefixClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the HeaderPrefixClientContext class. + * @param $host server parameter + * @param options The parameter options + */ + constructor($host: string, options?: HeaderPrefixClientOptionalParams) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: HeaderPrefixClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-headerprefix/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + } +} diff --git a/test/integration/generated/headerprefix/src/index.ts b/test/integration/generated/headerprefix/src/index.ts index 73dc28c465..713356a81b 100644 --- a/test/integration/generated/headerprefix/src/index.ts +++ b/test/integration/generated/headerprefix/src/index.ts @@ -1,3 +1,4 @@ export * from "./models"; export { HeaderPrefixClient } from "./headerPrefixClient"; +export { HeaderPrefixClientContext } from "./headerPrefixClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/headerprefix/src/operations/queue.ts b/test/integration/generated/headerprefix/src/operations/queue.ts index 3e1b090d7b..7b628af63b 100644 --- a/test/integration/generated/headerprefix/src/operations/queue.ts +++ b/test/integration/generated/headerprefix/src/operations/queue.ts @@ -2,7 +2,7 @@ import { Queue } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HeaderPrefixClient } from "../headerPrefixClient"; +import { HeaderPrefixClientContext } from "../headerPrefixClientContext"; import { QueueGetPropertiesOptionalParams, QueueGetPropertiesResponse @@ -10,13 +10,13 @@ import { /** Class containing Queue operations. */ export class QueueImpl implements Queue { - private readonly client: HeaderPrefixClient; + private readonly client: HeaderPrefixClientContext; /** * Initialize a new instance of the class Queue class. * @param client Reference to the service client */ - constructor(client: HeaderPrefixClient) { + constructor(client: HeaderPrefixClientContext) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/package.json b/test/integration/generated/healthcareapis/package.json index c962f9a8a8..1f7652f176 100644 --- a/test/integration/generated/healthcareapis/package.json +++ b/test/integration/generated/healthcareapis/package.json @@ -28,8 +28,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/healthcareapis/src/healthCareApisClient.ts b/test/integration/generated/healthcareapis/src/healthCareApisClient.ts index 6dabc217b5..6bbd563001 100644 --- a/test/integration/generated/healthcareapis/src/healthCareApisClient.ts +++ b/test/integration/generated/healthcareapis/src/healthCareApisClient.ts @@ -1,4 +1,3 @@ -import * as coreClient from "@azure/core-client"; import { ServicesImpl, PrivateEndpointConnectionsImpl, @@ -25,13 +24,10 @@ import { Operations, OperationResults } from "./operationsInterfaces"; +import { HealthCareApisClientContext } from "./healthCareApisClientContext"; import { HealthCareApisClientOptionalParams } from "./models"; -export class HealthCareApisClient extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - +export class HealthCareApisClient extends HealthCareApisClientContext { /** * Initializes a new instance of the HealthCareApisClient class. * @param subscriptionId The subscription identifier. @@ -41,42 +37,7 @@ export class HealthCareApisClient extends coreClient.ServiceClient { subscriptionId: string, options?: HealthCareApisClientOptionalParams ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: HealthCareApisClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-healthcareapis/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - if (!options.credentialScopes) { - options.credentialScopes = ["https://management.azure.com/.default"]; - } - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "https://management.azure.com" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-06-01-preview"; + super(subscriptionId, options); this.services = new ServicesImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); diff --git a/test/integration/generated/healthcareapis/src/healthCareApisClientContext.ts b/test/integration/generated/healthcareapis/src/healthCareApisClientContext.ts new file mode 100644 index 0000000000..b5ebd85a40 --- /dev/null +++ b/test/integration/generated/healthcareapis/src/healthCareApisClientContext.ts @@ -0,0 +1,55 @@ +import * as coreClient from "@azure/core-client"; +import { HealthCareApisClientOptionalParams } from "./models"; + +export class HealthCareApisClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the HealthCareApisClientContext class. + * @param subscriptionId The subscription identifier. + * @param options The parameter options + */ + constructor( + subscriptionId: string, + options?: HealthCareApisClientOptionalParams + ) { + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: HealthCareApisClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-healthcareapis/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-06-01-preview"; + } +} diff --git a/test/integration/generated/healthcareapis/src/index.ts b/test/integration/generated/healthcareapis/src/index.ts index 687695883e..39a782e8b3 100644 --- a/test/integration/generated/healthcareapis/src/index.ts +++ b/test/integration/generated/healthcareapis/src/index.ts @@ -1,4 +1,5 @@ /// export * from "./models"; export { HealthCareApisClient } from "./healthCareApisClient"; +export { HealthCareApisClientContext } from "./healthCareApisClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/healthcareapis/src/operations/dicomServices.ts b/test/integration/generated/healthcareapis/src/operations/dicomServices.ts index 44458f3f2a..a30ca4a0ec 100644 --- a/test/integration/generated/healthcareapis/src/operations/dicomServices.ts +++ b/test/integration/generated/healthcareapis/src/operations/dicomServices.ts @@ -3,7 +3,7 @@ import { DicomServices } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClient } from "../healthCareApisClient"; +import { HealthCareApisClientContext } from "../healthCareApisClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -25,13 +25,13 @@ import { /// /** Class containing DicomServices operations. */ export class DicomServicesImpl implements DicomServices { - private readonly client: HealthCareApisClient; + private readonly client: HealthCareApisClientContext; /** * Initialize a new instance of the class DicomServices class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClient) { + constructor(client: HealthCareApisClientContext) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/fhirDestinations.ts b/test/integration/generated/healthcareapis/src/operations/fhirDestinations.ts index b475905401..d8b8a06c10 100644 --- a/test/integration/generated/healthcareapis/src/operations/fhirDestinations.ts +++ b/test/integration/generated/healthcareapis/src/operations/fhirDestinations.ts @@ -3,7 +3,7 @@ import { FhirDestinations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClient } from "../healthCareApisClient"; +import { HealthCareApisClientContext } from "../healthCareApisClientContext"; import { IotFhirDestination, FhirDestinationsListByIotConnectorNextOptionalParams, @@ -15,13 +15,13 @@ import { /// /** Class containing FhirDestinations operations. */ export class FhirDestinationsImpl implements FhirDestinations { - private readonly client: HealthCareApisClient; + private readonly client: HealthCareApisClientContext; /** * Initialize a new instance of the class FhirDestinations class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClient) { + constructor(client: HealthCareApisClientContext) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/fhirServices.ts b/test/integration/generated/healthcareapis/src/operations/fhirServices.ts index 4e821f0a5d..a333394424 100644 --- a/test/integration/generated/healthcareapis/src/operations/fhirServices.ts +++ b/test/integration/generated/healthcareapis/src/operations/fhirServices.ts @@ -3,7 +3,7 @@ import { FhirServices } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClient } from "../healthCareApisClient"; +import { HealthCareApisClientContext } from "../healthCareApisClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -25,13 +25,13 @@ import { /// /** Class containing FhirServices operations. */ export class FhirServicesImpl implements FhirServices { - private readonly client: HealthCareApisClient; + private readonly client: HealthCareApisClientContext; /** * Initialize a new instance of the class FhirServices class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClient) { + constructor(client: HealthCareApisClientContext) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/iotConnectorFhirDestination.ts b/test/integration/generated/healthcareapis/src/operations/iotConnectorFhirDestination.ts index 437a6fdfc2..9f21f417b6 100644 --- a/test/integration/generated/healthcareapis/src/operations/iotConnectorFhirDestination.ts +++ b/test/integration/generated/healthcareapis/src/operations/iotConnectorFhirDestination.ts @@ -2,7 +2,7 @@ import { IotConnectorFhirDestination } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClient } from "../healthCareApisClient"; +import { HealthCareApisClientContext } from "../healthCareApisClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -17,13 +17,13 @@ import { /** Class containing IotConnectorFhirDestination operations. */ export class IotConnectorFhirDestinationImpl implements IotConnectorFhirDestination { - private readonly client: HealthCareApisClient; + private readonly client: HealthCareApisClientContext; /** * Initialize a new instance of the class IotConnectorFhirDestination class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClient) { + constructor(client: HealthCareApisClientContext) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/iotConnectors.ts b/test/integration/generated/healthcareapis/src/operations/iotConnectors.ts index 47a34b60e3..140021b2fe 100644 --- a/test/integration/generated/healthcareapis/src/operations/iotConnectors.ts +++ b/test/integration/generated/healthcareapis/src/operations/iotConnectors.ts @@ -3,7 +3,7 @@ import { IotConnectors } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClient } from "../healthCareApisClient"; +import { HealthCareApisClientContext } from "../healthCareApisClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -25,13 +25,13 @@ import { /// /** Class containing IotConnectors operations. */ export class IotConnectorsImpl implements IotConnectors { - private readonly client: HealthCareApisClient; + private readonly client: HealthCareApisClientContext; /** * Initialize a new instance of the class IotConnectors class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClient) { + constructor(client: HealthCareApisClientContext) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/operationResults.ts b/test/integration/generated/healthcareapis/src/operations/operationResults.ts index b8d56faba1..07eece35f8 100644 --- a/test/integration/generated/healthcareapis/src/operations/operationResults.ts +++ b/test/integration/generated/healthcareapis/src/operations/operationResults.ts @@ -2,7 +2,7 @@ import { OperationResults } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClient } from "../healthCareApisClient"; +import { HealthCareApisClientContext } from "../healthCareApisClientContext"; import { OperationResultsGetOptionalParams, OperationResultsGetResponse @@ -10,13 +10,13 @@ import { /** Class containing OperationResults operations. */ export class OperationResultsImpl implements OperationResults { - private readonly client: HealthCareApisClient; + private readonly client: HealthCareApisClientContext; /** * Initialize a new instance of the class OperationResults class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClient) { + constructor(client: HealthCareApisClientContext) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/operations.ts b/test/integration/generated/healthcareapis/src/operations/operations.ts index 480af1aa3c..b15f4b69da 100644 --- a/test/integration/generated/healthcareapis/src/operations/operations.ts +++ b/test/integration/generated/healthcareapis/src/operations/operations.ts @@ -3,7 +3,7 @@ import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClient } from "../healthCareApisClient"; +import { HealthCareApisClientContext } from "../healthCareApisClientContext"; import { OperationDetail, OperationsListNextOptionalParams, @@ -15,13 +15,13 @@ import { /// /** Class containing Operations operations. */ export class OperationsImpl implements Operations { - private readonly client: HealthCareApisClient; + private readonly client: HealthCareApisClientContext; /** * Initialize a new instance of the class Operations class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClient) { + constructor(client: HealthCareApisClientContext) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/privateEndpointConnections.ts b/test/integration/generated/healthcareapis/src/operations/privateEndpointConnections.ts index 6eab9933ef..e23dad8d5c 100644 --- a/test/integration/generated/healthcareapis/src/operations/privateEndpointConnections.ts +++ b/test/integration/generated/healthcareapis/src/operations/privateEndpointConnections.ts @@ -3,7 +3,7 @@ import { PrivateEndpointConnections } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClient } from "../healthCareApisClient"; +import { HealthCareApisClientContext } from "../healthCareApisClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -22,13 +22,13 @@ import { /** Class containing PrivateEndpointConnections operations. */ export class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { - private readonly client: HealthCareApisClient; + private readonly client: HealthCareApisClientContext; /** * Initialize a new instance of the class PrivateEndpointConnections class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClient) { + constructor(client: HealthCareApisClientContext) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/privateLinkResources.ts b/test/integration/generated/healthcareapis/src/operations/privateLinkResources.ts index 5e1e584dce..f1cf4dc882 100644 --- a/test/integration/generated/healthcareapis/src/operations/privateLinkResources.ts +++ b/test/integration/generated/healthcareapis/src/operations/privateLinkResources.ts @@ -2,7 +2,7 @@ import { PrivateLinkResources } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClient } from "../healthCareApisClient"; +import { HealthCareApisClientContext } from "../healthCareApisClientContext"; import { PrivateLinkResourcesListByServiceOptionalParams, PrivateLinkResourcesListByServiceResponse, @@ -12,13 +12,13 @@ import { /** Class containing PrivateLinkResources operations. */ export class PrivateLinkResourcesImpl implements PrivateLinkResources { - private readonly client: HealthCareApisClient; + private readonly client: HealthCareApisClientContext; /** * Initialize a new instance of the class PrivateLinkResources class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClient) { + constructor(client: HealthCareApisClientContext) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/services.ts b/test/integration/generated/healthcareapis/src/operations/services.ts index e35932fd9b..fcdbe389b4 100644 --- a/test/integration/generated/healthcareapis/src/operations/services.ts +++ b/test/integration/generated/healthcareapis/src/operations/services.ts @@ -3,7 +3,7 @@ import { Services } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClient } from "../healthCareApisClient"; +import { HealthCareApisClientContext } from "../healthCareApisClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -32,13 +32,13 @@ import { /// /** Class containing Services operations. */ export class ServicesImpl implements Services { - private readonly client: HealthCareApisClient; + private readonly client: HealthCareApisClientContext; /** * Initialize a new instance of the class Services class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClient) { + constructor(client: HealthCareApisClientContext) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/workspaces.ts b/test/integration/generated/healthcareapis/src/operations/workspaces.ts index 7ebfa6c2e9..b76ab962c7 100644 --- a/test/integration/generated/healthcareapis/src/operations/workspaces.ts +++ b/test/integration/generated/healthcareapis/src/operations/workspaces.ts @@ -3,7 +3,7 @@ import { Workspaces } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClient } from "../healthCareApisClient"; +import { HealthCareApisClientContext } from "../healthCareApisClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -29,13 +29,13 @@ import { /// /** Class containing Workspaces operations. */ export class WorkspacesImpl implements Workspaces { - private readonly client: HealthCareApisClient; + private readonly client: HealthCareApisClientContext; /** * Initialize a new instance of the class Workspaces class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClient) { + constructor(client: HealthCareApisClientContext) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/package.json b/test/integration/generated/httpInfrastructure/package.json index 130d4bed7a..5a79cf3bd8 100644 --- a/test/integration/generated/httpInfrastructure/package.json +++ b/test/integration/generated/httpInfrastructure/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/httpInfrastructure/src/httpInfrastructureClient.ts b/test/integration/generated/httpInfrastructure/src/httpInfrastructureClient.ts index a87b6480cd..e5660a8ed5 100644 --- a/test/integration/generated/httpInfrastructure/src/httpInfrastructureClient.ts +++ b/test/integration/generated/httpInfrastructure/src/httpInfrastructureClient.ts @@ -6,7 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { HttpFailureImpl, HttpSuccessImpl, @@ -25,42 +24,16 @@ import { HttpRetry, MultipleResponses } from "./operationsInterfaces"; +import { HttpInfrastructureClientContext } from "./httpInfrastructureClientContext"; import { HttpInfrastructureClientOptionalParams } from "./models"; -export class HttpInfrastructureClient extends coreClient.ServiceClient { - $host: string; - +export class HttpInfrastructureClient extends HttpInfrastructureClientContext { /** * Initializes a new instance of the HttpInfrastructureClient class. * @param options The parameter options */ constructor(options?: HttpInfrastructureClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: HttpInfrastructureClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-httpInfrastructure/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.httpFailure = new HttpFailureImpl(this); this.httpSuccess = new HttpSuccessImpl(this); this.httpRedirects = new HttpRedirectsImpl(this); diff --git a/test/integration/generated/httpInfrastructure/src/httpInfrastructureClientContext.ts b/test/integration/generated/httpInfrastructure/src/httpInfrastructureClientContext.ts new file mode 100644 index 0000000000..21f5b6d0fe --- /dev/null +++ b/test/integration/generated/httpInfrastructure/src/httpInfrastructureClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { HttpInfrastructureClientOptionalParams } from "./models"; + +export class HttpInfrastructureClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the HttpInfrastructureClientContext class. + * @param options The parameter options + */ + constructor(options?: HttpInfrastructureClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: HttpInfrastructureClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-httpInfrastructure/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/httpInfrastructure/src/index.ts b/test/integration/generated/httpInfrastructure/src/index.ts index 425fda045e..d263c8afe4 100644 --- a/test/integration/generated/httpInfrastructure/src/index.ts +++ b/test/integration/generated/httpInfrastructure/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { HttpInfrastructureClient } from "./httpInfrastructureClient"; +export { HttpInfrastructureClientContext } from "./httpInfrastructureClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/httpInfrastructure/src/operations/httpClientFailure.ts b/test/integration/generated/httpInfrastructure/src/operations/httpClientFailure.ts index ce69c9b68c..5d04c7ebf4 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/httpClientFailure.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/httpClientFailure.ts @@ -10,7 +10,7 @@ import { HttpClientFailure } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClient } from "../httpInfrastructureClient"; +import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; import { HttpClientFailureHead400OptionalParams, HttpClientFailureGet400OptionalParams, @@ -42,13 +42,13 @@ import { /** Class containing HttpClientFailure operations. */ export class HttpClientFailureImpl implements HttpClientFailure { - private readonly client: HttpInfrastructureClient; + private readonly client: HttpInfrastructureClientContext; /** * Initialize a new instance of the class HttpClientFailure class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClient) { + constructor(client: HttpInfrastructureClientContext) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/src/operations/httpFailure.ts b/test/integration/generated/httpInfrastructure/src/operations/httpFailure.ts index fd7a75519d..98e85a9db9 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/httpFailure.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/httpFailure.ts @@ -10,7 +10,7 @@ import { HttpFailure } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClient } from "../httpInfrastructureClient"; +import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; import { HttpFailureGetEmptyErrorOptionalParams, HttpFailureGetEmptyErrorResponse, @@ -22,13 +22,13 @@ import { /** Class containing HttpFailure operations. */ export class HttpFailureImpl implements HttpFailure { - private readonly client: HttpInfrastructureClient; + private readonly client: HttpInfrastructureClientContext; /** * Initialize a new instance of the class HttpFailure class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClient) { + constructor(client: HttpInfrastructureClientContext) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/src/operations/httpRedirects.ts b/test/integration/generated/httpInfrastructure/src/operations/httpRedirects.ts index 662281317f..ac8d3b7200 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/httpRedirects.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/httpRedirects.ts @@ -10,7 +10,7 @@ import { HttpRedirects } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClient } from "../httpInfrastructureClient"; +import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; import { HttpRedirectsHead300OptionalParams, HttpRedirectsHead300Response, @@ -48,13 +48,13 @@ import { /** Class containing HttpRedirects operations. */ export class HttpRedirectsImpl implements HttpRedirects { - private readonly client: HttpInfrastructureClient; + private readonly client: HttpInfrastructureClientContext; /** * Initialize a new instance of the class HttpRedirects class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClient) { + constructor(client: HttpInfrastructureClientContext) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/src/operations/httpRetry.ts b/test/integration/generated/httpInfrastructure/src/operations/httpRetry.ts index 1d263597bb..1a848cbb4d 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/httpRetry.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/httpRetry.ts @@ -10,7 +10,7 @@ import { HttpRetry } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClient } from "../httpInfrastructureClient"; +import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; import { HttpRetryHead408OptionalParams, HttpRetryPut500OptionalParams, @@ -26,13 +26,13 @@ import { /** Class containing HttpRetry operations. */ export class HttpRetryImpl implements HttpRetry { - private readonly client: HttpInfrastructureClient; + private readonly client: HttpInfrastructureClientContext; /** * Initialize a new instance of the class HttpRetry class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClient) { + constructor(client: HttpInfrastructureClientContext) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/src/operations/httpServerFailure.ts b/test/integration/generated/httpInfrastructure/src/operations/httpServerFailure.ts index aa1b7a3360..3d9df38a76 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/httpServerFailure.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/httpServerFailure.ts @@ -10,7 +10,7 @@ import { HttpServerFailure } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClient } from "../httpInfrastructureClient"; +import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; import { HttpServerFailureHead501OptionalParams, HttpServerFailureGet501OptionalParams, @@ -20,13 +20,13 @@ import { /** Class containing HttpServerFailure operations. */ export class HttpServerFailureImpl implements HttpServerFailure { - private readonly client: HttpInfrastructureClient; + private readonly client: HttpInfrastructureClientContext; /** * Initialize a new instance of the class HttpServerFailure class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClient) { + constructor(client: HttpInfrastructureClientContext) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/src/operations/httpSuccess.ts b/test/integration/generated/httpInfrastructure/src/operations/httpSuccess.ts index 79d424fb19..be40a73b1a 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/httpSuccess.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/httpSuccess.ts @@ -10,7 +10,7 @@ import { HttpSuccess } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClient } from "../httpInfrastructureClient"; +import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; import { HttpSuccessHead200OptionalParams, HttpSuccessGet200OptionalParams, @@ -37,13 +37,13 @@ import { /** Class containing HttpSuccess operations. */ export class HttpSuccessImpl implements HttpSuccess { - private readonly client: HttpInfrastructureClient; + private readonly client: HttpInfrastructureClientContext; /** * Initialize a new instance of the class HttpSuccess class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClient) { + constructor(client: HttpInfrastructureClientContext) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/src/operations/multipleResponses.ts b/test/integration/generated/httpInfrastructure/src/operations/multipleResponses.ts index 19ff583cb8..226a4d9767 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/multipleResponses.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/multipleResponses.ts @@ -10,7 +10,7 @@ import { MultipleResponses } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClient } from "../httpInfrastructureClient"; +import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; import { MultipleResponsesGet200Model204NoModelDefaultError200ValidOptionalParams, MultipleResponsesGet200Model204NoModelDefaultError200ValidResponse, @@ -71,13 +71,13 @@ import { /** Class containing MultipleResponses operations. */ export class MultipleResponsesImpl implements MultipleResponses { - private readonly client: HttpInfrastructureClient; + private readonly client: HttpInfrastructureClientContext; /** * Initialize a new instance of the class MultipleResponses class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClient) { + constructor(client: HttpInfrastructureClientContext) { this.client = client; } diff --git a/test/integration/generated/iotspaces/package.json b/test/integration/generated/iotspaces/package.json index cb4d211f34..ed59983279 100644 --- a/test/integration/generated/iotspaces/package.json +++ b/test/integration/generated/iotspaces/package.json @@ -26,8 +26,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/iotspaces/src/index.ts b/test/integration/generated/iotspaces/src/index.ts index 32c8a83adc..a02f095e88 100644 --- a/test/integration/generated/iotspaces/src/index.ts +++ b/test/integration/generated/iotspaces/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { IoTSpacesClient } from "./ioTSpacesClient"; +export { IoTSpacesClientContext } from "./ioTSpacesClientContext"; diff --git a/test/integration/generated/iotspaces/src/ioTSpacesClient.ts b/test/integration/generated/iotspaces/src/ioTSpacesClient.ts index 3d0decd5d8..22d92e7a5c 100644 --- a/test/integration/generated/iotspaces/src/ioTSpacesClient.ts +++ b/test/integration/generated/iotspaces/src/ioTSpacesClient.ts @@ -6,11 +6,11 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import * as coreAuth from "@azure/core-auth"; +import { IoTSpacesClientContext } from "./ioTSpacesClientContext"; import { IoTSpacesClientOptionalParams } from "./models"; -export class IoTSpacesClient extends coreClient.ServiceClient { +export class IoTSpacesClient extends IoTSpacesClientContext { /** * Initializes a new instance of the IoTSpacesClient class. * @param credentials Subscription credentials which uniquely identify client subscription. @@ -20,33 +20,6 @@ export class IoTSpacesClient extends coreClient.ServiceClient { credentials: coreAuth.TokenCredential, options?: IoTSpacesClientOptionalParams ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: IoTSpacesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials - }; - - const packageDetails = `azsdk-js-iotspaces/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint - }; - super(optionsWithDefaults); + super(credentials, options); } } diff --git a/test/integration/generated/iotspaces/src/ioTSpacesClientContext.ts b/test/integration/generated/iotspaces/src/ioTSpacesClientContext.ts new file mode 100644 index 0000000000..228bdb6c0c --- /dev/null +++ b/test/integration/generated/iotspaces/src/ioTSpacesClientContext.ts @@ -0,0 +1,52 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { IoTSpacesClientOptionalParams } from "./models"; + +export class IoTSpacesClientContext extends coreClient.ServiceClient { + /** + * Initializes a new instance of the IoTSpacesClientContext class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + options?: IoTSpacesClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: IoTSpacesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-iotspaces/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint + }; + super(optionsWithDefaults); + } +} diff --git a/test/integration/generated/licenseHeader/package.json b/test/integration/generated/licenseHeader/package.json index 477a603c11..8f787ab82d 100644 --- a/test/integration/generated/licenseHeader/package.json +++ b/test/integration/generated/licenseHeader/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/licenseHeader/src/index.ts b/test/integration/generated/licenseHeader/src/index.ts index 181cd20786..e6fa479580 100644 --- a/test/integration/generated/licenseHeader/src/index.ts +++ b/test/integration/generated/licenseHeader/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { LicenseHeaderClient } from "./licenseHeaderClient"; +export { LicenseHeaderClientContext } from "./licenseHeaderClientContext"; diff --git a/test/integration/generated/licenseHeader/src/licenseHeaderClient.ts b/test/integration/generated/licenseHeader/src/licenseHeaderClient.ts index e208ae03cf..ebb4afd0f7 100644 --- a/test/integration/generated/licenseHeader/src/licenseHeaderClient.ts +++ b/test/integration/generated/licenseHeader/src/licenseHeaderClient.ts @@ -8,17 +8,15 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; +import { LicenseHeaderClientContext } from "./licenseHeaderClientContext"; import { - Enum0, LicenseHeaderClientOptionalParams, + Enum0, ApiV1ValueGetOptionalParams, ApiV1ValueGetResponse } from "./models"; -export class LicenseHeaderClient extends coreClient.ServiceClient { - $host: string; - apiVersion: Enum0; - +export class LicenseHeaderClient extends LicenseHeaderClientContext { /** * Initializes a new instance of the LicenseHeaderClient class. * @param $host server parameter @@ -30,39 +28,7 @@ export class LicenseHeaderClient extends coreClient.ServiceClient { apiVersion: Enum0, options?: LicenseHeaderClientOptionalParams ) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: LicenseHeaderClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-license-header/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - this.apiVersion = apiVersion; + super($host, apiVersion, options); } /** @param options The options parameters. */ diff --git a/test/integration/generated/licenseHeader/src/licenseHeaderClientContext.ts b/test/integration/generated/licenseHeader/src/licenseHeaderClientContext.ts new file mode 100644 index 0000000000..120d30bba8 --- /dev/null +++ b/test/integration/generated/licenseHeader/src/licenseHeaderClientContext.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { Enum0, LicenseHeaderClientOptionalParams } from "./models"; + +export class LicenseHeaderClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: Enum0; + + /** + * Initializes a new instance of the LicenseHeaderClientContext class. + * @param $host server parameter + * @param apiVersion + * @param options The parameter options + */ + constructor( + $host: string, + apiVersion: Enum0, + options?: LicenseHeaderClientOptionalParams + ) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: LicenseHeaderClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-license-header/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + this.apiVersion = apiVersion; + } +} diff --git a/test/integration/generated/lro/package.json b/test/integration/generated/lro/package.json index b5de598e86..ae8effe779 100644 --- a/test/integration/generated/lro/package.json +++ b/test/integration/generated/lro/package.json @@ -27,8 +27,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/lro/src/index.ts b/test/integration/generated/lro/src/index.ts index b90ec9ab9c..158aab4da2 100644 --- a/test/integration/generated/lro/src/index.ts +++ b/test/integration/generated/lro/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { LROClient } from "./lROClient"; +export { LROClientContext } from "./lROClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/lro/src/lROClient.ts b/test/integration/generated/lro/src/lROClient.ts index 48543e5e78..c1bad98f69 100644 --- a/test/integration/generated/lro/src/lROClient.ts +++ b/test/integration/generated/lro/src/lROClient.ts @@ -6,7 +6,6 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { LROsImpl, LRORetrysImpl, @@ -19,42 +18,16 @@ import { LrosaDs, LROsCustomHeader } from "./operationsInterfaces"; +import { LROClientContext } from "./lROClientContext"; import { LROClientOptionalParams } from "./models"; -export class LROClient extends coreClient.ServiceClient { - $host: string; - +export class LROClient extends LROClientContext { /** * Initializes a new instance of the LROClient class. * @param options The parameter options */ constructor(options?: LROClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: LROClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-lro/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.lROs = new LROsImpl(this); this.lRORetrys = new LRORetrysImpl(this); this.lrosaDs = new LrosaDsImpl(this); diff --git a/test/integration/generated/lro/src/lROClientContext.ts b/test/integration/generated/lro/src/lROClientContext.ts new file mode 100644 index 0000000000..b4b1d5007e --- /dev/null +++ b/test/integration/generated/lro/src/lROClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { LROClientOptionalParams } from "./models"; + +export class LROClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the LROClientContext class. + * @param options The parameter options + */ + constructor(options?: LROClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: LROClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-lro/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/lro/src/operations/lRORetrys.ts b/test/integration/generated/lro/src/operations/lRORetrys.ts index 7d3c3716af..b98e91bbe8 100644 --- a/test/integration/generated/lro/src/operations/lRORetrys.ts +++ b/test/integration/generated/lro/src/operations/lRORetrys.ts @@ -10,7 +10,7 @@ import { LRORetrys } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { LROClient } from "../lROClient"; +import { LROClientContext } from "../lROClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -32,13 +32,13 @@ import { /** Class containing LRORetrys operations. */ export class LRORetrysImpl implements LRORetrys { - private readonly client: LROClient; + private readonly client: LROClientContext; /** * Initialize a new instance of the class LRORetrys class. * @param client Reference to the service client */ - constructor(client: LROClient) { + constructor(client: LROClientContext) { this.client = client; } diff --git a/test/integration/generated/lro/src/operations/lROs.ts b/test/integration/generated/lro/src/operations/lROs.ts index ab935beb22..8c9c676ec0 100644 --- a/test/integration/generated/lro/src/operations/lROs.ts +++ b/test/integration/generated/lro/src/operations/lROs.ts @@ -10,7 +10,7 @@ import { LROs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { LROClient } from "../lROClient"; +import { LROClientContext } from "../lROClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -101,13 +101,13 @@ import { /** Class containing LROs operations. */ export class LROsImpl implements LROs { - private readonly client: LROClient; + private readonly client: LROClientContext; /** * Initialize a new instance of the class LROs class. * @param client Reference to the service client */ - constructor(client: LROClient) { + constructor(client: LROClientContext) { this.client = client; } diff --git a/test/integration/generated/lro/src/operations/lROsCustomHeader.ts b/test/integration/generated/lro/src/operations/lROsCustomHeader.ts index 0a6b7391f0..6b026fb006 100644 --- a/test/integration/generated/lro/src/operations/lROsCustomHeader.ts +++ b/test/integration/generated/lro/src/operations/lROsCustomHeader.ts @@ -10,7 +10,7 @@ import { LROsCustomHeader } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { LROClient } from "../lROClient"; +import { LROClientContext } from "../lROClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -26,13 +26,13 @@ import { /** Class containing LROsCustomHeader operations. */ export class LROsCustomHeaderImpl implements LROsCustomHeader { - private readonly client: LROClient; + private readonly client: LROClientContext; /** * Initialize a new instance of the class LROsCustomHeader class. * @param client Reference to the service client */ - constructor(client: LROClient) { + constructor(client: LROClientContext) { this.client = client; } diff --git a/test/integration/generated/lro/src/operations/lrosaDs.ts b/test/integration/generated/lro/src/operations/lrosaDs.ts index 394c629652..5d9b60a84a 100644 --- a/test/integration/generated/lro/src/operations/lrosaDs.ts +++ b/test/integration/generated/lro/src/operations/lrosaDs.ts @@ -10,7 +10,7 @@ import { LrosaDs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { LROClient } from "../lROClient"; +import { LROClientContext } from "../lROClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -69,13 +69,13 @@ import { /** Class containing LrosaDs operations. */ export class LrosaDsImpl implements LrosaDs { - private readonly client: LROClient; + private readonly client: LROClientContext; /** * Initialize a new instance of the class LrosaDs class. * @param client Reference to the service client */ - constructor(client: LROClient) { + constructor(client: LROClientContext) { this.client = client; } diff --git a/test/integration/generated/lroParametrizedEndpoints/package.json b/test/integration/generated/lroParametrizedEndpoints/package.json index 2ceb813fcd..8389a7a47b 100644 --- a/test/integration/generated/lroParametrizedEndpoints/package.json +++ b/test/integration/generated/lroParametrizedEndpoints/package.json @@ -27,8 +27,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/lroParametrizedEndpoints/src/index.ts b/test/integration/generated/lroParametrizedEndpoints/src/index.ts index 8d88f7023f..1364a5cdbc 100644 --- a/test/integration/generated/lroParametrizedEndpoints/src/index.ts +++ b/test/integration/generated/lroParametrizedEndpoints/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { LroParametrizedEndpointsClient } from "./lroParametrizedEndpointsClient"; +export { LroParametrizedEndpointsClientContext } from "./lroParametrizedEndpointsClientContext"; diff --git a/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClient.ts b/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClient.ts index dfc7cd8c8c..6a545aafe3 100644 --- a/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClient.ts +++ b/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClient.ts @@ -11,6 +11,7 @@ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "./lroImpl"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { LroParametrizedEndpointsClientContext } from "./lroParametrizedEndpointsClientContext"; import { LroParametrizedEndpointsClientOptionalParams, PollWithParameterizedEndpointsOptionalParams, @@ -19,40 +20,13 @@ import { PollWithConstantParameterizedEndpointsResponse } from "./models"; -export class LroParametrizedEndpointsClient extends coreClient.ServiceClient { - host: string; - +export class LroParametrizedEndpointsClient extends LroParametrizedEndpointsClientContext { /** * Initializes a new instance of the LroParametrizedEndpointsClient class. * @param options The parameter options */ constructor(options?: LroParametrizedEndpointsClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: LroParametrizedEndpointsClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-lro-parameterized-endpoints/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://{accountName}{host}" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.host = options.host || "host"; + super(options); } /** diff --git a/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClientContext.ts b/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClientContext.ts new file mode 100644 index 0000000000..e5d0bca840 --- /dev/null +++ b/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { LroParametrizedEndpointsClientOptionalParams } from "./models"; + +export class LroParametrizedEndpointsClientContext extends coreClient.ServiceClient { + host: string; + + /** + * Initializes a new instance of the LroParametrizedEndpointsClientContext class. + * @param options The parameter options + */ + constructor(options?: LroParametrizedEndpointsClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: LroParametrizedEndpointsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-lro-parameterized-endpoints/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://{accountName}{host}" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.host = options.host || "host"; + } +} diff --git a/test/integration/generated/lroRest/package.json b/test/integration/generated/lroRest/package.json index 71ddd92753..5d8ab871ad 100644 --- a/test/integration/generated/lroRest/package.json +++ b/test/integration/generated/lroRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "MIT", + "license": "ISC", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/lroRest/src/lRORestClient.ts b/test/integration/generated/lroRest/src/lRORestClient.ts index 2a01564480..0b6645a364 100644 --- a/test/integration/generated/lroRest/src/lRORestClient.ts +++ b/test/integration/generated/lroRest/src/lRORestClient.ts @@ -1301,7 +1301,9 @@ export default function LRORestClient( ): LRORestClientRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - const client = getClient(baseUrl, options) as LRORestClientRestClient; + return getClient( + baseUrl, - return client; + options + ) as LRORestClientRestClient; } diff --git a/test/integration/generated/lroRest/tsconfig.json b/test/integration/generated/lroRest/tsconfig.json index 0202cc6570..965341beea 100644 --- a/test/integration/generated/lroRest/tsconfig.json +++ b/test/integration/generated/lroRest/tsconfig.json @@ -7,5 +7,13 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "include": ["src/**/*.ts"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } diff --git a/test/integration/generated/mapperrequired/package.json b/test/integration/generated/mapperrequired/package.json index af97f63073..2a4afc896d 100644 --- a/test/integration/generated/mapperrequired/package.json +++ b/test/integration/generated/mapperrequired/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/mapperrequired/src/index.ts b/test/integration/generated/mapperrequired/src/index.ts index 49ec4e4a76..567b97f0e0 100644 --- a/test/integration/generated/mapperrequired/src/index.ts +++ b/test/integration/generated/mapperrequired/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { MapperRequiredClient } from "./mapperRequiredClient"; +export { MapperRequiredClientContext } from "./mapperRequiredClientContext"; diff --git a/test/integration/generated/mapperrequired/src/mapperRequiredClient.ts b/test/integration/generated/mapperrequired/src/mapperRequiredClient.ts index 2b6abd4fdf..a08f77ca5c 100644 --- a/test/integration/generated/mapperrequired/src/mapperRequiredClient.ts +++ b/test/integration/generated/mapperrequired/src/mapperRequiredClient.ts @@ -9,50 +9,21 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { MapperRequiredClientContext } from "./mapperRequiredClientContext"; import { MapperRequiredClientOptionalParams, UpdateCertificateIssuerOptionalParams, UpdateCertificateIssuerResponse } from "./models"; -export class MapperRequiredClient extends coreClient.ServiceClient { - $host: string; - +export class MapperRequiredClient extends MapperRequiredClientContext { /** * Initializes a new instance of the MapperRequiredClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: MapperRequiredClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MapperRequiredClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-mapperrequired/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; + super($host, options); } /** diff --git a/test/integration/generated/mapperrequired/src/mapperRequiredClientContext.ts b/test/integration/generated/mapperrequired/src/mapperRequiredClientContext.ts new file mode 100644 index 0000000000..7b3618abd6 --- /dev/null +++ b/test/integration/generated/mapperrequired/src/mapperRequiredClientContext.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { MapperRequiredClientOptionalParams } from "./models"; + +export class MapperRequiredClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the MapperRequiredClientContext class. + * @param $host server parameter + * @param options The parameter options + */ + constructor($host: string, options?: MapperRequiredClientOptionalParams) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MapperRequiredClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-mapperrequired/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + } +} diff --git a/test/integration/generated/mediaTypes/package.json b/test/integration/generated/mediaTypes/package.json index ec200d1d38..4d11b2e16c 100644 --- a/test/integration/generated/mediaTypes/package.json +++ b/test/integration/generated/mediaTypes/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/mediaTypes/src/index.ts b/test/integration/generated/mediaTypes/src/index.ts index 6e27ba5431..8814cc1429 100644 --- a/test/integration/generated/mediaTypes/src/index.ts +++ b/test/integration/generated/mediaTypes/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { MediaTypesClient } from "./mediaTypesClient"; +export { MediaTypesClientContext } from "./mediaTypesClientContext"; diff --git a/test/integration/generated/mediaTypes/src/mediaTypesClient.ts b/test/integration/generated/mediaTypes/src/mediaTypesClient.ts index a52d54aa51..492a758f6a 100644 --- a/test/integration/generated/mediaTypes/src/mediaTypesClient.ts +++ b/test/integration/generated/mediaTypes/src/mediaTypesClient.ts @@ -10,6 +10,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { MediaTypesClientContext } from "./mediaTypesClientContext"; import { MediaTypesClientOptionalParams, ContentType, @@ -31,40 +32,13 @@ import { PutTextAndJsonBodyResponse } from "./models"; -export class MediaTypesClient extends coreClient.ServiceClient { - $host: string; - +export class MediaTypesClient extends MediaTypesClientContext { /** * Initializes a new instance of the MediaTypesClient class. * @param options The parameter options */ constructor(options?: MediaTypesClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MediaTypesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-media-types-service/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); } /** diff --git a/test/integration/generated/mediaTypes/src/mediaTypesClientContext.ts b/test/integration/generated/mediaTypes/src/mediaTypesClientContext.ts new file mode 100644 index 0000000000..29a994dde4 --- /dev/null +++ b/test/integration/generated/mediaTypes/src/mediaTypesClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { MediaTypesClientOptionalParams } from "./models"; + +export class MediaTypesClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the MediaTypesClientContext class. + * @param options The parameter options + */ + constructor(options?: MediaTypesClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MediaTypesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-media-types-service/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/mediaTypesRest/package.json b/test/integration/generated/mediaTypesRest/package.json index 19ff93e415..837cf9c5a1 100644 --- a/test/integration/generated/mediaTypesRest/package.json +++ b/test/integration/generated/mediaTypesRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "MIT", + "license": "ISC", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/mediaTypesRest/src/mediaTypes.ts b/test/integration/generated/mediaTypesRest/src/mediaTypes.ts index 86472c0e8e..c32db9821a 100644 --- a/test/integration/generated/mediaTypesRest/src/mediaTypes.ts +++ b/test/integration/generated/mediaTypesRest/src/mediaTypes.ts @@ -107,7 +107,9 @@ export default function MediaTypes( ): MediaTypesRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - const client = getClient(baseUrl, options) as MediaTypesRestClient; + return getClient( + baseUrl, - return client; + options + ) as MediaTypesRestClient; } diff --git a/test/integration/generated/mediaTypesRest/src/parameters.ts b/test/integration/generated/mediaTypesRest/src/parameters.ts index 5c04ff74ec..f26e12e2ff 100644 --- a/test/integration/generated/mediaTypesRest/src/parameters.ts +++ b/test/integration/generated/mediaTypesRest/src/parameters.ts @@ -10,7 +10,7 @@ export interface AnalyzeBodyBodyParam { * * Value may contain any sequence of octets */ - body?: string | Uint8Array; + body?: string; } export interface AnalyzeBodyMediaTypesParam { @@ -45,7 +45,7 @@ export interface AnalyzeBodyNoAcceptHeaderBodyParam { * * Value may contain any sequence of octets */ - body?: string | Uint8Array; + body?: string; } export interface AnalyzeBodyNoAcceptHeaderMediaTypesParam { @@ -94,7 +94,7 @@ export interface BinaryBodyWithTwoContentTypesBodyParam { * * Value may contain any sequence of octets */ - body: string | Uint8Array; + body: string; } export interface BinaryBodyWithTwoContentTypesMediaTypesParam { @@ -112,7 +112,7 @@ export interface BinaryBodyWithThreeContentTypesBodyParam { * * Value may contain any sequence of octets */ - body: string | Uint8Array; + body: string; } export interface BinaryBodyWithThreeContentTypesMediaTypesParam { diff --git a/test/integration/generated/mediaTypesRest/tsconfig.json b/test/integration/generated/mediaTypesRest/tsconfig.json index 0202cc6570..965341beea 100644 --- a/test/integration/generated/mediaTypesRest/tsconfig.json +++ b/test/integration/generated/mediaTypesRest/tsconfig.json @@ -7,5 +7,13 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "include": ["src/**/*.ts"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } diff --git a/test/integration/generated/mediaTypesV3/package.json b/test/integration/generated/mediaTypesV3/package.json index aa375de8c4..131e272fb7 100644 --- a/test/integration/generated/mediaTypesV3/package.json +++ b/test/integration/generated/mediaTypesV3/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/mediaTypesV3/src/index.ts b/test/integration/generated/mediaTypesV3/src/index.ts index d93916e81f..34dfb083a9 100644 --- a/test/integration/generated/mediaTypesV3/src/index.ts +++ b/test/integration/generated/mediaTypesV3/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { MediaTypesV3Client } from "./mediaTypesV3Client"; +export { MediaTypesV3ClientContext } from "./mediaTypesV3ClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/mediaTypesV3/src/mediaTypesV3Client.ts b/test/integration/generated/mediaTypesV3/src/mediaTypesV3Client.ts index adcb1d7ff4..14b10f9dfc 100644 --- a/test/integration/generated/mediaTypesV3/src/mediaTypesV3Client.ts +++ b/test/integration/generated/mediaTypesV3/src/mediaTypesV3Client.ts @@ -6,49 +6,19 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { BarApiImpl, FooApiImpl } from "./operations"; import { BarApi, FooApi } from "./operationsInterfaces"; +import { MediaTypesV3ClientContext } from "./mediaTypesV3ClientContext"; import { MediaTypesV3ClientOptionalParams } from "./models"; -export class MediaTypesV3Client extends coreClient.ServiceClient { - $host: string; - +export class MediaTypesV3Client extends MediaTypesV3ClientContext { /** * Initializes a new instance of the MediaTypesV3Client class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: MediaTypesV3ClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MediaTypesV3ClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-media-types-v3-client/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; + super($host, options); this.barApi = new BarApiImpl(this); this.fooApi = new FooApiImpl(this); } diff --git a/test/integration/generated/mediaTypesV3/src/mediaTypesV3ClientContext.ts b/test/integration/generated/mediaTypesV3/src/mediaTypesV3ClientContext.ts new file mode 100644 index 0000000000..2a2519d0e7 --- /dev/null +++ b/test/integration/generated/mediaTypesV3/src/mediaTypesV3ClientContext.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { MediaTypesV3ClientOptionalParams } from "./models"; + +export class MediaTypesV3ClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the MediaTypesV3ClientContext class. + * @param $host server parameter + * @param options The parameter options + */ + constructor($host: string, options?: MediaTypesV3ClientOptionalParams) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MediaTypesV3ClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-media-types-v3-client/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + } +} diff --git a/test/integration/generated/mediaTypesV3/src/operations/barApi.ts b/test/integration/generated/mediaTypesV3/src/operations/barApi.ts index 1bcf240425..e88f4ba716 100644 --- a/test/integration/generated/mediaTypesV3/src/operations/barApi.ts +++ b/test/integration/generated/mediaTypesV3/src/operations/barApi.ts @@ -9,7 +9,7 @@ import { BarApi } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Parameters from "../models/parameters"; -import { MediaTypesV3Client } from "../mediaTypesV3Client"; +import { MediaTypesV3ClientContext } from "../mediaTypesV3ClientContext"; import { BarApiPostSendOnDefaultOptionalParams, BarApiPostSendOnDefaultResponse @@ -17,13 +17,13 @@ import { /** Class containing BarApi operations. */ export class BarApiImpl implements BarApi { - private readonly client: MediaTypesV3Client; + private readonly client: MediaTypesV3ClientContext; /** * Initialize a new instance of the class BarApi class. * @param client Reference to the service client */ - constructor(client: MediaTypesV3Client) { + constructor(client: MediaTypesV3ClientContext) { this.client = client; } diff --git a/test/integration/generated/mediaTypesV3/src/operations/fooApi.ts b/test/integration/generated/mediaTypesV3/src/operations/fooApi.ts index 6e8bb47061..0d531f461b 100644 --- a/test/integration/generated/mediaTypesV3/src/operations/fooApi.ts +++ b/test/integration/generated/mediaTypesV3/src/operations/fooApi.ts @@ -10,7 +10,7 @@ import { FooApi } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Parameters from "../models/parameters"; -import { MediaTypesV3Client } from "../mediaTypesV3Client"; +import { MediaTypesV3ClientContext } from "../mediaTypesV3ClientContext"; import { FooApiPostSendOnDefault$binaryOptionalParams, FooApiPostSendOnDefault$textOptionalParams, @@ -22,13 +22,13 @@ import { /** Class containing FooApi operations. */ export class FooApiImpl implements FooApi { - private readonly client: MediaTypesV3Client; + private readonly client: MediaTypesV3ClientContext; /** * Initialize a new instance of the class FooApi class. * @param client Reference to the service client */ - constructor(client: MediaTypesV3Client) { + constructor(client: MediaTypesV3ClientContext) { this.client = client; } diff --git a/test/integration/generated/mediaTypesV3Lro/package.json b/test/integration/generated/mediaTypesV3Lro/package.json index b23901ee7d..61d35f193c 100644 --- a/test/integration/generated/mediaTypesV3Lro/package.json +++ b/test/integration/generated/mediaTypesV3Lro/package.json @@ -27,8 +27,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/mediaTypesV3Lro/src/index.ts b/test/integration/generated/mediaTypesV3Lro/src/index.ts index 16606678d0..bd0f0c747d 100644 --- a/test/integration/generated/mediaTypesV3Lro/src/index.ts +++ b/test/integration/generated/mediaTypesV3Lro/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { MediaTypesV3LROClient } from "./mediaTypesV3LROClient"; +export { MediaTypesV3LROClientContext } from "./mediaTypesV3LROClientContext"; diff --git a/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClient.ts b/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClient.ts index 06c4a83f6d..c5ab88bbb7 100644 --- a/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClient.ts +++ b/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClient.ts @@ -11,6 +11,7 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "./lroImpl"; import * as Parameters from "./models/parameters"; +import { MediaTypesV3LROClientContext } from "./mediaTypesV3LROClientContext"; import { MediaTypesV3LROClientOptionalParams, SendOnDefault$binaryOptionalParams, @@ -20,44 +21,14 @@ import { SendResponse } from "./models"; -export class MediaTypesV3LROClient extends coreClient.ServiceClient { - $host: string; - +export class MediaTypesV3LROClient extends MediaTypesV3LROClientContext { /** * Initializes a new instance of the MediaTypesV3LROClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: MediaTypesV3LROClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MediaTypesV3LROClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-media-types-v3-lro-client/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; + super($host, options); } private getOperationOptions( diff --git a/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClientContext.ts b/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClientContext.ts new file mode 100644 index 0000000000..26c813ce39 --- /dev/null +++ b/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClientContext.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { MediaTypesV3LROClientOptionalParams } from "./models"; + +export class MediaTypesV3LROClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the MediaTypesV3LROClientContext class. + * @param $host server parameter + * @param options The parameter options + */ + constructor($host: string, options?: MediaTypesV3LROClientOptionalParams) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MediaTypesV3LROClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-media-types-v3-lro-client/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + } +} diff --git a/test/integration/generated/mediaTypesWithTracing/package.json b/test/integration/generated/mediaTypesWithTracing/package.json index eaa9e49bdf..fef09bb6d6 100644 --- a/test/integration/generated/mediaTypesWithTracing/package.json +++ b/test/integration/generated/mediaTypesWithTracing/package.json @@ -27,8 +27,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/mediaTypesWithTracing/src/index.ts b/test/integration/generated/mediaTypesWithTracing/src/index.ts index dca21c93a8..1df8b594c3 100644 --- a/test/integration/generated/mediaTypesWithTracing/src/index.ts +++ b/test/integration/generated/mediaTypesWithTracing/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { MediaTypesWithTracingClient } from "./mediaTypesWithTracingClient"; +export { MediaTypesWithTracingClientContext } from "./mediaTypesWithTracingClientContext"; diff --git a/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClient.ts b/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClient.ts index 045fc47278..767c489841 100644 --- a/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClient.ts +++ b/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClient.ts @@ -12,6 +12,7 @@ import * as coreTracing from "@azure/core-tracing"; import { createSpan } from "./tracing"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { MediaTypesWithTracingClientContext } from "./mediaTypesWithTracingClientContext"; import { MediaTypesWithTracingClientOptionalParams, ContentType, @@ -33,40 +34,13 @@ import { PutTextAndJsonBodyResponse } from "./models"; -export class MediaTypesWithTracingClient extends coreClient.ServiceClient { - $host: string; - +export class MediaTypesWithTracingClient extends MediaTypesWithTracingClientContext { /** * Initializes a new instance of the MediaTypesWithTracingClient class. * @param options The parameter options */ constructor(options?: MediaTypesWithTracingClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MediaTypesWithTracingClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-media-types-service-tracing/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); } /** diff --git a/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClientContext.ts b/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClientContext.ts new file mode 100644 index 0000000000..a013a9c5a9 --- /dev/null +++ b/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { MediaTypesWithTracingClientOptionalParams } from "./models"; + +export class MediaTypesWithTracingClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the MediaTypesWithTracingClientContext class. + * @param options The parameter options + */ + constructor(options?: MediaTypesWithTracingClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MediaTypesWithTracingClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-media-types-service-tracing/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/modelFlattening/package.json b/test/integration/generated/modelFlattening/package.json index e2c457f6e2..480e7bca5a 100644 --- a/test/integration/generated/modelFlattening/package.json +++ b/test/integration/generated/modelFlattening/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/modelFlattening/src/index.ts b/test/integration/generated/modelFlattening/src/index.ts index edadd18e75..37ce269cb3 100644 --- a/test/integration/generated/modelFlattening/src/index.ts +++ b/test/integration/generated/modelFlattening/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { ModelFlatteningClient } from "./modelFlatteningClient"; +export { ModelFlatteningClientContext } from "./modelFlatteningClientContext"; diff --git a/test/integration/generated/modelFlattening/src/modelFlatteningClient.ts b/test/integration/generated/modelFlattening/src/modelFlatteningClient.ts index f8f527e1d9..89f8d1ba94 100644 --- a/test/integration/generated/modelFlattening/src/modelFlatteningClient.ts +++ b/test/integration/generated/modelFlattening/src/modelFlatteningClient.ts @@ -9,6 +9,7 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { ModelFlatteningClientContext } from "./modelFlatteningClientContext"; import { ModelFlatteningClientOptionalParams, PutArrayOptionalParams, @@ -32,40 +33,13 @@ import { PutSimpleProductWithGroupingResponse } from "./models"; -export class ModelFlatteningClient extends coreClient.ServiceClient { - $host: string; - +export class ModelFlatteningClient extends ModelFlatteningClientContext { /** * Initializes a new instance of the ModelFlatteningClient class. * @param options The parameter options */ constructor(options?: ModelFlatteningClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ModelFlatteningClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-model-flattening/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); } /** diff --git a/test/integration/generated/modelFlattening/src/modelFlatteningClientContext.ts b/test/integration/generated/modelFlattening/src/modelFlatteningClientContext.ts new file mode 100644 index 0000000000..043c8e4976 --- /dev/null +++ b/test/integration/generated/modelFlattening/src/modelFlatteningClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { ModelFlatteningClientOptionalParams } from "./models"; + +export class ModelFlatteningClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the ModelFlatteningClientContext class. + * @param options The parameter options + */ + constructor(options?: ModelFlatteningClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ModelFlatteningClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-model-flattening/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/multipleInheritance/package.json b/test/integration/generated/multipleInheritance/package.json index abf4713536..19cd7ab3de 100644 --- a/test/integration/generated/multipleInheritance/package.json +++ b/test/integration/generated/multipleInheritance/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/multipleInheritance/src/index.ts b/test/integration/generated/multipleInheritance/src/index.ts index d25e612f20..1a4473857e 100644 --- a/test/integration/generated/multipleInheritance/src/index.ts +++ b/test/integration/generated/multipleInheritance/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { MultipleInheritanceClient } from "./multipleInheritanceClient"; +export { MultipleInheritanceClientContext } from "./multipleInheritanceClientContext"; diff --git a/test/integration/generated/multipleInheritance/src/multipleInheritanceClient.ts b/test/integration/generated/multipleInheritance/src/multipleInheritanceClient.ts index 9f18111f35..b88ff6e361 100644 --- a/test/integration/generated/multipleInheritance/src/multipleInheritanceClient.ts +++ b/test/integration/generated/multipleInheritance/src/multipleInheritanceClient.ts @@ -9,6 +9,7 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { MultipleInheritanceClientContext } from "./multipleInheritanceClientContext"; import { MultipleInheritanceClientOptionalParams, GetHorseOptionalParams, @@ -38,40 +39,13 @@ import { PutKittenResponse } from "./models"; -export class MultipleInheritanceClient extends coreClient.ServiceClient { - $host: string; - +export class MultipleInheritanceClient extends MultipleInheritanceClientContext { /** * Initializes a new instance of the MultipleInheritanceClient class. * @param options The parameter options */ constructor(options?: MultipleInheritanceClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MultipleInheritanceClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-multiple-inheritance/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); } /** diff --git a/test/integration/generated/multipleInheritance/src/multipleInheritanceClientContext.ts b/test/integration/generated/multipleInheritance/src/multipleInheritanceClientContext.ts new file mode 100644 index 0000000000..78772db342 --- /dev/null +++ b/test/integration/generated/multipleInheritance/src/multipleInheritanceClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { MultipleInheritanceClientOptionalParams } from "./models"; + +export class MultipleInheritanceClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the MultipleInheritanceClientContext class. + * @param options The parameter options + */ + constructor(options?: MultipleInheritanceClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MultipleInheritanceClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-multiple-inheritance/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/multipleInheritanceRest/package.json b/test/integration/generated/multipleInheritanceRest/package.json index 769c5a004d..f559332816 100644 --- a/test/integration/generated/multipleInheritanceRest/package.json +++ b/test/integration/generated/multipleInheritanceRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "MIT", + "license": "ISC", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/multipleInheritanceRest/src/multipleInheritanceRestClient.ts b/test/integration/generated/multipleInheritanceRest/src/multipleInheritanceRestClient.ts index b9815dce40..5b3cb7f55e 100644 --- a/test/integration/generated/multipleInheritanceRest/src/multipleInheritanceRestClient.ts +++ b/test/integration/generated/multipleInheritanceRest/src/multipleInheritanceRestClient.ts @@ -33,40 +33,6 @@ import { import { getClient, ClientOptions, Client } from "@azure-rest/core-client"; import "@azure/core-auth"; -/** Contains operations for Client operations */ -export interface ClientOperations { - /** Get a horse with name 'Fred' and isAShowHorse true */ - getHorse( - options?: GetHorseParameters - ): Promise; - /** Put a horse with name 'General' and isAShowHorse false */ - putHorse(options: PutHorseParameters): Promise; - /** Get a pet with name 'Peanut' */ - getPet( - options?: GetPetParameters - ): Promise; - /** Put a pet with name 'Butter' */ - putPet(options: PutPetParameters): Promise; - /** Get a feline where meows and hisses are true */ - getFeline( - options?: GetFelineParameters - ): Promise; - /** Put a feline who hisses and doesn't meow */ - putFeline(options: PutFelineParameters): Promise; - /** Get a cat with name 'Whiskers' where likesMilk, meows, and hisses is true */ - getCat( - options?: GetCatParameters - ): Promise; - /** Put a cat with name 'Boots' where likesMilk and hisses is false, meows is true */ - putCat(options: PutCatParameters): Promise; - /** Get a kitten with name 'Gatito' where likesMilk and meows is true, and hisses and eatsMiceYet is false */ - getKitten( - options?: GetKittenParameters - ): Promise; - /** Put a kitten with name 'Kitty' where likesMilk and hisses is false, meows and eatsMiceYet is true */ - putKitten(options: PutKittenParameters): Promise; -} - export interface GetHorse { /** Get a horse with name 'Fred' and isAShowHorse true */ get( @@ -127,51 +93,16 @@ export interface Routes { export type MultipleInheritanceRestClientRestClient = Client & { path: Routes; -} & ClientOperations; +}; export default function MultipleInheritanceRestClient( options: ClientOptions = {} ): MultipleInheritanceRestClientRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - const client = getClient( + return getClient( baseUrl, + options ) as MultipleInheritanceRestClientRestClient; - - return { - ...client, - ...{ - getHorse: (options) => { - return client.path("/multipleInheritance/horse").get(options); - }, - putHorse: (options) => { - return client.path("/multipleInheritance/horse").put(options); - }, - getPet: (options) => { - return client.path("/multipleInheritance/pet").get(options); - }, - putPet: (options) => { - return client.path("/multipleInheritance/pet").put(options); - }, - getFeline: (options) => { - return client.path("/multipleInheritance/feline").get(options); - }, - putFeline: (options) => { - return client.path("/multipleInheritance/feline").put(options); - }, - getCat: (options) => { - return client.path("/multipleInheritance/cat").get(options); - }, - putCat: (options) => { - return client.path("/multipleInheritance/cat").put(options); - }, - getKitten: (options) => { - return client.path("/multipleInheritance/kitten").get(options); - }, - putKitten: (options) => { - return client.path("/multipleInheritance/kitten").put(options); - } - } - }; } diff --git a/test/integration/generated/multipleInheritanceRest/tsconfig.json b/test/integration/generated/multipleInheritanceRest/tsconfig.json index 0202cc6570..965341beea 100644 --- a/test/integration/generated/multipleInheritanceRest/tsconfig.json +++ b/test/integration/generated/multipleInheritanceRest/tsconfig.json @@ -7,5 +7,13 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "include": ["src/**/*.ts"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } diff --git a/test/integration/generated/nameChecker/package.json b/test/integration/generated/nameChecker/package.json index a3cd03e43c..6ad202a6b4 100644 --- a/test/integration/generated/nameChecker/package.json +++ b/test/integration/generated/nameChecker/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/nameChecker/src/index.ts b/test/integration/generated/nameChecker/src/index.ts index 82a0344909..88596163ee 100644 --- a/test/integration/generated/nameChecker/src/index.ts +++ b/test/integration/generated/nameChecker/src/index.ts @@ -1,3 +1,4 @@ export * from "./models"; export { SearchClient } from "./searchClient"; +export { SearchClientContext } from "./searchClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/nameChecker/src/operations/documents.ts b/test/integration/generated/nameChecker/src/operations/documents.ts index 5e3f90db77..a34fe08a3d 100644 --- a/test/integration/generated/nameChecker/src/operations/documents.ts +++ b/test/integration/generated/nameChecker/src/operations/documents.ts @@ -2,7 +2,7 @@ import { Documents } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SearchClient } from "../searchClient"; +import { SearchClientContext } from "../searchClientContext"; import { DocumentsCountOptionalParams, DocumentsCountResponse, @@ -30,13 +30,13 @@ import { /** Class containing Documents operations. */ export class DocumentsImpl implements Documents { - private readonly client: SearchClient; + private readonly client: SearchClientContext; /** * Initialize a new instance of the class Documents class. * @param client Reference to the service client */ - constructor(client: SearchClient) { + constructor(client: SearchClientContext) { this.client = client; } diff --git a/test/integration/generated/nameChecker/src/searchClient.ts b/test/integration/generated/nameChecker/src/searchClient.ts index a8c93d207d..0b1257ba2a 100644 --- a/test/integration/generated/nameChecker/src/searchClient.ts +++ b/test/integration/generated/nameChecker/src/searchClient.ts @@ -1,13 +1,9 @@ -import * as coreClient from "@azure/core-client"; import { DocumentsImpl } from "./operations"; import { Documents } from "./operationsInterfaces"; +import { SearchClientContext } from "./searchClientContext"; import { SearchClientOptionalParams } from "./models"; -export class SearchClient extends coreClient.ServiceClient { - endpoint: string; - indexName: string; - apiVersion: string; - +export class SearchClient extends SearchClientContext { /** * Initializes a new instance of the SearchClient class. * @param endpoint The endpoint URL of the search service. @@ -19,42 +15,7 @@ export class SearchClient extends coreClient.ServiceClient { indexName: string, options?: SearchClientOptionalParams ) { - if (endpoint === undefined) { - throw new Error("'endpoint' cannot be null"); - } - if (indexName === undefined) { - throw new Error("'indexName' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: SearchClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-search-documents/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{endpoint}/indexes('{indexName}')" - }; - super(optionsWithDefaults); - // Parameter assignments - this.endpoint = endpoint; - this.indexName = indexName; - - // Assigning values to Constant parameters - this.apiVersion = options.apiVersion || "2020-06-30-Preview"; + super(endpoint, indexName, options); this.documents = new DocumentsImpl(this); } diff --git a/test/integration/generated/nameChecker/src/searchClientContext.ts b/test/integration/generated/nameChecker/src/searchClientContext.ts new file mode 100644 index 0000000000..9ff3e9dcd0 --- /dev/null +++ b/test/integration/generated/nameChecker/src/searchClientContext.ts @@ -0,0 +1,57 @@ +import * as coreClient from "@azure/core-client"; +import { SearchClientOptionalParams } from "./models"; + +export class SearchClientContext extends coreClient.ServiceClient { + endpoint: string; + indexName: string; + apiVersion: string; + + /** + * Initializes a new instance of the SearchClientContext class. + * @param endpoint The endpoint URL of the search service. + * @param indexName The name of the index. + * @param options The parameter options + */ + constructor( + endpoint: string, + indexName: string, + options?: SearchClientOptionalParams + ) { + if (endpoint === undefined) { + throw new Error("'endpoint' cannot be null"); + } + if (indexName === undefined) { + throw new Error("'indexName' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: SearchClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-search-documents/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{endpoint}/indexes('{indexName}')" + }; + super(optionsWithDefaults); + // Parameter assignments + this.endpoint = endpoint; + this.indexName = indexName; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "2020-06-30-Preview"; + } +} diff --git a/test/integration/generated/noLicenseHeader/package.json b/test/integration/generated/noLicenseHeader/package.json index 6c911e6303..e0757e7b19 100644 --- a/test/integration/generated/noLicenseHeader/package.json +++ b/test/integration/generated/noLicenseHeader/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/noLicenseHeader/src/index.ts b/test/integration/generated/noLicenseHeader/src/index.ts index 41f25081f6..e2d9203d25 100644 --- a/test/integration/generated/noLicenseHeader/src/index.ts +++ b/test/integration/generated/noLicenseHeader/src/index.ts @@ -1,2 +1,3 @@ export * from "./models"; export { NoLicenseHeaderClient } from "./noLicenseHeaderClient"; +export { NoLicenseHeaderClientContext } from "./noLicenseHeaderClientContext"; diff --git a/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClient.ts b/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClient.ts index 3cd83ebea9..2843c5a913 100644 --- a/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClient.ts +++ b/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClient.ts @@ -1,16 +1,14 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; +import { NoLicenseHeaderClientContext } from "./noLicenseHeaderClientContext"; import { - Enum0, NoLicenseHeaderClientOptionalParams, + Enum0, ApiV1ValueGetOptionalParams, ApiV1ValueGetResponse } from "./models"; -export class NoLicenseHeaderClient extends coreClient.ServiceClient { - $host: string; - apiVersion: Enum0; - +export class NoLicenseHeaderClient extends NoLicenseHeaderClientContext { /** * Initializes a new instance of the NoLicenseHeaderClient class. * @param $host server parameter @@ -22,39 +20,7 @@ export class NoLicenseHeaderClient extends coreClient.ServiceClient { apiVersion: Enum0, options?: NoLicenseHeaderClientOptionalParams ) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: NoLicenseHeaderClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-nolicense-header/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - this.apiVersion = apiVersion; + super($host, apiVersion, options); } /** @param options The options parameters. */ diff --git a/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClientContext.ts b/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClientContext.ts new file mode 100644 index 0000000000..9123c2b6bc --- /dev/null +++ b/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClientContext.ts @@ -0,0 +1,53 @@ +import * as coreClient from "@azure/core-client"; +import { Enum0, NoLicenseHeaderClientOptionalParams } from "./models"; + +export class NoLicenseHeaderClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: Enum0; + + /** + * Initializes a new instance of the NoLicenseHeaderClientContext class. + * @param $host server parameter + * @param apiVersion + * @param options The parameter options + */ + constructor( + $host: string, + apiVersion: Enum0, + options?: NoLicenseHeaderClientOptionalParams + ) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: NoLicenseHeaderClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-nolicense-header/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + this.apiVersion = apiVersion; + } +} diff --git a/test/integration/generated/noMappers/package.json b/test/integration/generated/noMappers/package.json index a7ecea13ba..af0ace528e 100644 --- a/test/integration/generated/noMappers/package.json +++ b/test/integration/generated/noMappers/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/noMappers/src/index.ts b/test/integration/generated/noMappers/src/index.ts index 64fa69b4e7..4992eb40c4 100644 --- a/test/integration/generated/noMappers/src/index.ts +++ b/test/integration/generated/noMappers/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { NoMappersClient } from "./noMappersClient"; +export { NoMappersClientContext } from "./noMappersClientContext"; diff --git a/test/integration/generated/noMappers/src/noMappersClient.ts b/test/integration/generated/noMappers/src/noMappersClient.ts index e0c05c25be..3d91f6d9a2 100644 --- a/test/integration/generated/noMappers/src/noMappersClient.ts +++ b/test/integration/generated/noMappers/src/noMappersClient.ts @@ -8,17 +8,15 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; +import { NoMappersClientContext } from "./noMappersClientContext"; import { - Enum0, NoMappersClientOptionalParams, + Enum0, ApiV1ValueGetOptionalParams, ApiV1ValueGetResponse } from "./models"; -export class NoMappersClient extends coreClient.ServiceClient { - $host: string; - apiVersion: Enum0; - +export class NoMappersClient extends NoMappersClientContext { /** * Initializes a new instance of the NoMappersClient class. * @param $host server parameter @@ -30,39 +28,7 @@ export class NoMappersClient extends coreClient.ServiceClient { apiVersion: Enum0, options?: NoMappersClientOptionalParams ) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: NoMappersClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-no-mappers/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - this.apiVersion = apiVersion; + super($host, apiVersion, options); } /** @param options The options parameters. */ diff --git a/test/integration/generated/noMappers/src/noMappersClientContext.ts b/test/integration/generated/noMappers/src/noMappersClientContext.ts new file mode 100644 index 0000000000..82ba65f777 --- /dev/null +++ b/test/integration/generated/noMappers/src/noMappersClientContext.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { Enum0, NoMappersClientOptionalParams } from "./models"; + +export class NoMappersClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: Enum0; + + /** + * Initializes a new instance of the NoMappersClientContext class. + * @param $host server parameter + * @param apiVersion + * @param options The parameter options + */ + constructor( + $host: string, + apiVersion: Enum0, + options?: NoMappersClientOptionalParams + ) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: NoMappersClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-no-mappers/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + this.apiVersion = apiVersion; + } +} diff --git a/test/integration/generated/noOperation/package.json b/test/integration/generated/noOperation/package.json index 2ec0578eb7..2ab8741dd4 100644 --- a/test/integration/generated/noOperation/package.json +++ b/test/integration/generated/noOperation/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/noOperation/src/index.ts b/test/integration/generated/noOperation/src/index.ts index f715c2b19d..d6df9f4353 100644 --- a/test/integration/generated/noOperation/src/index.ts +++ b/test/integration/generated/noOperation/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { NoOperationsClient } from "./noOperationsClient"; +export { NoOperationsClientContext } from "./noOperationsClientContext"; diff --git a/test/integration/generated/noOperation/src/noOperationsClient.ts b/test/integration/generated/noOperation/src/noOperationsClient.ts index cb798f93e1..e4ba288bf9 100644 --- a/test/integration/generated/noOperation/src/noOperationsClient.ts +++ b/test/integration/generated/noOperation/src/noOperationsClient.ts @@ -6,37 +6,15 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; +import { NoOperationsClientContext } from "./noOperationsClientContext"; import { NoOperationsClientOptionalParams } from "./models"; -export class NoOperationsClient extends coreClient.ServiceClient { +export class NoOperationsClient extends NoOperationsClientContext { /** * Initializes a new instance of the NoOperationsClient class. * @param options The parameter options */ constructor(options?: NoOperationsClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: NoOperationsClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-no-operation/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint - }; - super(optionsWithDefaults); + super(options); } } diff --git a/test/integration/generated/noOperation/src/noOperationsClientContext.ts b/test/integration/generated/noOperation/src/noOperationsClientContext.ts new file mode 100644 index 0000000000..e8bb115cac --- /dev/null +++ b/test/integration/generated/noOperation/src/noOperationsClientContext.ts @@ -0,0 +1,42 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { NoOperationsClientOptionalParams } from "./models"; + +export class NoOperationsClientContext extends coreClient.ServiceClient { + /** + * Initializes a new instance of the NoOperationsClientContext class. + * @param options The parameter options + */ + constructor(options?: NoOperationsClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: NoOperationsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-no-operation/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint + }; + super(optionsWithDefaults); + } +} diff --git a/test/integration/generated/nonStringEnum/package.json b/test/integration/generated/nonStringEnum/package.json index d9daa93434..3c7529ad26 100644 --- a/test/integration/generated/nonStringEnum/package.json +++ b/test/integration/generated/nonStringEnum/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/nonStringEnum/src/index.ts b/test/integration/generated/nonStringEnum/src/index.ts index 99af2fcec0..f3615dca4d 100644 --- a/test/integration/generated/nonStringEnum/src/index.ts +++ b/test/integration/generated/nonStringEnum/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { NonStringEnumClient } from "./nonStringEnumClient"; +export { NonStringEnumClientContext } from "./nonStringEnumClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/nonStringEnum/src/nonStringEnumClient.ts b/test/integration/generated/nonStringEnum/src/nonStringEnumClient.ts index 6ef9dfa326..272b047f5b 100644 --- a/test/integration/generated/nonStringEnum/src/nonStringEnumClient.ts +++ b/test/integration/generated/nonStringEnum/src/nonStringEnumClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { IntImpl, FloatImpl } from "./operations"; import { Int, Float } from "./operationsInterfaces"; +import { NonStringEnumClientContext } from "./nonStringEnumClientContext"; import { NonStringEnumClientOptionalParams } from "./models"; -export class NonStringEnumClient extends coreClient.ServiceClient { - $host: string; - +export class NonStringEnumClient extends NonStringEnumClientContext { /** * Initializes a new instance of the NonStringEnumClient class. * @param options The parameter options */ constructor(options?: NonStringEnumClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: NonStringEnumClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-non-string-num/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.int = new IntImpl(this); this.float = new FloatImpl(this); } diff --git a/test/integration/generated/nonStringEnum/src/nonStringEnumClientContext.ts b/test/integration/generated/nonStringEnum/src/nonStringEnumClientContext.ts new file mode 100644 index 0000000000..114a0aa6c2 --- /dev/null +++ b/test/integration/generated/nonStringEnum/src/nonStringEnumClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { NonStringEnumClientOptionalParams } from "./models"; + +export class NonStringEnumClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the NonStringEnumClientContext class. + * @param options The parameter options + */ + constructor(options?: NonStringEnumClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: NonStringEnumClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-non-string-num/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/nonStringEnum/src/operations/float.ts b/test/integration/generated/nonStringEnum/src/operations/float.ts index c0966523d9..12b6cbfe3d 100644 --- a/test/integration/generated/nonStringEnum/src/operations/float.ts +++ b/test/integration/generated/nonStringEnum/src/operations/float.ts @@ -9,7 +9,7 @@ import { Float } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Parameters from "../models/parameters"; -import { NonStringEnumClient } from "../nonStringEnumClient"; +import { NonStringEnumClientContext } from "../nonStringEnumClientContext"; import { FloatPutOptionalParams, FloatPutResponse, @@ -19,13 +19,13 @@ import { /** Class containing Float operations. */ export class FloatImpl implements Float { - private readonly client: NonStringEnumClient; + private readonly client: NonStringEnumClientContext; /** * Initialize a new instance of the class Float class. * @param client Reference to the service client */ - constructor(client: NonStringEnumClient) { + constructor(client: NonStringEnumClientContext) { this.client = client; } diff --git a/test/integration/generated/nonStringEnum/src/operations/int.ts b/test/integration/generated/nonStringEnum/src/operations/int.ts index 0e1018fc41..3687051648 100644 --- a/test/integration/generated/nonStringEnum/src/operations/int.ts +++ b/test/integration/generated/nonStringEnum/src/operations/int.ts @@ -9,7 +9,7 @@ import { Int } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Parameters from "../models/parameters"; -import { NonStringEnumClient } from "../nonStringEnumClient"; +import { NonStringEnumClientContext } from "../nonStringEnumClientContext"; import { IntPutOptionalParams, IntPutResponse, @@ -19,13 +19,13 @@ import { /** Class containing Int operations. */ export class IntImpl implements Int { - private readonly client: NonStringEnumClient; + private readonly client: NonStringEnumClientContext; /** * Initialize a new instance of the class Int class. * @param client Reference to the service client */ - constructor(client: NonStringEnumClient) { + constructor(client: NonStringEnumClientContext) { this.client = client; } diff --git a/test/integration/generated/objectType/package.json b/test/integration/generated/objectType/package.json index 9b5fba7fef..5eff20fa0b 100644 --- a/test/integration/generated/objectType/package.json +++ b/test/integration/generated/objectType/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/objectType/src/index.ts b/test/integration/generated/objectType/src/index.ts index c605d1084b..0570e3decb 100644 --- a/test/integration/generated/objectType/src/index.ts +++ b/test/integration/generated/objectType/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { ObjectTypeClient } from "./objectTypeClient"; +export { ObjectTypeClientContext } from "./objectTypeClientContext"; diff --git a/test/integration/generated/objectType/src/objectTypeClient.ts b/test/integration/generated/objectType/src/objectTypeClient.ts index a4cee6e15b..bb9c60498b 100644 --- a/test/integration/generated/objectType/src/objectTypeClient.ts +++ b/test/integration/generated/objectType/src/objectTypeClient.ts @@ -8,6 +8,7 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; +import { ObjectTypeClientContext } from "./objectTypeClientContext"; import { ObjectTypeClientOptionalParams, GetOptionalParams, @@ -15,40 +16,13 @@ import { PutOptionalParams } from "./models"; -export class ObjectTypeClient extends coreClient.ServiceClient { - $host: string; - +export class ObjectTypeClient extends ObjectTypeClientContext { /** * Initializes a new instance of the ObjectTypeClient class. * @param options The parameter options */ constructor(options?: ObjectTypeClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ObjectTypeClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-object-type/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); } /** diff --git a/test/integration/generated/objectType/src/objectTypeClientContext.ts b/test/integration/generated/objectType/src/objectTypeClientContext.ts new file mode 100644 index 0000000000..47fb2dc260 --- /dev/null +++ b/test/integration/generated/objectType/src/objectTypeClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { ObjectTypeClientOptionalParams } from "./models"; + +export class ObjectTypeClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the ObjectTypeClientContext class. + * @param options The parameter options + */ + constructor(options?: ObjectTypeClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ObjectTypeClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-object-type/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/odataDiscriminator/package.json b/test/integration/generated/odataDiscriminator/package.json index 07ecd4dfda..7f75073bc9 100644 --- a/test/integration/generated/odataDiscriminator/package.json +++ b/test/integration/generated/odataDiscriminator/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/odataDiscriminator/src/index.ts b/test/integration/generated/odataDiscriminator/src/index.ts index 87c5e65f76..72ab36378f 100644 --- a/test/integration/generated/odataDiscriminator/src/index.ts +++ b/test/integration/generated/odataDiscriminator/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { ODataDiscriminatorClient } from "./oDataDiscriminatorClient"; +export { ODataDiscriminatorClientContext } from "./oDataDiscriminatorClientContext"; diff --git a/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClient.ts b/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClient.ts index 64e32be063..fd73bbba81 100644 --- a/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClient.ts +++ b/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClient.ts @@ -9,17 +9,15 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { ODataDiscriminatorClientContext } from "./oDataDiscriminatorClientContext"; import { - Enum0, ODataDiscriminatorClientOptionalParams, + Enum0, ApiV1ValueGetOptionalParams, ApiV1ValueGetResponse } from "./models"; -export class ODataDiscriminatorClient extends coreClient.ServiceClient { - $host: string; - apiVersion: Enum0; - +export class ODataDiscriminatorClient extends ODataDiscriminatorClientContext { /** * Initializes a new instance of the ODataDiscriminatorClient class. * @param $host server parameter @@ -31,39 +29,7 @@ export class ODataDiscriminatorClient extends coreClient.ServiceClient { apiVersion: Enum0, options?: ODataDiscriminatorClientOptionalParams ) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ODataDiscriminatorClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-odata-discriminator/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - this.apiVersion = apiVersion; + super($host, apiVersion, options); } /** @param options The options parameters. */ diff --git a/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClientContext.ts b/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClientContext.ts new file mode 100644 index 0000000000..b8d36043c6 --- /dev/null +++ b/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClientContext.ts @@ -0,0 +1,61 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { Enum0, ODataDiscriminatorClientOptionalParams } from "./models"; + +export class ODataDiscriminatorClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: Enum0; + + /** + * Initializes a new instance of the ODataDiscriminatorClientContext class. + * @param $host server parameter + * @param apiVersion + * @param options The parameter options + */ + constructor( + $host: string, + apiVersion: Enum0, + options?: ODataDiscriminatorClientOptionalParams + ) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ODataDiscriminatorClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-odata-discriminator/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + this.apiVersion = apiVersion; + } +} diff --git a/test/integration/generated/operationgroupclash/package.json b/test/integration/generated/operationgroupclash/package.json index 55d34f9542..283a9d27b1 100644 --- a/test/integration/generated/operationgroupclash/package.json +++ b/test/integration/generated/operationgroupclash/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/operationgroupclash/src/index.ts b/test/integration/generated/operationgroupclash/src/index.ts index e12fc6902d..611e4166c5 100644 --- a/test/integration/generated/operationgroupclash/src/index.ts +++ b/test/integration/generated/operationgroupclash/src/index.ts @@ -1,3 +1,4 @@ export * from "./models"; export { OperationGroupClashClient } from "./operationGroupClashClient"; +export { OperationGroupClashClientContext } from "./operationGroupClashClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/operationgroupclash/src/operationGroupClashClient.ts b/test/integration/generated/operationgroupclash/src/operationGroupClashClient.ts index e3b7c2179a..e7025c89ab 100644 --- a/test/integration/generated/operationgroupclash/src/operationGroupClashClient.ts +++ b/test/integration/generated/operationgroupclash/src/operationGroupClashClient.ts @@ -1,12 +1,9 @@ -import * as coreClient from "@azure/core-client"; import { ProductOperationsImpl, PipelineOperationsImpl } from "./operations"; import { ProductOperations, PipelineOperations } from "./operationsInterfaces"; -import { Enum0, OperationGroupClashClientOptionalParams } from "./models"; - -export class OperationGroupClashClient extends coreClient.ServiceClient { - $host: string; - apiVersion: Enum0; +import { OperationGroupClashClientContext } from "./operationGroupClashClientContext"; +import { OperationGroupClashClientOptionalParams, Enum0 } from "./models"; +export class OperationGroupClashClient extends OperationGroupClashClientContext { /** * Initializes a new instance of the OperationGroupClashClient class. * @param $host server parameter @@ -18,39 +15,7 @@ export class OperationGroupClashClient extends coreClient.ServiceClient { apiVersion: Enum0, options?: OperationGroupClashClientOptionalParams ) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: OperationGroupClashClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-operationgroupclash/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - this.apiVersion = apiVersion; + super($host, apiVersion, options); this.productOperations = new ProductOperationsImpl(this); this.pipelineOperations = new PipelineOperationsImpl(this); } diff --git a/test/integration/generated/operationgroupclash/src/operationGroupClashClientContext.ts b/test/integration/generated/operationgroupclash/src/operationGroupClashClientContext.ts new file mode 100644 index 0000000000..ff27a395ac --- /dev/null +++ b/test/integration/generated/operationgroupclash/src/operationGroupClashClientContext.ts @@ -0,0 +1,53 @@ +import * as coreClient from "@azure/core-client"; +import { Enum0, OperationGroupClashClientOptionalParams } from "./models"; + +export class OperationGroupClashClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: Enum0; + + /** + * Initializes a new instance of the OperationGroupClashClientContext class. + * @param $host server parameter + * @param apiVersion + * @param options The parameter options + */ + constructor( + $host: string, + apiVersion: Enum0, + options?: OperationGroupClashClientOptionalParams + ) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: OperationGroupClashClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-operationgroupclash/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + this.apiVersion = apiVersion; + } +} diff --git a/test/integration/generated/operationgroupclash/src/operations/pipelineOperations.ts b/test/integration/generated/operationgroupclash/src/operations/pipelineOperations.ts index f2bb8cf8a6..0e4c198d8f 100644 --- a/test/integration/generated/operationgroupclash/src/operations/pipelineOperations.ts +++ b/test/integration/generated/operationgroupclash/src/operations/pipelineOperations.ts @@ -2,7 +2,7 @@ import { PipelineOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { OperationGroupClashClient } from "../operationGroupClashClient"; +import { OperationGroupClashClientContext } from "../operationGroupClashClientContext"; import { PipelineApiV1ValueGetOptionalParams, PipelineApiV1ValueGetResponse @@ -10,13 +10,13 @@ import { /** Class containing PipelineOperations operations. */ export class PipelineOperationsImpl implements PipelineOperations { - private readonly client: OperationGroupClashClient; + private readonly client: OperationGroupClashClientContext; /** * Initialize a new instance of the class PipelineOperations class. * @param client Reference to the service client */ - constructor(client: OperationGroupClashClient) { + constructor(client: OperationGroupClashClientContext) { this.client = client; } diff --git a/test/integration/generated/operationgroupclash/src/operations/productOperations.ts b/test/integration/generated/operationgroupclash/src/operations/productOperations.ts index aa91ece2d8..ae4540184d 100644 --- a/test/integration/generated/operationgroupclash/src/operations/productOperations.ts +++ b/test/integration/generated/operationgroupclash/src/operations/productOperations.ts @@ -2,7 +2,7 @@ import { ProductOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { OperationGroupClashClient } from "../operationGroupClashClient"; +import { OperationGroupClashClientContext } from "../operationGroupClashClientContext"; import { ProductApiV1ValueGetOptionalParams, ProductApiV1ValueGetResponse @@ -10,13 +10,13 @@ import { /** Class containing ProductOperations operations. */ export class ProductOperationsImpl implements ProductOperations { - private readonly client: OperationGroupClashClient; + private readonly client: OperationGroupClashClientContext; /** * Initialize a new instance of the class ProductOperations class. * @param client Reference to the service client */ - constructor(client: OperationGroupClashClient) { + constructor(client: OperationGroupClashClientContext) { this.client = client; } diff --git a/test/integration/generated/optionalnull/package.json b/test/integration/generated/optionalnull/package.json index 11f6f198ba..4b05a8773b 100644 --- a/test/integration/generated/optionalnull/package.json +++ b/test/integration/generated/optionalnull/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/optionalnull/src/index.ts b/test/integration/generated/optionalnull/src/index.ts index 6b88093303..1a855f89b5 100644 --- a/test/integration/generated/optionalnull/src/index.ts +++ b/test/integration/generated/optionalnull/src/index.ts @@ -1,3 +1,4 @@ export * from "./models"; export { OptionalNullClient } from "./optionalNullClient"; +export { OptionalNullClientContext } from "./optionalNullClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/optionalnull/src/operations/documents.ts b/test/integration/generated/optionalnull/src/operations/documents.ts index 10de8aace7..7b73c1624d 100644 --- a/test/integration/generated/optionalnull/src/operations/documents.ts +++ b/test/integration/generated/optionalnull/src/operations/documents.ts @@ -2,18 +2,18 @@ import { Documents } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { OptionalNullClient } from "../optionalNullClient"; +import { OptionalNullClientContext } from "../optionalNullClientContext"; import { DocumentsSearchGetOptionalParams } from "../models"; /** Class containing Documents operations. */ export class DocumentsImpl implements Documents { - private readonly client: OptionalNullClient; + private readonly client: OptionalNullClientContext; /** * Initialize a new instance of the class Documents class. * @param client Reference to the service client */ - constructor(client: OptionalNullClient) { + constructor(client: OptionalNullClientContext) { this.client = client; } diff --git a/test/integration/generated/optionalnull/src/optionalNullClient.ts b/test/integration/generated/optionalnull/src/optionalNullClient.ts index 2ae086ff31..53a48c5bd2 100644 --- a/test/integration/generated/optionalnull/src/optionalNullClient.ts +++ b/test/integration/generated/optionalnull/src/optionalNullClient.ts @@ -1,46 +1,16 @@ -import * as coreClient from "@azure/core-client"; import { DocumentsImpl } from "./operations"; import { Documents } from "./operationsInterfaces"; +import { OptionalNullClientContext } from "./optionalNullClientContext"; import { OptionalNullClientOptionalParams } from "./models"; -export class OptionalNullClient extends coreClient.ServiceClient { - $host: string; - +export class OptionalNullClient extends OptionalNullClientContext { /** * Initializes a new instance of the OptionalNullClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: OptionalNullClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: OptionalNullClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-optionalnull/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; + super($host, options); this.documents = new DocumentsImpl(this); } diff --git a/test/integration/generated/optionalnull/src/optionalNullClientContext.ts b/test/integration/generated/optionalnull/src/optionalNullClientContext.ts new file mode 100644 index 0000000000..96a9f52f76 --- /dev/null +++ b/test/integration/generated/optionalnull/src/optionalNullClientContext.ts @@ -0,0 +1,43 @@ +import * as coreClient from "@azure/core-client"; +import { OptionalNullClientOptionalParams } from "./models"; + +export class OptionalNullClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the OptionalNullClientContext class. + * @param $host server parameter + * @param options The parameter options + */ + constructor($host: string, options?: OptionalNullClientOptionalParams) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: OptionalNullClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-optionalnull/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + } +} diff --git a/test/integration/generated/paging/package.json b/test/integration/generated/paging/package.json index 33e5d94617..9c9aa3be4a 100644 --- a/test/integration/generated/paging/package.json +++ b/test/integration/generated/paging/package.json @@ -30,8 +30,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/paging/src/index.ts b/test/integration/generated/paging/src/index.ts index 8799083d71..93722e9555 100644 --- a/test/integration/generated/paging/src/index.ts +++ b/test/integration/generated/paging/src/index.ts @@ -9,4 +9,5 @@ /// export * from "./models"; export { PagingClient } from "./pagingClient"; +export { PagingClientContext } from "./pagingClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/paging/src/operations/paging.ts b/test/integration/generated/paging/src/operations/paging.ts index 4395db6b03..49d8aaede5 100644 --- a/test/integration/generated/paging/src/operations/paging.ts +++ b/test/integration/generated/paging/src/operations/paging.ts @@ -13,7 +13,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { PagingClient } from "../pagingClient"; +import { PagingClientContext } from "../pagingClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -91,13 +91,13 @@ import { /// /** Class containing Paging operations. */ export class PagingImpl implements Paging { - private readonly client: PagingClient; + private readonly client: PagingClientContext; /** * Initialize a new instance of the class Paging class. * @param client Reference to the service client */ - constructor(client: PagingClient) { + constructor(client: PagingClientContext) { this.client = client; } diff --git a/test/integration/generated/paging/src/pagingClient.ts b/test/integration/generated/paging/src/pagingClient.ts index 85041ba7a0..3350be50e9 100644 --- a/test/integration/generated/paging/src/pagingClient.ts +++ b/test/integration/generated/paging/src/pagingClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { PagingImpl } from "./operations"; import { Paging } from "./operationsInterfaces"; +import { PagingClientContext } from "./pagingClientContext"; import { PagingClientOptionalParams } from "./models"; -export class PagingClient extends coreClient.ServiceClient { - $host: string; - +export class PagingClient extends PagingClientContext { /** * Initializes a new instance of the PagingClient class. * @param options The parameter options */ constructor(options?: PagingClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: PagingClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-paging-service/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.paging = new PagingImpl(this); } diff --git a/test/integration/generated/paging/src/pagingClientContext.ts b/test/integration/generated/paging/src/pagingClientContext.ts new file mode 100644 index 0000000000..e2c274db9f --- /dev/null +++ b/test/integration/generated/paging/src/pagingClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { PagingClientOptionalParams } from "./models"; + +export class PagingClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the PagingClientContext class. + * @param options The parameter options + */ + constructor(options?: PagingClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: PagingClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-paging-service/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/pagingNoIterators/package.json b/test/integration/generated/pagingNoIterators/package.json index 3c9a8965ce..9fc9fe22f4 100644 --- a/test/integration/generated/pagingNoIterators/package.json +++ b/test/integration/generated/pagingNoIterators/package.json @@ -27,8 +27,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/pagingNoIterators/src/index.ts b/test/integration/generated/pagingNoIterators/src/index.ts index 961750bcbd..97d71c43b9 100644 --- a/test/integration/generated/pagingNoIterators/src/index.ts +++ b/test/integration/generated/pagingNoIterators/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { PagingNoIteratorsClient } from "./pagingNoIteratorsClient"; +export { PagingNoIteratorsClientContext } from "./pagingNoIteratorsClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/pagingNoIterators/src/operations/paging.ts b/test/integration/generated/pagingNoIterators/src/operations/paging.ts index 26d9297b91..454ba1185b 100644 --- a/test/integration/generated/pagingNoIterators/src/operations/paging.ts +++ b/test/integration/generated/pagingNoIterators/src/operations/paging.ts @@ -10,7 +10,7 @@ import { Paging } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { PagingNoIteratorsClient } from "../pagingNoIteratorsClient"; +import { PagingNoIteratorsClientContext } from "../pagingNoIteratorsClientContext"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -86,13 +86,13 @@ import { /** Class containing Paging operations. */ export class PagingImpl implements Paging { - private readonly client: PagingNoIteratorsClient; + private readonly client: PagingNoIteratorsClientContext; /** * Initialize a new instance of the class Paging class. * @param client Reference to the service client */ - constructor(client: PagingNoIteratorsClient) { + constructor(client: PagingNoIteratorsClientContext) { this.client = client; } diff --git a/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClient.ts b/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClient.ts index 7e21ec2aca..e78284d942 100644 --- a/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClient.ts +++ b/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { PagingImpl } from "./operations"; import { Paging } from "./operationsInterfaces"; +import { PagingNoIteratorsClientContext } from "./pagingNoIteratorsClientContext"; import { PagingNoIteratorsClientOptionalParams } from "./models"; -export class PagingNoIteratorsClient extends coreClient.ServiceClient { - $host: string; - +export class PagingNoIteratorsClient extends PagingNoIteratorsClientContext { /** * Initializes a new instance of the PagingNoIteratorsClient class. * @param options The parameter options */ constructor(options?: PagingNoIteratorsClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: PagingNoIteratorsClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-paging-no-iterators/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.paging = new PagingImpl(this); } diff --git a/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClientContext.ts b/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClientContext.ts new file mode 100644 index 0000000000..0c1feaa0a8 --- /dev/null +++ b/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { PagingNoIteratorsClientOptionalParams } from "./models"; + +export class PagingNoIteratorsClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the PagingNoIteratorsClientContext class. + * @param options The parameter options + */ + constructor(options?: PagingNoIteratorsClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: PagingNoIteratorsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-paging-no-iterators/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/pagingRest/package.json b/test/integration/generated/pagingRest/package.json index c81988f825..98077902bc 100644 --- a/test/integration/generated/pagingRest/package.json +++ b/test/integration/generated/pagingRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "MIT", + "license": "ISC", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/pagingRest/src/paging.ts b/test/integration/generated/pagingRest/src/paging.ts index 7e784714f5..21556dfa7a 100644 --- a/test/integration/generated/pagingRest/src/paging.ts +++ b/test/integration/generated/pagingRest/src/paging.ts @@ -317,7 +317,9 @@ export type PagingRestClient = Client & { export default function Paging(options: ClientOptions = {}): PagingRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - const client = getClient(baseUrl, options) as PagingRestClient; + return getClient( + baseUrl, - return client; + options + ) as PagingRestClient; } diff --git a/test/integration/generated/pagingRest/tsconfig.json b/test/integration/generated/pagingRest/tsconfig.json index 0202cc6570..965341beea 100644 --- a/test/integration/generated/pagingRest/tsconfig.json +++ b/test/integration/generated/pagingRest/tsconfig.json @@ -7,5 +7,13 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "include": ["src/**/*.ts"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } diff --git a/test/integration/generated/petstore/package.json b/test/integration/generated/petstore/package.json index 87a3266ac7..b8f7dc1ce9 100644 --- a/test/integration/generated/petstore/package.json +++ b/test/integration/generated/petstore/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/petstore/src/index.ts b/test/integration/generated/petstore/src/index.ts index e7627063d3..1e212493f3 100644 --- a/test/integration/generated/petstore/src/index.ts +++ b/test/integration/generated/petstore/src/index.ts @@ -1,2 +1,3 @@ export * from "./models"; export { PetStore } from "./petStore"; +export { PetStoreContext } from "./petStoreContext"; diff --git a/test/integration/generated/petstore/src/petStore.ts b/test/integration/generated/petstore/src/petStore.ts index 70f3dd789b..23ffa34c96 100644 --- a/test/integration/generated/petstore/src/petStore.ts +++ b/test/integration/generated/petstore/src/petStore.ts @@ -1,6 +1,7 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { PetStoreContext } from "./petStoreContext"; import { PetStoreOptionalParams, AddPetUsingByteArray$binaryOptionalParams, @@ -37,40 +38,13 @@ import { DeleteUserOptionalParams } from "./models"; -export class PetStore extends coreClient.ServiceClient { - $host: string; - +export class PetStore extends PetStoreContext { /** * Initializes a new instance of the PetStore class. * @param options The parameter options */ constructor(options?: PetStoreOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: PetStoreOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-petstore/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://petstore.swagger.io/v2" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://petstore.swagger.io/v2"; + super(options); } /** diff --git a/test/integration/generated/petstore/src/petStoreContext.ts b/test/integration/generated/petstore/src/petStoreContext.ts new file mode 100644 index 0000000000..321604d804 --- /dev/null +++ b/test/integration/generated/petstore/src/petStoreContext.ts @@ -0,0 +1,39 @@ +import * as coreClient from "@azure/core-client"; +import { PetStoreOptionalParams } from "./models"; + +export class PetStoreContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the PetStoreContext class. + * @param options The parameter options + */ + constructor(options?: PetStoreOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: PetStoreOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-petstore/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://petstore.swagger.io/v2" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://petstore.swagger.io/v2"; + } +} diff --git a/test/integration/generated/polymorphicSkipNormalize/src/generated/index.ts b/test/integration/generated/polymorphicSkipNormalize/src/generated/index.ts index 0512bd167b..181c807cee 100644 --- a/test/integration/generated/polymorphicSkipNormalize/src/generated/index.ts +++ b/test/integration/generated/polymorphicSkipNormalize/src/generated/index.ts @@ -1,2 +1,3 @@ export * from "./models"; export { MediaServicesClient } from "./mediaServicesClient"; +export { MediaServicesClientContext } from "./mediaServicesClientContext"; diff --git a/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClient.ts b/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClient.ts index 9818b762eb..a5ffc600b0 100644 --- a/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClient.ts +++ b/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClient.ts @@ -1,34 +1,12 @@ -import * as coreClient from "@azure/core-client"; +import { MediaServicesClientContext } from "./mediaServicesClientContext"; import { MediaServicesClientOptionalParams } from "./models"; -export class MediaServicesClient extends coreClient.ServiceClient { +export class MediaServicesClient extends MediaServicesClientContext { /** * Initializes a new instance of the MediaServicesClient class. * @param options The parameter options */ constructor(options?: MediaServicesClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MediaServicesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-media-services/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint - }; - super(optionsWithDefaults); + super(options); } } diff --git a/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClientContext.ts b/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClientContext.ts new file mode 100644 index 0000000000..af078f9a47 --- /dev/null +++ b/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClientContext.ts @@ -0,0 +1,34 @@ +import * as coreClient from "@azure/core-client"; +import { MediaServicesClientOptionalParams } from "./models"; + +export class MediaServicesClientContext extends coreClient.ServiceClient { + /** + * Initializes a new instance of the MediaServicesClientContext class. + * @param options The parameter options + */ + constructor(options?: MediaServicesClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MediaServicesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-media-services/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint + }; + super(optionsWithDefaults); + } +} diff --git a/test/integration/generated/readmeFileChecker/package.json b/test/integration/generated/readmeFileChecker/package.json index fc94536d53..651f1f4307 100644 --- a/test/integration/generated/readmeFileChecker/package.json +++ b/test/integration/generated/readmeFileChecker/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/readmeFileChecker/src/index.ts b/test/integration/generated/readmeFileChecker/src/index.ts index 3bf5f73dcc..2d61ce0624 100644 --- a/test/integration/generated/readmeFileChecker/src/index.ts +++ b/test/integration/generated/readmeFileChecker/src/index.ts @@ -1,2 +1,3 @@ export * from "./models"; export { KeyVaultClient } from "./keyVaultClient"; +export { KeyVaultClientContext } from "./keyVaultClientContext"; diff --git a/test/integration/generated/readmeFileChecker/src/keyVaultClient.ts b/test/integration/generated/readmeFileChecker/src/keyVaultClient.ts index 6d5404e636..f2fca6d5aa 100644 --- a/test/integration/generated/readmeFileChecker/src/keyVaultClient.ts +++ b/test/integration/generated/readmeFileChecker/src/keyVaultClient.ts @@ -1,9 +1,10 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { KeyVaultClientContext } from "./keyVaultClientContext"; import { - ApiVersion72Preview, KeyVaultClientOptionalParams, + ApiVersion72Preview, SetSecretOptionalParams, SetSecretResponse, DeleteSecretOptionalParams, @@ -36,9 +37,7 @@ import { } from "./models"; /** @internal */ -export class KeyVaultClient extends coreClient.ServiceClient { - apiVersion: ApiVersion72Preview; - +export class KeyVaultClient extends KeyVaultClientContext { /** * Initializes a new instance of the KeyVaultClient class. * @param apiVersion Api Version @@ -48,35 +47,7 @@ export class KeyVaultClient extends coreClient.ServiceClient { apiVersion: ApiVersion72Preview, options?: KeyVaultClientOptionalParams ) { - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: KeyVaultClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-keyvault-secrets/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{vaultBaseUrl}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.apiVersion = apiVersion; + super(apiVersion, options); } /** diff --git a/test/integration/generated/readmeFileChecker/src/keyVaultClientContext.ts b/test/integration/generated/readmeFileChecker/src/keyVaultClientContext.ts new file mode 100644 index 0000000000..feeb5d865b --- /dev/null +++ b/test/integration/generated/readmeFileChecker/src/keyVaultClientContext.ts @@ -0,0 +1,47 @@ +import * as coreClient from "@azure/core-client"; +import { ApiVersion72Preview, KeyVaultClientOptionalParams } from "./models"; + +/** @internal */ +export class KeyVaultClientContext extends coreClient.ServiceClient { + apiVersion: ApiVersion72Preview; + + /** + * Initializes a new instance of the KeyVaultClientContext class. + * @param apiVersion Api Version + * @param options The parameter options + */ + constructor( + apiVersion: ApiVersion72Preview, + options?: KeyVaultClientOptionalParams + ) { + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: KeyVaultClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-keyvault-secrets/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{vaultBaseUrl}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.apiVersion = apiVersion; + } +} diff --git a/test/integration/generated/regexConstraint/package.json b/test/integration/generated/regexConstraint/package.json index 1357defd88..cbc8154b22 100644 --- a/test/integration/generated/regexConstraint/package.json +++ b/test/integration/generated/regexConstraint/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/regexConstraint/src/index.ts b/test/integration/generated/regexConstraint/src/index.ts index 14324e9d64..4faab7d293 100644 --- a/test/integration/generated/regexConstraint/src/index.ts +++ b/test/integration/generated/regexConstraint/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { RegexConstraint } from "./regexConstraint"; +export { RegexConstraintContext } from "./regexConstraintContext"; diff --git a/test/integration/generated/regexConstraint/src/regexConstraint.ts b/test/integration/generated/regexConstraint/src/regexConstraint.ts index a9d24c5ec2..bfa657b6b4 100644 --- a/test/integration/generated/regexConstraint/src/regexConstraint.ts +++ b/test/integration/generated/regexConstraint/src/regexConstraint.ts @@ -8,50 +8,21 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; +import { RegexConstraintContext } from "./regexConstraintContext"; import { RegexConstraintOptionalParams, ApiV1ValueGetOptionalParams, ApiV1ValueGetResponse } from "./models"; -export class RegexConstraint extends coreClient.ServiceClient { - $host: string; - +export class RegexConstraint extends RegexConstraintContext { /** * Initializes a new instance of the RegexConstraint class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: RegexConstraintOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: RegexConstraintOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-regex-constraint/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; + super($host, options); } /** diff --git a/test/integration/generated/regexConstraint/src/regexConstraintContext.ts b/test/integration/generated/regexConstraint/src/regexConstraintContext.ts new file mode 100644 index 0000000000..71ef72b6b0 --- /dev/null +++ b/test/integration/generated/regexConstraint/src/regexConstraintContext.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { RegexConstraintOptionalParams } from "./models"; + +export class RegexConstraintContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the RegexConstraintContext class. + * @param $host server parameter + * @param options The parameter options + */ + constructor($host: string, options?: RegexConstraintOptionalParams) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: RegexConstraintOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-regex-constraint/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + } +} diff --git a/test/integration/generated/report/package.json b/test/integration/generated/report/package.json index e01430ce01..a99ee8a7b0 100644 --- a/test/integration/generated/report/package.json +++ b/test/integration/generated/report/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/report/src/index.ts b/test/integration/generated/report/src/index.ts index 597f974fe7..5a2e464d52 100644 --- a/test/integration/generated/report/src/index.ts +++ b/test/integration/generated/report/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { ReportClient } from "./reportClient"; +export { ReportClientContext } from "./reportClientContext"; diff --git a/test/integration/generated/report/src/reportClient.ts b/test/integration/generated/report/src/reportClient.ts index 41fdd6314e..ef43d11cfb 100644 --- a/test/integration/generated/report/src/reportClient.ts +++ b/test/integration/generated/report/src/reportClient.ts @@ -9,6 +9,7 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { ReportClientContext } from "./reportClientContext"; import { ReportClientOptionalParams, GetReportOptionalParams, @@ -17,40 +18,13 @@ import { GetOptionalReportResponse } from "./models"; -export class ReportClient extends coreClient.ServiceClient { - $host: string; - +export class ReportClient extends ReportClientContext { /** * Initializes a new instance of the ReportClient class. * @param options The parameter options */ constructor(options?: ReportClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ReportClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-zzzReport/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); } /** diff --git a/test/integration/generated/report/src/reportClientContext.ts b/test/integration/generated/report/src/reportClientContext.ts new file mode 100644 index 0000000000..8313b2c37f --- /dev/null +++ b/test/integration/generated/report/src/reportClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { ReportClientOptionalParams } from "./models"; + +export class ReportClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the ReportClientContext class. + * @param options The parameter options + */ + constructor(options?: ReportClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ReportClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-zzzReport/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/requiredOptional/package.json b/test/integration/generated/requiredOptional/package.json index 4e7c443317..901861026a 100644 --- a/test/integration/generated/requiredOptional/package.json +++ b/test/integration/generated/requiredOptional/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/requiredOptional/src/index.ts b/test/integration/generated/requiredOptional/src/index.ts index e6c355a1c6..ee04017c01 100644 --- a/test/integration/generated/requiredOptional/src/index.ts +++ b/test/integration/generated/requiredOptional/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { RequiredOptionalClient } from "./requiredOptionalClient"; +export { RequiredOptionalClientContext } from "./requiredOptionalClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/requiredOptional/src/operations/explicit.ts b/test/integration/generated/requiredOptional/src/operations/explicit.ts index 4eb1043f1d..3d9c19ba28 100644 --- a/test/integration/generated/requiredOptional/src/operations/explicit.ts +++ b/test/integration/generated/requiredOptional/src/operations/explicit.ts @@ -11,7 +11,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RequiredOptionalClient } from "../requiredOptionalClient"; +import { RequiredOptionalClientContext } from "../requiredOptionalClientContext"; import { ExplicitPutOptionalBinaryBodyOptionalParams, ExplicitPutRequiredBinaryBodyOptionalParams, @@ -46,13 +46,13 @@ import { /** Class containing Explicit operations. */ export class ExplicitImpl implements Explicit { - private readonly client: RequiredOptionalClient; + private readonly client: RequiredOptionalClientContext; /** * Initialize a new instance of the class Explicit class. * @param client Reference to the service client */ - constructor(client: RequiredOptionalClient) { + constructor(client: RequiredOptionalClientContext) { this.client = client; } diff --git a/test/integration/generated/requiredOptional/src/operations/implicit.ts b/test/integration/generated/requiredOptional/src/operations/implicit.ts index 53fb37fb8a..43805eda03 100644 --- a/test/integration/generated/requiredOptional/src/operations/implicit.ts +++ b/test/integration/generated/requiredOptional/src/operations/implicit.ts @@ -10,7 +10,7 @@ import { Implicit } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RequiredOptionalClient } from "../requiredOptionalClient"; +import { RequiredOptionalClientContext } from "../requiredOptionalClientContext"; import { ImplicitGetRequiredPathOptionalParams, ImplicitPutOptionalQueryOptionalParams, @@ -24,13 +24,13 @@ import { /** Class containing Implicit operations. */ export class ImplicitImpl implements Implicit { - private readonly client: RequiredOptionalClient; + private readonly client: RequiredOptionalClientContext; /** * Initialize a new instance of the class Implicit class. * @param client Reference to the service client */ - constructor(client: RequiredOptionalClient) { + constructor(client: RequiredOptionalClientContext) { this.client = client; } diff --git a/test/integration/generated/requiredOptional/src/requiredOptionalClient.ts b/test/integration/generated/requiredOptional/src/requiredOptionalClient.ts index 35403e7a93..0095eedb42 100644 --- a/test/integration/generated/requiredOptional/src/requiredOptionalClient.ts +++ b/test/integration/generated/requiredOptional/src/requiredOptionalClient.ts @@ -6,17 +6,12 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { ImplicitImpl, ExplicitImpl } from "./operations"; import { Implicit, Explicit } from "./operationsInterfaces"; +import { RequiredOptionalClientContext } from "./requiredOptionalClientContext"; import { RequiredOptionalClientOptionalParams } from "./models"; -export class RequiredOptionalClient extends coreClient.ServiceClient { - $host: string; - requiredGlobalPath: string; - requiredGlobalQuery: string; - optionalGlobalQuery?: number; - +export class RequiredOptionalClient extends RequiredOptionalClientContext { /** * Initializes a new instance of the RequiredOptionalClient class. * @param requiredGlobalPath number of items to skip @@ -28,42 +23,7 @@ export class RequiredOptionalClient extends coreClient.ServiceClient { requiredGlobalQuery: string, options?: RequiredOptionalClientOptionalParams ) { - if (requiredGlobalPath === undefined) { - throw new Error("'requiredGlobalPath' cannot be null"); - } - if (requiredGlobalQuery === undefined) { - throw new Error("'requiredGlobalQuery' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: RequiredOptionalClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-required-optional/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - // Parameter assignments - this.requiredGlobalPath = requiredGlobalPath; - this.requiredGlobalQuery = requiredGlobalQuery; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(requiredGlobalPath, requiredGlobalQuery, options); this.implicit = new ImplicitImpl(this); this.explicit = new ExplicitImpl(this); } diff --git a/test/integration/generated/requiredOptional/src/requiredOptionalClientContext.ts b/test/integration/generated/requiredOptional/src/requiredOptionalClientContext.ts new file mode 100644 index 0000000000..96b712bc0b --- /dev/null +++ b/test/integration/generated/requiredOptional/src/requiredOptionalClientContext.ts @@ -0,0 +1,66 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { RequiredOptionalClientOptionalParams } from "./models"; + +export class RequiredOptionalClientContext extends coreClient.ServiceClient { + $host: string; + requiredGlobalPath: string; + requiredGlobalQuery: string; + optionalGlobalQuery?: number; + + /** + * Initializes a new instance of the RequiredOptionalClientContext class. + * @param requiredGlobalPath number of items to skip + * @param requiredGlobalQuery number of items to skip + * @param options The parameter options + */ + constructor( + requiredGlobalPath: string, + requiredGlobalQuery: string, + options?: RequiredOptionalClientOptionalParams + ) { + if (requiredGlobalPath === undefined) { + throw new Error("'requiredGlobalPath' cannot be null"); + } + if (requiredGlobalQuery === undefined) { + throw new Error("'requiredGlobalQuery' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: RequiredOptionalClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-required-optional/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + // Parameter assignments + this.requiredGlobalPath = requiredGlobalPath; + this.requiredGlobalQuery = requiredGlobalQuery; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/resources/package.json b/test/integration/generated/resources/package.json index e0c4a3c08d..68d3396693 100644 --- a/test/integration/generated/resources/package.json +++ b/test/integration/generated/resources/package.json @@ -26,8 +26,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/resources/src/index.ts b/test/integration/generated/resources/src/index.ts index 535f6d990a..33fe3d93b2 100644 --- a/test/integration/generated/resources/src/index.ts +++ b/test/integration/generated/resources/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { ResourcesClient } from "./resourcesClient"; +export { ResourcesClientContext } from "./resourcesClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/resources/src/operations/resourceGroups.ts b/test/integration/generated/resources/src/operations/resourceGroups.ts index 9523e02489..d3326d6626 100644 --- a/test/integration/generated/resources/src/operations/resourceGroups.ts +++ b/test/integration/generated/resources/src/operations/resourceGroups.ts @@ -10,7 +10,7 @@ import { ResourceGroups } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ResourcesClient } from "../resourcesClient"; +import { ResourcesClientContext } from "../resourcesClientContext"; import { ResourceGroupsCheckExistenceOptionalParams, ResourceGroupsCheckExistenceResponse @@ -18,13 +18,13 @@ import { /** Class containing ResourceGroups operations. */ export class ResourceGroupsImpl implements ResourceGroups { - private readonly client: ResourcesClient; + private readonly client: ResourcesClientContext; /** * Initialize a new instance of the class ResourceGroups class. * @param client Reference to the service client */ - constructor(client: ResourcesClient) { + constructor(client: ResourcesClientContext) { this.client = client; } diff --git a/test/integration/generated/resources/src/resourcesClient.ts b/test/integration/generated/resources/src/resourcesClient.ts index 93ceefdb62..cda4095a55 100644 --- a/test/integration/generated/resources/src/resourcesClient.ts +++ b/test/integration/generated/resources/src/resourcesClient.ts @@ -6,17 +6,13 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import * as coreAuth from "@azure/core-auth"; import { ResourceGroupsImpl } from "./operations"; import { ResourceGroups } from "./operationsInterfaces"; +import { ResourcesClientContext } from "./resourcesClientContext"; import { ResourcesClientOptionalParams } from "./models"; -export class ResourcesClient extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - +export class ResourcesClient extends ResourcesClientContext { /** * Initializes a new instance of the ResourcesClient class. * @param credentials Subscription credentials which uniquely identify client subscription. @@ -28,43 +24,7 @@ export class ResourcesClient extends coreClient.ServiceClient { subscriptionId: string, options?: ResourcesClientOptionalParams ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ResourcesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials - }; - - const packageDetails = `azsdk-js-resources/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "https://management.azure.com" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2020-10-01"; + super(credentials, subscriptionId, options); this.resourceGroups = new ResourceGroupsImpl(this); } diff --git a/test/integration/generated/resources/src/resourcesClientContext.ts b/test/integration/generated/resources/src/resourcesClientContext.ts new file mode 100644 index 0000000000..61cbd4cb57 --- /dev/null +++ b/test/integration/generated/resources/src/resourcesClientContext.ts @@ -0,0 +1,67 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import * as coreAuth from "@azure/core-auth"; +import { ResourcesClientOptionalParams } from "./models"; + +export class ResourcesClientContext extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + + /** + * Initializes a new instance of the ResourcesClientContext class. + * @param credentials Subscription credentials which uniquely identify client subscription. + * @param subscriptionId The ID of the target subscription. + * @param options The parameter options + */ + constructor( + credentials: coreAuth.TokenCredential, + subscriptionId: string, + options?: ResourcesClientOptionalParams + ) { + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ResourcesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-resources/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2020-10-01"; + } +} diff --git a/test/integration/generated/sealedchoice/package.json b/test/integration/generated/sealedchoice/package.json index bb80e079a1..11e7ef2f35 100644 --- a/test/integration/generated/sealedchoice/package.json +++ b/test/integration/generated/sealedchoice/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/sealedchoice/src/index.ts b/test/integration/generated/sealedchoice/src/index.ts index 74e9a8df24..91c343f2ec 100644 --- a/test/integration/generated/sealedchoice/src/index.ts +++ b/test/integration/generated/sealedchoice/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { SealedChoiceClient } from "./sealedChoiceClient"; +export { SealedChoiceClientContext } from "./sealedChoiceClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/sealedchoice/src/operations/authentication.ts b/test/integration/generated/sealedchoice/src/operations/authentication.ts index 4422b2654c..cf2892c7ca 100644 --- a/test/integration/generated/sealedchoice/src/operations/authentication.ts +++ b/test/integration/generated/sealedchoice/src/operations/authentication.ts @@ -10,7 +10,7 @@ import { Authentication } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SealedChoiceClient } from "../sealedChoiceClient"; +import { SealedChoiceClientContext } from "../sealedChoiceClientContext"; import { TokenGrantType, AuthenticationExchangeAcrRefreshTokenForAcrAccessTokenOptionalParams @@ -18,13 +18,13 @@ import { /** Class containing Authentication operations. */ export class AuthenticationImpl implements Authentication { - private readonly client: SealedChoiceClient; + private readonly client: SealedChoiceClientContext; /** * Initialize a new instance of the class Authentication class. * @param client Reference to the service client */ - constructor(client: SealedChoiceClient) { + constructor(client: SealedChoiceClientContext) { this.client = client; } diff --git a/test/integration/generated/sealedchoice/src/sealedChoiceClient.ts b/test/integration/generated/sealedchoice/src/sealedChoiceClient.ts index 207a936166..ef6a75f9cf 100644 --- a/test/integration/generated/sealedchoice/src/sealedChoiceClient.ts +++ b/test/integration/generated/sealedchoice/src/sealedChoiceClient.ts @@ -6,49 +6,19 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { AuthenticationImpl } from "./operations"; import { Authentication } from "./operationsInterfaces"; +import { SealedChoiceClientContext } from "./sealedChoiceClientContext"; import { SealedChoiceClientOptionalParams } from "./models"; -export class SealedChoiceClient extends coreClient.ServiceClient { - $host: string; - +export class SealedChoiceClient extends SealedChoiceClientContext { /** * Initializes a new instance of the SealedChoiceClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: SealedChoiceClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: SealedChoiceClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-sealedchoice/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; + super($host, options); this.authentication = new AuthenticationImpl(this); } diff --git a/test/integration/generated/sealedchoice/src/sealedChoiceClientContext.ts b/test/integration/generated/sealedchoice/src/sealedChoiceClientContext.ts new file mode 100644 index 0000000000..48672b0efe --- /dev/null +++ b/test/integration/generated/sealedchoice/src/sealedChoiceClientContext.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { SealedChoiceClientOptionalParams } from "./models"; + +export class SealedChoiceClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the SealedChoiceClientContext class. + * @param $host server parameter + * @param options The parameter options + */ + constructor($host: string, options?: SealedChoiceClientOptionalParams) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: SealedChoiceClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-sealedchoice/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + } +} diff --git a/test/integration/generated/storageblob/package.json b/test/integration/generated/storageblob/package.json index 4eece87a10..1d39e32e72 100644 --- a/test/integration/generated/storageblob/package.json +++ b/test/integration/generated/storageblob/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/storageblob/src/index.ts b/test/integration/generated/storageblob/src/index.ts index 74a2462cea..5c1aa22efd 100644 --- a/test/integration/generated/storageblob/src/index.ts +++ b/test/integration/generated/storageblob/src/index.ts @@ -1,3 +1,4 @@ export * from "./models"; export { StorageBlobClient } from "./storageBlobClient"; +export { StorageBlobClientContext } from "./storageBlobClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/storageblob/src/operations/appendBlob.ts b/test/integration/generated/storageblob/src/operations/appendBlob.ts index e257ecd798..e2d1fe4f9f 100644 --- a/test/integration/generated/storageblob/src/operations/appendBlob.ts +++ b/test/integration/generated/storageblob/src/operations/appendBlob.ts @@ -3,7 +3,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageBlobClient } from "../storageBlobClient"; +import { StorageBlobClientContext } from "../storageBlobClientContext"; import { AppendBlobAppendBlockOptionalParams, AppendBlobAppendBlockResponse @@ -11,13 +11,13 @@ import { /** Class containing AppendBlob operations. */ export class AppendBlobImpl implements AppendBlob { - private readonly client: StorageBlobClient; + private readonly client: StorageBlobClientContext; /** * Initialize a new instance of the class AppendBlob class. * @param client Reference to the service client */ - constructor(client: StorageBlobClient) { + constructor(client: StorageBlobClientContext) { this.client = client; } diff --git a/test/integration/generated/storageblob/src/operations/blockBlob.ts b/test/integration/generated/storageblob/src/operations/blockBlob.ts index 2b1f8905ce..9e1355d7ce 100644 --- a/test/integration/generated/storageblob/src/operations/blockBlob.ts +++ b/test/integration/generated/storageblob/src/operations/blockBlob.ts @@ -3,7 +3,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageBlobClient } from "../storageBlobClient"; +import { StorageBlobClientContext } from "../storageBlobClientContext"; import { BlockBlobStageBlockOptionalParams, BlockBlobStageBlockResponse, @@ -15,13 +15,13 @@ import { /** Class containing BlockBlob operations. */ export class BlockBlobImpl implements BlockBlob { - private readonly client: StorageBlobClient; + private readonly client: StorageBlobClientContext; /** * Initialize a new instance of the class BlockBlob class. * @param client Reference to the service client */ - constructor(client: StorageBlobClient) { + constructor(client: StorageBlobClientContext) { this.client = client; } diff --git a/test/integration/generated/storageblob/src/operations/pageBlob.ts b/test/integration/generated/storageblob/src/operations/pageBlob.ts index c0b71e1a2a..322d95b72f 100644 --- a/test/integration/generated/storageblob/src/operations/pageBlob.ts +++ b/test/integration/generated/storageblob/src/operations/pageBlob.ts @@ -3,7 +3,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageBlobClient } from "../storageBlobClient"; +import { StorageBlobClientContext } from "../storageBlobClientContext"; import { PageBlobUploadPagesOptionalParams, PageBlobUploadPagesResponse @@ -11,13 +11,13 @@ import { /** Class containing PageBlob operations. */ export class PageBlobImpl implements PageBlob { - private readonly client: StorageBlobClient; + private readonly client: StorageBlobClientContext; /** * Initialize a new instance of the class PageBlob class. * @param client Reference to the service client */ - constructor(client: StorageBlobClient) { + constructor(client: StorageBlobClientContext) { this.client = client; } diff --git a/test/integration/generated/storageblob/src/storageBlobClient.ts b/test/integration/generated/storageblob/src/storageBlobClient.ts index 58e4f9da7e..83876fc888 100644 --- a/test/integration/generated/storageblob/src/storageBlobClient.ts +++ b/test/integration/generated/storageblob/src/storageBlobClient.ts @@ -1,12 +1,9 @@ -import * as coreClient from "@azure/core-client"; import { PageBlobImpl, BlockBlobImpl, AppendBlobImpl } from "./operations"; import { PageBlob, BlockBlob, AppendBlob } from "./operationsInterfaces"; +import { StorageBlobClientContext } from "./storageBlobClientContext"; import { StorageBlobClientOptionalParams } from "./models"; -export class StorageBlobClient extends coreClient.ServiceClient { - url: string; - version: string; - +export class StorageBlobClient extends StorageBlobClientContext { /** * Initializes a new instance of the StorageBlobClient class. * @param url The URL of the service account, container, or blob that is the targe of the desired @@ -14,38 +11,7 @@ export class StorageBlobClient extends coreClient.ServiceClient { * @param options The parameter options */ constructor(url: string, options?: StorageBlobClientOptionalParams) { - if (url === undefined) { - throw new Error("'url' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: StorageBlobClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-storageblob/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{url}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.url = url; - - // Assigning values to Constant parameters - this.version = options.version || "2020-06-12"; + super(url, options); this.pageBlob = new PageBlobImpl(this); this.blockBlob = new BlockBlobImpl(this); this.appendBlob = new AppendBlobImpl(this); diff --git a/test/integration/generated/storageblob/src/storageBlobClientContext.ts b/test/integration/generated/storageblob/src/storageBlobClientContext.ts new file mode 100644 index 0000000000..8e52ea3a49 --- /dev/null +++ b/test/integration/generated/storageblob/src/storageBlobClientContext.ts @@ -0,0 +1,48 @@ +import * as coreClient from "@azure/core-client"; +import { StorageBlobClientOptionalParams } from "./models"; + +export class StorageBlobClientContext extends coreClient.ServiceClient { + url: string; + version: string; + + /** + * Initializes a new instance of the StorageBlobClientContext class. + * @param url The URL of the service account, container, or blob that is the targe of the desired + * operation. + * @param options The parameter options + */ + constructor(url: string, options?: StorageBlobClientOptionalParams) { + if (url === undefined) { + throw new Error("'url' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: StorageBlobClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-storageblob/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{url}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.url = url; + + // Assigning values to Constant parameters + this.version = options.version || "2020-06-12"; + } +} diff --git a/test/integration/generated/storagefileshare/package.json b/test/integration/generated/storagefileshare/package.json index 1985c037c9..a7b34560cb 100644 --- a/test/integration/generated/storagefileshare/package.json +++ b/test/integration/generated/storagefileshare/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/storagefileshare/src/index.ts b/test/integration/generated/storagefileshare/src/index.ts index 69e726bc75..94b40f6f2c 100644 --- a/test/integration/generated/storagefileshare/src/index.ts +++ b/test/integration/generated/storagefileshare/src/index.ts @@ -1,3 +1,4 @@ export * from "./models"; export { StorageFileShareClient } from "./storageFileShareClient"; +export { StorageFileShareClientContext } from "./storageFileShareClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/storagefileshare/src/operations/file.ts b/test/integration/generated/storagefileshare/src/operations/file.ts index 3af508a0d6..7be858f606 100644 --- a/test/integration/generated/storagefileshare/src/operations/file.ts +++ b/test/integration/generated/storagefileshare/src/operations/file.ts @@ -2,7 +2,7 @@ import { File } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageFileShareClient } from "../storageFileShareClient"; +import { StorageFileShareClientContext } from "../storageFileShareClientContext"; import { FileUploadRangeFromURLOptionalParams, FileUploadRangeFromURLResponse @@ -10,13 +10,13 @@ import { /** Class containing File operations. */ export class FileImpl implements File { - private readonly client: StorageFileShareClient; + private readonly client: StorageFileShareClientContext; /** * Initialize a new instance of the class File class. * @param client Reference to the service client */ - constructor(client: StorageFileShareClient) { + constructor(client: StorageFileShareClientContext) { this.client = client; } diff --git a/test/integration/generated/storagefileshare/src/storageFileShareClient.ts b/test/integration/generated/storagefileshare/src/storageFileShareClient.ts index 14c86def16..f22dcff604 100644 --- a/test/integration/generated/storagefileshare/src/storageFileShareClient.ts +++ b/test/integration/generated/storagefileshare/src/storageFileShareClient.ts @@ -1,13 +1,9 @@ -import * as coreClient from "@azure/core-client"; import { FileImpl } from "./operations"; import { File } from "./operationsInterfaces"; +import { StorageFileShareClientContext } from "./storageFileShareClientContext"; import { StorageFileShareClientOptionalParams } from "./models"; -export class StorageFileShareClient extends coreClient.ServiceClient { - url: string; - fileRangeWriteFromUrl: string; - version: string; - +export class StorageFileShareClient extends StorageFileShareClientContext { /** * Initializes a new instance of the StorageFileShareClient class. * @param url The URL of the service account, share, directory or file that is the target of the @@ -15,39 +11,7 @@ export class StorageFileShareClient extends coreClient.ServiceClient { * @param options The parameter options */ constructor(url: string, options?: StorageFileShareClientOptionalParams) { - if (url === undefined) { - throw new Error("'url' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: StorageFileShareClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-storagefileshare/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{url}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.url = url; - - // Assigning values to Constant parameters - this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update"; - this.version = options.version || "2020-04-08"; + super(url, options); this.file = new FileImpl(this); } diff --git a/test/integration/generated/storagefileshare/src/storageFileShareClientContext.ts b/test/integration/generated/storagefileshare/src/storageFileShareClientContext.ts new file mode 100644 index 0000000000..0a2010b1ce --- /dev/null +++ b/test/integration/generated/storagefileshare/src/storageFileShareClientContext.ts @@ -0,0 +1,50 @@ +import * as coreClient from "@azure/core-client"; +import { StorageFileShareClientOptionalParams } from "./models"; + +export class StorageFileShareClientContext extends coreClient.ServiceClient { + url: string; + fileRangeWriteFromUrl: string; + version: string; + + /** + * Initializes a new instance of the StorageFileShareClientContext class. + * @param url The URL of the service account, share, directory or file that is the target of the + * desired operation. + * @param options The parameter options + */ + constructor(url: string, options?: StorageFileShareClientOptionalParams) { + if (url === undefined) { + throw new Error("'url' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: StorageFileShareClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-storagefileshare/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{url}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.url = url; + + // Assigning values to Constant parameters + this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update"; + this.version = options.version || "2020-04-08"; + } +} diff --git a/test/integration/generated/subscriptionIdApiVersion/package.json b/test/integration/generated/subscriptionIdApiVersion/package.json index 9112210fe3..78b55da2ed 100644 --- a/test/integration/generated/subscriptionIdApiVersion/package.json +++ b/test/integration/generated/subscriptionIdApiVersion/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/subscriptionIdApiVersion/src/index.ts b/test/integration/generated/subscriptionIdApiVersion/src/index.ts index 84314295c4..9a12c4595d 100644 --- a/test/integration/generated/subscriptionIdApiVersion/src/index.ts +++ b/test/integration/generated/subscriptionIdApiVersion/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { SubscriptionIdApiVersionClient } from "./subscriptionIdApiVersionClient"; +export { SubscriptionIdApiVersionClientContext } from "./subscriptionIdApiVersionClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/subscriptionIdApiVersion/src/operations/group.ts b/test/integration/generated/subscriptionIdApiVersion/src/operations/group.ts index 1566d3c8cb..af41c3be01 100644 --- a/test/integration/generated/subscriptionIdApiVersion/src/operations/group.ts +++ b/test/integration/generated/subscriptionIdApiVersion/src/operations/group.ts @@ -10,7 +10,7 @@ import { Group } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SubscriptionIdApiVersionClient } from "../subscriptionIdApiVersionClient"; +import { SubscriptionIdApiVersionClientContext } from "../subscriptionIdApiVersionClientContext"; import { GroupGetSampleResourceGroupOptionalParams, GroupGetSampleResourceGroupResponse @@ -18,13 +18,13 @@ import { /** Class containing Group operations. */ export class GroupImpl implements Group { - private readonly client: SubscriptionIdApiVersionClient; + private readonly client: SubscriptionIdApiVersionClientContext; /** * Initialize a new instance of the class Group class. * @param client Reference to the service client */ - constructor(client: SubscriptionIdApiVersionClient) { + constructor(client: SubscriptionIdApiVersionClientContext) { this.client = client; } diff --git a/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClient.ts b/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClient.ts index c2010bce20..5181264149 100644 --- a/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClient.ts +++ b/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClient.ts @@ -6,16 +6,12 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { GroupImpl } from "./operations"; import { Group } from "./operationsInterfaces"; +import { SubscriptionIdApiVersionClientContext } from "./subscriptionIdApiVersionClientContext"; import { SubscriptionIdApiVersionClientOptionalParams } from "./models"; -export class SubscriptionIdApiVersionClient extends coreClient.ServiceClient { - $host: string; - subscriptionId: string; - apiVersion: string; - +export class SubscriptionIdApiVersionClient extends SubscriptionIdApiVersionClientContext { /** * Initializes a new instance of the SubscriptionIdApiVersionClient class. * @param subscriptionId Subscription Id. @@ -25,39 +21,7 @@ export class SubscriptionIdApiVersionClient extends coreClient.ServiceClient { subscriptionId: string, options?: SubscriptionIdApiVersionClientOptionalParams ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: SubscriptionIdApiVersionClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-subscriptionid-apiversion/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "2014-04-01-preview"; + super(subscriptionId, options); this.group = new GroupImpl(this); } diff --git a/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClientContext.ts b/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClientContext.ts new file mode 100644 index 0000000000..dc7d3d7aca --- /dev/null +++ b/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClientContext.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { SubscriptionIdApiVersionClientOptionalParams } from "./models"; + +export class SubscriptionIdApiVersionClientContext extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the SubscriptionIdApiVersionClientContext class. + * @param subscriptionId Subscription Id. + * @param options The parameter options + */ + constructor( + subscriptionId: string, + options?: SubscriptionIdApiVersionClientOptionalParams + ) { + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: SubscriptionIdApiVersionClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-subscriptionid-apiversion/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "2014-04-01-preview"; + } +} diff --git a/test/integration/generated/textanalytics/package.json b/test/integration/generated/textanalytics/package.json index 579e3e73ed..e688c4f8e6 100644 --- a/test/integration/generated/textanalytics/package.json +++ b/test/integration/generated/textanalytics/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/textanalytics/src/generatedClient.ts b/test/integration/generated/textanalytics/src/generatedClient.ts index 3e35781635..d67f5bc228 100644 --- a/test/integration/generated/textanalytics/src/generatedClient.ts +++ b/test/integration/generated/textanalytics/src/generatedClient.ts @@ -9,6 +9,7 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { GeneratedClientContext } from "./generatedClientContext"; import { GeneratedClientOptionalParams, AnalyzeOptionalParams, @@ -38,9 +39,7 @@ import { } from "./models"; /** @internal */ -export class GeneratedClient extends coreClient.ServiceClient { - endpoint: string; - +export class GeneratedClient extends GeneratedClientContext { /** * Initializes a new instance of the GeneratedClient class. * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: @@ -48,35 +47,7 @@ export class GeneratedClient extends coreClient.ServiceClient { * @param options The parameter options */ constructor(endpoint: string, options?: GeneratedClientOptionalParams) { - if (endpoint === undefined) { - throw new Error("'endpoint' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: GeneratedClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-textanalytics/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{Endpoint}/text/analytics/v3.1-preview.4" - }; - super(optionsWithDefaults); - // Parameter assignments - this.endpoint = endpoint; + super(endpoint, options); } /** diff --git a/test/integration/generated/textanalytics/src/generatedClientContext.ts b/test/integration/generated/textanalytics/src/generatedClientContext.ts new file mode 100644 index 0000000000..8d6dd24c73 --- /dev/null +++ b/test/integration/generated/textanalytics/src/generatedClientContext.ts @@ -0,0 +1,53 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { GeneratedClientOptionalParams } from "./models"; + +/** @internal */ +export class GeneratedClientContext extends coreClient.ServiceClient { + endpoint: string; + + /** + * Initializes a new instance of the GeneratedClientContext class. + * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: + * https://westus.api.cognitive.microsoft.com). + * @param options The parameter options + */ + constructor(endpoint: string, options?: GeneratedClientOptionalParams) { + if (endpoint === undefined) { + throw new Error("'endpoint' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: GeneratedClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-textanalytics/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{Endpoint}/text/analytics/v3.1-preview.4" + }; + super(optionsWithDefaults); + // Parameter assignments + this.endpoint = endpoint; + } +} diff --git a/test/integration/generated/textanalytics/src/index.ts b/test/integration/generated/textanalytics/src/index.ts index 657fb6d642..3aebf3c9a5 100644 --- a/test/integration/generated/textanalytics/src/index.ts +++ b/test/integration/generated/textanalytics/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { GeneratedClient } from "./generatedClient"; +export { GeneratedClientContext } from "./generatedClientContext"; diff --git a/test/integration/generated/url/package.json b/test/integration/generated/url/package.json index 1b76589909..4e00c5f94e 100644 --- a/test/integration/generated/url/package.json +++ b/test/integration/generated/url/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/url/src/index.ts b/test/integration/generated/url/src/index.ts index 16bc9dbd78..e20342e593 100644 --- a/test/integration/generated/url/src/index.ts +++ b/test/integration/generated/url/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { UrlClient } from "./urlClient"; +export { UrlClientContext } from "./urlClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/url/src/operations/pathItems.ts b/test/integration/generated/url/src/operations/pathItems.ts index a69f72e3d6..84fd4cee14 100644 --- a/test/integration/generated/url/src/operations/pathItems.ts +++ b/test/integration/generated/url/src/operations/pathItems.ts @@ -10,7 +10,7 @@ import { PathItems } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { UrlClient } from "../urlClient"; +import { UrlClientContext } from "../urlClientContext"; import { PathItemsGetAllWithValuesOptionalParams, PathItemsGetGlobalQueryNullOptionalParams, @@ -20,13 +20,13 @@ import { /** Class containing PathItems operations. */ export class PathItemsImpl implements PathItems { - private readonly client: UrlClient; + private readonly client: UrlClientContext; /** * Initialize a new instance of the class PathItems class. * @param client Reference to the service client */ - constructor(client: UrlClient) { + constructor(client: UrlClientContext) { this.client = client; } diff --git a/test/integration/generated/url/src/operations/paths.ts b/test/integration/generated/url/src/operations/paths.ts index 8af1157c11..aa7d81056b 100644 --- a/test/integration/generated/url/src/operations/paths.ts +++ b/test/integration/generated/url/src/operations/paths.ts @@ -10,7 +10,7 @@ import { Paths } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { UrlClient } from "../urlClient"; +import { UrlClientContext } from "../urlClientContext"; import { PathsGetBooleanTrueOptionalParams, PathsGetBooleanFalseOptionalParams, @@ -44,13 +44,13 @@ import { /** Class containing Paths operations. */ export class PathsImpl implements Paths { - private readonly client: UrlClient; + private readonly client: UrlClientContext; /** * Initialize a new instance of the class Paths class. * @param client Reference to the service client */ - constructor(client: UrlClient) { + constructor(client: UrlClientContext) { this.client = client; } diff --git a/test/integration/generated/url/src/operations/queries.ts b/test/integration/generated/url/src/operations/queries.ts index 1bfa356e60..15df402b64 100644 --- a/test/integration/generated/url/src/operations/queries.ts +++ b/test/integration/generated/url/src/operations/queries.ts @@ -10,7 +10,7 @@ import { Queries } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { UrlClient } from "../urlClient"; +import { UrlClientContext } from "../urlClientContext"; import { QueriesGetBooleanTrueOptionalParams, QueriesGetBooleanFalseOptionalParams, @@ -51,13 +51,13 @@ import { /** Class containing Queries operations. */ export class QueriesImpl implements Queries { - private readonly client: UrlClient; + private readonly client: UrlClientContext; /** * Initialize a new instance of the class Queries class. * @param client Reference to the service client */ - constructor(client: UrlClient) { + constructor(client: UrlClientContext) { this.client = client; } diff --git a/test/integration/generated/url/src/urlClient.ts b/test/integration/generated/url/src/urlClient.ts index 736c18a7e4..b83046f6f1 100644 --- a/test/integration/generated/url/src/urlClient.ts +++ b/test/integration/generated/url/src/urlClient.ts @@ -6,54 +6,19 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { PathsImpl, QueriesImpl, PathItemsImpl } from "./operations"; import { Paths, Queries, PathItems } from "./operationsInterfaces"; +import { UrlClientContext } from "./urlClientContext"; import { UrlClientOptionalParams } from "./models"; -export class UrlClient extends coreClient.ServiceClient { - $host: string; - globalStringPath: string; - globalStringQuery?: string; - +export class UrlClient extends UrlClientContext { /** * Initializes a new instance of the UrlClient class. * @param globalStringPath A string value 'globalItemStringPath' that appears in the path * @param options The parameter options */ constructor(globalStringPath: string, options?: UrlClientOptionalParams) { - if (globalStringPath === undefined) { - throw new Error("'globalStringPath' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: UrlClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-url/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - // Parameter assignments - this.globalStringPath = globalStringPath; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(globalStringPath, options); this.paths = new PathsImpl(this); this.queries = new QueriesImpl(this); this.pathItems = new PathItemsImpl(this); diff --git a/test/integration/generated/url/src/urlClientContext.ts b/test/integration/generated/url/src/urlClientContext.ts new file mode 100644 index 0000000000..6071da34a2 --- /dev/null +++ b/test/integration/generated/url/src/urlClientContext.ts @@ -0,0 +1,56 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { UrlClientOptionalParams } from "./models"; + +export class UrlClientContext extends coreClient.ServiceClient { + $host: string; + globalStringPath: string; + globalStringQuery?: string; + + /** + * Initializes a new instance of the UrlClientContext class. + * @param globalStringPath A string value 'globalItemStringPath' that appears in the path + * @param options The parameter options + */ + constructor(globalStringPath: string, options?: UrlClientOptionalParams) { + if (globalStringPath === undefined) { + throw new Error("'globalStringPath' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: UrlClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-url/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + // Parameter assignments + this.globalStringPath = globalStringPath; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/url2/package.json b/test/integration/generated/url2/package.json index 1b76589909..4e00c5f94e 100644 --- a/test/integration/generated/url2/package.json +++ b/test/integration/generated/url2/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/url2/src/index.ts b/test/integration/generated/url2/src/index.ts index 16bc9dbd78..e20342e593 100644 --- a/test/integration/generated/url2/src/index.ts +++ b/test/integration/generated/url2/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { UrlClient } from "./urlClient"; +export { UrlClientContext } from "./urlClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/url2/src/operations/get.ts b/test/integration/generated/url2/src/operations/get.ts index d14dae3cf0..608c2ccac9 100644 --- a/test/integration/generated/url2/src/operations/get.ts +++ b/test/integration/generated/url2/src/operations/get.ts @@ -9,18 +9,18 @@ import { Get } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Parameters from "../models/parameters"; -import { UrlClient } from "../urlClient"; +import { UrlClientContext } from "../urlClientContext"; import { GetUrlOptionalParams, GetUrlResponse } from "../models"; /** Class containing Get operations. */ export class GetImpl implements Get { - private readonly client: UrlClient; + private readonly client: UrlClientContext; /** * Initialize a new instance of the class Get class. * @param client Reference to the service client */ - constructor(client: UrlClient) { + constructor(client: UrlClientContext) { this.client = client; } diff --git a/test/integration/generated/url2/src/urlClient.ts b/test/integration/generated/url2/src/urlClient.ts index 953d273ba4..07725ee6a4 100644 --- a/test/integration/generated/url2/src/urlClient.ts +++ b/test/integration/generated/url2/src/urlClient.ts @@ -6,49 +6,19 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { GetImpl } from "./operations"; import { Get } from "./operationsInterfaces"; +import { UrlClientContext } from "./urlClientContext"; import { UrlClientOptionalParams } from "./models"; -export class UrlClient extends coreClient.ServiceClient { - $host: string; - +export class UrlClient extends UrlClientContext { /** * Initializes a new instance of the UrlClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: UrlClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: UrlClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-url/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; + super($host, options); this.get = new GetImpl(this); } diff --git a/test/integration/generated/url2/src/urlClientContext.ts b/test/integration/generated/url2/src/urlClientContext.ts new file mode 100644 index 0000000000..00fe829509 --- /dev/null +++ b/test/integration/generated/url2/src/urlClientContext.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { UrlClientOptionalParams } from "./models"; + +export class UrlClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the UrlClientContext class. + * @param $host server parameter + * @param options The parameter options + */ + constructor($host: string, options?: UrlClientOptionalParams) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: UrlClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-url/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + } +} diff --git a/test/integration/generated/urlMulti/package.json b/test/integration/generated/urlMulti/package.json index bbeb31e2b1..2b5564962e 100644 --- a/test/integration/generated/urlMulti/package.json +++ b/test/integration/generated/urlMulti/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/urlMulti/src/index.ts b/test/integration/generated/urlMulti/src/index.ts index 323d550fed..6410dfe50b 100644 --- a/test/integration/generated/urlMulti/src/index.ts +++ b/test/integration/generated/urlMulti/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { UrlMultiClient } from "./urlMultiClient"; +export { UrlMultiClientContext } from "./urlMultiClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/urlMulti/src/operations/queries.ts b/test/integration/generated/urlMulti/src/operations/queries.ts index e3bbf14d7c..681edf9807 100644 --- a/test/integration/generated/urlMulti/src/operations/queries.ts +++ b/test/integration/generated/urlMulti/src/operations/queries.ts @@ -10,7 +10,7 @@ import { Queries } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { UrlMultiClient } from "../urlMultiClient"; +import { UrlMultiClientContext } from "../urlMultiClientContext"; import { QueriesArrayStringMultiNullOptionalParams, QueriesArrayStringMultiEmptyOptionalParams, @@ -19,13 +19,13 @@ import { /** Class containing Queries operations. */ export class QueriesImpl implements Queries { - private readonly client: UrlMultiClient; + private readonly client: UrlMultiClientContext; /** * Initialize a new instance of the class Queries class. * @param client Reference to the service client */ - constructor(client: UrlMultiClient) { + constructor(client: UrlMultiClientContext) { this.client = client; } diff --git a/test/integration/generated/urlMulti/src/urlMultiClient.ts b/test/integration/generated/urlMulti/src/urlMultiClient.ts index 6699a49a0c..8aab277c0e 100644 --- a/test/integration/generated/urlMulti/src/urlMultiClient.ts +++ b/test/integration/generated/urlMulti/src/urlMultiClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { QueriesImpl } from "./operations"; import { Queries } from "./operationsInterfaces"; +import { UrlMultiClientContext } from "./urlMultiClientContext"; import { UrlMultiClientOptionalParams } from "./models"; -export class UrlMultiClient extends coreClient.ServiceClient { - $host: string; - +export class UrlMultiClient extends UrlMultiClientContext { /** * Initializes a new instance of the UrlMultiClient class. * @param options The parameter options */ constructor(options?: UrlMultiClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: UrlMultiClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-url-multi/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.queries = new QueriesImpl(this); } diff --git a/test/integration/generated/urlMulti/src/urlMultiClientContext.ts b/test/integration/generated/urlMulti/src/urlMultiClientContext.ts new file mode 100644 index 0000000000..bfd2b05ce3 --- /dev/null +++ b/test/integration/generated/urlMulti/src/urlMultiClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { UrlMultiClientOptionalParams } from "./models"; + +export class UrlMultiClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the UrlMultiClientContext class. + * @param options The parameter options + */ + constructor(options?: UrlMultiClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: UrlMultiClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-url-multi/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/urlRest/package.json b/test/integration/generated/urlRest/package.json index 7c332f5a21..72582d221f 100644 --- a/test/integration/generated/urlRest/package.json +++ b/test/integration/generated/urlRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "MIT", + "license": "ISC", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/urlRest/src/urlRestClient.ts b/test/integration/generated/urlRest/src/urlRestClient.ts index ad7f8dd493..02a9de7879 100644 --- a/test/integration/generated/urlRest/src/urlRestClient.ts +++ b/test/integration/generated/urlRest/src/urlRestClient.ts @@ -206,423 +206,6 @@ import { import { getClient, ClientOptions, Client } from "@azure-rest/core-client"; import "@azure/core-auth"; -/** Contains operations for Paths operations */ -export interface PathsOperations { - /** Get true Boolean value on path */ - getBooleanTrue( - boolPath: true, - options?: PathsGetBooleanTrueParameters - ): Promise< - PathsGetBooleanTrue200Response | PathsGetBooleanTruedefaultResponse - >; - /** Get false Boolean value on path */ - getBooleanFalse( - boolPath: false, - options?: PathsGetBooleanFalseParameters - ): Promise< - PathsGetBooleanFalse200Response | PathsGetBooleanFalsedefaultResponse - >; - /** Get '1000000' integer value */ - getIntOneMillion( - intPath: 1000000, - options?: PathsGetIntOneMillionParameters - ): Promise< - PathsGetIntOneMillion200Response | PathsGetIntOneMilliondefaultResponse - >; - /** Get '-1000000' integer value */ - getIntNegativeOneMillion( - intPath: -1000000, - options?: PathsGetIntNegativeOneMillionParameters - ): Promise< - | PathsGetIntNegativeOneMillion200Response - | PathsGetIntNegativeOneMilliondefaultResponse - >; - /** Get '10000000000' 64 bit integer value */ - getTenBillion( - longPath: 10000000000, - options?: PathsGetTenBillionParameters - ): Promise; - /** Get '-10000000000' 64 bit integer value */ - getNegativeTenBillion( - longPath: -10000000000, - options?: PathsGetNegativeTenBillionParameters - ): Promise< - | PathsGetNegativeTenBillion200Response - | PathsGetNegativeTenBilliondefaultResponse - >; - /** Get '1.034E+20' numeric value */ - floatScientificPositive( - floatPath: 103400000000000000000, - options?: PathsFloatScientificPositiveParameters - ): Promise< - | PathsFloatScientificPositive200Response - | PathsFloatScientificPositivedefaultResponse - >; - /** Get '-1.034E-20' numeric value */ - floatScientificNegative( - floatPath: -1.034e-20, - options?: PathsFloatScientificNegativeParameters - ): Promise< - | PathsFloatScientificNegative200Response - | PathsFloatScientificNegativedefaultResponse - >; - /** Get '9999999.999' numeric value */ - doubleDecimalPositive( - doublePath: 9999999.999, - options?: PathsDoubleDecimalPositiveParameters - ): Promise< - | PathsDoubleDecimalPositive200Response - | PathsDoubleDecimalPositivedefaultResponse - >; - /** Get '-9999999.999' numeric value */ - doubleDecimalNegative( - doublePath: -9999999.999, - options?: PathsDoubleDecimalNegativeParameters - ): Promise< - | PathsDoubleDecimalNegative200Response - | PathsDoubleDecimalNegativedefaultResponse - >; - /** Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value */ - stringUnicode( - stringPath: "啊齄丂狛狜隣郎隣兀﨩", - options?: PathsStringUnicodeParameters - ): Promise; - /** Get 'begin!*'();:@ &=+$,/?#[]end */ - stringUrlEncoded( - stringPath: "begin!*'();:@ &=+$,/?#[]end", - options?: PathsStringUrlEncodedParameters - ): Promise< - PathsStringUrlEncoded200Response | PathsStringUrlEncodeddefaultResponse - >; - /** https://tools.ietf.org/html/rfc3986#appendix-A 'path' accept any 'pchar' not encoded */ - stringUrlNonEncoded( - stringPath: "begin!*'();:@&=+$,end", - options?: PathsStringUrlNonEncodedParameters - ): Promise< - | PathsStringUrlNonEncoded200Response - | PathsStringUrlNonEncodeddefaultResponse - >; - /** Get '' */ - stringEmpty( - stringPath: "", - options?: PathsStringEmptyParameters - ): Promise; - /** Get null (should throw) */ - stringNull( - stringPath: string, - options?: PathsStringNullParameters - ): Promise; - /** Get using uri with 'green color' in path parameter */ - enumValid( - enumPath: "red color" | "green color" | "blue color", - options?: PathsEnumValidParameters - ): Promise; - /** Get null (should throw on the client before the request is sent on wire) */ - enumNull( - enumPath: "red color" | "green color" | "blue color", - options?: PathsEnumNullParameters - ): Promise; - /** Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array */ - byteMultiByte( - bytePath: string, - options?: PathsByteMultiByteParameters - ): Promise; - /** Get '' as byte array */ - byteEmpty( - bytePath: "", - options?: PathsByteEmptyParameters - ): Promise; - /** Get null as byte array (should throw) */ - byteNull( - bytePath: string, - options?: PathsByteNullParameters - ): Promise; - /** Get '2012-01-01' as date */ - dateValid( - datePath: "2012-01-01", - options?: PathsDateValidParameters - ): Promise; - /** Get null as date - this should throw or be unusable on the client side, depending on date representation */ - dateNull( - datePath: Date | string, - options?: PathsDateNullParameters - ): Promise; - /** Get '2012-01-01T01:01:01Z' as date-time */ - dateTimeValid( - dateTimePath: "2012-01-01T01:01:01Z", - options?: PathsDateTimeValidParameters - ): Promise; - /** Get null as date-time, should be disallowed or throw depending on representation of date-time */ - dateTimeNull( - dateTimePath: Date | string, - options?: PathsDateTimeNullParameters - ): Promise; - /** Get 'lorem' encoded value as 'bG9yZW0' (base64url) */ - base64Url( - base64UrlPath: string, - options?: PathsBase64UrlParameters - ): Promise; - /** Get an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format */ - arrayCsvInPath( - arrayPath: Array, - options?: PathsArrayCsvInPathParameters - ): Promise< - PathsArrayCsvInPath200Response | PathsArrayCsvInPathdefaultResponse - >; - /** Get the date 2016-04-13 encoded value as '1460505600' (Unix time) */ - unixTimeUrl( - unixTimeUrlPath: string, - options?: PathsUnixTimeUrlParameters - ): Promise; -} - -/** Contains operations for Queries operations */ -export interface QueriesOperations { - /** Get true Boolean value on path */ - getBooleanTrue( - options: QueriesGetBooleanTrueParameters - ): Promise< - QueriesGetBooleanTrue200Response | QueriesGetBooleanTruedefaultResponse - >; - /** Get false Boolean value on path */ - getBooleanFalse( - options: QueriesGetBooleanFalseParameters - ): Promise< - QueriesGetBooleanFalse200Response | QueriesGetBooleanFalsedefaultResponse - >; - /** Get null Boolean value on query (query string should be absent) */ - getBooleanNull( - options?: QueriesGetBooleanNullParameters - ): Promise< - QueriesGetBooleanNull200Response | QueriesGetBooleanNulldefaultResponse - >; - /** Get '1000000' integer value */ - getIntOneMillion( - options: QueriesGetIntOneMillionParameters - ): Promise< - QueriesGetIntOneMillion200Response | QueriesGetIntOneMilliondefaultResponse - >; - /** Get '-1000000' integer value */ - getIntNegativeOneMillion( - options: QueriesGetIntNegativeOneMillionParameters - ): Promise< - | QueriesGetIntNegativeOneMillion200Response - | QueriesGetIntNegativeOneMilliondefaultResponse - >; - /** Get null integer value (no query parameter) */ - getIntNull( - options?: QueriesGetIntNullParameters - ): Promise; - /** Get '10000000000' 64 bit integer value */ - getTenBillion( - options: QueriesGetTenBillionParameters - ): Promise< - QueriesGetTenBillion200Response | QueriesGetTenBilliondefaultResponse - >; - /** Get '-10000000000' 64 bit integer value */ - getNegativeTenBillion( - options: QueriesGetNegativeTenBillionParameters - ): Promise< - | QueriesGetNegativeTenBillion200Response - | QueriesGetNegativeTenBilliondefaultResponse - >; - /** Get 'null 64 bit integer value (no query param in uri) */ - getLongNull( - options?: QueriesGetLongNullParameters - ): Promise; - /** Get '1.034E+20' numeric value */ - floatScientificPositive( - options: QueriesFloatScientificPositiveParameters - ): Promise< - | QueriesFloatScientificPositive200Response - | QueriesFloatScientificPositivedefaultResponse - >; - /** Get '-1.034E-20' numeric value */ - floatScientificNegative( - options: QueriesFloatScientificNegativeParameters - ): Promise< - | QueriesFloatScientificNegative200Response - | QueriesFloatScientificNegativedefaultResponse - >; - /** Get null numeric value (no query parameter) */ - floatNull( - options?: QueriesFloatNullParameters - ): Promise; - /** Get '9999999.999' numeric value */ - doubleDecimalPositive( - options: QueriesDoubleDecimalPositiveParameters - ): Promise< - | QueriesDoubleDecimalPositive200Response - | QueriesDoubleDecimalPositivedefaultResponse - >; - /** Get '-9999999.999' numeric value */ - doubleDecimalNegative( - options: QueriesDoubleDecimalNegativeParameters - ): Promise< - | QueriesDoubleDecimalNegative200Response - | QueriesDoubleDecimalNegativedefaultResponse - >; - /** Get null numeric value (no query parameter) */ - doubleNull( - options?: QueriesDoubleNullParameters - ): Promise; - /** Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value */ - stringUnicode( - options: QueriesStringUnicodeParameters - ): Promise< - QueriesStringUnicode200Response | QueriesStringUnicodedefaultResponse - >; - /** Get 'begin!*'();:@ &=+$,/?#[]end */ - stringUrlEncoded( - options: QueriesStringUrlEncodedParameters - ): Promise< - QueriesStringUrlEncoded200Response | QueriesStringUrlEncodeddefaultResponse - >; - /** Get '' */ - stringEmpty( - options: QueriesStringEmptyParameters - ): Promise; - /** Get null (no query parameter in url) */ - stringNull( - options?: QueriesStringNullParameters - ): Promise; - /** Get using uri with query parameter 'green color' */ - enumValid( - options?: QueriesEnumValidParameters - ): Promise; - /** Get null (no query parameter in url) */ - enumNull( - options?: QueriesEnumNullParameters - ): Promise; - /** Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array */ - byteMultiByte( - options?: QueriesByteMultiByteParameters - ): Promise< - QueriesByteMultiByte200Response | QueriesByteMultiBytedefaultResponse - >; - /** Get '' as byte array */ - byteEmpty( - options: QueriesByteEmptyParameters - ): Promise; - /** Get null as byte array (no query parameters in uri) */ - byteNull( - options?: QueriesByteNullParameters - ): Promise; - /** Get '2012-01-01' as date */ - dateValid( - options: QueriesDateValidParameters - ): Promise; - /** Get null as date - this should result in no query parameters in uri */ - dateNull( - options?: QueriesDateNullParameters - ): Promise; - /** Get '2012-01-01T01:01:01Z' as date-time */ - dateTimeValid( - options: QueriesDateTimeValidParameters - ): Promise< - QueriesDateTimeValid200Response | QueriesDateTimeValiddefaultResponse - >; - /** Get null as date-time, should result in no query parameters in uri */ - dateTimeNull( - options?: QueriesDateTimeNullParameters - ): Promise< - QueriesDateTimeNull200Response | QueriesDateTimeNulldefaultResponse - >; - /** Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format */ - arrayStringCsvValid( - options?: QueriesArrayStringCsvValidParameters - ): Promise< - | QueriesArrayStringCsvValid200Response - | QueriesArrayStringCsvValiddefaultResponse - >; - /** Get a null array of string using the csv-array format */ - arrayStringCsvNull( - options?: QueriesArrayStringCsvNullParameters - ): Promise< - | QueriesArrayStringCsvNull200Response - | QueriesArrayStringCsvNulldefaultResponse - >; - /** Get an empty array [] of string using the csv-array format */ - arrayStringCsvEmpty( - options?: QueriesArrayStringCsvEmptyParameters - ): Promise< - | QueriesArrayStringCsvEmpty200Response - | QueriesArrayStringCsvEmptydefaultResponse - >; - /** Array query has no defined collection format, should default to csv. Pass in ['hello', 'nihao', 'bonjour'] for the 'arrayQuery' parameter to the service */ - arrayStringNoCollectionFormatEmpty( - options?: QueriesArrayStringNoCollectionFormatEmptyParameters - ): Promise< - | QueriesArrayStringNoCollectionFormatEmpty200Response - | QueriesArrayStringNoCollectionFormatEmptydefaultResponse - >; - /** Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format */ - arrayStringSsvValid( - options?: QueriesArrayStringSsvValidParameters - ): Promise< - | QueriesArrayStringSsvValid200Response - | QueriesArrayStringSsvValiddefaultResponse - >; - /** Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format */ - arrayStringTsvValid( - options?: QueriesArrayStringTsvValidParameters - ): Promise< - | QueriesArrayStringTsvValid200Response - | QueriesArrayStringTsvValiddefaultResponse - >; - /** Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format */ - arrayStringPipesValid( - options?: QueriesArrayStringPipesValidParameters - ): Promise< - | QueriesArrayStringPipesValid200Response - | QueriesArrayStringPipesValiddefaultResponse - >; -} - -/** Contains operations for PathItems operations */ -export interface PathItemsOperations { - /** send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery' */ - getAllWithValues( - globalStringPath: string, - pathItemStringPath: string, - localStringPath: string, - options?: PathItemsGetAllWithValuesParameters - ): Promise< - | PathItemsGetAllWithValues200Response - | PathItemsGetAllWithValuesdefaultResponse - >; - /** send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery' */ - getGlobalQueryNull( - globalStringPath: string, - pathItemStringPath: string, - localStringPath: string, - options?: PathItemsGetGlobalQueryNullParameters - ): Promise< - | PathItemsGetGlobalQueryNull200Response - | PathItemsGetGlobalQueryNulldefaultResponse - >; - /** send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null */ - getGlobalAndLocalQueryNull( - globalStringPath: string, - pathItemStringPath: string, - localStringPath: string, - options?: PathItemsGetGlobalAndLocalQueryNullParameters - ): Promise< - | PathItemsGetGlobalAndLocalQueryNull200Response - | PathItemsGetGlobalAndLocalQueryNulldefaultResponse - >; - /** send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null */ - getLocalPathItemQueryNull( - globalStringPath: string, - pathItemStringPath: string, - localStringPath: string, - options?: PathItemsGetLocalPathItemQueryNullParameters - ): Promise< - | PathItemsGetLocalPathItemQueryNull200Response - | PathItemsGetLocalPathItemQueryNulldefaultResponse - >; -} - export interface PathsGetBooleanTrue { /** Get true Boolean value on path */ get( @@ -1411,9 +994,6 @@ export interface Routes { export type UrlRestClientRestClient = Client & { path: Routes; - paths: PathsOperations; - queries: QueriesOperations; - pathItems: PathItemsOperations; }; export default function UrlRestClient( @@ -1421,330 +1001,9 @@ export default function UrlRestClient( ): UrlRestClientRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - const client = getClient(baseUrl, options) as UrlRestClientRestClient; - - return { - ...client, - paths: { - getBooleanTrue: (boolPath, options) => { - return client - .path("/paths/bool/true/{boolPath}", boolPath) - .get(options); - }, - getBooleanFalse: (boolPath, options) => { - return client - .path("/paths/bool/false/{boolPath}", boolPath) - .get(options); - }, - getIntOneMillion: (intPath, options) => { - return client - .path("/paths/int/1000000/{intPath}", intPath) - .get(options); - }, - getIntNegativeOneMillion: (intPath, options) => { - return client - .path("/paths/int/-1000000/{intPath}", intPath) - .get(options); - }, - getTenBillion: (longPath, options) => { - return client - .path("/paths/long/10000000000/{longPath}", longPath) - .get(options); - }, - getNegativeTenBillion: (longPath, options) => { - return client - .path("/paths/long/-10000000000/{longPath}", longPath) - .get(options); - }, - floatScientificPositive: (floatPath, options) => { - return client - .path("/paths/float/1.034E+20/{floatPath}", floatPath) - .get(options); - }, - floatScientificNegative: (floatPath, options) => { - return client - .path("/paths/float/-1.034E-20/{floatPath}", floatPath) - .get(options); - }, - doubleDecimalPositive: (doublePath, options) => { - return client - .path("/paths/double/9999999.999/{doublePath}", doublePath) - .get(options); - }, - doubleDecimalNegative: (doublePath, options) => { - return client - .path("/paths/double/-9999999.999/{doublePath}", doublePath) - .get(options); - }, - stringUnicode: (stringPath, options) => { - return client - .path("/paths/string/unicode/{stringPath}", stringPath) - .get(options); - }, - stringUrlEncoded: (stringPath, options) => { - return client - .path( - "/paths/string/begin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend/{stringPath}", - stringPath - ) - .get(options); - }, - stringUrlNonEncoded: (stringPath, options) => { - return client - .path("/paths/string/begin!*'();:@&=+$,end/{stringPath}", stringPath) - .get(options); - }, - stringEmpty: (stringPath, options) => { - return client - .path("/paths/string/empty/{stringPath}", stringPath) - .get(options); - }, - stringNull: (stringPath, options) => { - return client - .path("/paths/string/null/{stringPath}", stringPath) - .get(options); - }, - enumValid: (enumPath, options) => { - return client - .path("/paths/enum/green%20color/{enumPath}", enumPath) - .get(options); - }, - enumNull: (enumPath, options) => { - return client - .path("/paths/string/null/{enumPath}", enumPath) - .get(options); - }, - byteMultiByte: (bytePath, options) => { - return client - .path("/paths/byte/multibyte/{bytePath}", bytePath) - .get(options); - }, - byteEmpty: (bytePath, options) => { - return client - .path("/paths/byte/empty/{bytePath}", bytePath) - .get(options); - }, - byteNull: (bytePath, options) => { - return client - .path("/paths/byte/null/{bytePath}", bytePath) - .get(options); - }, - dateValid: (datePath, options) => { - return client - .path("/paths/date/2012-01-01/{datePath}", datePath) - .get(options); - }, - dateNull: (datePath, options) => { - return client - .path("/paths/date/null/{datePath}", datePath) - .get(options); - }, - dateTimeValid: (dateTimePath, options) => { - return client - .path( - "/paths/datetime/2012-01-01T01%3A01%3A01Z/{dateTimePath}", - dateTimePath - ) - .get(options); - }, - dateTimeNull: (dateTimePath, options) => { - return client - .path("/paths/datetime/null/{dateTimePath}", dateTimePath) - .get(options); - }, - base64Url: (base64UrlPath, options) => { - return client - .path("/paths/string/bG9yZW0/{base64UrlPath}", base64UrlPath) - .get(options); - }, - arrayCsvInPath: (arrayPath, options) => { - return client - .path( - "/paths/array/ArrayPath1%2cbegin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend%2c%2c/{arrayPath}", - arrayPath - ) - .get(options); - }, - unixTimeUrl: (unixTimeUrlPath, options) => { - return client - .path("/paths/int/1460505600/{unixTimeUrlPath}", unixTimeUrlPath) - .get(options); - } - }, - queries: { - getBooleanTrue: (options) => { - return client.path("/queries/bool/true").get(options); - }, - getBooleanFalse: (options) => { - return client.path("/queries/bool/false").get(options); - }, - getBooleanNull: (options) => { - return client.path("/queries/bool/null").get(options); - }, - getIntOneMillion: (options) => { - return client.path("/queries/int/1000000").get(options); - }, - getIntNegativeOneMillion: (options) => { - return client.path("/queries/int/-1000000").get(options); - }, - getIntNull: (options) => { - return client.path("/queries/int/null").get(options); - }, - getTenBillion: (options) => { - return client.path("/queries/long/10000000000").get(options); - }, - getNegativeTenBillion: (options) => { - return client.path("/queries/long/-10000000000").get(options); - }, - getLongNull: (options) => { - return client.path("/queries/long/null").get(options); - }, - floatScientificPositive: (options) => { - return client.path("/queries/float/1.034E+20").get(options); - }, - floatScientificNegative: (options) => { - return client.path("/queries/float/-1.034E-20").get(options); - }, - floatNull: (options) => { - return client.path("/queries/float/null").get(options); - }, - doubleDecimalPositive: (options) => { - return client.path("/queries/double/9999999.999").get(options); - }, - doubleDecimalNegative: (options) => { - return client.path("/queries/double/-9999999.999").get(options); - }, - doubleNull: (options) => { - return client.path("/queries/double/null").get(options); - }, - stringUnicode: (options) => { - return client.path("/queries/string/unicode/").get(options); - }, - stringUrlEncoded: (options) => { - return client - .path( - "/queries/string/begin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend" - ) - .get(options); - }, - stringEmpty: (options) => { - return client.path("/queries/string/empty").get(options); - }, - stringNull: (options) => { - return client.path("/queries/string/null").get(options); - }, - enumValid: (options) => { - return client.path("/queries/enum/green%20color").get(options); - }, - enumNull: (options) => { - return client.path("/queries/enum/null").get(options); - }, - byteMultiByte: (options) => { - return client.path("/queries/byte/multibyte").get(options); - }, - byteEmpty: (options) => { - return client.path("/queries/byte/empty").get(options); - }, - byteNull: (options) => { - return client.path("/queries/byte/null").get(options); - }, - dateValid: (options) => { - return client.path("/queries/date/2012-01-01").get(options); - }, - dateNull: (options) => { - return client.path("/queries/date/null").get(options); - }, - dateTimeValid: (options) => { - return client - .path("/queries/datetime/2012-01-01T01%3A01%3A01Z") - .get(options); - }, - dateTimeNull: (options) => { - return client.path("/queries/datetime/null").get(options); - }, - arrayStringCsvValid: (options) => { - return client.path("/queries/array/csv/string/valid").get(options); - }, - arrayStringCsvNull: (options) => { - return client.path("/queries/array/csv/string/null").get(options); - }, - arrayStringCsvEmpty: (options) => { - return client.path("/queries/array/csv/string/empty").get(options); - }, - arrayStringNoCollectionFormatEmpty: (options) => { - return client.path("/queries/array/none/string/empty").get(options); - }, - arrayStringSsvValid: (options) => { - return client.path("/queries/array/ssv/string/valid").get(options); - }, - arrayStringTsvValid: (options) => { - return client.path("/queries/array/tsv/string/valid").get(options); - }, - arrayStringPipesValid: (options) => { - return client.path("/queries/array/pipes/string/valid").get(options); - } - }, - pathItems: { - getAllWithValues: ( - globalStringPath, - pathItemStringPath, - localStringPath, - options - ) => { - return client - .path( - "/pathitem/nullable/globalStringPath/{globalStringPath}/pathItemStringPath/{pathItemStringPath}/localStringPath/{localStringPath}/globalStringQuery/pathItemStringQuery/localStringQuery", - globalStringPath, - pathItemStringPath, - localStringPath - ) - .get(options); - }, - getGlobalQueryNull: ( - globalStringPath, - pathItemStringPath, - localStringPath, - options - ) => { - return client - .path( - "/pathitem/nullable/globalStringPath/{globalStringPath}/pathItemStringPath/{pathItemStringPath}/localStringPath/{localStringPath}/null/pathItemStringQuery/localStringQuery", - globalStringPath, - pathItemStringPath, - localStringPath - ) - .get(options); - }, - getGlobalAndLocalQueryNull: ( - globalStringPath, - pathItemStringPath, - localStringPath, - options - ) => { - return client - .path( - "/pathitem/nullable/globalStringPath/{globalStringPath}/pathItemStringPath/{pathItemStringPath}/localStringPath/{localStringPath}/null/pathItemStringQuery/null", - globalStringPath, - pathItemStringPath, - localStringPath - ) - .get(options); - }, - getLocalPathItemQueryNull: ( - globalStringPath, - pathItemStringPath, - localStringPath, - options - ) => { - return client - .path( - "/pathitem/nullable/globalStringPath/{globalStringPath}/pathItemStringPath/{pathItemStringPath}/localStringPath/{localStringPath}/globalStringQuery/null/null", - globalStringPath, - pathItemStringPath, - localStringPath - ) - .get(options); - } - } - }; + return getClient( + baseUrl, + + options + ) as UrlRestClientRestClient; } diff --git a/test/integration/generated/urlRest/tsconfig.json b/test/integration/generated/urlRest/tsconfig.json index 0202cc6570..965341beea 100644 --- a/test/integration/generated/urlRest/tsconfig.json +++ b/test/integration/generated/urlRest/tsconfig.json @@ -7,5 +7,13 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "include": ["src/**/*.ts"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } diff --git a/test/integration/generated/useragentcorev1/package.json b/test/integration/generated/useragentcorev1/package.json index c99cf97989..0991895822 100644 --- a/test/integration/generated/useragentcorev1/package.json +++ b/test/integration/generated/useragentcorev1/package.json @@ -21,8 +21,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/useragentcorev1/src/index.ts b/test/integration/generated/useragentcorev1/src/index.ts index 93fea1e1df..fa5409e3dd 100644 --- a/test/integration/generated/useragentcorev1/src/index.ts +++ b/test/integration/generated/useragentcorev1/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { UserAgentCoreV1Client } from "./userAgentCoreV1Client"; +export { UserAgentCoreV1ClientContext } from "./userAgentCoreV1ClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/useragentcorev1/src/operations/group.ts b/test/integration/generated/useragentcorev1/src/operations/group.ts index 405796f207..6ffe3c7b98 100644 --- a/test/integration/generated/useragentcorev1/src/operations/group.ts +++ b/test/integration/generated/useragentcorev1/src/operations/group.ts @@ -10,7 +10,7 @@ import { Group } from "../operationsInterfaces"; import * as coreHttp from "@azure/core-http"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { UserAgentCoreV1Client } from "../userAgentCoreV1Client"; +import { UserAgentCoreV1ClientContext } from "../userAgentCoreV1ClientContext"; import { GroupGetSampleResourceGroupOptionalParams, GroupGetSampleResourceGroupResponse @@ -18,13 +18,13 @@ import { /** Class containing Group operations. */ export class GroupImpl implements Group { - private readonly client: UserAgentCoreV1Client; + private readonly client: UserAgentCoreV1ClientContext; /** * Initialize a new instance of the class Group class. * @param client Reference to the service client */ - constructor(client: UserAgentCoreV1Client) { + constructor(client: UserAgentCoreV1ClientContext) { this.client = client; } diff --git a/test/integration/generated/useragentcorev1/src/userAgentCoreV1Client.ts b/test/integration/generated/useragentcorev1/src/userAgentCoreV1Client.ts index eb0d71e85d..0b98e48b01 100644 --- a/test/integration/generated/useragentcorev1/src/userAgentCoreV1Client.ts +++ b/test/integration/generated/useragentcorev1/src/userAgentCoreV1Client.ts @@ -6,19 +6,12 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreHttp from "@azure/core-http"; import { GroupImpl } from "./operations"; import { Group } from "./operationsInterfaces"; +import { UserAgentCoreV1ClientContext } from "./userAgentCoreV1ClientContext"; import { UserAgentCoreV1ClientOptionalParams } from "./models"; -const packageName = "@msinternal/useragent-corev1"; -const packageVersion = "1.0.0-preview1"; - -export class UserAgentCoreV1Client extends coreHttp.ServiceClient { - $host: string; - subscriptionId: string; - apiVersion: string; - +export class UserAgentCoreV1Client extends UserAgentCoreV1ClientContext { /** * Initializes a new instance of the UserAgentCoreV1Client class. * @param subscriptionId Subscription Id. @@ -28,35 +21,7 @@ export class UserAgentCoreV1Client extends coreHttp.ServiceClient { subscriptionId: string, options?: UserAgentCoreV1ClientOptionalParams ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - - const defaultUserAgent = `azsdk-js-${packageName.replace( - /@.*\//, - "" - )}/${packageVersion} ${coreHttp.getDefaultUserAgentValue()}`; - - super(undefined, { - ...options, - userAgent: options.userAgent - ? `${options.userAgent} ${defaultUserAgent}` - : `${defaultUserAgent}` - }); - - this.requestContentType = "application/json; charset=utf-8"; - this.baseUri = options.endpoint || "http://localhost:3000"; - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "2014-04-01-preview"; + super(subscriptionId, options); this.group = new GroupImpl(this); } diff --git a/test/integration/generated/useragentcorev1/src/userAgentCoreV1ClientContext.ts b/test/integration/generated/useragentcorev1/src/userAgentCoreV1ClientContext.ts new file mode 100644 index 0000000000..98f03ee4bf --- /dev/null +++ b/test/integration/generated/useragentcorev1/src/userAgentCoreV1ClientContext.ts @@ -0,0 +1,59 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreHttp from "@azure/core-http"; +import { UserAgentCoreV1ClientOptionalParams } from "./models"; + +const packageName = "@msinternal/useragent-corev1"; +const packageVersion = "1.0.0-preview1"; + +export class UserAgentCoreV1ClientContext extends coreHttp.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the UserAgentCoreV1ClientContext class. + * @param subscriptionId Subscription Id. + * @param options The parameter options + */ + constructor( + subscriptionId: string, + options?: UserAgentCoreV1ClientOptionalParams + ) { + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + + const defaultUserAgent = `azsdk-js-${packageName.replace( + /@.*\//, + "" + )}/${packageVersion} ${coreHttp.getDefaultUserAgentValue()}`; + + super(undefined, { + ...options, + userAgent: options.userAgent + ? `${options.userAgent} ${defaultUserAgent}` + : `${defaultUserAgent}` + }); + + this.requestContentType = "application/json; charset=utf-8"; + this.baseUri = options.endpoint || "http://localhost:3000"; + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "2014-04-01-preview"; + } +} diff --git a/test/integration/generated/useragentcorev2/package.json b/test/integration/generated/useragentcorev2/package.json index 2fffbdf3cc..21d3ac88ac 100644 --- a/test/integration/generated/useragentcorev2/package.json +++ b/test/integration/generated/useragentcorev2/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/useragentcorev2/src/index.ts b/test/integration/generated/useragentcorev2/src/index.ts index 542d1e958f..0ad57cb7a8 100644 --- a/test/integration/generated/useragentcorev2/src/index.ts +++ b/test/integration/generated/useragentcorev2/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { UserAgentCoreV2Client } from "./userAgentCoreV2Client"; +export { UserAgentCoreV2ClientContext } from "./userAgentCoreV2ClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/useragentcorev2/src/operations/group.ts b/test/integration/generated/useragentcorev2/src/operations/group.ts index 5914eb2870..330e56d33d 100644 --- a/test/integration/generated/useragentcorev2/src/operations/group.ts +++ b/test/integration/generated/useragentcorev2/src/operations/group.ts @@ -10,7 +10,7 @@ import { Group } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { UserAgentCoreV2Client } from "../userAgentCoreV2Client"; +import { UserAgentCoreV2ClientContext } from "../userAgentCoreV2ClientContext"; import { GroupGetSampleResourceGroupOptionalParams, GroupGetSampleResourceGroupResponse @@ -18,13 +18,13 @@ import { /** Class containing Group operations. */ export class GroupImpl implements Group { - private readonly client: UserAgentCoreV2Client; + private readonly client: UserAgentCoreV2ClientContext; /** * Initialize a new instance of the class Group class. * @param client Reference to the service client */ - constructor(client: UserAgentCoreV2Client) { + constructor(client: UserAgentCoreV2ClientContext) { this.client = client; } diff --git a/test/integration/generated/useragentcorev2/src/userAgentCoreV2Client.ts b/test/integration/generated/useragentcorev2/src/userAgentCoreV2Client.ts index 8b0758bc51..d1509fad1d 100644 --- a/test/integration/generated/useragentcorev2/src/userAgentCoreV2Client.ts +++ b/test/integration/generated/useragentcorev2/src/userAgentCoreV2Client.ts @@ -6,16 +6,12 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { GroupImpl } from "./operations"; import { Group } from "./operationsInterfaces"; +import { UserAgentCoreV2ClientContext } from "./userAgentCoreV2ClientContext"; import { UserAgentCoreV2ClientOptionalParams } from "./models"; -export class UserAgentCoreV2Client extends coreClient.ServiceClient { - $host: string; - subscriptionId: string; - apiVersion: string; - +export class UserAgentCoreV2Client extends UserAgentCoreV2ClientContext { /** * Initializes a new instance of the UserAgentCoreV2Client class. * @param subscriptionId Subscription Id. @@ -25,39 +21,7 @@ export class UserAgentCoreV2Client extends coreClient.ServiceClient { subscriptionId: string, options?: UserAgentCoreV2ClientOptionalParams ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: UserAgentCoreV2ClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-useragent-corev2/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "2014-04-01-preview"; + super(subscriptionId, options); this.group = new GroupImpl(this); } diff --git a/test/integration/generated/useragentcorev2/src/userAgentCoreV2ClientContext.ts b/test/integration/generated/useragentcorev2/src/userAgentCoreV2ClientContext.ts new file mode 100644 index 0000000000..114864e2ad --- /dev/null +++ b/test/integration/generated/useragentcorev2/src/userAgentCoreV2ClientContext.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { UserAgentCoreV2ClientOptionalParams } from "./models"; + +export class UserAgentCoreV2ClientContext extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the UserAgentCoreV2ClientContext class. + * @param subscriptionId Subscription Id. + * @param options The parameter options + */ + constructor( + subscriptionId: string, + options?: UserAgentCoreV2ClientOptionalParams + ) { + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: UserAgentCoreV2ClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-useragent-corev2/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "2014-04-01-preview"; + } +} diff --git a/test/integration/generated/uuid/package.json b/test/integration/generated/uuid/package.json index 8883f088fa..c892662916 100644 --- a/test/integration/generated/uuid/package.json +++ b/test/integration/generated/uuid/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/uuid/src/index.ts b/test/integration/generated/uuid/src/index.ts index 145f796645..a9c86214b9 100644 --- a/test/integration/generated/uuid/src/index.ts +++ b/test/integration/generated/uuid/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { UuidClient } from "./uuidClient"; +export { UuidClientContext } from "./uuidClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/uuid/src/operations/get.ts b/test/integration/generated/uuid/src/operations/get.ts index f5bc9d342e..3c3f11d54d 100644 --- a/test/integration/generated/uuid/src/operations/get.ts +++ b/test/integration/generated/uuid/src/operations/get.ts @@ -9,18 +9,18 @@ import { Get } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Parameters from "../models/parameters"; -import { UuidClient } from "../uuidClient"; +import { UuidClientContext } from "../uuidClientContext"; import { GetUuidOptionalParams, GetUuidResponse } from "../models"; /** Class containing Get operations. */ export class GetImpl implements Get { - private readonly client: UuidClient; + private readonly client: UuidClientContext; /** * Initialize a new instance of the class Get class. * @param client Reference to the service client */ - constructor(client: UuidClient) { + constructor(client: UuidClientContext) { this.client = client; } diff --git a/test/integration/generated/uuid/src/uuidClient.ts b/test/integration/generated/uuid/src/uuidClient.ts index e9f223ea2b..7ca7a0c2f1 100644 --- a/test/integration/generated/uuid/src/uuidClient.ts +++ b/test/integration/generated/uuid/src/uuidClient.ts @@ -6,49 +6,19 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { GetImpl } from "./operations"; import { Get } from "./operationsInterfaces"; +import { UuidClientContext } from "./uuidClientContext"; import { UuidClientOptionalParams } from "./models"; -export class UuidClient extends coreClient.ServiceClient { - $host: string; - +export class UuidClient extends UuidClientContext { /** * Initializes a new instance of the UuidClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: UuidClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: UuidClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-uuid/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; + super($host, options); this.get = new GetImpl(this); } diff --git a/test/integration/generated/uuid/src/uuidClientContext.ts b/test/integration/generated/uuid/src/uuidClientContext.ts new file mode 100644 index 0000000000..d484458855 --- /dev/null +++ b/test/integration/generated/uuid/src/uuidClientContext.ts @@ -0,0 +1,51 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { UuidClientOptionalParams } from "./models"; + +export class UuidClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the UuidClientContext class. + * @param $host server parameter + * @param options The parameter options + */ + constructor($host: string, options?: UuidClientOptionalParams) { + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: UuidClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-uuid/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + } +} diff --git a/test/integration/generated/validation/package.json b/test/integration/generated/validation/package.json index 7c3cf41f92..5be6aec330 100644 --- a/test/integration/generated/validation/package.json +++ b/test/integration/generated/validation/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/validation/src/index.ts b/test/integration/generated/validation/src/index.ts index 758a222c7f..4fcb6fa545 100644 --- a/test/integration/generated/validation/src/index.ts +++ b/test/integration/generated/validation/src/index.ts @@ -8,3 +8,4 @@ export * from "./models"; export { ValidationClient } from "./validationClient"; +export { ValidationClientContext } from "./validationClientContext"; diff --git a/test/integration/generated/validation/src/validationClient.ts b/test/integration/generated/validation/src/validationClient.ts index 307ab0082b..d2de02e962 100644 --- a/test/integration/generated/validation/src/validationClient.ts +++ b/test/integration/generated/validation/src/validationClient.ts @@ -9,6 +9,7 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; +import { ValidationClientContext } from "./validationClientContext"; import { ValidationClientOptionalParams, ValidationOfMethodParametersOptionalParams, @@ -20,11 +21,7 @@ import { PostWithConstantInBodyResponse } from "./models"; -export class ValidationClient extends coreClient.ServiceClient { - $host: string; - subscriptionId: string; - apiVersion: string; - +export class ValidationClient extends ValidationClientContext { /** * Initializes a new instance of the ValidationClient class. * @param subscriptionId Subscription ID. @@ -34,39 +31,7 @@ export class ValidationClient extends coreClient.ServiceClient { subscriptionId: string, options?: ValidationClientOptionalParams ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ValidationClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-validation/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "1.0.0"; + super(subscriptionId, options); } /** diff --git a/test/integration/generated/validation/src/validationClientContext.ts b/test/integration/generated/validation/src/validationClientContext.ts new file mode 100644 index 0000000000..ca09149eb5 --- /dev/null +++ b/test/integration/generated/validation/src/validationClientContext.ts @@ -0,0 +1,60 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { ValidationClientOptionalParams } from "./models"; + +export class ValidationClientContext extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + + /** + * Initializes a new instance of the ValidationClientContext class. + * @param subscriptionId Subscription ID. + * @param options The parameter options + */ + constructor( + subscriptionId: string, + options?: ValidationClientOptionalParams + ) { + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ValidationClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-validation/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "1.0.0"; + } +} diff --git a/test/integration/generated/xmlservice/package.json b/test/integration/generated/xmlservice/package.json index 014b142c95..d095822126 100644 --- a/test/integration/generated/xmlservice/package.json +++ b/test/integration/generated/xmlservice/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/xmlservice/src/index.ts b/test/integration/generated/xmlservice/src/index.ts index 807b7026da..e19ad03f12 100644 --- a/test/integration/generated/xmlservice/src/index.ts +++ b/test/integration/generated/xmlservice/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { XmlServiceClient } from "./xmlServiceClient"; +export { XmlServiceClientContext } from "./xmlServiceClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/xmlservice/src/operations/xml.ts b/test/integration/generated/xmlservice/src/operations/xml.ts index 81bbb7c31d..f6e9c0f2b1 100644 --- a/test/integration/generated/xmlservice/src/operations/xml.ts +++ b/test/integration/generated/xmlservice/src/operations/xml.ts @@ -10,7 +10,7 @@ import { Xml } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { XmlServiceClient } from "../xmlServiceClient"; +import { XmlServiceClientContext } from "../xmlServiceClientContext"; import { XmlGetComplexTypeRefNoMetaOptionalParams, XmlGetComplexTypeRefNoMetaResponse, @@ -79,13 +79,13 @@ import { /** Class containing Xml operations. */ export class XmlImpl implements Xml { - private readonly client: XmlServiceClient; + private readonly client: XmlServiceClientContext; /** * Initialize a new instance of the class Xml class. * @param client Reference to the service client */ - constructor(client: XmlServiceClient) { + constructor(client: XmlServiceClientContext) { this.client = client; } diff --git a/test/integration/generated/xmlservice/src/xmlServiceClient.ts b/test/integration/generated/xmlservice/src/xmlServiceClient.ts index eb0e620f8f..d52fc49cc1 100644 --- a/test/integration/generated/xmlservice/src/xmlServiceClient.ts +++ b/test/integration/generated/xmlservice/src/xmlServiceClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { XmlImpl } from "./operations"; import { Xml } from "./operationsInterfaces"; +import { XmlServiceClientContext } from "./xmlServiceClientContext"; import { XmlServiceClientOptionalParams } from "./models"; -export class XmlServiceClient extends coreClient.ServiceClient { - $host: string; - +export class XmlServiceClient extends XmlServiceClientContext { /** * Initializes a new instance of the XmlServiceClient class. * @param options The parameter options */ constructor(options?: XmlServiceClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: XmlServiceClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-xml-service/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; + super(options); this.xml = new XmlImpl(this); } diff --git a/test/integration/generated/xmlservice/src/xmlServiceClientContext.ts b/test/integration/generated/xmlservice/src/xmlServiceClientContext.ts new file mode 100644 index 0000000000..4c22ec1f53 --- /dev/null +++ b/test/integration/generated/xmlservice/src/xmlServiceClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { XmlServiceClientOptionalParams } from "./models"; + +export class XmlServiceClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the XmlServiceClientContext class. + * @param options The parameter options + */ + constructor(options?: XmlServiceClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: XmlServiceClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-xml-service/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + } +} diff --git a/test/integration/generated/xmsErrorResponses/package.json b/test/integration/generated/xmsErrorResponses/package.json index 181744c005..05094b8019 100644 --- a/test/integration/generated/xmsErrorResponses/package.json +++ b/test/integration/generated/xmsErrorResponses/package.json @@ -25,8 +25,7 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9", - "rimraf": "^3.0.0" + "uglify-js": "^3.4.9" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/xmsErrorResponses/src/index.ts b/test/integration/generated/xmsErrorResponses/src/index.ts index 9322e6f442..141cb3ce5a 100644 --- a/test/integration/generated/xmsErrorResponses/src/index.ts +++ b/test/integration/generated/xmsErrorResponses/src/index.ts @@ -8,4 +8,5 @@ export * from "./models"; export { XmsErrorResponsesClient } from "./xmsErrorResponsesClient"; +export { XmsErrorResponsesClientContext } from "./xmsErrorResponsesClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/xmsErrorResponses/src/operations/pet.ts b/test/integration/generated/xmsErrorResponses/src/operations/pet.ts index b013912d7b..89de9d197f 100644 --- a/test/integration/generated/xmsErrorResponses/src/operations/pet.ts +++ b/test/integration/generated/xmsErrorResponses/src/operations/pet.ts @@ -10,7 +10,7 @@ import { Pet } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { XmsErrorResponsesClient } from "../xmsErrorResponsesClient"; +import { XmsErrorResponsesClientContext } from "../xmsErrorResponsesClientContext"; import { PetGetPetByIdOptionalParams, PetGetPetByIdResponse, @@ -21,13 +21,13 @@ import { /** Class containing Pet operations. */ export class PetImpl implements Pet { - private readonly client: XmsErrorResponsesClient; + private readonly client: XmsErrorResponsesClientContext; /** * Initialize a new instance of the class Pet class. * @param client Reference to the service client */ - constructor(client: XmsErrorResponsesClient) { + constructor(client: XmsErrorResponsesClientContext) { this.client = client; } diff --git a/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClient.ts b/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClient.ts index e0dfbbc741..29fdd87282 100644 --- a/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClient.ts +++ b/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClient.ts @@ -6,45 +6,18 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import * as coreClient from "@azure/core-client"; import { PetImpl } from "./operations"; import { Pet } from "./operationsInterfaces"; +import { XmsErrorResponsesClientContext } from "./xmsErrorResponsesClientContext"; import { XmsErrorResponsesClientOptionalParams } from "./models"; -export class XmsErrorResponsesClient extends coreClient.ServiceClient { - $host: string; - +export class XmsErrorResponsesClient extends XmsErrorResponsesClientContext { /** * Initializes a new instance of the XmsErrorResponsesClient class. * @param options The parameter options */ constructor(options?: XmsErrorResponsesClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: XmsErrorResponsesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-xms-error-responses/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost"; + super(options); this.pet = new PetImpl(this); } diff --git a/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClientContext.ts b/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClientContext.ts new file mode 100644 index 0000000000..d9974777ad --- /dev/null +++ b/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClientContext.ts @@ -0,0 +1,47 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import * as coreClient from "@azure/core-client"; +import { XmsErrorResponsesClientOptionalParams } from "./models"; + +export class XmsErrorResponsesClientContext extends coreClient.ServiceClient { + $host: string; + + /** + * Initializes a new instance of the XmsErrorResponsesClientContext class. + * @param options The parameter options + */ + constructor(options?: XmsErrorResponsesClientOptionalParams) { + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: XmsErrorResponsesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-xms-error-responses/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost"; + } +} From e4d12dfc27367b9c83fe9137b823f7751c86c174 Mon Sep 17 00:00:00 2001 From: Jonathan Cardenas Date: Mon, 3 Jan 2022 16:45:30 -0600 Subject: [PATCH 5/7] Regen version tolerance --- .../generated/llc-initial/LICENSE | 2 +- .../generated/llc-initial/package.json | 4 +- .../generated/llc-initial/src/lLCClient.ts | 27 ++---------- .../generated/llc-initial/tsconfig.json | 10 ++++- .../generated/llc-updated/LICENSE | 2 +- .../generated/llc-updated/package.json | 4 +- .../generated/llc-updated/src/lLCClient.ts | 41 ++----------------- .../generated/llc-updated/src/parameters.ts | 2 +- .../generated/llc-updated/tsconfig.json | 10 ++++- 9 files changed, 33 insertions(+), 69 deletions(-) diff --git a/test/version-tolerance/generated/llc-initial/LICENSE b/test/version-tolerance/generated/llc-initial/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/version-tolerance/generated/llc-initial/LICENSE +++ b/test/version-tolerance/generated/llc-initial/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/version-tolerance/generated/llc-initial/package.json b/test/version-tolerance/generated/llc-initial/package.json index 6f50fdf871..2537b8f278 100644 --- a/test/version-tolerance/generated/llc-initial/package.json +++ b/test/version-tolerance/generated/llc-initial/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "MIT", + "license": "ISC", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", @@ -44,7 +44,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/version-tolerance/generated/llc-initial/src/lLCClient.ts b/test/version-tolerance/generated/llc-initial/src/lLCClient.ts index e0b8418948..e75322830b 100644 --- a/test/version-tolerance/generated/llc-initial/src/lLCClient.ts +++ b/test/version-tolerance/generated/llc-initial/src/lLCClient.ts @@ -6,16 +6,6 @@ import { GetRequired200Response, PostParameters200Response } from "./responses"; import { getClient, ClientOptions, Client } from "@azure-rest/core-client"; import "@azure/core-auth"; -/** Contains operations for Params operations */ -export interface ParamsOperations { - /** Get true Boolean value on path */ - getRequired(options: GetRequiredParameters): Promise; - /** POST a JSON */ - postParameters( - options: PostParametersParameters - ): Promise; -} - export interface GetRequired { /** Get true Boolean value on path */ get(options: GetRequiredParameters): Promise; @@ -30,7 +20,6 @@ export interface Routes { export type LLCClientRestClient = Client & { path: Routes; - params: ParamsOperations; }; export default function LLCClient( @@ -38,17 +27,9 @@ export default function LLCClient( ): LLCClientRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - const client = getClient(baseUrl, options) as LLCClientRestClient; + return getClient( + baseUrl, - return { - ...client, - params: { - getRequired: (options) => { - return client.path("/servicedriven/parameters").get(options); - }, - postParameters: (options) => { - return client.path("/servicedriven/parameters").post(options); - } - } - }; + options + ) as LLCClientRestClient; } diff --git a/test/version-tolerance/generated/llc-initial/tsconfig.json b/test/version-tolerance/generated/llc-initial/tsconfig.json index 0202cc6570..965341beea 100644 --- a/test/version-tolerance/generated/llc-initial/tsconfig.json +++ b/test/version-tolerance/generated/llc-initial/tsconfig.json @@ -7,5 +7,13 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "include": ["src/**/*.ts"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } diff --git a/test/version-tolerance/generated/llc-updated/LICENSE b/test/version-tolerance/generated/llc-updated/LICENSE index 3f3e190c4a..a15a7628ca 100644 --- a/test/version-tolerance/generated/llc-updated/LICENSE +++ b/test/version-tolerance/generated/llc-updated/LICENSE @@ -3,7 +3,7 @@ The MIT License (MIT) -Copyright (c) 2021 Microsoft +Copyright (c) 2022 Microsoft Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/test/version-tolerance/generated/llc-updated/package.json b/test/version-tolerance/generated/llc-updated/package.json index 6f50fdf871..2537b8f278 100644 --- a/test/version-tolerance/generated/llc-updated/package.json +++ b/test/version-tolerance/generated/llc-updated/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "MIT", + "license": "ISC", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", @@ -44,7 +44,7 @@ "@microsoft/api-extractor": "^7.18.11", "@types/node": "^14.14.22", "dotenv": "^8.2.0", - "prettier": "^2.2.1", + "prettier": "^2.5.1", "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", diff --git a/test/version-tolerance/generated/llc-updated/src/lLCClient.ts b/test/version-tolerance/generated/llc-updated/src/lLCClient.ts index 2355eeb679..d1aeb10b32 100644 --- a/test/version-tolerance/generated/llc-updated/src/lLCClient.ts +++ b/test/version-tolerance/generated/llc-updated/src/lLCClient.ts @@ -16,24 +16,6 @@ import { import { getClient, ClientOptions, Client } from "@azure-rest/core-client"; import "@azure/core-auth"; -/** Contains operations for Params operations */ -export interface ParamsOperations { - /** Get true Boolean value on path */ - getRequired(options: GetRequiredParameters): Promise; - /** POST a JSON or a JPEG */ - postParameters( - options: PostParametersParameters | PostParametersParameters - ): Promise | Promise; - /** Delete something */ - deleteParameters( - options?: DeleteParametersParameters - ): Promise; - /** I'm a new operation */ - getNewOperation( - options?: GetNewOperationParameters - ): Promise; -} - export interface GetRequired { /** Get true Boolean value on path */ get(options: GetRequiredParameters): Promise; @@ -61,7 +43,6 @@ export interface Routes { export type LLCClientRestClient = Client & { path: Routes; - params: ParamsOperations; }; export default function LLCClient( @@ -69,23 +50,9 @@ export default function LLCClient( ): LLCClientRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - const client = getClient(baseUrl, options) as LLCClientRestClient; + return getClient( + baseUrl, - return { - ...client, - params: { - getRequired: (options) => { - return client.path("/servicedriven/parameters").get(options); - }, - postParameters: (options) => { - return client.path("/servicedriven/parameters").post(options); - }, - deleteParameters: (options) => { - return client.path("/servicedriven/parameters").delete(options); - }, - getNewOperation: (options) => { - return client.path("/servicedriven/newpath").get(options); - } - } - }; + options + ) as LLCClientRestClient; } diff --git a/test/version-tolerance/generated/llc-updated/src/parameters.ts b/test/version-tolerance/generated/llc-updated/src/parameters.ts index da6a46e246..ba81a4cb77 100644 --- a/test/version-tolerance/generated/llc-updated/src/parameters.ts +++ b/test/version-tolerance/generated/llc-updated/src/parameters.ts @@ -23,7 +23,7 @@ export interface PostParametersBodyParam { * * Value may contain any sequence of octets */ - body: string | Uint8Array; + body: string; } export interface PostParametersMediaTypesParam { diff --git a/test/version-tolerance/generated/llc-updated/tsconfig.json b/test/version-tolerance/generated/llc-updated/tsconfig.json index 0202cc6570..965341beea 100644 --- a/test/version-tolerance/generated/llc-updated/tsconfig.json +++ b/test/version-tolerance/generated/llc-updated/tsconfig.json @@ -7,5 +7,13 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "include": ["src/**/*.ts"] + "exclude": [ + "node_modules", + "types", + "temp", + "browser", + "dist", + "dist-esm", + "./samples/**/*.ts" + ] } From 8dedd80e29e847c2b4b593b64a9dea191eff9807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20C=C3=A1rdenas?= Date: Mon, 3 Jan 2022 23:13:09 +0000 Subject: [PATCH 6/7] generate-version-tolerance --- .../generated/llc-initial/package.json | 2 +- .../generated/llc-initial/src/lLCClient.ts | 27 ++++++++++-- .../generated/llc-initial/tsconfig.json | 10 +---- .../generated/llc-updated/package.json | 2 +- .../generated/llc-updated/src/lLCClient.ts | 41 +++++++++++++++++-- .../generated/llc-updated/src/parameters.ts | 2 +- .../generated/llc-updated/tsconfig.json | 10 +---- 7 files changed, 65 insertions(+), 29 deletions(-) diff --git a/test/version-tolerance/generated/llc-initial/package.json b/test/version-tolerance/generated/llc-initial/package.json index 2537b8f278..6416c4cd7b 100644 --- a/test/version-tolerance/generated/llc-initial/package.json +++ b/test/version-tolerance/generated/llc-initial/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/version-tolerance/generated/llc-initial/src/lLCClient.ts b/test/version-tolerance/generated/llc-initial/src/lLCClient.ts index e75322830b..e0b8418948 100644 --- a/test/version-tolerance/generated/llc-initial/src/lLCClient.ts +++ b/test/version-tolerance/generated/llc-initial/src/lLCClient.ts @@ -6,6 +6,16 @@ import { GetRequired200Response, PostParameters200Response } from "./responses"; import { getClient, ClientOptions, Client } from "@azure-rest/core-client"; import "@azure/core-auth"; +/** Contains operations for Params operations */ +export interface ParamsOperations { + /** Get true Boolean value on path */ + getRequired(options: GetRequiredParameters): Promise; + /** POST a JSON */ + postParameters( + options: PostParametersParameters + ): Promise; +} + export interface GetRequired { /** Get true Boolean value on path */ get(options: GetRequiredParameters): Promise; @@ -20,6 +30,7 @@ export interface Routes { export type LLCClientRestClient = Client & { path: Routes; + params: ParamsOperations; }; export default function LLCClient( @@ -27,9 +38,17 @@ export default function LLCClient( ): LLCClientRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - return getClient( - baseUrl, + const client = getClient(baseUrl, options) as LLCClientRestClient; - options - ) as LLCClientRestClient; + return { + ...client, + params: { + getRequired: (options) => { + return client.path("/servicedriven/parameters").get(options); + }, + postParameters: (options) => { + return client.path("/servicedriven/parameters").post(options); + } + } + }; } diff --git a/test/version-tolerance/generated/llc-initial/tsconfig.json b/test/version-tolerance/generated/llc-initial/tsconfig.json index 965341beea..0202cc6570 100644 --- a/test/version-tolerance/generated/llc-initial/tsconfig.json +++ b/test/version-tolerance/generated/llc-initial/tsconfig.json @@ -7,13 +7,5 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/test/version-tolerance/generated/llc-updated/package.json b/test/version-tolerance/generated/llc-updated/package.json index 2537b8f278..6416c4cd7b 100644 --- a/test/version-tolerance/generated/llc-updated/package.json +++ b/test/version-tolerance/generated/llc-updated/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/version-tolerance/generated/llc-updated/src/lLCClient.ts b/test/version-tolerance/generated/llc-updated/src/lLCClient.ts index d1aeb10b32..2355eeb679 100644 --- a/test/version-tolerance/generated/llc-updated/src/lLCClient.ts +++ b/test/version-tolerance/generated/llc-updated/src/lLCClient.ts @@ -16,6 +16,24 @@ import { import { getClient, ClientOptions, Client } from "@azure-rest/core-client"; import "@azure/core-auth"; +/** Contains operations for Params operations */ +export interface ParamsOperations { + /** Get true Boolean value on path */ + getRequired(options: GetRequiredParameters): Promise; + /** POST a JSON or a JPEG */ + postParameters( + options: PostParametersParameters | PostParametersParameters + ): Promise | Promise; + /** Delete something */ + deleteParameters( + options?: DeleteParametersParameters + ): Promise; + /** I'm a new operation */ + getNewOperation( + options?: GetNewOperationParameters + ): Promise; +} + export interface GetRequired { /** Get true Boolean value on path */ get(options: GetRequiredParameters): Promise; @@ -43,6 +61,7 @@ export interface Routes { export type LLCClientRestClient = Client & { path: Routes; + params: ParamsOperations; }; export default function LLCClient( @@ -50,9 +69,23 @@ export default function LLCClient( ): LLCClientRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - return getClient( - baseUrl, + const client = getClient(baseUrl, options) as LLCClientRestClient; - options - ) as LLCClientRestClient; + return { + ...client, + params: { + getRequired: (options) => { + return client.path("/servicedriven/parameters").get(options); + }, + postParameters: (options) => { + return client.path("/servicedriven/parameters").post(options); + }, + deleteParameters: (options) => { + return client.path("/servicedriven/parameters").delete(options); + }, + getNewOperation: (options) => { + return client.path("/servicedriven/newpath").get(options); + } + } + }; } diff --git a/test/version-tolerance/generated/llc-updated/src/parameters.ts b/test/version-tolerance/generated/llc-updated/src/parameters.ts index ba81a4cb77..da6a46e246 100644 --- a/test/version-tolerance/generated/llc-updated/src/parameters.ts +++ b/test/version-tolerance/generated/llc-updated/src/parameters.ts @@ -23,7 +23,7 @@ export interface PostParametersBodyParam { * * Value may contain any sequence of octets */ - body: string; + body: string | Uint8Array; } export interface PostParametersMediaTypesParam { diff --git a/test/version-tolerance/generated/llc-updated/tsconfig.json b/test/version-tolerance/generated/llc-updated/tsconfig.json index 965341beea..0202cc6570 100644 --- a/test/version-tolerance/generated/llc-updated/tsconfig.json +++ b/test/version-tolerance/generated/llc-updated/tsconfig.json @@ -7,13 +7,5 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts"] } From fd232977c0e02ae567d72fcc0c31220db5b32875 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20C=C3=A1rdenas?= Date: Mon, 3 Jan 2022 23:41:03 +0000 Subject: [PATCH 7/7] Regen swaggers --- .../additionalProperties/package.json | 3 +- .../src/additionalPropertiesClient.ts | 33 +- .../src/additionalPropertiesClientContext.ts | 47 -- .../additionalProperties/src/index.ts | 1 - .../src/operations/pets.ts | 6 +- .../generated/appconfiguration/package.json | 3 +- .../src/appConfigurationClient.ts | 40 +- .../src/appConfigurationClientContext.ts | 59 -- .../generated/appconfiguration/src/index.ts | 1 - .../appconfigurationexport/package.json | 3 +- .../src/appConfigurationClient.ts | 40 +- .../src/appConfigurationClientContext.ts | 60 -- .../appconfigurationexport/src/index.ts | 1 - .../generated/arrayConstraints/package.json | 3 +- .../src/arrayConstraintsClient.ts | 42 +- .../src/arrayConstraintsClientContext.ts | 61 -- .../generated/arrayConstraints/src/index.ts | 1 - .../generated/attestation/package.json | 3 +- .../attestation/src/generatedClient.ts | 40 +- .../attestation/src/generatedClientContext.ts | 56 -- .../generated/attestation/src/index.ts | 1 - .../attestation/src/operations/policy.ts | 6 +- .../azureParameterGrouping/package.json | 3 +- .../src/azureParameterGroupingClient.ts | 33 +- .../azureParameterGroupingClientContext.ts | 47 -- .../azureParameterGrouping/src/index.ts | 1 - .../src/operations/parameterGrouping.ts | 6 +- .../generated/azureReport/package.json | 3 +- .../generated/azureReport/src/index.ts | 1 - .../generated/azureReport/src/reportClient.ts | 32 +- .../azureReport/src/reportClientContext.ts | 47 -- .../azureSpecialProperties/package.json | 3 +- .../src/azureSpecialPropertiesClient.ts | 52 +- .../azureSpecialPropertiesClientContext.ts | 74 -- .../azureSpecialProperties/src/index.ts | 1 - .../src/operations/apiVersionDefault.ts | 6 +- .../src/operations/apiVersionLocal.ts | 6 +- .../src/operations/header.ts | 6 +- .../src/operations/odata.ts | 6 +- .../src/operations/skipUrlEncoding.ts | 6 +- .../operations/subscriptionInCredentials.ts | 6 +- .../src/operations/subscriptionInMethod.ts | 6 +- .../src/operations/xMsClientRequestId.ts | 6 +- .../generated/bodyArray/package.json | 3 +- .../bodyArray/src/bodyArrayClient.ts | 33 +- .../bodyArray/src/bodyArrayClientContext.ts | 47 -- .../generated/bodyArray/src/index.ts | 1 - .../bodyArray/src/operations/array.ts | 6 +- .../generated/bodyBoolean/package.json | 3 +- .../bodyBoolean/src/bodyBooleanClient.ts | 33 +- .../src/bodyBooleanClientContext.ts | 47 -- .../generated/bodyBoolean/src/index.ts | 1 - .../bodyBoolean/src/operations/bool.ts | 6 +- .../generated/bodyBooleanQuirks/package.json | 3 +- .../src/bodyBooleanQuirksClient.ts | 33 +- .../src/bodyBooleanQuirksClientContext.ts | 47 -- .../generated/bodyBooleanQuirks/src/index.ts | 1 - .../bodyBooleanQuirks/src/operations/bool.ts | 6 +- .../generated/bodyByte/package.json | 3 +- .../generated/bodyByte/src/bodyByteClient.ts | 33 +- .../bodyByte/src/bodyByteClientContext.ts | 47 -- .../generated/bodyByte/src/index.ts | 1 - .../generated/bodyByte/src/operations/byte.ts | 6 +- .../generated/bodyComplex/package.json | 3 +- .../bodyComplex/src/bodyComplexClient.ts | 35 +- .../src/bodyComplexClientContext.ts | 49 -- .../generated/bodyComplex/src/index.ts | 1 - .../bodyComplex/src/operations/array.ts | 6 +- .../bodyComplex/src/operations/basic.ts | 6 +- .../bodyComplex/src/operations/dictionary.ts | 6 +- .../src/operations/flattencomplex.ts | 6 +- .../bodyComplex/src/operations/inheritance.ts | 6 +- .../src/operations/polymorphicrecursive.ts | 6 +- .../src/operations/polymorphism.ts | 6 +- .../bodyComplex/src/operations/primitive.ts | 6 +- .../src/operations/readonlyproperty.ts | 6 +- .../generated/bodyComplexRest/package.json | 2 +- .../src/bodyComplexRestClient.ts | 6 +- .../generated/bodyComplexRest/tsconfig.json | 10 +- .../bodyComplexWithTracing/package.json | 3 +- .../src/bodyComplexWithTracing.ts | 35 +- .../src/bodyComplexWithTracingContext.ts | 49 -- .../bodyComplexWithTracing/src/index.ts | 1 - .../src/operations/array.ts | 6 +- .../src/operations/basic.ts | 6 +- .../src/operations/dictionary.ts | 6 +- .../src/operations/flattencomplex.ts | 6 +- .../src/operations/inheritance.ts | 6 +- .../src/operations/polymorphicrecursive.ts | 6 +- .../src/operations/polymorphism.ts | 6 +- .../src/operations/primitive.ts | 6 +- .../src/operations/readonlyproperty.ts | 6 +- .../generated/bodyDate/package.json | 3 +- .../generated/bodyDate/src/bodyDateClient.ts | 33 +- .../bodyDate/src/bodyDateClientContext.ts | 47 -- .../generated/bodyDate/src/index.ts | 1 - .../generated/bodyDate/src/operations/date.ts | 6 +- .../generated/bodyDateTime/package.json | 3 +- .../bodyDateTime/src/bodyDateTimeClient.ts | 33 +- .../src/bodyDateTimeClientContext.ts | 47 -- .../generated/bodyDateTime/src/index.ts | 1 - .../bodyDateTime/src/operations/datetime.ts | 6 +- .../bodyDateTimeRfc1123/package.json | 3 +- .../src/bodyDateTimeRfc1123Client.ts | 33 +- .../src/bodyDateTimeRfc1123ClientContext.ts | 47 -- .../bodyDateTimeRfc1123/src/index.ts | 1 - .../src/operations/datetimerfc1123.ts | 6 +- .../generated/bodyDictionary/package.json | 3 +- .../src/bodyDictionaryClient.ts | 33 +- .../src/bodyDictionaryClientContext.ts | 47 -- .../generated/bodyDictionary/src/index.ts | 1 - .../src/operations/dictionary.ts | 6 +- .../generated/bodyDuration/package.json | 3 +- .../bodyDuration/src/bodyDurationClient.ts | 33 +- .../src/bodyDurationClientContext.ts | 47 -- .../generated/bodyDuration/src/index.ts | 1 - .../bodyDuration/src/operations/duration.ts | 6 +- .../generated/bodyFile/package.json | 3 +- .../generated/bodyFile/src/bodyFileClient.ts | 33 +- .../bodyFile/src/bodyFileClientContext.ts | 47 -- .../generated/bodyFile/src/index.ts | 1 - .../bodyFile/src/operations/files.ts | 6 +- .../generated/bodyFileRest/package.json | 2 +- .../generated/bodyFileRest/src/bodyFile.ts | 6 +- .../generated/bodyFileRest/src/responses.ts | 9 +- .../generated/bodyFileRest/tsconfig.json | 10 +- .../generated/bodyFormData/package.json | 3 +- .../bodyFormData/src/bodyFormDataClient.ts | 33 +- .../src/bodyFormDataClientContext.ts | 47 -- .../generated/bodyFormData/src/index.ts | 1 - .../bodyFormData/src/operations/formdata.ts | 6 +- .../generated/bodyFormDataRest/package.json | 2 +- .../bodyFormDataRest/src/bodyFormData.ts | 6 +- .../bodyFormDataRest/src/parameters.ts | 16 +- .../bodyFormDataRest/src/responses.ts | 9 +- .../generated/bodyFormDataRest/tsconfig.json | 10 +- .../generated/bodyInteger/package.json | 3 +- .../bodyInteger/src/bodyIntegerClient.ts | 33 +- .../src/bodyIntegerClientContext.ts | 47 -- .../generated/bodyInteger/src/index.ts | 1 - .../bodyInteger/src/operations/int.ts | 6 +- .../generated/bodyNumber/package.json | 3 +- .../bodyNumber/src/bodyNumberClient.ts | 33 +- .../bodyNumber/src/bodyNumberClientContext.ts | 47 -- .../generated/bodyNumber/src/index.ts | 1 - .../bodyNumber/src/operations/number.ts | 6 +- .../generated/bodyString/package.json | 3 +- .../bodyString/src/bodyStringClient.ts | 33 +- .../bodyString/src/bodyStringClientContext.ts | 47 -- .../generated/bodyString/src/index.ts | 1 - .../bodyString/src/operations/enum.ts | 6 +- .../bodyString/src/operations/string.ts | 6 +- .../generated/bodyStringRest/karma.conf.js | 153 ++++ .../generated/bodyStringRest/package.json | 52 +- .../bodyStringRest/src/bodyStringRest.ts | 6 +- .../test/public/sampleTest.spec.ts | 22 + .../test/public/utils/env.browser.ts | 2 + .../bodyStringRest/test/public/utils/env.ts | 6 + .../test/public/utils/recordedClient.ts | 46 ++ .../generated/bodyStringRest/tsconfig.json | 10 +- .../generated/bodyTime/package.json | 3 +- .../generated/bodyTime/src/bodyTimeClient.ts | 33 +- .../bodyTime/src/bodyTimeClientContext.ts | 47 -- .../generated/bodyTime/src/index.ts | 1 - .../generated/bodyTime/src/operations/time.ts | 6 +- .../generated/constantParam/package.json | 3 +- .../constantParam/src/generatedClient.ts | 39 +- .../src/generatedClientContext.ts | 57 -- .../generated/constantParam/src/index.ts | 1 - .../generated/customUrl/package.json | 3 +- .../customUrl/src/customUrlClient.ts | 33 +- .../customUrl/src/customUrlClientContext.ts | 47 -- .../generated/customUrl/src/index.ts | 1 - .../customUrl/src/operations/paths.ts | 6 +- .../customUrlMoreOptions/package.json | 3 +- .../src/customUrlMoreOptionsClient.ts | 40 +- .../src/customUrlMoreOptionsClientContext.ts | 58 -- .../customUrlMoreOptions/src/index.ts | 1 - .../src/operations/paths.ts | 6 +- .../generated/customUrlPaging/package.json | 3 +- .../src/customUrlPagingClient.ts | 33 +- .../src/customUrlPagingClientContext.ts | 47 -- .../generated/customUrlPaging/src/index.ts | 1 - .../customUrlPaging/src/operations/paging.ts | 6 +- .../generated/datafactory/package.json | 3 +- .../datafactory/src/dataFactoryClient.ts | 42 +- .../src/dataFactoryClientContext.ts | 52 -- .../generated/datafactory/src/index.ts | 1 - .../src/operations/activityRuns.ts | 6 +- .../src/operations/dataFlowDebugSession.ts | 6 +- .../datafactory/src/operations/dataFlows.ts | 6 +- .../datafactory/src/operations/datasets.ts | 6 +- .../src/operations/exposureControl.ts | 6 +- .../datafactory/src/operations/factories.ts | 6 +- .../src/operations/integrationRuntimeNodes.ts | 6 +- .../integrationRuntimeObjectMetadata.ts | 6 +- .../src/operations/integrationRuntimes.ts | 6 +- .../src/operations/linkedServices.ts | 6 +- .../src/operations/managedPrivateEndpoints.ts | 6 +- .../src/operations/managedVirtualNetworks.ts | 6 +- .../datafactory/src/operations/operations.ts | 6 +- .../src/operations/pipelineRuns.ts | 6 +- .../datafactory/src/operations/pipelines.ts | 6 +- .../operations/privateEndPointConnections.ts | 6 +- .../operations/privateEndpointConnection.ts | 6 +- .../src/operations/privateLinkResources.ts | 6 +- .../datafactory/src/operations/triggerRuns.ts | 6 +- .../datafactory/src/operations/triggers.ts | 6 +- .../generated/datalakestorage/package.json | 3 +- .../src/dataLakeStorageClient.ts | 50 +- .../src/dataLakeStorageClientContext.ts | 73 -- .../generated/datalakestorage/src/index.ts | 1 - .../src/operations/pathOperations.ts | 6 +- .../deviceprovisioningservice/package.json | 3 +- .../src/deviceProvisioningClient.ts | 42 +- .../src/deviceProvisioningClientContext.ts | 52 -- .../deviceprovisioningservice/src/index.ts | 1 - .../src/operations/dpsCertificate.ts | 6 +- .../src/operations/iotDpsResource.ts | 6 +- .../src/operations/operations.ts | 6 +- .../generated/domainservices/package.json | 3 +- .../src/domainServicesClient.ts | 42 +- .../src/domainServicesClientContext.ts | 53 -- .../generated/domainservices/src/index.ts | 1 - .../src/operations/domainServiceOperations.ts | 6 +- .../src/operations/domainServices.ts | 6 +- .../src/operations/ouContainerOperationGrp.ts | 6 +- .../src/operations/ouContainerOperations.ts | 6 +- .../generated/extensibleEnums/package.json | 3 +- .../src/extensibleEnumsClient.ts | 33 +- .../src/extensibleEnumsClientContext.ts | 47 -- .../generated/extensibleEnums/src/index.ts | 1 - .../extensibleEnums/src/operations/pet.ts | 6 +- .../integration/generated/header/package.json | 3 +- .../generated/header/src/headerClient.ts | 33 +- .../header/src/headerClientContext.ts | 47 -- .../integration/generated/header/src/index.ts | 1 - .../generated/header/src/operations/header.ts | 6 +- .../generated/headerRest/package.json | 2 +- .../headerRest/src/headerRestClient.ts | 6 +- .../generated/headerRest/tsconfig.json | 10 +- .../generated/headerprefix/package.json | 3 +- .../headerprefix/src/headerPrefixClient.ts | 36 +- .../src/headerPrefixClientContext.ts | 43 - .../generated/headerprefix/src/index.ts | 1 - .../headerprefix/src/operations/queue.ts | 6 +- .../generated/healthcareapis/package.json | 3 +- .../src/healthCareApisClient.ts | 45 +- .../src/healthCareApisClientContext.ts | 55 -- .../generated/healthcareapis/src/index.ts | 1 - .../src/operations/dicomServices.ts | 6 +- .../src/operations/fhirDestinations.ts | 6 +- .../src/operations/fhirServices.ts | 6 +- .../operations/iotConnectorFhirDestination.ts | 6 +- .../src/operations/iotConnectors.ts | 6 +- .../src/operations/operationResults.ts | 6 +- .../src/operations/operations.ts | 6 +- .../operations/privateEndpointConnections.ts | 6 +- .../src/operations/privateLinkResources.ts | 6 +- .../healthcareapis/src/operations/services.ts | 6 +- .../src/operations/workspaces.ts | 6 +- .../generated/httpInfrastructure/package.json | 3 +- .../src/httpInfrastructureClient.ts | 33 +- .../src/httpInfrastructureClientContext.ts | 47 -- .../generated/httpInfrastructure/src/index.ts | 1 - .../src/operations/httpClientFailure.ts | 6 +- .../src/operations/httpFailure.ts | 6 +- .../src/operations/httpRedirects.ts | 6 +- .../src/operations/httpRetry.ts | 6 +- .../src/operations/httpServerFailure.ts | 6 +- .../src/operations/httpSuccess.ts | 6 +- .../src/operations/multipleResponses.ts | 6 +- .../generated/iotspaces/package.json | 3 +- .../generated/iotspaces/src/index.ts | 1 - .../iotspaces/src/ioTSpacesClient.ts | 33 +- .../iotspaces/src/ioTSpacesClientContext.ts | 52 -- .../generated/licenseHeader/package.json | 3 +- .../generated/licenseHeader/src/index.ts | 1 - .../licenseHeader/src/licenseHeaderClient.ts | 42 +- .../src/licenseHeaderClientContext.ts | 61 -- test/integration/generated/lro/package.json | 3 +- test/integration/generated/lro/src/index.ts | 1 - .../generated/lro/src/lROClient.ts | 33 +- .../generated/lro/src/lROClientContext.ts | 47 -- .../generated/lro/src/operations/lRORetrys.ts | 6 +- .../generated/lro/src/operations/lROs.ts | 6 +- .../lro/src/operations/lROsCustomHeader.ts | 6 +- .../generated/lro/src/operations/lrosaDs.ts | 6 +- .../lroParametrizedEndpoints/package.json | 3 +- .../lroParametrizedEndpoints/src/index.ts | 1 - .../src/lroParametrizedEndpointsClient.ts | 32 +- .../lroParametrizedEndpointsClientContext.ts | 47 -- .../generated/lroRest/package.json | 2 +- .../generated/lroRest/src/lRORestClient.ts | 6 +- .../generated/lroRest/tsconfig.json | 10 +- .../generated/mapperrequired/package.json | 3 +- .../generated/mapperrequired/src/index.ts | 1 - .../src/mapperRequiredClient.ts | 35 +- .../src/mapperRequiredClientContext.ts | 51 -- .../generated/mediaTypes/package.json | 3 +- .../generated/mediaTypes/src/index.ts | 1 - .../mediaTypes/src/mediaTypesClient.ts | 32 +- .../mediaTypes/src/mediaTypesClientContext.ts | 47 -- .../generated/mediaTypesRest/package.json | 2 +- .../mediaTypesRest/src/mediaTypes.ts | 6 +- .../mediaTypesRest/src/parameters.ts | 8 +- .../generated/mediaTypesRest/tsconfig.json | 10 +- .../generated/mediaTypesV3/package.json | 3 +- .../generated/mediaTypesV3/src/index.ts | 1 - .../mediaTypesV3/src/mediaTypesV3Client.ts | 36 +- .../src/mediaTypesV3ClientContext.ts | 51 -- .../mediaTypesV3/src/operations/barApi.ts | 6 +- .../mediaTypesV3/src/operations/fooApi.ts | 6 +- .../generated/mediaTypesV3Lro/package.json | 3 +- .../generated/mediaTypesV3Lro/src/index.ts | 1 - .../src/mediaTypesV3LROClient.ts | 35 +- .../src/mediaTypesV3LROClientContext.ts | 51 -- .../mediaTypesWithTracing/package.json | 3 +- .../mediaTypesWithTracing/src/index.ts | 1 - .../src/mediaTypesWithTracingClient.ts | 32 +- .../src/mediaTypesWithTracingClientContext.ts | 47 -- .../generated/modelFlattening/package.json | 3 +- .../generated/modelFlattening/src/index.ts | 1 - .../src/modelFlatteningClient.ts | 32 +- .../src/modelFlatteningClientContext.ts | 47 -- .../multipleInheritance/package.json | 3 +- .../multipleInheritance/src/index.ts | 1 - .../src/multipleInheritanceClient.ts | 32 +- .../src/multipleInheritanceClientContext.ts | 47 -- .../multipleInheritanceRest/package.json | 2 +- .../src/multipleInheritanceRestClient.ts | 75 +- .../multipleInheritanceRest/tsconfig.json | 10 +- .../generated/nameChecker/package.json | 3 +- .../generated/nameChecker/src/index.ts | 1 - .../nameChecker/src/operations/documents.ts | 6 +- .../generated/nameChecker/src/searchClient.ts | 45 +- .../nameChecker/src/searchClientContext.ts | 57 -- .../generated/noLicenseHeader/package.json | 3 +- .../generated/noLicenseHeader/src/index.ts | 1 - .../src/noLicenseHeaderClient.ts | 42 +- .../src/noLicenseHeaderClientContext.ts | 53 -- .../generated/noMappers/package.json | 3 +- .../generated/noMappers/src/index.ts | 1 - .../noMappers/src/noMappersClient.ts | 42 +- .../noMappers/src/noMappersClientContext.ts | 61 -- .../generated/noOperation/package.json | 3 +- .../generated/noOperation/src/index.ts | 1 - .../noOperation/src/noOperationsClient.ts | 28 +- .../src/noOperationsClientContext.ts | 42 - .../generated/nonStringEnum/package.json | 3 +- .../generated/nonStringEnum/src/index.ts | 1 - .../nonStringEnum/src/nonStringEnumClient.ts | 33 +- .../src/nonStringEnumClientContext.ts | 47 -- .../nonStringEnum/src/operations/float.ts | 6 +- .../nonStringEnum/src/operations/int.ts | 6 +- .../generated/objectType/package.json | 3 +- .../generated/objectType/src/index.ts | 1 - .../objectType/src/objectTypeClient.ts | 32 +- .../objectType/src/objectTypeClientContext.ts | 47 -- .../generated/odataDiscriminator/package.json | 3 +- .../generated/odataDiscriminator/src/index.ts | 1 - .../src/oDataDiscriminatorClient.ts | 42 +- .../src/oDataDiscriminatorClientContext.ts | 61 -- .../operationgroupclash/package.json | 3 +- .../operationgroupclash/src/index.ts | 1 - .../src/operationGroupClashClient.ts | 43 +- .../src/operationGroupClashClientContext.ts | 53 -- .../src/operations/pipelineOperations.ts | 6 +- .../src/operations/productOperations.ts | 6 +- .../generated/optionalnull/package.json | 3 +- .../generated/optionalnull/src/index.ts | 1 - .../optionalnull/src/operations/documents.ts | 6 +- .../optionalnull/src/optionalNullClient.ts | 36 +- .../src/optionalNullClientContext.ts | 43 - .../integration/generated/paging/package.json | 3 +- .../integration/generated/paging/src/index.ts | 1 - .../generated/paging/src/operations/paging.ts | 6 +- .../generated/paging/src/pagingClient.ts | 33 +- .../paging/src/pagingClientContext.ts | 47 -- .../generated/pagingNoIterators/package.json | 3 +- .../generated/pagingNoIterators/src/index.ts | 1 - .../src/operations/paging.ts | 6 +- .../src/pagingNoIteratorsClient.ts | 33 +- .../src/pagingNoIteratorsClientContext.ts | 47 -- .../generated/pagingRest/package.json | 2 +- .../generated/pagingRest/src/paging.ts | 6 +- .../generated/pagingRest/tsconfig.json | 10 +- .../generated/petstore/package.json | 3 +- .../generated/petstore/src/index.ts | 1 - .../generated/petstore/src/petStore.ts | 32 +- .../generated/petstore/src/petStoreContext.ts | 39 - .../src/generated/index.ts | 1 - .../src/generated/mediaServicesClient.ts | 28 +- .../generated/mediaServicesClientContext.ts | 34 - .../generated/readmeFileChecker/package.json | 3 +- .../generated/readmeFileChecker/src/index.ts | 1 - .../readmeFileChecker/src/keyVaultClient.ts | 37 +- .../src/keyVaultClientContext.ts | 47 -- .../generated/regexConstraint/package.json | 3 +- .../generated/regexConstraint/src/index.ts | 1 - .../regexConstraint/src/regexConstraint.ts | 35 +- .../src/regexConstraintContext.ts | 51 -- .../integration/generated/report/package.json | 3 +- .../integration/generated/report/src/index.ts | 1 - .../generated/report/src/reportClient.ts | 32 +- .../report/src/reportClientContext.ts | 47 -- .../generated/requiredOptional/package.json | 3 +- .../generated/requiredOptional/src/index.ts | 1 - .../src/operations/explicit.ts | 6 +- .../src/operations/implicit.ts | 6 +- .../src/requiredOptionalClient.ts | 46 +- .../src/requiredOptionalClientContext.ts | 66 -- .../generated/resources/package.json | 3 +- .../generated/resources/src/index.ts | 1 - .../src/operations/resourceGroups.ts | 6 +- .../resources/src/resourcesClient.ts | 46 +- .../resources/src/resourcesClientContext.ts | 67 -- .../generated/sealedchoice/package.json | 3 +- .../generated/sealedchoice/src/index.ts | 1 - .../src/operations/authentication.ts | 6 +- .../sealedchoice/src/sealedChoiceClient.ts | 36 +- .../src/sealedChoiceClientContext.ts | 51 -- .../generated/storageblob/package.json | 3 +- .../generated/storageblob/src/index.ts | 1 - .../storageblob/src/operations/appendBlob.ts | 6 +- .../storageblob/src/operations/blockBlob.ts | 6 +- .../storageblob/src/operations/pageBlob.ts | 6 +- .../storageblob/src/storageBlobClient.ts | 40 +- .../src/storageBlobClientContext.ts | 48 -- .../generated/storagefileshare/package.json | 3 +- .../generated/storagefileshare/src/index.ts | 1 - .../storagefileshare/src/operations/file.ts | 6 +- .../src/storageFileShareClient.ts | 42 +- .../src/storageFileShareClientContext.ts | 50 -- .../subscriptionIdApiVersion/package.json | 3 +- .../subscriptionIdApiVersion/src/index.ts | 1 - .../src/operations/group.ts | 6 +- .../src/subscriptionIdApiVersionClient.ts | 42 +- .../subscriptionIdApiVersionClientContext.ts | 60 -- .../generated/textanalytics/package.json | 3 +- .../textanalytics/src/generatedClient.ts | 35 +- .../src/generatedClientContext.ts | 53 -- .../generated/textanalytics/src/index.ts | 1 - test/integration/generated/url/package.json | 3 +- test/integration/generated/url/src/index.ts | 1 - .../generated/url/src/operations/pathItems.ts | 6 +- .../generated/url/src/operations/paths.ts | 6 +- .../generated/url/src/operations/queries.ts | 6 +- .../generated/url/src/urlClient.ts | 41 +- .../generated/url/src/urlClientContext.ts | 56 -- test/integration/generated/url2/package.json | 3 +- test/integration/generated/url2/src/index.ts | 1 - .../generated/url2/src/operations/get.ts | 6 +- .../generated/url2/src/urlClient.ts | 36 +- .../generated/url2/src/urlClientContext.ts | 51 -- .../generated/urlMulti/package.json | 3 +- .../generated/urlMulti/src/index.ts | 1 - .../urlMulti/src/operations/queries.ts | 6 +- .../generated/urlMulti/src/urlMultiClient.ts | 33 +- .../urlMulti/src/urlMultiClientContext.ts | 47 -- .../generated/urlRest/package.json | 2 +- .../generated/urlRest/src/urlRestClient.ts | 751 +++++++++++++++++- .../generated/urlRest/tsconfig.json | 10 +- .../generated/useragentcorev1/package.json | 3 +- .../generated/useragentcorev1/src/index.ts | 1 - .../useragentcorev1/src/operations/group.ts | 6 +- .../src/userAgentCoreV1Client.ts | 41 +- .../src/userAgentCoreV1ClientContext.ts | 59 -- .../generated/useragentcorev2/package.json | 3 +- .../generated/useragentcorev2/src/index.ts | 1 - .../useragentcorev2/src/operations/group.ts | 6 +- .../src/userAgentCoreV2Client.ts | 42 +- .../src/userAgentCoreV2ClientContext.ts | 60 -- test/integration/generated/uuid/package.json | 3 +- test/integration/generated/uuid/src/index.ts | 1 - .../generated/uuid/src/operations/get.ts | 6 +- .../generated/uuid/src/uuidClient.ts | 36 +- .../generated/uuid/src/uuidClientContext.ts | 51 -- .../generated/validation/package.json | 3 +- .../generated/validation/src/index.ts | 1 - .../validation/src/validationClient.ts | 41 +- .../validation/src/validationClientContext.ts | 60 -- .../generated/xmlservice/package.json | 3 +- .../generated/xmlservice/src/index.ts | 1 - .../xmlservice/src/operations/xml.ts | 6 +- .../xmlservice/src/xmlServiceClient.ts | 33 +- .../xmlservice/src/xmlServiceClientContext.ts | 47 -- .../generated/xmsErrorResponses/package.json | 3 +- .../generated/xmsErrorResponses/src/index.ts | 1 - .../xmsErrorResponses/src/operations/pet.ts | 6 +- .../src/xmsErrorResponsesClient.ts | 33 +- .../src/xmsErrorResponsesClientContext.ts | 47 -- 492 files changed, 4398 insertions(+), 5095 deletions(-) delete mode 100644 test/integration/generated/additionalProperties/src/additionalPropertiesClientContext.ts delete mode 100644 test/integration/generated/appconfiguration/src/appConfigurationClientContext.ts delete mode 100644 test/integration/generated/appconfigurationexport/src/appConfigurationClientContext.ts delete mode 100644 test/integration/generated/arrayConstraints/src/arrayConstraintsClientContext.ts delete mode 100644 test/integration/generated/attestation/src/generatedClientContext.ts delete mode 100644 test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClientContext.ts delete mode 100644 test/integration/generated/azureReport/src/reportClientContext.ts delete mode 100644 test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClientContext.ts delete mode 100644 test/integration/generated/bodyArray/src/bodyArrayClientContext.ts delete mode 100644 test/integration/generated/bodyBoolean/src/bodyBooleanClientContext.ts delete mode 100644 test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClientContext.ts delete mode 100644 test/integration/generated/bodyByte/src/bodyByteClientContext.ts delete mode 100644 test/integration/generated/bodyComplex/src/bodyComplexClientContext.ts delete mode 100644 test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracingContext.ts delete mode 100644 test/integration/generated/bodyDate/src/bodyDateClientContext.ts delete mode 100644 test/integration/generated/bodyDateTime/src/bodyDateTimeClientContext.ts delete mode 100644 test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123ClientContext.ts delete mode 100644 test/integration/generated/bodyDictionary/src/bodyDictionaryClientContext.ts delete mode 100644 test/integration/generated/bodyDuration/src/bodyDurationClientContext.ts delete mode 100644 test/integration/generated/bodyFile/src/bodyFileClientContext.ts delete mode 100644 test/integration/generated/bodyFormData/src/bodyFormDataClientContext.ts delete mode 100644 test/integration/generated/bodyInteger/src/bodyIntegerClientContext.ts delete mode 100644 test/integration/generated/bodyNumber/src/bodyNumberClientContext.ts delete mode 100644 test/integration/generated/bodyString/src/bodyStringClientContext.ts create mode 100644 test/integration/generated/bodyStringRest/karma.conf.js create mode 100644 test/integration/generated/bodyStringRest/test/public/sampleTest.spec.ts create mode 100644 test/integration/generated/bodyStringRest/test/public/utils/env.browser.ts create mode 100644 test/integration/generated/bodyStringRest/test/public/utils/env.ts create mode 100644 test/integration/generated/bodyStringRest/test/public/utils/recordedClient.ts delete mode 100644 test/integration/generated/bodyTime/src/bodyTimeClientContext.ts delete mode 100644 test/integration/generated/constantParam/src/generatedClientContext.ts delete mode 100644 test/integration/generated/customUrl/src/customUrlClientContext.ts delete mode 100644 test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClientContext.ts delete mode 100644 test/integration/generated/customUrlPaging/src/customUrlPagingClientContext.ts delete mode 100644 test/integration/generated/datafactory/src/dataFactoryClientContext.ts delete mode 100644 test/integration/generated/datalakestorage/src/dataLakeStorageClientContext.ts delete mode 100644 test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClientContext.ts delete mode 100644 test/integration/generated/domainservices/src/domainServicesClientContext.ts delete mode 100644 test/integration/generated/extensibleEnums/src/extensibleEnumsClientContext.ts delete mode 100644 test/integration/generated/header/src/headerClientContext.ts delete mode 100644 test/integration/generated/headerprefix/src/headerPrefixClientContext.ts delete mode 100644 test/integration/generated/healthcareapis/src/healthCareApisClientContext.ts delete mode 100644 test/integration/generated/httpInfrastructure/src/httpInfrastructureClientContext.ts delete mode 100644 test/integration/generated/iotspaces/src/ioTSpacesClientContext.ts delete mode 100644 test/integration/generated/licenseHeader/src/licenseHeaderClientContext.ts delete mode 100644 test/integration/generated/lro/src/lROClientContext.ts delete mode 100644 test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClientContext.ts delete mode 100644 test/integration/generated/mapperrequired/src/mapperRequiredClientContext.ts delete mode 100644 test/integration/generated/mediaTypes/src/mediaTypesClientContext.ts delete mode 100644 test/integration/generated/mediaTypesV3/src/mediaTypesV3ClientContext.ts delete mode 100644 test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClientContext.ts delete mode 100644 test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClientContext.ts delete mode 100644 test/integration/generated/modelFlattening/src/modelFlatteningClientContext.ts delete mode 100644 test/integration/generated/multipleInheritance/src/multipleInheritanceClientContext.ts delete mode 100644 test/integration/generated/nameChecker/src/searchClientContext.ts delete mode 100644 test/integration/generated/noLicenseHeader/src/noLicenseHeaderClientContext.ts delete mode 100644 test/integration/generated/noMappers/src/noMappersClientContext.ts delete mode 100644 test/integration/generated/noOperation/src/noOperationsClientContext.ts delete mode 100644 test/integration/generated/nonStringEnum/src/nonStringEnumClientContext.ts delete mode 100644 test/integration/generated/objectType/src/objectTypeClientContext.ts delete mode 100644 test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClientContext.ts delete mode 100644 test/integration/generated/operationgroupclash/src/operationGroupClashClientContext.ts delete mode 100644 test/integration/generated/optionalnull/src/optionalNullClientContext.ts delete mode 100644 test/integration/generated/paging/src/pagingClientContext.ts delete mode 100644 test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClientContext.ts delete mode 100644 test/integration/generated/petstore/src/petStoreContext.ts delete mode 100644 test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClientContext.ts delete mode 100644 test/integration/generated/readmeFileChecker/src/keyVaultClientContext.ts delete mode 100644 test/integration/generated/regexConstraint/src/regexConstraintContext.ts delete mode 100644 test/integration/generated/report/src/reportClientContext.ts delete mode 100644 test/integration/generated/requiredOptional/src/requiredOptionalClientContext.ts delete mode 100644 test/integration/generated/resources/src/resourcesClientContext.ts delete mode 100644 test/integration/generated/sealedchoice/src/sealedChoiceClientContext.ts delete mode 100644 test/integration/generated/storageblob/src/storageBlobClientContext.ts delete mode 100644 test/integration/generated/storagefileshare/src/storageFileShareClientContext.ts delete mode 100644 test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClientContext.ts delete mode 100644 test/integration/generated/textanalytics/src/generatedClientContext.ts delete mode 100644 test/integration/generated/url/src/urlClientContext.ts delete mode 100644 test/integration/generated/url2/src/urlClientContext.ts delete mode 100644 test/integration/generated/urlMulti/src/urlMultiClientContext.ts delete mode 100644 test/integration/generated/useragentcorev1/src/userAgentCoreV1ClientContext.ts delete mode 100644 test/integration/generated/useragentcorev2/src/userAgentCoreV2ClientContext.ts delete mode 100644 test/integration/generated/uuid/src/uuidClientContext.ts delete mode 100644 test/integration/generated/validation/src/validationClientContext.ts delete mode 100644 test/integration/generated/xmlservice/src/xmlServiceClientContext.ts delete mode 100644 test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClientContext.ts diff --git a/test/integration/generated/additionalProperties/package.json b/test/integration/generated/additionalProperties/package.json index 63b35927f8..fc0c835b33 100644 --- a/test/integration/generated/additionalProperties/package.json +++ b/test/integration/generated/additionalProperties/package.json @@ -26,6 +26,7 @@ "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", "uglify-js": "^3.4.9", + "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", "@azure-tools/test-recorder": "^1.0.0", "mocha": "^7.1.1", @@ -78,7 +79,7 @@ "unit-test:node": "cross-env TEST_MODE=playback npm run integration-test:node", "unit-test:browser": "echo skipped", "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts", + "integration-test:node": "mocha -r esm --require ts-node/register --timeout 1200000 --full-trace test/*.ts --reporter ../../../common/tools/mocha-multi-reporter.js", "integration-test:browser": "echo skipped", "docs": "echo skipped" }, diff --git a/test/integration/generated/additionalProperties/src/additionalPropertiesClient.ts b/test/integration/generated/additionalProperties/src/additionalPropertiesClient.ts index 197c6052b5..992c69cc69 100644 --- a/test/integration/generated/additionalProperties/src/additionalPropertiesClient.ts +++ b/test/integration/generated/additionalProperties/src/additionalPropertiesClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { PetsImpl } from "./operations"; import { Pets } from "./operationsInterfaces"; -import { AdditionalPropertiesClientContext } from "./additionalPropertiesClientContext"; import { AdditionalPropertiesClientOptionalParams } from "./models"; -export class AdditionalPropertiesClient extends AdditionalPropertiesClientContext { +export class AdditionalPropertiesClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the AdditionalPropertiesClient class. * @param options The parameter options */ constructor(options?: AdditionalPropertiesClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AdditionalPropertiesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-additional-properties/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.pets = new PetsImpl(this); } diff --git a/test/integration/generated/additionalProperties/src/additionalPropertiesClientContext.ts b/test/integration/generated/additionalProperties/src/additionalPropertiesClientContext.ts deleted file mode 100644 index 44f819ca51..0000000000 --- a/test/integration/generated/additionalProperties/src/additionalPropertiesClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { AdditionalPropertiesClientOptionalParams } from "./models"; - -export class AdditionalPropertiesClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the AdditionalPropertiesClientContext class. - * @param options The parameter options - */ - constructor(options?: AdditionalPropertiesClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: AdditionalPropertiesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-additional-properties/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/additionalProperties/src/index.ts b/test/integration/generated/additionalProperties/src/index.ts index 27e7c36b41..1e65507bb3 100644 --- a/test/integration/generated/additionalProperties/src/index.ts +++ b/test/integration/generated/additionalProperties/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { AdditionalPropertiesClient } from "./additionalPropertiesClient"; -export { AdditionalPropertiesClientContext } from "./additionalPropertiesClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/additionalProperties/src/operations/pets.ts b/test/integration/generated/additionalProperties/src/operations/pets.ts index 4e16d2f7f1..352bad2c9f 100644 --- a/test/integration/generated/additionalProperties/src/operations/pets.ts +++ b/test/integration/generated/additionalProperties/src/operations/pets.ts @@ -10,7 +10,7 @@ import { Pets } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AdditionalPropertiesClientContext } from "../additionalPropertiesClientContext"; +import { AdditionalPropertiesClient } from "../additionalPropertiesClient"; import { PetAPTrue, PetsCreateAPTrueOptionalParams, @@ -34,13 +34,13 @@ import { /** Class containing Pets operations. */ export class PetsImpl implements Pets { - private readonly client: AdditionalPropertiesClientContext; + private readonly client: AdditionalPropertiesClient; /** * Initialize a new instance of the class Pets class. * @param client Reference to the service client */ - constructor(client: AdditionalPropertiesClientContext) { + constructor(client: AdditionalPropertiesClient) { this.client = client; } diff --git a/test/integration/generated/appconfiguration/package.json b/test/integration/generated/appconfiguration/package.json index 7bbcc7bc8a..7b771b375b 100644 --- a/test/integration/generated/appconfiguration/package.json +++ b/test/integration/generated/appconfiguration/package.json @@ -26,7 +26,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/appconfiguration/src/appConfigurationClient.ts b/test/integration/generated/appconfiguration/src/appConfigurationClient.ts index fb504da7a1..92fbb174ad 100644 --- a/test/integration/generated/appconfiguration/src/appConfigurationClient.ts +++ b/test/integration/generated/appconfiguration/src/appConfigurationClient.ts @@ -10,7 +10,6 @@ import * as coreClient from "@azure/core-client"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { AppConfigurationClientContext } from "./appConfigurationClientContext"; import { AppConfigurationClientOptionalParams, Key, @@ -55,7 +54,11 @@ import { } from "./models"; /// -export class AppConfigurationClient extends AppConfigurationClientContext { +export class AppConfigurationClient extends coreClient.ServiceClient { + endpoint: string; + syncToken?: string; + apiVersion: string; + /** * Initializes a new instance of the AppConfigurationClient class. * @param endpoint The endpoint of the App Configuration instance to send requests to. @@ -65,7 +68,38 @@ export class AppConfigurationClient extends AppConfigurationClientContext { endpoint: string, options?: AppConfigurationClientOptionalParams ) { - super(endpoint, options); + if (endpoint === undefined) { + throw new Error("'endpoint' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AppConfigurationClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-appconfiguration/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{endpoint}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.endpoint = endpoint; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "1.0"; } /** diff --git a/test/integration/generated/appconfiguration/src/appConfigurationClientContext.ts b/test/integration/generated/appconfiguration/src/appConfigurationClientContext.ts deleted file mode 100644 index 772e816c74..0000000000 --- a/test/integration/generated/appconfiguration/src/appConfigurationClientContext.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { AppConfigurationClientOptionalParams } from "./models"; - -export class AppConfigurationClientContext extends coreClient.ServiceClient { - endpoint: string; - syncToken?: string; - apiVersion: string; - - /** - * Initializes a new instance of the AppConfigurationClientContext class. - * @param endpoint The endpoint of the App Configuration instance to send requests to. - * @param options The parameter options - */ - constructor( - endpoint: string, - options?: AppConfigurationClientOptionalParams - ) { - if (endpoint === undefined) { - throw new Error("'endpoint' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: AppConfigurationClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-appconfiguration/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{endpoint}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.endpoint = endpoint; - - // Assigning values to Constant parameters - this.apiVersion = options.apiVersion || "1.0"; - } -} diff --git a/test/integration/generated/appconfiguration/src/index.ts b/test/integration/generated/appconfiguration/src/index.ts index f4f4cc420a..de43cce385 100644 --- a/test/integration/generated/appconfiguration/src/index.ts +++ b/test/integration/generated/appconfiguration/src/index.ts @@ -9,4 +9,3 @@ /// export * from "./models"; export { AppConfigurationClient } from "./appConfigurationClient"; -export { AppConfigurationClientContext } from "./appConfigurationClientContext"; diff --git a/test/integration/generated/appconfigurationexport/package.json b/test/integration/generated/appconfigurationexport/package.json index 7bbcc7bc8a..7b771b375b 100644 --- a/test/integration/generated/appconfigurationexport/package.json +++ b/test/integration/generated/appconfigurationexport/package.json @@ -26,7 +26,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/appconfigurationexport/src/appConfigurationClient.ts b/test/integration/generated/appconfigurationexport/src/appConfigurationClient.ts index 2929a210e7..678834664b 100644 --- a/test/integration/generated/appconfigurationexport/src/appConfigurationClient.ts +++ b/test/integration/generated/appconfigurationexport/src/appConfigurationClient.ts @@ -10,7 +10,6 @@ import * as coreClient from "@azure/core-client"; import { PagedAsyncIterableIterator } from "@azure/core-paging"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { AppConfigurationClientContext } from "./appConfigurationClientContext"; import { AppConfigurationClientOptionalParams, Key, @@ -56,7 +55,11 @@ import { /// /** @internal */ -export class AppConfigurationClient extends AppConfigurationClientContext { +export class AppConfigurationClient extends coreClient.ServiceClient { + endpoint: string; + syncToken?: string; + apiVersion: string; + /** * Initializes a new instance of the AppConfigurationClient class. * @param endpoint The endpoint of the App Configuration instance to send requests to. @@ -66,7 +69,38 @@ export class AppConfigurationClient extends AppConfigurationClientContext { endpoint: string, options?: AppConfigurationClientOptionalParams ) { - super(endpoint, options); + if (endpoint === undefined) { + throw new Error("'endpoint' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AppConfigurationClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-appconfiguration/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{endpoint}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.endpoint = endpoint; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "1.0"; } /** diff --git a/test/integration/generated/appconfigurationexport/src/appConfigurationClientContext.ts b/test/integration/generated/appconfigurationexport/src/appConfigurationClientContext.ts deleted file mode 100644 index 9095f25830..0000000000 --- a/test/integration/generated/appconfigurationexport/src/appConfigurationClientContext.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { AppConfigurationClientOptionalParams } from "./models"; - -/** @internal */ -export class AppConfigurationClientContext extends coreClient.ServiceClient { - endpoint: string; - syncToken?: string; - apiVersion: string; - - /** - * Initializes a new instance of the AppConfigurationClientContext class. - * @param endpoint The endpoint of the App Configuration instance to send requests to. - * @param options The parameter options - */ - constructor( - endpoint: string, - options?: AppConfigurationClientOptionalParams - ) { - if (endpoint === undefined) { - throw new Error("'endpoint' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: AppConfigurationClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-appconfiguration/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{endpoint}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.endpoint = endpoint; - - // Assigning values to Constant parameters - this.apiVersion = options.apiVersion || "1.0"; - } -} diff --git a/test/integration/generated/appconfigurationexport/src/index.ts b/test/integration/generated/appconfigurationexport/src/index.ts index f4f4cc420a..de43cce385 100644 --- a/test/integration/generated/appconfigurationexport/src/index.ts +++ b/test/integration/generated/appconfigurationexport/src/index.ts @@ -9,4 +9,3 @@ /// export * from "./models"; export { AppConfigurationClient } from "./appConfigurationClient"; -export { AppConfigurationClientContext } from "./appConfigurationClientContext"; diff --git a/test/integration/generated/arrayConstraints/package.json b/test/integration/generated/arrayConstraints/package.json index 46bf9eddce..15d3569b1e 100644 --- a/test/integration/generated/arrayConstraints/package.json +++ b/test/integration/generated/arrayConstraints/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/arrayConstraints/src/arrayConstraintsClient.ts b/test/integration/generated/arrayConstraints/src/arrayConstraintsClient.ts index 02ff61db0c..09dc3de587 100644 --- a/test/integration/generated/arrayConstraints/src/arrayConstraintsClient.ts +++ b/test/integration/generated/arrayConstraints/src/arrayConstraintsClient.ts @@ -9,10 +9,9 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { ArrayConstraintsClientContext } from "./arrayConstraintsClientContext"; import { - ArrayConstraintsClientOptionalParams, Enum0, + ArrayConstraintsClientOptionalParams, Product, PostValueOptionalParams, PostValueResponse, @@ -20,7 +19,10 @@ import { ApiV1ValueGetResponse } from "./models"; -export class ArrayConstraintsClient extends ArrayConstraintsClientContext { +export class ArrayConstraintsClient extends coreClient.ServiceClient { + $host: string; + apiVersion: Enum0; + /** * Initializes a new instance of the ArrayConstraintsClient class. * @param $host server parameter @@ -32,7 +34,39 @@ export class ArrayConstraintsClient extends ArrayConstraintsClientContext { apiVersion: Enum0, options?: ArrayConstraintsClientOptionalParams ) { - super($host, apiVersion, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ArrayConstraintsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-array-constraints-client/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + this.apiVersion = apiVersion; } /** diff --git a/test/integration/generated/arrayConstraints/src/arrayConstraintsClientContext.ts b/test/integration/generated/arrayConstraints/src/arrayConstraintsClientContext.ts deleted file mode 100644 index 39f895daf9..0000000000 --- a/test/integration/generated/arrayConstraints/src/arrayConstraintsClientContext.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { Enum0, ArrayConstraintsClientOptionalParams } from "./models"; - -export class ArrayConstraintsClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: Enum0; - - /** - * Initializes a new instance of the ArrayConstraintsClientContext class. - * @param $host server parameter - * @param apiVersion - * @param options The parameter options - */ - constructor( - $host: string, - apiVersion: Enum0, - options?: ArrayConstraintsClientOptionalParams - ) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ArrayConstraintsClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-array-constraints-client/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - this.apiVersion = apiVersion; - } -} diff --git a/test/integration/generated/arrayConstraints/src/index.ts b/test/integration/generated/arrayConstraints/src/index.ts index 1b3254ede2..dd642ba343 100644 --- a/test/integration/generated/arrayConstraints/src/index.ts +++ b/test/integration/generated/arrayConstraints/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { ArrayConstraintsClient } from "./arrayConstraintsClient"; -export { ArrayConstraintsClientContext } from "./arrayConstraintsClientContext"; diff --git a/test/integration/generated/attestation/package.json b/test/integration/generated/attestation/package.json index ea28192dc5..c9002fd337 100644 --- a/test/integration/generated/attestation/package.json +++ b/test/integration/generated/attestation/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/attestation/src/generatedClient.ts b/test/integration/generated/attestation/src/generatedClient.ts index 385cb6afca..56ee62e27e 100644 --- a/test/integration/generated/attestation/src/generatedClient.ts +++ b/test/integration/generated/attestation/src/generatedClient.ts @@ -6,20 +6,54 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { PolicyImpl } from "./operations"; import { Policy } from "./operationsInterfaces"; -import { GeneratedClientContext } from "./generatedClientContext"; import { GeneratedClientOptionalParams } from "./models"; /** @internal */ -export class GeneratedClient extends GeneratedClientContext { +export class GeneratedClient extends coreClient.ServiceClient { + instanceUrl: string; + apiVersion: string; + /** * Initializes a new instance of the GeneratedClient class. * @param instanceUrl The attestation instance base URI, for example https://mytenant.attest.azure.net. * @param options The parameter options */ constructor(instanceUrl: string, options?: GeneratedClientOptionalParams) { - super(instanceUrl, options); + if (instanceUrl === undefined) { + throw new Error("'instanceUrl' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: GeneratedClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-attestation/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{instanceUrl}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.instanceUrl = instanceUrl; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "2020-10-01"; this.policy = new PolicyImpl(this); } diff --git a/test/integration/generated/attestation/src/generatedClientContext.ts b/test/integration/generated/attestation/src/generatedClientContext.ts deleted file mode 100644 index 427f261447..0000000000 --- a/test/integration/generated/attestation/src/generatedClientContext.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { GeneratedClientOptionalParams } from "./models"; - -/** @internal */ -export class GeneratedClientContext extends coreClient.ServiceClient { - instanceUrl: string; - apiVersion: string; - - /** - * Initializes a new instance of the GeneratedClientContext class. - * @param instanceUrl The attestation instance base URI, for example https://mytenant.attest.azure.net. - * @param options The parameter options - */ - constructor(instanceUrl: string, options?: GeneratedClientOptionalParams) { - if (instanceUrl === undefined) { - throw new Error("'instanceUrl' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: GeneratedClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-attestation/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{instanceUrl}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.instanceUrl = instanceUrl; - - // Assigning values to Constant parameters - this.apiVersion = options.apiVersion || "2020-10-01"; - } -} diff --git a/test/integration/generated/attestation/src/index.ts b/test/integration/generated/attestation/src/index.ts index 707d58f011..db5d703d07 100644 --- a/test/integration/generated/attestation/src/index.ts +++ b/test/integration/generated/attestation/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { GeneratedClient } from "./generatedClient"; -export { GeneratedClientContext } from "./generatedClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/attestation/src/operations/policy.ts b/test/integration/generated/attestation/src/operations/policy.ts index 1514312853..fc614fdf05 100644 --- a/test/integration/generated/attestation/src/operations/policy.ts +++ b/test/integration/generated/attestation/src/operations/policy.ts @@ -10,7 +10,7 @@ import { Policy } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { GeneratedClientContext } from "../generatedClientContext"; +import { GeneratedClient } from "../generatedClient"; import { AttestationType, PolicyGetOptionalParams, @@ -23,13 +23,13 @@ import { /** Class containing Policy operations. */ export class PolicyImpl implements Policy { - private readonly client: GeneratedClientContext; + private readonly client: GeneratedClient; /** * Initialize a new instance of the class Policy class. * @param client Reference to the service client */ - constructor(client: GeneratedClientContext) { + constructor(client: GeneratedClient) { this.client = client; } diff --git a/test/integration/generated/azureParameterGrouping/package.json b/test/integration/generated/azureParameterGrouping/package.json index 019a2c5a73..774aec2ea5 100644 --- a/test/integration/generated/azureParameterGrouping/package.json +++ b/test/integration/generated/azureParameterGrouping/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClient.ts b/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClient.ts index eacb40c2c6..b1fcc04f05 100644 --- a/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClient.ts +++ b/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { ParameterGroupingImpl } from "./operations"; import { ParameterGrouping } from "./operationsInterfaces"; -import { AzureParameterGroupingClientContext } from "./azureParameterGroupingClientContext"; import { AzureParameterGroupingClientOptionalParams } from "./models"; -export class AzureParameterGroupingClient extends AzureParameterGroupingClientContext { +export class AzureParameterGroupingClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the AzureParameterGroupingClient class. * @param options The parameter options */ constructor(options?: AzureParameterGroupingClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AzureParameterGroupingClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-azure-parameter-grouping/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.parameterGrouping = new ParameterGroupingImpl(this); } diff --git a/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClientContext.ts b/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClientContext.ts deleted file mode 100644 index b3b7294fb4..0000000000 --- a/test/integration/generated/azureParameterGrouping/src/azureParameterGroupingClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { AzureParameterGroupingClientOptionalParams } from "./models"; - -export class AzureParameterGroupingClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the AzureParameterGroupingClientContext class. - * @param options The parameter options - */ - constructor(options?: AzureParameterGroupingClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: AzureParameterGroupingClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-azure-parameter-grouping/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/azureParameterGrouping/src/index.ts b/test/integration/generated/azureParameterGrouping/src/index.ts index 89becd64b0..81a8b12231 100644 --- a/test/integration/generated/azureParameterGrouping/src/index.ts +++ b/test/integration/generated/azureParameterGrouping/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { AzureParameterGroupingClient } from "./azureParameterGroupingClient"; -export { AzureParameterGroupingClientContext } from "./azureParameterGroupingClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/azureParameterGrouping/src/operations/parameterGrouping.ts b/test/integration/generated/azureParameterGrouping/src/operations/parameterGrouping.ts index e54e593e61..a2d7dc8550 100644 --- a/test/integration/generated/azureParameterGrouping/src/operations/parameterGrouping.ts +++ b/test/integration/generated/azureParameterGrouping/src/operations/parameterGrouping.ts @@ -10,7 +10,7 @@ import { ParameterGrouping } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureParameterGroupingClientContext } from "../azureParameterGroupingClientContext"; +import { AzureParameterGroupingClient } from "../azureParameterGroupingClient"; import { ParameterGroupingPostRequiredParameters, ParameterGroupingPostRequiredOptionalParams, @@ -22,13 +22,13 @@ import { /** Class containing ParameterGrouping operations. */ export class ParameterGroupingImpl implements ParameterGrouping { - private readonly client: AzureParameterGroupingClientContext; + private readonly client: AzureParameterGroupingClient; /** * Initialize a new instance of the class ParameterGrouping class. * @param client Reference to the service client */ - constructor(client: AzureParameterGroupingClientContext) { + constructor(client: AzureParameterGroupingClient) { this.client = client; } diff --git a/test/integration/generated/azureReport/package.json b/test/integration/generated/azureReport/package.json index 0964d316ba..2e522ea81d 100644 --- a/test/integration/generated/azureReport/package.json +++ b/test/integration/generated/azureReport/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/azureReport/src/index.ts b/test/integration/generated/azureReport/src/index.ts index 5a2e464d52..597f974fe7 100644 --- a/test/integration/generated/azureReport/src/index.ts +++ b/test/integration/generated/azureReport/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { ReportClient } from "./reportClient"; -export { ReportClientContext } from "./reportClientContext"; diff --git a/test/integration/generated/azureReport/src/reportClient.ts b/test/integration/generated/azureReport/src/reportClient.ts index 84fc34fbfc..4238a6d2be 100644 --- a/test/integration/generated/azureReport/src/reportClient.ts +++ b/test/integration/generated/azureReport/src/reportClient.ts @@ -9,20 +9,46 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { ReportClientContext } from "./reportClientContext"; import { ReportClientOptionalParams, GetReportOptionalParams, GetReportResponse } from "./models"; -export class ReportClient extends ReportClientContext { +export class ReportClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the ReportClient class. * @param options The parameter options */ constructor(options?: ReportClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ReportClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-zzzAzureReport/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; } /** diff --git a/test/integration/generated/azureReport/src/reportClientContext.ts b/test/integration/generated/azureReport/src/reportClientContext.ts deleted file mode 100644 index a42d66a2ab..0000000000 --- a/test/integration/generated/azureReport/src/reportClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { ReportClientOptionalParams } from "./models"; - -export class ReportClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the ReportClientContext class. - * @param options The parameter options - */ - constructor(options?: ReportClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ReportClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-zzzAzureReport/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/azureSpecialProperties/package.json b/test/integration/generated/azureSpecialProperties/package.json index 7b88dd3b01..55df262957 100644 --- a/test/integration/generated/azureSpecialProperties/package.json +++ b/test/integration/generated/azureSpecialProperties/package.json @@ -26,7 +26,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClient.ts b/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClient.ts index 85d7dd8998..5a150afc11 100644 --- a/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClient.ts +++ b/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClient.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import * as coreAuth from "@azure/core-auth"; import { XMsClientRequestIdImpl, @@ -27,10 +28,13 @@ import { Odata, Header } from "./operationsInterfaces"; -import { AzureSpecialPropertiesClientContext } from "./azureSpecialPropertiesClientContext"; import { AzureSpecialPropertiesClientOptionalParams } from "./models"; -export class AzureSpecialPropertiesClient extends AzureSpecialPropertiesClientContext { +export class AzureSpecialPropertiesClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + /** * Initializes a new instance of the AzureSpecialPropertiesClient class. * @param credentials Subscription credentials which uniquely identify client subscription. @@ -43,7 +47,49 @@ export class AzureSpecialPropertiesClient extends AzureSpecialPropertiesClientCo subscriptionId: string, options?: AzureSpecialPropertiesClientOptionalParams ) { - super(credentials, subscriptionId, options); + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: AzureSpecialPropertiesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-azure-special-properties/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = [ + "https://microsoft.com/.default", + "http://microsoft.com/.default" + ]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "2015-07-01-preview"; this.xMsClientRequestId = new XMsClientRequestIdImpl(this); this.subscriptionInCredentials = new SubscriptionInCredentialsImpl(this); this.subscriptionInMethod = new SubscriptionInMethodImpl(this); diff --git a/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClientContext.ts b/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClientContext.ts deleted file mode 100644 index 2bf7f4a3b2..0000000000 --- a/test/integration/generated/azureSpecialProperties/src/azureSpecialPropertiesClientContext.ts +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import * as coreAuth from "@azure/core-auth"; -import { AzureSpecialPropertiesClientOptionalParams } from "./models"; - -export class AzureSpecialPropertiesClientContext extends coreClient.ServiceClient { - $host: string; - subscriptionId: string; - apiVersion: string; - - /** - * Initializes a new instance of the AzureSpecialPropertiesClientContext class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The subscription id, which appears in the path, always modeled in credentials. - * The value is always '1234-5678-9012-3456' - * @param options The parameter options - */ - constructor( - credentials: coreAuth.TokenCredential, - subscriptionId: string, - options?: AzureSpecialPropertiesClientOptionalParams - ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: AzureSpecialPropertiesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials - }; - - const packageDetails = `azsdk-js-azure-special-properties/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - if (!options.credentialScopes) { - options.credentialScopes = [ - "https://microsoft.com/.default", - "http://microsoft.com/.default" - ]; - } - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "2015-07-01-preview"; - } -} diff --git a/test/integration/generated/azureSpecialProperties/src/index.ts b/test/integration/generated/azureSpecialProperties/src/index.ts index 67661dc286..e96237bae4 100644 --- a/test/integration/generated/azureSpecialProperties/src/index.ts +++ b/test/integration/generated/azureSpecialProperties/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { AzureSpecialPropertiesClient } from "./azureSpecialPropertiesClient"; -export { AzureSpecialPropertiesClientContext } from "./azureSpecialPropertiesClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/azureSpecialProperties/src/operations/apiVersionDefault.ts b/test/integration/generated/azureSpecialProperties/src/operations/apiVersionDefault.ts index c79b71e874..9a1dab5a8f 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/apiVersionDefault.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/apiVersionDefault.ts @@ -10,7 +10,7 @@ import { ApiVersionDefault } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; +import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; import { ApiVersionDefaultGetMethodGlobalValidOptionalParams, ApiVersionDefaultGetMethodGlobalNotProvidedValidOptionalParams, @@ -20,13 +20,13 @@ import { /** Class containing ApiVersionDefault operations. */ export class ApiVersionDefaultImpl implements ApiVersionDefault { - private readonly client: AzureSpecialPropertiesClientContext; + private readonly client: AzureSpecialPropertiesClient; /** * Initialize a new instance of the class ApiVersionDefault class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClientContext) { + constructor(client: AzureSpecialPropertiesClient) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/apiVersionLocal.ts b/test/integration/generated/azureSpecialProperties/src/operations/apiVersionLocal.ts index b61b58af0a..539c6557a5 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/apiVersionLocal.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/apiVersionLocal.ts @@ -10,7 +10,7 @@ import { ApiVersionLocal } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; +import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; import { ApiVersionLocalGetMethodLocalValidOptionalParams, ApiVersionLocalGetMethodLocalNullOptionalParams, @@ -20,13 +20,13 @@ import { /** Class containing ApiVersionLocal operations. */ export class ApiVersionLocalImpl implements ApiVersionLocal { - private readonly client: AzureSpecialPropertiesClientContext; + private readonly client: AzureSpecialPropertiesClient; /** * Initialize a new instance of the class ApiVersionLocal class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClientContext) { + constructor(client: AzureSpecialPropertiesClient) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/header.ts b/test/integration/generated/azureSpecialProperties/src/operations/header.ts index e270eb406e..cd7cb2b60e 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/header.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/header.ts @@ -10,7 +10,7 @@ import { Header } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; +import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; import { HeaderCustomNamedRequestIdOptionalParams, HeaderCustomNamedRequestIdResponse, @@ -23,13 +23,13 @@ import { /** Class containing Header operations. */ export class HeaderImpl implements Header { - private readonly client: AzureSpecialPropertiesClientContext; + private readonly client: AzureSpecialPropertiesClient; /** * Initialize a new instance of the class Header class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClientContext) { + constructor(client: AzureSpecialPropertiesClient) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/odata.ts b/test/integration/generated/azureSpecialProperties/src/operations/odata.ts index 55fde31b2b..c3f6334d31 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/odata.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/odata.ts @@ -10,18 +10,18 @@ import { Odata } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; +import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; import { OdataGetWithFilterOptionalParams } from "../models"; /** Class containing Odata operations. */ export class OdataImpl implements Odata { - private readonly client: AzureSpecialPropertiesClientContext; + private readonly client: AzureSpecialPropertiesClient; /** * Initialize a new instance of the class Odata class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClientContext) { + constructor(client: AzureSpecialPropertiesClient) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/skipUrlEncoding.ts b/test/integration/generated/azureSpecialProperties/src/operations/skipUrlEncoding.ts index 268157843d..a576fda5d1 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/skipUrlEncoding.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/skipUrlEncoding.ts @@ -10,7 +10,7 @@ import { SkipUrlEncoding } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; +import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; import { SkipUrlEncodingGetMethodPathValidOptionalParams, SkipUrlEncodingGetPathValidOptionalParams, @@ -23,13 +23,13 @@ import { /** Class containing SkipUrlEncoding operations. */ export class SkipUrlEncodingImpl implements SkipUrlEncoding { - private readonly client: AzureSpecialPropertiesClientContext; + private readonly client: AzureSpecialPropertiesClient; /** * Initialize a new instance of the class SkipUrlEncoding class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClientContext) { + constructor(client: AzureSpecialPropertiesClient) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInCredentials.ts b/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInCredentials.ts index 9817175e31..832a11f80e 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInCredentials.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInCredentials.ts @@ -10,7 +10,7 @@ import { SubscriptionInCredentials } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; +import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; import { SubscriptionInCredentialsPostMethodGlobalValidOptionalParams, SubscriptionInCredentialsPostMethodGlobalNullOptionalParams, @@ -22,13 +22,13 @@ import { /** Class containing SubscriptionInCredentials operations. */ export class SubscriptionInCredentialsImpl implements SubscriptionInCredentials { - private readonly client: AzureSpecialPropertiesClientContext; + private readonly client: AzureSpecialPropertiesClient; /** * Initialize a new instance of the class SubscriptionInCredentials class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClientContext) { + constructor(client: AzureSpecialPropertiesClient) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInMethod.ts b/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInMethod.ts index 5168d65744..83ddfc9830 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInMethod.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/subscriptionInMethod.ts @@ -10,7 +10,7 @@ import { SubscriptionInMethod } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; +import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; import { SubscriptionInMethodPostMethodLocalValidOptionalParams, SubscriptionInMethodPostMethodLocalNullOptionalParams, @@ -20,13 +20,13 @@ import { /** Class containing SubscriptionInMethod operations. */ export class SubscriptionInMethodImpl implements SubscriptionInMethod { - private readonly client: AzureSpecialPropertiesClientContext; + private readonly client: AzureSpecialPropertiesClient; /** * Initialize a new instance of the class SubscriptionInMethod class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClientContext) { + constructor(client: AzureSpecialPropertiesClient) { this.client = client; } diff --git a/test/integration/generated/azureSpecialProperties/src/operations/xMsClientRequestId.ts b/test/integration/generated/azureSpecialProperties/src/operations/xMsClientRequestId.ts index c423a5b6f7..8093a9865c 100644 --- a/test/integration/generated/azureSpecialProperties/src/operations/xMsClientRequestId.ts +++ b/test/integration/generated/azureSpecialProperties/src/operations/xMsClientRequestId.ts @@ -10,7 +10,7 @@ import { XMsClientRequestId } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { AzureSpecialPropertiesClientContext } from "../azureSpecialPropertiesClientContext"; +import { AzureSpecialPropertiesClient } from "../azureSpecialPropertiesClient"; import { XMsClientRequestIdGetOptionalParams, XMsClientRequestIdParamGetOptionalParams @@ -18,13 +18,13 @@ import { /** Class containing XMsClientRequestId operations. */ export class XMsClientRequestIdImpl implements XMsClientRequestId { - private readonly client: AzureSpecialPropertiesClientContext; + private readonly client: AzureSpecialPropertiesClient; /** * Initialize a new instance of the class XMsClientRequestId class. * @param client Reference to the service client */ - constructor(client: AzureSpecialPropertiesClientContext) { + constructor(client: AzureSpecialPropertiesClient) { this.client = client; } diff --git a/test/integration/generated/bodyArray/package.json b/test/integration/generated/bodyArray/package.json index 0e883c0312..b2e9ec3e50 100644 --- a/test/integration/generated/bodyArray/package.json +++ b/test/integration/generated/bodyArray/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyArray/src/bodyArrayClient.ts b/test/integration/generated/bodyArray/src/bodyArrayClient.ts index cb5a7477f6..8abf3d71eb 100644 --- a/test/integration/generated/bodyArray/src/bodyArrayClient.ts +++ b/test/integration/generated/bodyArray/src/bodyArrayClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { ArrayImpl } from "./operations"; import { Array } from "./operationsInterfaces"; -import { BodyArrayClientContext } from "./bodyArrayClientContext"; import { BodyArrayClientOptionalParams } from "./models"; -export class BodyArrayClient extends BodyArrayClientContext { +export class BodyArrayClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyArrayClient class. * @param options The parameter options */ constructor(options?: BodyArrayClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyArrayClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-array/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.array = new ArrayImpl(this); } diff --git a/test/integration/generated/bodyArray/src/bodyArrayClientContext.ts b/test/integration/generated/bodyArray/src/bodyArrayClientContext.ts deleted file mode 100644 index a4563aa7bd..0000000000 --- a/test/integration/generated/bodyArray/src/bodyArrayClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyArrayClientOptionalParams } from "./models"; - -export class BodyArrayClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyArrayClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyArrayClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyArrayClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-array/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyArray/src/index.ts b/test/integration/generated/bodyArray/src/index.ts index 008ea24110..6c1db93646 100644 --- a/test/integration/generated/bodyArray/src/index.ts +++ b/test/integration/generated/bodyArray/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyArrayClient } from "./bodyArrayClient"; -export { BodyArrayClientContext } from "./bodyArrayClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyArray/src/operations/array.ts b/test/integration/generated/bodyArray/src/operations/array.ts index ae7aae9bd4..d28393fc90 100644 --- a/test/integration/generated/bodyArray/src/operations/array.ts +++ b/test/integration/generated/bodyArray/src/operations/array.ts @@ -10,7 +10,7 @@ import { Array } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyArrayClientContext } from "../bodyArrayClientContext"; +import { BodyArrayClient } from "../bodyArrayClient"; import { ArrayGetNullOptionalParams, ArrayGetNullResponse, @@ -139,13 +139,13 @@ import { /** Class containing Array operations. */ export class ArrayImpl implements Array { - private readonly client: BodyArrayClientContext; + private readonly client: BodyArrayClient; /** * Initialize a new instance of the class Array class. * @param client Reference to the service client */ - constructor(client: BodyArrayClientContext) { + constructor(client: BodyArrayClient) { this.client = client; } diff --git a/test/integration/generated/bodyBoolean/package.json b/test/integration/generated/bodyBoolean/package.json index a66f664550..df7a65559d 100644 --- a/test/integration/generated/bodyBoolean/package.json +++ b/test/integration/generated/bodyBoolean/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyBoolean/src/bodyBooleanClient.ts b/test/integration/generated/bodyBoolean/src/bodyBooleanClient.ts index baa84ceae4..d9139fafa0 100644 --- a/test/integration/generated/bodyBoolean/src/bodyBooleanClient.ts +++ b/test/integration/generated/bodyBoolean/src/bodyBooleanClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { BoolImpl } from "./operations"; import { Bool } from "./operationsInterfaces"; -import { BodyBooleanClientContext } from "./bodyBooleanClientContext"; import { BodyBooleanClientOptionalParams } from "./models"; -export class BodyBooleanClient extends BodyBooleanClientContext { +export class BodyBooleanClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyBooleanClient class. * @param options The parameter options */ constructor(options?: BodyBooleanClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyBooleanClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-boolean/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.bool = new BoolImpl(this); } diff --git a/test/integration/generated/bodyBoolean/src/bodyBooleanClientContext.ts b/test/integration/generated/bodyBoolean/src/bodyBooleanClientContext.ts deleted file mode 100644 index 2838b08726..0000000000 --- a/test/integration/generated/bodyBoolean/src/bodyBooleanClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyBooleanClientOptionalParams } from "./models"; - -export class BodyBooleanClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyBooleanClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyBooleanClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyBooleanClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-boolean/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyBoolean/src/index.ts b/test/integration/generated/bodyBoolean/src/index.ts index 4836a95b44..4ccee4090c 100644 --- a/test/integration/generated/bodyBoolean/src/index.ts +++ b/test/integration/generated/bodyBoolean/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyBooleanClient } from "./bodyBooleanClient"; -export { BodyBooleanClientContext } from "./bodyBooleanClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyBoolean/src/operations/bool.ts b/test/integration/generated/bodyBoolean/src/operations/bool.ts index d0a6267175..47509979e8 100644 --- a/test/integration/generated/bodyBoolean/src/operations/bool.ts +++ b/test/integration/generated/bodyBoolean/src/operations/bool.ts @@ -10,7 +10,7 @@ import { Bool } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyBooleanClientContext } from "../bodyBooleanClientContext"; +import { BodyBooleanClient } from "../bodyBooleanClient"; import { BoolGetTrueOptionalParams, BoolGetTrueResponse, @@ -26,13 +26,13 @@ import { /** Class containing Bool operations. */ export class BoolImpl implements Bool { - private readonly client: BodyBooleanClientContext; + private readonly client: BodyBooleanClient; /** * Initialize a new instance of the class Bool class. * @param client Reference to the service client */ - constructor(client: BodyBooleanClientContext) { + constructor(client: BodyBooleanClient) { this.client = client; } diff --git a/test/integration/generated/bodyBooleanQuirks/package.json b/test/integration/generated/bodyBooleanQuirks/package.json index 82fc5d52bd..1f0e151999 100644 --- a/test/integration/generated/bodyBooleanQuirks/package.json +++ b/test/integration/generated/bodyBooleanQuirks/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClient.ts b/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClient.ts index 562e9c0cdd..40df991aa1 100644 --- a/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClient.ts +++ b/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { BoolImpl } from "./operations"; import { Bool } from "./operationsInterfaces"; -import { BodyBooleanQuirksClientContext } from "./bodyBooleanQuirksClientContext"; import { BodyBooleanQuirksClientOptionalParams } from "./models"; -export class BodyBooleanQuirksClient extends BodyBooleanQuirksClientContext { +export class BodyBooleanQuirksClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyBooleanQuirksClient class. * @param options The parameter options */ constructor(options?: BodyBooleanQuirksClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyBooleanQuirksClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-boolean-quirks/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.bool = new BoolImpl(this); } diff --git a/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClientContext.ts b/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClientContext.ts deleted file mode 100644 index 7dbc364fe4..0000000000 --- a/test/integration/generated/bodyBooleanQuirks/src/bodyBooleanQuirksClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyBooleanQuirksClientOptionalParams } from "./models"; - -export class BodyBooleanQuirksClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyBooleanQuirksClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyBooleanQuirksClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyBooleanQuirksClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-boolean-quirks/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyBooleanQuirks/src/index.ts b/test/integration/generated/bodyBooleanQuirks/src/index.ts index cba80478c1..c2fd7fd6d7 100644 --- a/test/integration/generated/bodyBooleanQuirks/src/index.ts +++ b/test/integration/generated/bodyBooleanQuirks/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyBooleanQuirksClient } from "./bodyBooleanQuirksClient"; -export { BodyBooleanQuirksClientContext } from "./bodyBooleanQuirksClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyBooleanQuirks/src/operations/bool.ts b/test/integration/generated/bodyBooleanQuirks/src/operations/bool.ts index 39ac4d75c0..7738992abf 100644 --- a/test/integration/generated/bodyBooleanQuirks/src/operations/bool.ts +++ b/test/integration/generated/bodyBooleanQuirks/src/operations/bool.ts @@ -10,7 +10,7 @@ import { Bool } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyBooleanQuirksClientContext } from "../bodyBooleanQuirksClientContext"; +import { BodyBooleanQuirksClient } from "../bodyBooleanQuirksClient"; import { BoolGetTrueOptionalParams, BoolGetTrueResponse, @@ -26,13 +26,13 @@ import { /** Class containing Bool operations. */ export class BoolImpl implements Bool { - private readonly client: BodyBooleanQuirksClientContext; + private readonly client: BodyBooleanQuirksClient; /** * Initialize a new instance of the class Bool class. * @param client Reference to the service client */ - constructor(client: BodyBooleanQuirksClientContext) { + constructor(client: BodyBooleanQuirksClient) { this.client = client; } diff --git a/test/integration/generated/bodyByte/package.json b/test/integration/generated/bodyByte/package.json index 390d3c0c15..7e0de94823 100644 --- a/test/integration/generated/bodyByte/package.json +++ b/test/integration/generated/bodyByte/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyByte/src/bodyByteClient.ts b/test/integration/generated/bodyByte/src/bodyByteClient.ts index 9802ab077c..7ebf8e7903 100644 --- a/test/integration/generated/bodyByte/src/bodyByteClient.ts +++ b/test/integration/generated/bodyByte/src/bodyByteClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { ByteImpl } from "./operations"; import { Byte } from "./operationsInterfaces"; -import { BodyByteClientContext } from "./bodyByteClientContext"; import { BodyByteClientOptionalParams } from "./models"; -export class BodyByteClient extends BodyByteClientContext { +export class BodyByteClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyByteClient class. * @param options The parameter options */ constructor(options?: BodyByteClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyByteClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-byte/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.byte = new ByteImpl(this); } diff --git a/test/integration/generated/bodyByte/src/bodyByteClientContext.ts b/test/integration/generated/bodyByte/src/bodyByteClientContext.ts deleted file mode 100644 index 1b9cdaa669..0000000000 --- a/test/integration/generated/bodyByte/src/bodyByteClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyByteClientOptionalParams } from "./models"; - -export class BodyByteClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyByteClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyByteClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyByteClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-byte/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyByte/src/index.ts b/test/integration/generated/bodyByte/src/index.ts index cacab8eef6..a1c296dd4d 100644 --- a/test/integration/generated/bodyByte/src/index.ts +++ b/test/integration/generated/bodyByte/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyByteClient } from "./bodyByteClient"; -export { BodyByteClientContext } from "./bodyByteClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyByte/src/operations/byte.ts b/test/integration/generated/bodyByte/src/operations/byte.ts index c0cb774389..0c6d5d71df 100644 --- a/test/integration/generated/bodyByte/src/operations/byte.ts +++ b/test/integration/generated/bodyByte/src/operations/byte.ts @@ -10,7 +10,7 @@ import { Byte } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyByteClientContext } from "../bodyByteClientContext"; +import { BodyByteClient } from "../bodyByteClient"; import { ByteGetNullOptionalParams, ByteGetNullResponse, @@ -25,13 +25,13 @@ import { /** Class containing Byte operations. */ export class ByteImpl implements Byte { - private readonly client: BodyByteClientContext; + private readonly client: BodyByteClient; /** * Initialize a new instance of the class Byte class. * @param client Reference to the service client */ - constructor(client: BodyByteClientContext) { + constructor(client: BodyByteClient) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/package.json b/test/integration/generated/bodyComplex/package.json index fecd94b340..17f594207d 100644 --- a/test/integration/generated/bodyComplex/package.json +++ b/test/integration/generated/bodyComplex/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyComplex/src/bodyComplexClient.ts b/test/integration/generated/bodyComplex/src/bodyComplexClient.ts index 96b7bbd56f..1c492990c5 100644 --- a/test/integration/generated/bodyComplex/src/bodyComplexClient.ts +++ b/test/integration/generated/bodyComplex/src/bodyComplexClient.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { BasicImpl, PrimitiveImpl, @@ -28,16 +29,44 @@ import { Readonlyproperty, Flattencomplex } from "./operationsInterfaces"; -import { BodyComplexClientContext } from "./bodyComplexClientContext"; import { BodyComplexClientOptionalParams } from "./models"; -export class BodyComplexClient extends BodyComplexClientContext { +export class BodyComplexClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + /** * Initializes a new instance of the BodyComplexClient class. * @param options The parameter options */ constructor(options?: BodyComplexClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyComplexClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-complex/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "2016-02-29"; this.basic = new BasicImpl(this); this.primitive = new PrimitiveImpl(this); this.array = new ArrayImpl(this); diff --git a/test/integration/generated/bodyComplex/src/bodyComplexClientContext.ts b/test/integration/generated/bodyComplex/src/bodyComplexClientContext.ts deleted file mode 100644 index 58d2ce6a43..0000000000 --- a/test/integration/generated/bodyComplex/src/bodyComplexClientContext.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyComplexClientOptionalParams } from "./models"; - -export class BodyComplexClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - - /** - * Initializes a new instance of the BodyComplexClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyComplexClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyComplexClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-complex/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "2016-02-29"; - } -} diff --git a/test/integration/generated/bodyComplex/src/index.ts b/test/integration/generated/bodyComplex/src/index.ts index 6790646e3a..cc8998cfbd 100644 --- a/test/integration/generated/bodyComplex/src/index.ts +++ b/test/integration/generated/bodyComplex/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyComplexClient } from "./bodyComplexClient"; -export { BodyComplexClientContext } from "./bodyComplexClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyComplex/src/operations/array.ts b/test/integration/generated/bodyComplex/src/operations/array.ts index de5fcade99..c7241262df 100644 --- a/test/integration/generated/bodyComplex/src/operations/array.ts +++ b/test/integration/generated/bodyComplex/src/operations/array.ts @@ -10,7 +10,7 @@ import { Array } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClientContext } from "../bodyComplexClientContext"; +import { BodyComplexClient } from "../bodyComplexClient"; import { ArrayGetValidOptionalParams, ArrayGetValidResponse, @@ -25,13 +25,13 @@ import { /** Class containing Array operations. */ export class ArrayImpl implements Array { - private readonly client: BodyComplexClientContext; + private readonly client: BodyComplexClient; /** * Initialize a new instance of the class Array class. * @param client Reference to the service client */ - constructor(client: BodyComplexClientContext) { + constructor(client: BodyComplexClient) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/basic.ts b/test/integration/generated/bodyComplex/src/operations/basic.ts index cd5506860c..36ff28a7ea 100644 --- a/test/integration/generated/bodyComplex/src/operations/basic.ts +++ b/test/integration/generated/bodyComplex/src/operations/basic.ts @@ -10,7 +10,7 @@ import { Basic } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClientContext } from "../bodyComplexClientContext"; +import { BodyComplexClient } from "../bodyComplexClient"; import { BasicGetValidOptionalParams, BasicGetValidResponse, @@ -28,13 +28,13 @@ import { /** Class containing Basic operations. */ export class BasicImpl implements Basic { - private readonly client: BodyComplexClientContext; + private readonly client: BodyComplexClient; /** * Initialize a new instance of the class Basic class. * @param client Reference to the service client */ - constructor(client: BodyComplexClientContext) { + constructor(client: BodyComplexClient) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/dictionary.ts b/test/integration/generated/bodyComplex/src/operations/dictionary.ts index ef233bc8f3..3881a54e89 100644 --- a/test/integration/generated/bodyComplex/src/operations/dictionary.ts +++ b/test/integration/generated/bodyComplex/src/operations/dictionary.ts @@ -10,7 +10,7 @@ import { Dictionary } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClientContext } from "../bodyComplexClientContext"; +import { BodyComplexClient } from "../bodyComplexClient"; import { DictionaryGetValidOptionalParams, DictionaryGetValidResponse, @@ -27,13 +27,13 @@ import { /** Class containing Dictionary operations. */ export class DictionaryImpl implements Dictionary { - private readonly client: BodyComplexClientContext; + private readonly client: BodyComplexClient; /** * Initialize a new instance of the class Dictionary class. * @param client Reference to the service client */ - constructor(client: BodyComplexClientContext) { + constructor(client: BodyComplexClient) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/flattencomplex.ts b/test/integration/generated/bodyComplex/src/operations/flattencomplex.ts index 859b6cec75..58d042f1f8 100644 --- a/test/integration/generated/bodyComplex/src/operations/flattencomplex.ts +++ b/test/integration/generated/bodyComplex/src/operations/flattencomplex.ts @@ -10,7 +10,7 @@ import { Flattencomplex } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClientContext } from "../bodyComplexClientContext"; +import { BodyComplexClient } from "../bodyComplexClient"; import { FlattencomplexGetValidOptionalParams, FlattencomplexGetValidResponse @@ -18,13 +18,13 @@ import { /** Class containing Flattencomplex operations. */ export class FlattencomplexImpl implements Flattencomplex { - private readonly client: BodyComplexClientContext; + private readonly client: BodyComplexClient; /** * Initialize a new instance of the class Flattencomplex class. * @param client Reference to the service client */ - constructor(client: BodyComplexClientContext) { + constructor(client: BodyComplexClient) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/inheritance.ts b/test/integration/generated/bodyComplex/src/operations/inheritance.ts index b3c1438444..92275d528e 100644 --- a/test/integration/generated/bodyComplex/src/operations/inheritance.ts +++ b/test/integration/generated/bodyComplex/src/operations/inheritance.ts @@ -10,7 +10,7 @@ import { Inheritance } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClientContext } from "../bodyComplexClientContext"; +import { BodyComplexClient } from "../bodyComplexClient"; import { InheritanceGetValidOptionalParams, InheritanceGetValidResponse, @@ -20,13 +20,13 @@ import { /** Class containing Inheritance operations. */ export class InheritanceImpl implements Inheritance { - private readonly client: BodyComplexClientContext; + private readonly client: BodyComplexClient; /** * Initialize a new instance of the class Inheritance class. * @param client Reference to the service client */ - constructor(client: BodyComplexClientContext) { + constructor(client: BodyComplexClient) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/polymorphicrecursive.ts b/test/integration/generated/bodyComplex/src/operations/polymorphicrecursive.ts index e2d32eb92b..d566c049a0 100644 --- a/test/integration/generated/bodyComplex/src/operations/polymorphicrecursive.ts +++ b/test/integration/generated/bodyComplex/src/operations/polymorphicrecursive.ts @@ -10,7 +10,7 @@ import { Polymorphicrecursive } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClientContext } from "../bodyComplexClientContext"; +import { BodyComplexClient } from "../bodyComplexClient"; import { PolymorphicrecursiveGetValidOptionalParams, PolymorphicrecursiveGetValidResponse, @@ -20,13 +20,13 @@ import { /** Class containing Polymorphicrecursive operations. */ export class PolymorphicrecursiveImpl implements Polymorphicrecursive { - private readonly client: BodyComplexClientContext; + private readonly client: BodyComplexClient; /** * Initialize a new instance of the class Polymorphicrecursive class. * @param client Reference to the service client */ - constructor(client: BodyComplexClientContext) { + constructor(client: BodyComplexClient) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/polymorphism.ts b/test/integration/generated/bodyComplex/src/operations/polymorphism.ts index a540ddc03a..ce74db51c8 100644 --- a/test/integration/generated/bodyComplex/src/operations/polymorphism.ts +++ b/test/integration/generated/bodyComplex/src/operations/polymorphism.ts @@ -10,7 +10,7 @@ import { Polymorphism } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClientContext } from "../bodyComplexClientContext"; +import { BodyComplexClient } from "../bodyComplexClient"; import { PolymorphismGetValidOptionalParams, PolymorphismGetValidResponse, @@ -33,13 +33,13 @@ import { /** Class containing Polymorphism operations. */ export class PolymorphismImpl implements Polymorphism { - private readonly client: BodyComplexClientContext; + private readonly client: BodyComplexClient; /** * Initialize a new instance of the class Polymorphism class. * @param client Reference to the service client */ - constructor(client: BodyComplexClientContext) { + constructor(client: BodyComplexClient) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/primitive.ts b/test/integration/generated/bodyComplex/src/operations/primitive.ts index a830cf7f50..f662d19011 100644 --- a/test/integration/generated/bodyComplex/src/operations/primitive.ts +++ b/test/integration/generated/bodyComplex/src/operations/primitive.ts @@ -10,7 +10,7 @@ import { Primitive } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClientContext } from "../bodyComplexClientContext"; +import { BodyComplexClient } from "../bodyComplexClient"; import { PrimitiveGetIntOptionalParams, PrimitiveGetIntResponse, @@ -60,13 +60,13 @@ import { /** Class containing Primitive operations. */ export class PrimitiveImpl implements Primitive { - private readonly client: BodyComplexClientContext; + private readonly client: BodyComplexClient; /** * Initialize a new instance of the class Primitive class. * @param client Reference to the service client */ - constructor(client: BodyComplexClientContext) { + constructor(client: BodyComplexClient) { this.client = client; } diff --git a/test/integration/generated/bodyComplex/src/operations/readonlyproperty.ts b/test/integration/generated/bodyComplex/src/operations/readonlyproperty.ts index 39f7c8b2e3..a2e9b21d8b 100644 --- a/test/integration/generated/bodyComplex/src/operations/readonlyproperty.ts +++ b/test/integration/generated/bodyComplex/src/operations/readonlyproperty.ts @@ -10,7 +10,7 @@ import { Readonlyproperty } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexClientContext } from "../bodyComplexClientContext"; +import { BodyComplexClient } from "../bodyComplexClient"; import { ReadonlypropertyGetValidOptionalParams, ReadonlypropertyGetValidResponse, @@ -20,13 +20,13 @@ import { /** Class containing Readonlyproperty operations. */ export class ReadonlypropertyImpl implements Readonlyproperty { - private readonly client: BodyComplexClientContext; + private readonly client: BodyComplexClient; /** * Initialize a new instance of the class Readonlyproperty class. * @param client Reference to the service client */ - constructor(client: BodyComplexClientContext) { + constructor(client: BodyComplexClient) { this.client = client; } diff --git a/test/integration/generated/bodyComplexRest/package.json b/test/integration/generated/bodyComplexRest/package.json index 3c83cd182b..1f5e242dd3 100644 --- a/test/integration/generated/bodyComplexRest/package.json +++ b/test/integration/generated/bodyComplexRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/bodyComplexRest/src/bodyComplexRestClient.ts b/test/integration/generated/bodyComplexRest/src/bodyComplexRestClient.ts index 4fc13cdb2c..5db3479164 100644 --- a/test/integration/generated/bodyComplexRest/src/bodyComplexRestClient.ts +++ b/test/integration/generated/bodyComplexRest/src/bodyComplexRestClient.ts @@ -644,9 +644,7 @@ export default function BodyComplexRestClient( const baseUrl = options.baseUrl ?? "http://localhost:3000"; options.apiVersion = options.apiVersion ?? "2016-02-29"; - return getClient( - baseUrl, + const client = getClient(baseUrl, options) as BodyComplexRestClientRestClient; - options - ) as BodyComplexRestClientRestClient; + return client; } diff --git a/test/integration/generated/bodyComplexRest/tsconfig.json b/test/integration/generated/bodyComplexRest/tsconfig.json index 965341beea..0202cc6570 100644 --- a/test/integration/generated/bodyComplexRest/tsconfig.json +++ b/test/integration/generated/bodyComplexRest/tsconfig.json @@ -7,13 +7,5 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/test/integration/generated/bodyComplexWithTracing/package.json b/test/integration/generated/bodyComplexWithTracing/package.json index 118c55f9ca..446c8846de 100644 --- a/test/integration/generated/bodyComplexWithTracing/package.json +++ b/test/integration/generated/bodyComplexWithTracing/package.json @@ -27,7 +27,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracing.ts b/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracing.ts index ea5bda4f6a..867d6f6ace 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracing.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracing.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { BasicImpl, PrimitiveImpl, @@ -28,16 +29,44 @@ import { Readonlyproperty, Flattencomplex } from "./operationsInterfaces"; -import { BodyComplexWithTracingContext } from "./bodyComplexWithTracingContext"; import { BodyComplexWithTracingOptionalParams } from "./models"; -export class BodyComplexWithTracing extends BodyComplexWithTracingContext { +export class BodyComplexWithTracing extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + /** * Initializes a new instance of the BodyComplexWithTracing class. * @param options The parameter options */ constructor(options?: BodyComplexWithTracingOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyComplexWithTracingOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-complex-tracing/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "2016-02-29"; this.basic = new BasicImpl(this); this.primitive = new PrimitiveImpl(this); this.array = new ArrayImpl(this); diff --git a/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracingContext.ts b/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracingContext.ts deleted file mode 100644 index c0e58324df..0000000000 --- a/test/integration/generated/bodyComplexWithTracing/src/bodyComplexWithTracingContext.ts +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyComplexWithTracingOptionalParams } from "./models"; - -export class BodyComplexWithTracingContext extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - - /** - * Initializes a new instance of the BodyComplexWithTracingContext class. - * @param options The parameter options - */ - constructor(options?: BodyComplexWithTracingOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyComplexWithTracingOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-complex-tracing/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "2016-02-29"; - } -} diff --git a/test/integration/generated/bodyComplexWithTracing/src/index.ts b/test/integration/generated/bodyComplexWithTracing/src/index.ts index 521fcdb3a8..ee387fe83f 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/index.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyComplexWithTracing } from "./bodyComplexWithTracing"; -export { BodyComplexWithTracingContext } from "./bodyComplexWithTracingContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/array.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/array.ts index 1bfdf6f2d0..403e1ce979 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/array.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/array.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; +import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; import { ArrayGetValidOptionalParams, ArrayGetValidResponse, @@ -27,13 +27,13 @@ import { /** Class containing Array operations. */ export class ArrayImpl implements Array { - private readonly client: BodyComplexWithTracingContext; + private readonly client: BodyComplexWithTracing; /** * Initialize a new instance of the class Array class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracingContext) { + constructor(client: BodyComplexWithTracing) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/basic.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/basic.ts index b5d58de2ed..6f26ad496e 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/basic.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/basic.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; +import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; import { BasicGetValidOptionalParams, BasicGetValidResponse, @@ -30,13 +30,13 @@ import { /** Class containing Basic operations. */ export class BasicImpl implements Basic { - private readonly client: BodyComplexWithTracingContext; + private readonly client: BodyComplexWithTracing; /** * Initialize a new instance of the class Basic class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracingContext) { + constructor(client: BodyComplexWithTracing) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/dictionary.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/dictionary.ts index 3dee6b748c..739152a014 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/dictionary.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/dictionary.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; +import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; import { DictionaryGetValidOptionalParams, DictionaryGetValidResponse, @@ -29,13 +29,13 @@ import { /** Class containing Dictionary operations. */ export class DictionaryImpl implements Dictionary { - private readonly client: BodyComplexWithTracingContext; + private readonly client: BodyComplexWithTracing; /** * Initialize a new instance of the class Dictionary class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracingContext) { + constructor(client: BodyComplexWithTracing) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/flattencomplex.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/flattencomplex.ts index 1760d7413b..a97c48c5e8 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/flattencomplex.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/flattencomplex.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; +import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; import { FlattencomplexGetValidOptionalParams, FlattencomplexGetValidResponse @@ -20,13 +20,13 @@ import { /** Class containing Flattencomplex operations. */ export class FlattencomplexImpl implements Flattencomplex { - private readonly client: BodyComplexWithTracingContext; + private readonly client: BodyComplexWithTracing; /** * Initialize a new instance of the class Flattencomplex class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracingContext) { + constructor(client: BodyComplexWithTracing) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/inheritance.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/inheritance.ts index f6bf2e7866..b105135eb1 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/inheritance.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/inheritance.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; +import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; import { InheritanceGetValidOptionalParams, InheritanceGetValidResponse, @@ -22,13 +22,13 @@ import { /** Class containing Inheritance operations. */ export class InheritanceImpl implements Inheritance { - private readonly client: BodyComplexWithTracingContext; + private readonly client: BodyComplexWithTracing; /** * Initialize a new instance of the class Inheritance class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracingContext) { + constructor(client: BodyComplexWithTracing) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphicrecursive.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphicrecursive.ts index a32fec43e1..9aa801ea2f 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphicrecursive.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphicrecursive.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; +import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; import { PolymorphicrecursiveGetValidOptionalParams, PolymorphicrecursiveGetValidResponse, @@ -22,13 +22,13 @@ import { /** Class containing Polymorphicrecursive operations. */ export class PolymorphicrecursiveImpl implements Polymorphicrecursive { - private readonly client: BodyComplexWithTracingContext; + private readonly client: BodyComplexWithTracing; /** * Initialize a new instance of the class Polymorphicrecursive class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracingContext) { + constructor(client: BodyComplexWithTracing) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphism.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphism.ts index 0827a91aa3..2235f6ece2 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphism.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/polymorphism.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; +import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; import { PolymorphismGetValidOptionalParams, PolymorphismGetValidResponse, @@ -35,13 +35,13 @@ import { /** Class containing Polymorphism operations. */ export class PolymorphismImpl implements Polymorphism { - private readonly client: BodyComplexWithTracingContext; + private readonly client: BodyComplexWithTracing; /** * Initialize a new instance of the class Polymorphism class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracingContext) { + constructor(client: BodyComplexWithTracing) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/primitive.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/primitive.ts index 792eec3355..78b0629be3 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/primitive.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/primitive.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; +import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; import { PrimitiveGetIntOptionalParams, PrimitiveGetIntResponse, @@ -62,13 +62,13 @@ import { /** Class containing Primitive operations. */ export class PrimitiveImpl implements Primitive { - private readonly client: BodyComplexWithTracingContext; + private readonly client: BodyComplexWithTracing; /** * Initialize a new instance of the class Primitive class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracingContext) { + constructor(client: BodyComplexWithTracing) { this.client = client; } diff --git a/test/integration/generated/bodyComplexWithTracing/src/operations/readonlyproperty.ts b/test/integration/generated/bodyComplexWithTracing/src/operations/readonlyproperty.ts index 52f64eadde..f86e46987e 100644 --- a/test/integration/generated/bodyComplexWithTracing/src/operations/readonlyproperty.ts +++ b/test/integration/generated/bodyComplexWithTracing/src/operations/readonlyproperty.ts @@ -12,7 +12,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyComplexWithTracingContext } from "../bodyComplexWithTracingContext"; +import { BodyComplexWithTracing } from "../bodyComplexWithTracing"; import { ReadonlypropertyGetValidOptionalParams, ReadonlypropertyGetValidResponse, @@ -22,13 +22,13 @@ import { /** Class containing Readonlyproperty operations. */ export class ReadonlypropertyImpl implements Readonlyproperty { - private readonly client: BodyComplexWithTracingContext; + private readonly client: BodyComplexWithTracing; /** * Initialize a new instance of the class Readonlyproperty class. * @param client Reference to the service client */ - constructor(client: BodyComplexWithTracingContext) { + constructor(client: BodyComplexWithTracing) { this.client = client; } diff --git a/test/integration/generated/bodyDate/package.json b/test/integration/generated/bodyDate/package.json index e261c2dfa5..a565cc2ad2 100644 --- a/test/integration/generated/bodyDate/package.json +++ b/test/integration/generated/bodyDate/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyDate/src/bodyDateClient.ts b/test/integration/generated/bodyDate/src/bodyDateClient.ts index bf173c5a9a..cf0855cacf 100644 --- a/test/integration/generated/bodyDate/src/bodyDateClient.ts +++ b/test/integration/generated/bodyDate/src/bodyDateClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { DateOperationsImpl } from "./operations"; import { DateOperations } from "./operationsInterfaces"; -import { BodyDateClientContext } from "./bodyDateClientContext"; import { BodyDateClientOptionalParams } from "./models"; -export class BodyDateClient extends BodyDateClientContext { +export class BodyDateClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyDateClient class. * @param options The parameter options */ constructor(options?: BodyDateClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyDateClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-date/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.date = new DateOperationsImpl(this); } diff --git a/test/integration/generated/bodyDate/src/bodyDateClientContext.ts b/test/integration/generated/bodyDate/src/bodyDateClientContext.ts deleted file mode 100644 index 2451e0ee63..0000000000 --- a/test/integration/generated/bodyDate/src/bodyDateClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyDateClientOptionalParams } from "./models"; - -export class BodyDateClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyDateClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyDateClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyDateClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-date/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyDate/src/index.ts b/test/integration/generated/bodyDate/src/index.ts index c642206a0a..cca5dcbe5b 100644 --- a/test/integration/generated/bodyDate/src/index.ts +++ b/test/integration/generated/bodyDate/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyDateClient } from "./bodyDateClient"; -export { BodyDateClientContext } from "./bodyDateClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyDate/src/operations/date.ts b/test/integration/generated/bodyDate/src/operations/date.ts index de9d94964f..21ad2a932d 100644 --- a/test/integration/generated/bodyDate/src/operations/date.ts +++ b/test/integration/generated/bodyDate/src/operations/date.ts @@ -10,7 +10,7 @@ import { DateOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyDateClientContext } from "../bodyDateClientContext"; +import { BodyDateClient } from "../bodyDateClient"; import { DateGetNullOptionalParams, DateGetNullResponse, @@ -30,13 +30,13 @@ import { /** Class containing DateOperations operations. */ export class DateOperationsImpl implements DateOperations { - private readonly client: BodyDateClientContext; + private readonly client: BodyDateClient; /** * Initialize a new instance of the class DateOperations class. * @param client Reference to the service client */ - constructor(client: BodyDateClientContext) { + constructor(client: BodyDateClient) { this.client = client; } diff --git a/test/integration/generated/bodyDateTime/package.json b/test/integration/generated/bodyDateTime/package.json index b33e683a71..3fc428d48f 100644 --- a/test/integration/generated/bodyDateTime/package.json +++ b/test/integration/generated/bodyDateTime/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyDateTime/src/bodyDateTimeClient.ts b/test/integration/generated/bodyDateTime/src/bodyDateTimeClient.ts index 29edda21d0..a7b45fb804 100644 --- a/test/integration/generated/bodyDateTime/src/bodyDateTimeClient.ts +++ b/test/integration/generated/bodyDateTime/src/bodyDateTimeClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { DatetimeImpl } from "./operations"; import { Datetime } from "./operationsInterfaces"; -import { BodyDateTimeClientContext } from "./bodyDateTimeClientContext"; import { BodyDateTimeClientOptionalParams } from "./models"; -export class BodyDateTimeClient extends BodyDateTimeClientContext { +export class BodyDateTimeClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyDateTimeClient class. * @param options The parameter options */ constructor(options?: BodyDateTimeClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyDateTimeClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-datetime/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.datetime = new DatetimeImpl(this); } diff --git a/test/integration/generated/bodyDateTime/src/bodyDateTimeClientContext.ts b/test/integration/generated/bodyDateTime/src/bodyDateTimeClientContext.ts deleted file mode 100644 index e108fb4f36..0000000000 --- a/test/integration/generated/bodyDateTime/src/bodyDateTimeClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyDateTimeClientOptionalParams } from "./models"; - -export class BodyDateTimeClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyDateTimeClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyDateTimeClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyDateTimeClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-datetime/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyDateTime/src/index.ts b/test/integration/generated/bodyDateTime/src/index.ts index 072308135f..ab6f074916 100644 --- a/test/integration/generated/bodyDateTime/src/index.ts +++ b/test/integration/generated/bodyDateTime/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyDateTimeClient } from "./bodyDateTimeClient"; -export { BodyDateTimeClientContext } from "./bodyDateTimeClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyDateTime/src/operations/datetime.ts b/test/integration/generated/bodyDateTime/src/operations/datetime.ts index 10799fa9ac..a82e1259d9 100644 --- a/test/integration/generated/bodyDateTime/src/operations/datetime.ts +++ b/test/integration/generated/bodyDateTime/src/operations/datetime.ts @@ -10,7 +10,7 @@ import { Datetime } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyDateTimeClientContext } from "../bodyDateTimeClientContext"; +import { BodyDateTimeClient } from "../bodyDateTimeClient"; import { DatetimeGetNullOptionalParams, DatetimeGetNullResponse, @@ -53,13 +53,13 @@ import { /** Class containing Datetime operations. */ export class DatetimeImpl implements Datetime { - private readonly client: BodyDateTimeClientContext; + private readonly client: BodyDateTimeClient; /** * Initialize a new instance of the class Datetime class. * @param client Reference to the service client */ - constructor(client: BodyDateTimeClientContext) { + constructor(client: BodyDateTimeClient) { this.client = client; } diff --git a/test/integration/generated/bodyDateTimeRfc1123/package.json b/test/integration/generated/bodyDateTimeRfc1123/package.json index c4f43edfe3..5e4b2d57c4 100644 --- a/test/integration/generated/bodyDateTimeRfc1123/package.json +++ b/test/integration/generated/bodyDateTimeRfc1123/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123Client.ts b/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123Client.ts index 1194ad6582..06dfcad726 100644 --- a/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123Client.ts +++ b/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123Client.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { Datetimerfc1123Impl } from "./operations"; import { Datetimerfc1123 } from "./operationsInterfaces"; -import { BodyDateTimeRfc1123ClientContext } from "./bodyDateTimeRfc1123ClientContext"; import { BodyDateTimeRfc1123ClientOptionalParams } from "./models"; -export class BodyDateTimeRfc1123Client extends BodyDateTimeRfc1123ClientContext { +export class BodyDateTimeRfc1123Client extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyDateTimeRfc1123Client class. * @param options The parameter options */ constructor(options?: BodyDateTimeRfc1123ClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyDateTimeRfc1123ClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-datetime-rfc1123/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.datetimerfc1123 = new Datetimerfc1123Impl(this); } diff --git a/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123ClientContext.ts b/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123ClientContext.ts deleted file mode 100644 index 072dac7139..0000000000 --- a/test/integration/generated/bodyDateTimeRfc1123/src/bodyDateTimeRfc1123ClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyDateTimeRfc1123ClientOptionalParams } from "./models"; - -export class BodyDateTimeRfc1123ClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyDateTimeRfc1123ClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyDateTimeRfc1123ClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyDateTimeRfc1123ClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-datetime-rfc1123/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyDateTimeRfc1123/src/index.ts b/test/integration/generated/bodyDateTimeRfc1123/src/index.ts index 6fec891866..dc25430372 100644 --- a/test/integration/generated/bodyDateTimeRfc1123/src/index.ts +++ b/test/integration/generated/bodyDateTimeRfc1123/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyDateTimeRfc1123Client } from "./bodyDateTimeRfc1123Client"; -export { BodyDateTimeRfc1123ClientContext } from "./bodyDateTimeRfc1123ClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyDateTimeRfc1123/src/operations/datetimerfc1123.ts b/test/integration/generated/bodyDateTimeRfc1123/src/operations/datetimerfc1123.ts index ad84399b80..10f9615918 100644 --- a/test/integration/generated/bodyDateTimeRfc1123/src/operations/datetimerfc1123.ts +++ b/test/integration/generated/bodyDateTimeRfc1123/src/operations/datetimerfc1123.ts @@ -10,7 +10,7 @@ import { Datetimerfc1123 } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyDateTimeRfc1123ClientContext } from "../bodyDateTimeRfc1123ClientContext"; +import { BodyDateTimeRfc1123Client } from "../bodyDateTimeRfc1123Client"; import { Datetimerfc1123GetNullOptionalParams, Datetimerfc1123GetNullResponse, @@ -32,13 +32,13 @@ import { /** Class containing Datetimerfc1123 operations. */ export class Datetimerfc1123Impl implements Datetimerfc1123 { - private readonly client: BodyDateTimeRfc1123ClientContext; + private readonly client: BodyDateTimeRfc1123Client; /** * Initialize a new instance of the class Datetimerfc1123 class. * @param client Reference to the service client */ - constructor(client: BodyDateTimeRfc1123ClientContext) { + constructor(client: BodyDateTimeRfc1123Client) { this.client = client; } diff --git a/test/integration/generated/bodyDictionary/package.json b/test/integration/generated/bodyDictionary/package.json index 076d99551b..07ca27ebac 100644 --- a/test/integration/generated/bodyDictionary/package.json +++ b/test/integration/generated/bodyDictionary/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyDictionary/src/bodyDictionaryClient.ts b/test/integration/generated/bodyDictionary/src/bodyDictionaryClient.ts index fdf02d81e0..2dc6201f86 100644 --- a/test/integration/generated/bodyDictionary/src/bodyDictionaryClient.ts +++ b/test/integration/generated/bodyDictionary/src/bodyDictionaryClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { DictionaryImpl } from "./operations"; import { Dictionary } from "./operationsInterfaces"; -import { BodyDictionaryClientContext } from "./bodyDictionaryClientContext"; import { BodyDictionaryClientOptionalParams } from "./models"; -export class BodyDictionaryClient extends BodyDictionaryClientContext { +export class BodyDictionaryClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyDictionaryClient class. * @param options The parameter options */ constructor(options?: BodyDictionaryClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyDictionaryClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-dictionary/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.dictionary = new DictionaryImpl(this); } diff --git a/test/integration/generated/bodyDictionary/src/bodyDictionaryClientContext.ts b/test/integration/generated/bodyDictionary/src/bodyDictionaryClientContext.ts deleted file mode 100644 index 8105d8961c..0000000000 --- a/test/integration/generated/bodyDictionary/src/bodyDictionaryClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyDictionaryClientOptionalParams } from "./models"; - -export class BodyDictionaryClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyDictionaryClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyDictionaryClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyDictionaryClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-dictionary/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyDictionary/src/index.ts b/test/integration/generated/bodyDictionary/src/index.ts index 267ce5e4db..a2c84db556 100644 --- a/test/integration/generated/bodyDictionary/src/index.ts +++ b/test/integration/generated/bodyDictionary/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyDictionaryClient } from "./bodyDictionaryClient"; -export { BodyDictionaryClientContext } from "./bodyDictionaryClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyDictionary/src/operations/dictionary.ts b/test/integration/generated/bodyDictionary/src/operations/dictionary.ts index 6682dba9b5..6b0f10b2fb 100644 --- a/test/integration/generated/bodyDictionary/src/operations/dictionary.ts +++ b/test/integration/generated/bodyDictionary/src/operations/dictionary.ts @@ -10,7 +10,7 @@ import { Dictionary } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyDictionaryClientContext } from "../bodyDictionaryClientContext"; +import { BodyDictionaryClient } from "../bodyDictionaryClient"; import { DictionaryGetNullOptionalParams, DictionaryGetNullResponse, @@ -132,13 +132,13 @@ import { /** Class containing Dictionary operations. */ export class DictionaryImpl implements Dictionary { - private readonly client: BodyDictionaryClientContext; + private readonly client: BodyDictionaryClient; /** * Initialize a new instance of the class Dictionary class. * @param client Reference to the service client */ - constructor(client: BodyDictionaryClientContext) { + constructor(client: BodyDictionaryClient) { this.client = client; } diff --git a/test/integration/generated/bodyDuration/package.json b/test/integration/generated/bodyDuration/package.json index 29bb7abce2..09dad1296d 100644 --- a/test/integration/generated/bodyDuration/package.json +++ b/test/integration/generated/bodyDuration/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyDuration/src/bodyDurationClient.ts b/test/integration/generated/bodyDuration/src/bodyDurationClient.ts index b770a26cd8..14d9062896 100644 --- a/test/integration/generated/bodyDuration/src/bodyDurationClient.ts +++ b/test/integration/generated/bodyDuration/src/bodyDurationClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { DurationImpl } from "./operations"; import { Duration } from "./operationsInterfaces"; -import { BodyDurationClientContext } from "./bodyDurationClientContext"; import { BodyDurationClientOptionalParams } from "./models"; -export class BodyDurationClient extends BodyDurationClientContext { +export class BodyDurationClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyDurationClient class. * @param options The parameter options */ constructor(options?: BodyDurationClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyDurationClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-duration/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.duration = new DurationImpl(this); } diff --git a/test/integration/generated/bodyDuration/src/bodyDurationClientContext.ts b/test/integration/generated/bodyDuration/src/bodyDurationClientContext.ts deleted file mode 100644 index 852fb67903..0000000000 --- a/test/integration/generated/bodyDuration/src/bodyDurationClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyDurationClientOptionalParams } from "./models"; - -export class BodyDurationClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyDurationClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyDurationClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyDurationClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-duration/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyDuration/src/index.ts b/test/integration/generated/bodyDuration/src/index.ts index f85142fd75..1b4ce3d845 100644 --- a/test/integration/generated/bodyDuration/src/index.ts +++ b/test/integration/generated/bodyDuration/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyDurationClient } from "./bodyDurationClient"; -export { BodyDurationClientContext } from "./bodyDurationClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyDuration/src/operations/duration.ts b/test/integration/generated/bodyDuration/src/operations/duration.ts index 2c9db02b23..15cbf91347 100644 --- a/test/integration/generated/bodyDuration/src/operations/duration.ts +++ b/test/integration/generated/bodyDuration/src/operations/duration.ts @@ -10,7 +10,7 @@ import { Duration } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyDurationClientContext } from "../bodyDurationClientContext"; +import { BodyDurationClient } from "../bodyDurationClient"; import { DurationGetNullOptionalParams, DurationGetNullResponse, @@ -23,13 +23,13 @@ import { /** Class containing Duration operations. */ export class DurationImpl implements Duration { - private readonly client: BodyDurationClientContext; + private readonly client: BodyDurationClient; /** * Initialize a new instance of the class Duration class. * @param client Reference to the service client */ - constructor(client: BodyDurationClientContext) { + constructor(client: BodyDurationClient) { this.client = client; } diff --git a/test/integration/generated/bodyFile/package.json b/test/integration/generated/bodyFile/package.json index 28d97bf1dd..a5c9144183 100644 --- a/test/integration/generated/bodyFile/package.json +++ b/test/integration/generated/bodyFile/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyFile/src/bodyFileClient.ts b/test/integration/generated/bodyFile/src/bodyFileClient.ts index f3c77d354d..3caea44a15 100644 --- a/test/integration/generated/bodyFile/src/bodyFileClient.ts +++ b/test/integration/generated/bodyFile/src/bodyFileClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { FilesImpl } from "./operations"; import { Files } from "./operationsInterfaces"; -import { BodyFileClientContext } from "./bodyFileClientContext"; import { BodyFileClientOptionalParams } from "./models"; -export class BodyFileClient extends BodyFileClientContext { +export class BodyFileClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyFileClient class. * @param options The parameter options */ constructor(options?: BodyFileClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyFileClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-file/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.files = new FilesImpl(this); } diff --git a/test/integration/generated/bodyFile/src/bodyFileClientContext.ts b/test/integration/generated/bodyFile/src/bodyFileClientContext.ts deleted file mode 100644 index 48269a2f66..0000000000 --- a/test/integration/generated/bodyFile/src/bodyFileClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyFileClientOptionalParams } from "./models"; - -export class BodyFileClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyFileClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyFileClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyFileClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-file/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyFile/src/index.ts b/test/integration/generated/bodyFile/src/index.ts index 642c73ea74..4413d9ba09 100644 --- a/test/integration/generated/bodyFile/src/index.ts +++ b/test/integration/generated/bodyFile/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyFileClient } from "./bodyFileClient"; -export { BodyFileClientContext } from "./bodyFileClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyFile/src/operations/files.ts b/test/integration/generated/bodyFile/src/operations/files.ts index 45927dcc40..69c39becb8 100644 --- a/test/integration/generated/bodyFile/src/operations/files.ts +++ b/test/integration/generated/bodyFile/src/operations/files.ts @@ -10,7 +10,7 @@ import { Files } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyFileClientContext } from "../bodyFileClientContext"; +import { BodyFileClient } from "../bodyFileClient"; import { FilesGetFileOptionalParams, FilesGetFileResponse, @@ -22,13 +22,13 @@ import { /** Class containing Files operations. */ export class FilesImpl implements Files { - private readonly client: BodyFileClientContext; + private readonly client: BodyFileClient; /** * Initialize a new instance of the class Files class. * @param client Reference to the service client */ - constructor(client: BodyFileClientContext) { + constructor(client: BodyFileClient) { this.client = client; } diff --git a/test/integration/generated/bodyFileRest/package.json b/test/integration/generated/bodyFileRest/package.json index f4a8d8ef3d..84323e4f2d 100644 --- a/test/integration/generated/bodyFileRest/package.json +++ b/test/integration/generated/bodyFileRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/bodyFileRest/src/bodyFile.ts b/test/integration/generated/bodyFileRest/src/bodyFile.ts index 769448ab40..e85a9d74fd 100644 --- a/test/integration/generated/bodyFileRest/src/bodyFile.ts +++ b/test/integration/generated/bodyFileRest/src/bodyFile.ts @@ -56,9 +56,7 @@ export default function BodyFile( ): BodyFileRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - return getClient( - baseUrl, + const client = getClient(baseUrl, options) as BodyFileRestClient; - options - ) as BodyFileRestClient; + return client; } diff --git a/test/integration/generated/bodyFileRest/src/responses.ts b/test/integration/generated/bodyFileRest/src/responses.ts index 4f404d2ccc..0be0a15ade 100644 --- a/test/integration/generated/bodyFileRest/src/responses.ts +++ b/test/integration/generated/bodyFileRest/src/responses.ts @@ -7,7 +7,8 @@ import { ErrorModelOutput } from "./outputModels"; /** Get file */ export interface GetFile200Response extends HttpResponse { status: "200"; - body: Record; + /** Value may contain any sequence of octets */ + body: Uint8Array; } /** Get file */ @@ -19,7 +20,8 @@ export interface GetFiledefaultResponse extends HttpResponse { /** Get a large file */ export interface GetFileLarge200Response extends HttpResponse { status: "200"; - body: Record; + /** Value may contain any sequence of octets */ + body: Uint8Array; } /** Get a large file */ @@ -31,7 +33,8 @@ export interface GetFileLargedefaultResponse extends HttpResponse { /** Get empty file */ export interface GetEmptyFile200Response extends HttpResponse { status: "200"; - body: Record; + /** Value may contain any sequence of octets */ + body: Uint8Array; } /** Get empty file */ diff --git a/test/integration/generated/bodyFileRest/tsconfig.json b/test/integration/generated/bodyFileRest/tsconfig.json index 965341beea..0202cc6570 100644 --- a/test/integration/generated/bodyFileRest/tsconfig.json +++ b/test/integration/generated/bodyFileRest/tsconfig.json @@ -7,13 +7,5 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/test/integration/generated/bodyFormData/package.json b/test/integration/generated/bodyFormData/package.json index c6ffdccee6..8bbf2c1001 100644 --- a/test/integration/generated/bodyFormData/package.json +++ b/test/integration/generated/bodyFormData/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyFormData/src/bodyFormDataClient.ts b/test/integration/generated/bodyFormData/src/bodyFormDataClient.ts index 6548d03b4d..e154a48fa0 100644 --- a/test/integration/generated/bodyFormData/src/bodyFormDataClient.ts +++ b/test/integration/generated/bodyFormData/src/bodyFormDataClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { FormdataImpl } from "./operations"; import { Formdata } from "./operationsInterfaces"; -import { BodyFormDataClientContext } from "./bodyFormDataClientContext"; import { BodyFormDataClientOptionalParams } from "./models"; -export class BodyFormDataClient extends BodyFormDataClientContext { +export class BodyFormDataClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyFormDataClient class. * @param options The parameter options */ constructor(options?: BodyFormDataClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyFormDataClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-formdata/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.formdata = new FormdataImpl(this); } diff --git a/test/integration/generated/bodyFormData/src/bodyFormDataClientContext.ts b/test/integration/generated/bodyFormData/src/bodyFormDataClientContext.ts deleted file mode 100644 index f18d81ea5e..0000000000 --- a/test/integration/generated/bodyFormData/src/bodyFormDataClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyFormDataClientOptionalParams } from "./models"; - -export class BodyFormDataClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyFormDataClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyFormDataClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyFormDataClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-formdata/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyFormData/src/index.ts b/test/integration/generated/bodyFormData/src/index.ts index 75cd9f1fc3..88e36d7ab0 100644 --- a/test/integration/generated/bodyFormData/src/index.ts +++ b/test/integration/generated/bodyFormData/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyFormDataClient } from "./bodyFormDataClient"; -export { BodyFormDataClientContext } from "./bodyFormDataClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyFormData/src/operations/formdata.ts b/test/integration/generated/bodyFormData/src/operations/formdata.ts index ee94c976ff..08682edb50 100644 --- a/test/integration/generated/bodyFormData/src/operations/formdata.ts +++ b/test/integration/generated/bodyFormData/src/operations/formdata.ts @@ -11,7 +11,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyFormDataClientContext } from "../bodyFormDataClientContext"; +import { BodyFormDataClient } from "../bodyFormDataClient"; import { FormdataUploadFileOptionalParams, FormdataUploadFileResponse, @@ -23,13 +23,13 @@ import { /** Class containing Formdata operations. */ export class FormdataImpl implements Formdata { - private readonly client: BodyFormDataClientContext; + private readonly client: BodyFormDataClient; /** * Initialize a new instance of the class Formdata class. * @param client Reference to the service client */ - constructor(client: BodyFormDataClientContext) { + constructor(client: BodyFormDataClient) { this.client = client; } diff --git a/test/integration/generated/bodyFormDataRest/package.json b/test/integration/generated/bodyFormDataRest/package.json index e6b5dcac0a..05e75dd034 100644 --- a/test/integration/generated/bodyFormDataRest/package.json +++ b/test/integration/generated/bodyFormDataRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/bodyFormDataRest/src/bodyFormData.ts b/test/integration/generated/bodyFormDataRest/src/bodyFormData.ts index c88e441f04..861c2400ad 100644 --- a/test/integration/generated/bodyFormDataRest/src/bodyFormData.ts +++ b/test/integration/generated/bodyFormDataRest/src/bodyFormData.ts @@ -51,9 +51,7 @@ export default function BodyFormData( ): BodyFormDataRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - return getClient( - baseUrl, + const client = getClient(baseUrl, options) as BodyFormDataRestClient; - options - ) as BodyFormDataRestClient; + return client; } diff --git a/test/integration/generated/bodyFormDataRest/src/parameters.ts b/test/integration/generated/bodyFormDataRest/src/parameters.ts index f364bb1aa1..25733e0f85 100644 --- a/test/integration/generated/bodyFormDataRest/src/parameters.ts +++ b/test/integration/generated/bodyFormDataRest/src/parameters.ts @@ -4,12 +4,18 @@ import { RequestParameters } from "@azure-rest/core-client"; export interface UploadFileBodyParam { + body: UploadFileFormBody; +} + +export interface UploadFileFormBody { /** * File to upload. * * Value may contain any sequence of octets */ - body: string; + fileContent: string | Uint8Array; + /** File name to upload. Name has to be spelled exactly as written here. */ + fileName: string; } export interface UploadFileMediaTypesParam { @@ -27,7 +33,7 @@ export interface UploadFileViaBodyBodyParam { * * Value may contain any sequence of octets */ - body: string; + body: string | Uint8Array; } export interface UploadFileViaBodyMediaTypesParam { @@ -40,8 +46,12 @@ export type UploadFileViaBodyParameters = UploadFileViaBodyMediaTypesParam & RequestParameters; export interface UploadFilesBodyParam { + body: UploadFilesFormBody; +} + +export interface UploadFilesFormBody { /** Files to upload. */ - body: Array; + fileContent: Array; } export interface UploadFilesMediaTypesParam { diff --git a/test/integration/generated/bodyFormDataRest/src/responses.ts b/test/integration/generated/bodyFormDataRest/src/responses.ts index 0c93c8187f..817be0b806 100644 --- a/test/integration/generated/bodyFormDataRest/src/responses.ts +++ b/test/integration/generated/bodyFormDataRest/src/responses.ts @@ -7,7 +7,8 @@ import { ErrorModelOutput } from "./outputModels"; /** Upload file */ export interface UploadFile200Response extends HttpResponse { status: "200"; - body: Record; + /** Value may contain any sequence of octets */ + body: Uint8Array; } /** Upload file */ @@ -19,7 +20,8 @@ export interface UploadFiledefaultResponse extends HttpResponse { /** Upload file */ export interface UploadFileViaBody200Response extends HttpResponse { status: "200"; - body: Record; + /** Value may contain any sequence of octets */ + body: Uint8Array; } /** Upload file */ @@ -31,7 +33,8 @@ export interface UploadFileViaBodydefaultResponse extends HttpResponse { /** Upload multiple files */ export interface UploadFiles200Response extends HttpResponse { status: "200"; - body: Record; + /** Value may contain any sequence of octets */ + body: Uint8Array; } /** Upload multiple files */ diff --git a/test/integration/generated/bodyFormDataRest/tsconfig.json b/test/integration/generated/bodyFormDataRest/tsconfig.json index 965341beea..0202cc6570 100644 --- a/test/integration/generated/bodyFormDataRest/tsconfig.json +++ b/test/integration/generated/bodyFormDataRest/tsconfig.json @@ -7,13 +7,5 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/test/integration/generated/bodyInteger/package.json b/test/integration/generated/bodyInteger/package.json index d4bb5b2a3e..fc1c4f0fb8 100644 --- a/test/integration/generated/bodyInteger/package.json +++ b/test/integration/generated/bodyInteger/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyInteger/src/bodyIntegerClient.ts b/test/integration/generated/bodyInteger/src/bodyIntegerClient.ts index e9fe0f99c2..b9e79c0c46 100644 --- a/test/integration/generated/bodyInteger/src/bodyIntegerClient.ts +++ b/test/integration/generated/bodyInteger/src/bodyIntegerClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { IntImpl } from "./operations"; import { Int } from "./operationsInterfaces"; -import { BodyIntegerClientContext } from "./bodyIntegerClientContext"; import { BodyIntegerClientOptionalParams } from "./models"; -export class BodyIntegerClient extends BodyIntegerClientContext { +export class BodyIntegerClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyIntegerClient class. * @param options The parameter options */ constructor(options?: BodyIntegerClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyIntegerClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-integer/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.int = new IntImpl(this); } diff --git a/test/integration/generated/bodyInteger/src/bodyIntegerClientContext.ts b/test/integration/generated/bodyInteger/src/bodyIntegerClientContext.ts deleted file mode 100644 index 0ea90f4043..0000000000 --- a/test/integration/generated/bodyInteger/src/bodyIntegerClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyIntegerClientOptionalParams } from "./models"; - -export class BodyIntegerClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyIntegerClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyIntegerClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyIntegerClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-integer/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyInteger/src/index.ts b/test/integration/generated/bodyInteger/src/index.ts index 7364e58eb9..0b69679705 100644 --- a/test/integration/generated/bodyInteger/src/index.ts +++ b/test/integration/generated/bodyInteger/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyIntegerClient } from "./bodyIntegerClient"; -export { BodyIntegerClientContext } from "./bodyIntegerClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyInteger/src/operations/int.ts b/test/integration/generated/bodyInteger/src/operations/int.ts index 77369cc378..145c150293 100644 --- a/test/integration/generated/bodyInteger/src/operations/int.ts +++ b/test/integration/generated/bodyInteger/src/operations/int.ts @@ -10,7 +10,7 @@ import { Int } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyIntegerClientContext } from "../bodyIntegerClientContext"; +import { BodyIntegerClient } from "../bodyIntegerClient"; import { IntGetNullOptionalParams, IntGetNullResponse, @@ -39,13 +39,13 @@ import { /** Class containing Int operations. */ export class IntImpl implements Int { - private readonly client: BodyIntegerClientContext; + private readonly client: BodyIntegerClient; /** * Initialize a new instance of the class Int class. * @param client Reference to the service client */ - constructor(client: BodyIntegerClientContext) { + constructor(client: BodyIntegerClient) { this.client = client; } diff --git a/test/integration/generated/bodyNumber/package.json b/test/integration/generated/bodyNumber/package.json index b81831f6fe..c9c7219c29 100644 --- a/test/integration/generated/bodyNumber/package.json +++ b/test/integration/generated/bodyNumber/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyNumber/src/bodyNumberClient.ts b/test/integration/generated/bodyNumber/src/bodyNumberClient.ts index 28083f6a5d..880b4fd93d 100644 --- a/test/integration/generated/bodyNumber/src/bodyNumberClient.ts +++ b/test/integration/generated/bodyNumber/src/bodyNumberClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { NumberOperationsImpl } from "./operations"; import { NumberOperations } from "./operationsInterfaces"; -import { BodyNumberClientContext } from "./bodyNumberClientContext"; import { BodyNumberClientOptionalParams } from "./models"; -export class BodyNumberClient extends BodyNumberClientContext { +export class BodyNumberClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyNumberClient class. * @param options The parameter options */ constructor(options?: BodyNumberClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyNumberClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-number/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.number = new NumberOperationsImpl(this); } diff --git a/test/integration/generated/bodyNumber/src/bodyNumberClientContext.ts b/test/integration/generated/bodyNumber/src/bodyNumberClientContext.ts deleted file mode 100644 index 20b58fd833..0000000000 --- a/test/integration/generated/bodyNumber/src/bodyNumberClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyNumberClientOptionalParams } from "./models"; - -export class BodyNumberClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyNumberClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyNumberClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyNumberClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-number/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyNumber/src/index.ts b/test/integration/generated/bodyNumber/src/index.ts index 8b4c86296d..20c5862034 100644 --- a/test/integration/generated/bodyNumber/src/index.ts +++ b/test/integration/generated/bodyNumber/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyNumberClient } from "./bodyNumberClient"; -export { BodyNumberClientContext } from "./bodyNumberClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyNumber/src/operations/number.ts b/test/integration/generated/bodyNumber/src/operations/number.ts index 00ec423071..157a0c7abd 100644 --- a/test/integration/generated/bodyNumber/src/operations/number.ts +++ b/test/integration/generated/bodyNumber/src/operations/number.ts @@ -10,7 +10,7 @@ import { NumberOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyNumberClientContext } from "../bodyNumberClientContext"; +import { BodyNumberClient } from "../bodyNumberClient"; import { NumberGetNullOptionalParams, NumberGetNullResponse, @@ -54,13 +54,13 @@ import { /** Class containing NumberOperations operations. */ export class NumberOperationsImpl implements NumberOperations { - private readonly client: BodyNumberClientContext; + private readonly client: BodyNumberClient; /** * Initialize a new instance of the class NumberOperations class. * @param client Reference to the service client */ - constructor(client: BodyNumberClientContext) { + constructor(client: BodyNumberClient) { this.client = client; } diff --git a/test/integration/generated/bodyString/package.json b/test/integration/generated/bodyString/package.json index 1d54a229d0..3f45a5fe17 100644 --- a/test/integration/generated/bodyString/package.json +++ b/test/integration/generated/bodyString/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyString/src/bodyStringClient.ts b/test/integration/generated/bodyString/src/bodyStringClient.ts index cd7d6999c5..b0c5b167ed 100644 --- a/test/integration/generated/bodyString/src/bodyStringClient.ts +++ b/test/integration/generated/bodyString/src/bodyStringClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { StringOperationsImpl, EnumImpl } from "./operations"; import { StringOperations, Enum } from "./operationsInterfaces"; -import { BodyStringClientContext } from "./bodyStringClientContext"; import { BodyStringClientOptionalParams } from "./models"; -export class BodyStringClient extends BodyStringClientContext { +export class BodyStringClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyStringClient class. * @param options The parameter options */ constructor(options?: BodyStringClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyStringClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-string/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.string = new StringOperationsImpl(this); this.enum = new EnumImpl(this); } diff --git a/test/integration/generated/bodyString/src/bodyStringClientContext.ts b/test/integration/generated/bodyString/src/bodyStringClientContext.ts deleted file mode 100644 index 74024d8db5..0000000000 --- a/test/integration/generated/bodyString/src/bodyStringClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyStringClientOptionalParams } from "./models"; - -export class BodyStringClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyStringClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyStringClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyStringClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-string/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyString/src/index.ts b/test/integration/generated/bodyString/src/index.ts index 6806f529d8..e26188374f 100644 --- a/test/integration/generated/bodyString/src/index.ts +++ b/test/integration/generated/bodyString/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyStringClient } from "./bodyStringClient"; -export { BodyStringClientContext } from "./bodyStringClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyString/src/operations/enum.ts b/test/integration/generated/bodyString/src/operations/enum.ts index 5ca0b4ca9b..e2a7a48f12 100644 --- a/test/integration/generated/bodyString/src/operations/enum.ts +++ b/test/integration/generated/bodyString/src/operations/enum.ts @@ -10,7 +10,7 @@ import { Enum } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyStringClientContext } from "../bodyStringClientContext"; +import { BodyStringClient } from "../bodyStringClient"; import { EnumGetNotExpandableOptionalParams, EnumGetNotExpandableResponse, @@ -27,13 +27,13 @@ import { /** Class containing Enum operations. */ export class EnumImpl implements Enum { - private readonly client: BodyStringClientContext; + private readonly client: BodyStringClient; /** * Initialize a new instance of the class Enum class. * @param client Reference to the service client */ - constructor(client: BodyStringClientContext) { + constructor(client: BodyStringClient) { this.client = client; } diff --git a/test/integration/generated/bodyString/src/operations/string.ts b/test/integration/generated/bodyString/src/operations/string.ts index bbc83bd9b5..75361b1410 100644 --- a/test/integration/generated/bodyString/src/operations/string.ts +++ b/test/integration/generated/bodyString/src/operations/string.ts @@ -10,7 +10,7 @@ import { StringOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyStringClientContext } from "../bodyStringClientContext"; +import { BodyStringClient } from "../bodyStringClient"; import { StringGetNullOptionalParams, StringGetNullResponse, @@ -37,13 +37,13 @@ import { /** Class containing StringOperations operations. */ export class StringOperationsImpl implements StringOperations { - private readonly client: BodyStringClientContext; + private readonly client: BodyStringClient; /** * Initialize a new instance of the class StringOperations class. * @param client Reference to the service client */ - constructor(client: BodyStringClientContext) { + constructor(client: BodyStringClient) { this.client = client; } diff --git a/test/integration/generated/bodyStringRest/karma.conf.js b/test/integration/generated/bodyStringRest/karma.conf.js new file mode 100644 index 0000000000..5610b7bb06 --- /dev/null +++ b/test/integration/generated/bodyStringRest/karma.conf.js @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +// https://github.com/karma-runner/karma-chrome-launcher +process.env.CHROME_BIN = require("puppeteer").executablePath(); +require("dotenv").config(); +const { + jsonRecordingFilterFunction, + isPlaybackMode, + isSoftRecordMode, + isRecordMode +} = require("@azure-tools/test-recorder"); + +module.exports = function(config) { + config.set({ + // base path that will be used to resolve all patterns (eg. files, exclude) + basePath: "./", + + // frameworks to use + // available frameworks: https://npmjs.org/browse/keyword/karma-adapter + frameworks: ["source-map-support", "mocha"], + + plugins: [ + "karma-mocha", + "karma-mocha-reporter", + "karma-chrome-launcher", + "karma-edge-launcher", + "karma-firefox-launcher", + "karma-ie-launcher", + "karma-env-preprocessor", + "karma-coverage", + "karma-sourcemap-loader", + "karma-junit-reporter", + "karma-json-to-file-reporter", + "karma-source-map-support", + "karma-json-preprocessor" + ], + + // list of files / patterns to load in the browser + files: [ + "dist-test/index.browser.js", + { + pattern: "dist-test/index.browser.js.map", + type: "html", + included: false, + served: true + } + ].concat( + isPlaybackMode() || isSoftRecordMode() + ? ["recordings/browsers/**/*.json"] + : [] + ), + + // list of files / patterns to exclude + exclude: [], + + // preprocess matching files before serving them to the browser + // available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor + preprocessors: { + "**/*.js": ["sourcemap", "env"], + "recordings/browsers/**/*.json": ["json"] + // IMPORTANT: COMMENT following line if you want to debug in your browsers!! + // Preprocess source file to calculate code coverage, however this will make source file unreadable + // "dist-test/index.js": ["coverage"] + }, + + envPreprocessor: [ + "TEST_MODE", + "ENDPOINT", + "AZURE_CLIENT_SECRET", + "AZURE_CLIENT_ID", + "AZURE_TENANT_ID", + "SUBSCRIPTION_ID" + ], + + // test results reporter to use + // possible values: 'dots', 'progress' + // available reporters: https://npmjs.org/browse/keyword/karma-reporter + reporters: ["mocha", "coverage", "junit", "json-to-file"], + + coverageReporter: { + // specify a common output directory + dir: "coverage-browser/", + reporters: [ + { type: "json", subdir: ".", file: "coverage.json" }, + { type: "lcovonly", subdir: ".", file: "lcov.info" }, + { type: "html", subdir: "html" }, + { type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" } + ] + }, + + junitReporter: { + outputDir: "", // results will be saved as $outputDir/$browserName.xml + outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile + suite: "", // suite will become the package name attribute in xml testsuite element + useBrowserName: false, // add browser name to report and classes names + nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element + classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element + properties: {} // key value pair of properties to add to the section of the report + }, + + jsonToFileReporter: { + filter: jsonRecordingFilterFunction, + outputPath: "." + }, + + // web server port + port: 9876, + + // enable / disable colors in the output (reporters and logs) + colors: true, + + // level of logging + // possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG + logLevel: config.LOG_INFO, + + // enable / disable watching file and executing tests whenever any file changes + autoWatch: false, + + // --no-sandbox allows our tests to run in Linux without having to change the system. + // --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex. + browsers: ["ChromeHeadlessNoSandbox"], + customLaunchers: { + ChromeHeadlessNoSandbox: { + base: "ChromeHeadless", + flags: ["--no-sandbox", "--disable-web-security"] + } + }, + + // Continuous Integration mode + // if true, Karma captures browsers, runs the tests and exits + singleRun: false, + + // Concurrency level + // how many browser should be started simultaneous + concurrency: 1, + + browserNoActivityTimeout: 60000000, + browserDisconnectTimeout: 10000, + browserDisconnectTolerance: 3, + browserConsoleLogOptions: { + terminal: !isRecordMode() + }, + + client: { + mocha: { + // change Karma's debug.html to the mocha web reporter + reporter: "html", + timeout: "600000" + } + } + }); +}; diff --git a/test/integration/generated/bodyStringRest/package.json b/test/integration/generated/bodyStringRest/package.json index 0ca186f83d..c26187583d 100644 --- a/test/integration/generated/bodyStringRest/package.json +++ b/test/integration/generated/bodyStringRest/package.json @@ -6,7 +6,7 @@ "main": "dist-esm/index.js", "types": "./types/body-string-rest.d.ts", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "test": "npm run clean && npm run build:test && npm run unit-test", "build": "npm run clean && tsc --build && npm run extract-api", "extract-api": "mkdirp ./review && api-extractor run --local", "pack": "npm pack 2>&1", @@ -15,24 +15,24 @@ "clean": "echo skipped", "build:node": "echo skipped", "build:browser": "echo skipped", - "build:test": "echo skipped", + "build:test": "tsc -p . && rollup -c 2>&1", "build:samples": "echo skipped.", "check-format": "echo skipped", "execute:samples": "echo skipped", "format": "echo skipped", - "test:node": "echo skipped", - "test:browser": "echo skipped", - "unit-test": "echo skipped", - "unit-test:node": "echo skipped", - "unit-test:browser": "echo skipped", - "integration-test:browser": "echo skipped", - "integration-test:node": "echo skipped", - "integration-test": "echo skipped", + "test:node": "npm run clean && npm run build:test && npm run unit-test:node", + "test:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1", + "unit-test": "npm run unit-test:node && npm run unit-test:browser", + "unit-test:node": "mocha -r esm --require ts-node/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 1200000 --full-trace \"test/{,!(browser)/**/}*.spec.ts\"", + "unit-test:browser": "karma start --single-run", + "integration-test:browser": "karma start --single-run", + "integration-test:node": "nyc mocha -r esm --require source-map-support/register --reporter ../../../common/tools/mocha-multi-reporter.js --timeout 5000000 --full-trace \"dist-esm/test/{,!(browser)/**/}*.spec.js\"", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", "docs": "echo skipped" }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", @@ -48,8 +48,34 @@ "ts-node": "^9.1.1", "typescript": "~4.2.4", "mkdirp": "^1.0.4", - "rimraf": "^3.0.0" + "rimraf": "^3.0.0", + "@azure/identity": "^2.0.1", + "@azure-tools/test-recorder": "^1.0.0", + "mocha": "^7.1.1", + "mocha-junit-reporter": "^1.18.0", + "cross-env": "^7.0.2", + "chai": "^4.2.0", + "karma-chrome-launcher": "^3.0.0", + "karma-coverage": "^2.0.0", + "karma-edge-launcher": "^0.4.2", + "karma-env-preprocessor": "^0.1.1", + "karma-firefox-launcher": "^1.1.0", + "karma-ie-launcher": "^1.0.0", + "karma-json-preprocessor": "^0.3.3", + "karma-json-to-file-reporter": "^1.0.1", + "karma-junit-reporter": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", + "karma-mocha": "^2.0.1", + "karma-source-map-support": "~1.4.0", + "karma-sourcemap-loader": "^0.3.8", + "karma": "^6.2.0", + "nyc": "^14.0.0", + "source-map-support": "^0.5.9" }, "sideEffects": false, - "autoPublish": true + "autoPublish": true, + "module": "./dist-esm/src/index.js", + "browser": { + "./dist-esm/test/public/utils/env.js": "./dist-esm/test/public/utils/env.browser.js" + } } diff --git a/test/integration/generated/bodyStringRest/src/bodyStringRest.ts b/test/integration/generated/bodyStringRest/src/bodyStringRest.ts index fa10ad9f60..6d3d0af4b7 100644 --- a/test/integration/generated/bodyStringRest/src/bodyStringRest.ts +++ b/test/integration/generated/bodyStringRest/src/bodyStringRest.ts @@ -235,9 +235,7 @@ export default function BodyStringRest( ): BodyStringRestRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - return getClient( - baseUrl, + const client = getClient(baseUrl, options) as BodyStringRestRestClient; - options - ) as BodyStringRestRestClient; + return client; } diff --git a/test/integration/generated/bodyStringRest/test/public/sampleTest.spec.ts b/test/integration/generated/bodyStringRest/test/public/sampleTest.spec.ts new file mode 100644 index 0000000000..5a71b56861 --- /dev/null +++ b/test/integration/generated/bodyStringRest/test/public/sampleTest.spec.ts @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { Recorder } from "@azure-tools/test-recorder"; +import * as assert from "assert"; +import { createRecorder } from "./utils/recordedClient"; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function() { + recorder = createRecorder(this); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/test/integration/generated/bodyStringRest/test/public/utils/env.browser.ts b/test/integration/generated/bodyStringRest/test/public/utils/env.browser.ts new file mode 100644 index 0000000000..fd2aca680c --- /dev/null +++ b/test/integration/generated/bodyStringRest/test/public/utils/env.browser.ts @@ -0,0 +1,2 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. diff --git a/test/integration/generated/bodyStringRest/test/public/utils/env.ts b/test/integration/generated/bodyStringRest/test/public/utils/env.ts new file mode 100644 index 0000000000..0e06855b73 --- /dev/null +++ b/test/integration/generated/bodyStringRest/test/public/utils/env.ts @@ -0,0 +1,6 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import * as dotenv from "dotenv"; + +dotenv.config(); diff --git a/test/integration/generated/bodyStringRest/test/public/utils/recordedClient.ts b/test/integration/generated/bodyStringRest/test/public/utils/recordedClient.ts new file mode 100644 index 0000000000..b090e6c7d0 --- /dev/null +++ b/test/integration/generated/bodyStringRest/test/public/utils/recordedClient.ts @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT license. + +import { Context } from "mocha"; +import { + env, + record, + RecorderEnvironmentSetup, + Recorder +} from "@azure-tools/test-recorder"; +import "./env"; + +const recorderEnvSetup: RecorderEnvironmentSetup = { + replaceableVariables: { + ENDPOINT: "https://endpoint", + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" + }, + customizationsOnRecordings: [ + (recording: any): any => + recording.replace( + /"access_token":"[^"]*"/g, + `"access_token":"access_token"` + ), + // If we put ENDPOINT in replaceableVariables above, it will not capture + // the endpoint string used with nock, which will be expanded to + // https://:443/ and therefore will not match, so we have to do + // this instead. + (recording: string): string => { + const replaced = recording.replace("endpoint:443", "endpoint"); + return replaced; + } + ], + queryParametersToSkip: [] +}; + +/** + * creates the recorder and reads the environment variables from the `.env` file. + * Should be called first in the test suite to make sure environment variables are + * read before they are being used. + */ +export function createRecorder(context: Context): Recorder { + return record(context, recorderEnvSetup); +} diff --git a/test/integration/generated/bodyStringRest/tsconfig.json b/test/integration/generated/bodyStringRest/tsconfig.json index 965341beea..3819483a36 100644 --- a/test/integration/generated/bodyStringRest/tsconfig.json +++ b/test/integration/generated/bodyStringRest/tsconfig.json @@ -7,13 +7,5 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts", "./test/**/*.ts"] } diff --git a/test/integration/generated/bodyTime/package.json b/test/integration/generated/bodyTime/package.json index ee098fb82c..82180a39cf 100644 --- a/test/integration/generated/bodyTime/package.json +++ b/test/integration/generated/bodyTime/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/bodyTime/src/bodyTimeClient.ts b/test/integration/generated/bodyTime/src/bodyTimeClient.ts index 07a31e1ab2..ec6a407fd3 100644 --- a/test/integration/generated/bodyTime/src/bodyTimeClient.ts +++ b/test/integration/generated/bodyTime/src/bodyTimeClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { TimeImpl } from "./operations"; import { Time } from "./operationsInterfaces"; -import { BodyTimeClientContext } from "./bodyTimeClientContext"; import { BodyTimeClientOptionalParams } from "./models"; -export class BodyTimeClient extends BodyTimeClientContext { +export class BodyTimeClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the BodyTimeClient class. * @param options The parameter options */ constructor(options?: BodyTimeClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: BodyTimeClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-body-time/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.time = new TimeImpl(this); } diff --git a/test/integration/generated/bodyTime/src/bodyTimeClientContext.ts b/test/integration/generated/bodyTime/src/bodyTimeClientContext.ts deleted file mode 100644 index f6dbe759e7..0000000000 --- a/test/integration/generated/bodyTime/src/bodyTimeClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { BodyTimeClientOptionalParams } from "./models"; - -export class BodyTimeClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the BodyTimeClientContext class. - * @param options The parameter options - */ - constructor(options?: BodyTimeClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: BodyTimeClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-body-time/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/bodyTime/src/index.ts b/test/integration/generated/bodyTime/src/index.ts index 8b5b0475d6..ea4f18ef00 100644 --- a/test/integration/generated/bodyTime/src/index.ts +++ b/test/integration/generated/bodyTime/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { BodyTimeClient } from "./bodyTimeClient"; -export { BodyTimeClientContext } from "./bodyTimeClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/bodyTime/src/operations/time.ts b/test/integration/generated/bodyTime/src/operations/time.ts index 558d0f792a..fcb71f082a 100644 --- a/test/integration/generated/bodyTime/src/operations/time.ts +++ b/test/integration/generated/bodyTime/src/operations/time.ts @@ -10,7 +10,7 @@ import { Time } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { BodyTimeClientContext } from "../bodyTimeClientContext"; +import { BodyTimeClient } from "../bodyTimeClient"; import { TimeGetOptionalParams, TimeGetResponse, @@ -20,13 +20,13 @@ import { /** Class containing Time operations. */ export class TimeImpl implements Time { - private readonly client: BodyTimeClientContext; + private readonly client: BodyTimeClient; /** * Initialize a new instance of the class Time class. * @param client Reference to the service client */ - constructor(client: BodyTimeClientContext) { + constructor(client: BodyTimeClient) { this.client = client; } diff --git a/test/integration/generated/constantParam/package.json b/test/integration/generated/constantParam/package.json index 5fd55dce86..ceef21430d 100644 --- a/test/integration/generated/constantParam/package.json +++ b/test/integration/generated/constantParam/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/constantParam/src/generatedClient.ts b/test/integration/generated/constantParam/src/generatedClient.ts index 29e4c26ca0..9597796dfc 100644 --- a/test/integration/generated/constantParam/src/generatedClient.ts +++ b/test/integration/generated/constantParam/src/generatedClient.ts @@ -9,7 +9,6 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { GeneratedClientContext } from "./generatedClientContext"; import { GeneratedClientOptionalParams, LanguageBatchInput, @@ -18,7 +17,10 @@ import { } from "./models"; /** @internal */ -export class GeneratedClient extends GeneratedClientContext { +export class GeneratedClient extends coreClient.ServiceClient { + endpoint: string; + apiVersion: string; + /** * Initializes a new instance of the GeneratedClient class. * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: @@ -26,7 +28,38 @@ export class GeneratedClient extends GeneratedClientContext { * @param options The parameter options */ constructor(endpoint: string, options?: GeneratedClientOptionalParams) { - super(endpoint, options); + if (endpoint === undefined) { + throw new Error("'endpoint' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: GeneratedClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-constantParam/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{Endpoint}/text/analytics/{ApiVersion}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.endpoint = endpoint; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "v3.1"; } /** diff --git a/test/integration/generated/constantParam/src/generatedClientContext.ts b/test/integration/generated/constantParam/src/generatedClientContext.ts deleted file mode 100644 index 7add4b74d8..0000000000 --- a/test/integration/generated/constantParam/src/generatedClientContext.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { GeneratedClientOptionalParams } from "./models"; - -/** @internal */ -export class GeneratedClientContext extends coreClient.ServiceClient { - endpoint: string; - apiVersion: string; - - /** - * Initializes a new instance of the GeneratedClientContext class. - * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: - * https://westus.api.cognitive.microsoft.com). - * @param options The parameter options - */ - constructor(endpoint: string, options?: GeneratedClientOptionalParams) { - if (endpoint === undefined) { - throw new Error("'endpoint' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: GeneratedClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-constantParam/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{Endpoint}/text/analytics/{ApiVersion}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.endpoint = endpoint; - - // Assigning values to Constant parameters - this.apiVersion = options.apiVersion || "v3.1"; - } -} diff --git a/test/integration/generated/constantParam/src/index.ts b/test/integration/generated/constantParam/src/index.ts index 3aebf3c9a5..657fb6d642 100644 --- a/test/integration/generated/constantParam/src/index.ts +++ b/test/integration/generated/constantParam/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { GeneratedClient } from "./generatedClient"; -export { GeneratedClientContext } from "./generatedClientContext"; diff --git a/test/integration/generated/customUrl/package.json b/test/integration/generated/customUrl/package.json index ede2ae1e12..e4f0710513 100644 --- a/test/integration/generated/customUrl/package.json +++ b/test/integration/generated/customUrl/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/customUrl/src/customUrlClient.ts b/test/integration/generated/customUrl/src/customUrlClient.ts index bdbe110917..f09de24f3e 100644 --- a/test/integration/generated/customUrl/src/customUrlClient.ts +++ b/test/integration/generated/customUrl/src/customUrlClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { PathsImpl } from "./operations"; import { Paths } from "./operationsInterfaces"; -import { CustomUrlClientContext } from "./customUrlClientContext"; import { CustomUrlClientOptionalParams } from "./models"; -export class CustomUrlClient extends CustomUrlClientContext { +export class CustomUrlClient extends coreClient.ServiceClient { + host: string; + /** * Initializes a new instance of the CustomUrlClient class. * @param options The parameter options */ constructor(options?: CustomUrlClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: CustomUrlClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-custom-url/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://{accountName}{host}" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.host = options.host || "host"; this.paths = new PathsImpl(this); } diff --git a/test/integration/generated/customUrl/src/customUrlClientContext.ts b/test/integration/generated/customUrl/src/customUrlClientContext.ts deleted file mode 100644 index 593612639b..0000000000 --- a/test/integration/generated/customUrl/src/customUrlClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { CustomUrlClientOptionalParams } from "./models"; - -export class CustomUrlClientContext extends coreClient.ServiceClient { - host: string; - - /** - * Initializes a new instance of the CustomUrlClientContext class. - * @param options The parameter options - */ - constructor(options?: CustomUrlClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: CustomUrlClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-custom-url/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://{accountName}{host}" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.host = options.host || "host"; - } -} diff --git a/test/integration/generated/customUrl/src/index.ts b/test/integration/generated/customUrl/src/index.ts index 7156c26a93..96499ffc46 100644 --- a/test/integration/generated/customUrl/src/index.ts +++ b/test/integration/generated/customUrl/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { CustomUrlClient } from "./customUrlClient"; -export { CustomUrlClientContext } from "./customUrlClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/customUrl/src/operations/paths.ts b/test/integration/generated/customUrl/src/operations/paths.ts index 754b326a07..e182ccdfb6 100644 --- a/test/integration/generated/customUrl/src/operations/paths.ts +++ b/test/integration/generated/customUrl/src/operations/paths.ts @@ -10,18 +10,18 @@ import { Paths } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { CustomUrlClientContext } from "../customUrlClientContext"; +import { CustomUrlClient } from "../customUrlClient"; import { PathsGetEmptyOptionalParams } from "../models"; /** Class containing Paths operations. */ export class PathsImpl implements Paths { - private readonly client: CustomUrlClientContext; + private readonly client: CustomUrlClient; /** * Initialize a new instance of the class Paths class. * @param client Reference to the service client */ - constructor(client: CustomUrlClientContext) { + constructor(client: CustomUrlClient) { this.client = client; } diff --git a/test/integration/generated/customUrlMoreOptions/package.json b/test/integration/generated/customUrlMoreOptions/package.json index 08a96049cf..4c38c82527 100644 --- a/test/integration/generated/customUrlMoreOptions/package.json +++ b/test/integration/generated/customUrlMoreOptions/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClient.ts b/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClient.ts index aed2b7e64b..535c0868c9 100644 --- a/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClient.ts +++ b/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClient.ts @@ -6,12 +6,15 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { PathsImpl } from "./operations"; import { Paths } from "./operationsInterfaces"; -import { CustomUrlMoreOptionsClientContext } from "./customUrlMoreOptionsClientContext"; import { CustomUrlMoreOptionsClientOptionalParams } from "./models"; -export class CustomUrlMoreOptionsClient extends CustomUrlMoreOptionsClientContext { +export class CustomUrlMoreOptionsClient extends coreClient.ServiceClient { + dnsSuffix: string; + subscriptionId: string; + /** * Initializes a new instance of the CustomUrlMoreOptionsClient class. * @param subscriptionId The subscription id with value 'test12'. @@ -21,7 +24,38 @@ export class CustomUrlMoreOptionsClient extends CustomUrlMoreOptionsClientContex subscriptionId: string, options?: CustomUrlMoreOptionsClientOptionalParams ) { - super(subscriptionId, options); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: CustomUrlMoreOptionsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-custom-url-MoreOptions/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{vault}{secret}{dnsSuffix}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.dnsSuffix = options.dnsSuffix || "host"; this.paths = new PathsImpl(this); } diff --git a/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClientContext.ts b/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClientContext.ts deleted file mode 100644 index 05ddcb1ab1..0000000000 --- a/test/integration/generated/customUrlMoreOptions/src/customUrlMoreOptionsClientContext.ts +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { CustomUrlMoreOptionsClientOptionalParams } from "./models"; - -export class CustomUrlMoreOptionsClientContext extends coreClient.ServiceClient { - dnsSuffix: string; - subscriptionId: string; - - /** - * Initializes a new instance of the CustomUrlMoreOptionsClientContext class. - * @param subscriptionId The subscription id with value 'test12'. - * @param options The parameter options - */ - constructor( - subscriptionId: string, - options?: CustomUrlMoreOptionsClientOptionalParams - ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: CustomUrlMoreOptionsClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-custom-url-MoreOptions/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{vault}{secret}{dnsSuffix}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.dnsSuffix = options.dnsSuffix || "host"; - } -} diff --git a/test/integration/generated/customUrlMoreOptions/src/index.ts b/test/integration/generated/customUrlMoreOptions/src/index.ts index 535fef5a9a..a399d58aa8 100644 --- a/test/integration/generated/customUrlMoreOptions/src/index.ts +++ b/test/integration/generated/customUrlMoreOptions/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { CustomUrlMoreOptionsClient } from "./customUrlMoreOptionsClient"; -export { CustomUrlMoreOptionsClientContext } from "./customUrlMoreOptionsClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/customUrlMoreOptions/src/operations/paths.ts b/test/integration/generated/customUrlMoreOptions/src/operations/paths.ts index d0a0434a61..5befb8bfdf 100644 --- a/test/integration/generated/customUrlMoreOptions/src/operations/paths.ts +++ b/test/integration/generated/customUrlMoreOptions/src/operations/paths.ts @@ -10,18 +10,18 @@ import { Paths } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { CustomUrlMoreOptionsClientContext } from "../customUrlMoreOptionsClientContext"; +import { CustomUrlMoreOptionsClient } from "../customUrlMoreOptionsClient"; import { PathsGetEmptyOptionalParams } from "../models"; /** Class containing Paths operations. */ export class PathsImpl implements Paths { - private readonly client: CustomUrlMoreOptionsClientContext; + private readonly client: CustomUrlMoreOptionsClient; /** * Initialize a new instance of the class Paths class. * @param client Reference to the service client */ - constructor(client: CustomUrlMoreOptionsClientContext) { + constructor(client: CustomUrlMoreOptionsClient) { this.client = client; } diff --git a/test/integration/generated/customUrlPaging/package.json b/test/integration/generated/customUrlPaging/package.json index 401a15be00..a0c22fc5c1 100644 --- a/test/integration/generated/customUrlPaging/package.json +++ b/test/integration/generated/customUrlPaging/package.json @@ -26,7 +26,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/customUrlPaging/src/customUrlPagingClient.ts b/test/integration/generated/customUrlPaging/src/customUrlPagingClient.ts index 7beb261cdc..1ecd4c74fb 100644 --- a/test/integration/generated/customUrlPaging/src/customUrlPagingClient.ts +++ b/test/integration/generated/customUrlPaging/src/customUrlPagingClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { PagingImpl } from "./operations"; import { Paging } from "./operationsInterfaces"; -import { CustomUrlPagingClientContext } from "./customUrlPagingClientContext"; import { CustomUrlPagingClientOptionalParams } from "./models"; -export class CustomUrlPagingClient extends CustomUrlPagingClientContext { +export class CustomUrlPagingClient extends coreClient.ServiceClient { + host: string; + /** * Initializes a new instance of the CustomUrlPagingClient class. * @param options The parameter options */ constructor(options?: CustomUrlPagingClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: CustomUrlPagingClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-custom-url-paging/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://{accountName}{host}" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.host = options.host || "host"; this.paging = new PagingImpl(this); } diff --git a/test/integration/generated/customUrlPaging/src/customUrlPagingClientContext.ts b/test/integration/generated/customUrlPaging/src/customUrlPagingClientContext.ts deleted file mode 100644 index 84ec2c0e75..0000000000 --- a/test/integration/generated/customUrlPaging/src/customUrlPagingClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { CustomUrlPagingClientOptionalParams } from "./models"; - -export class CustomUrlPagingClientContext extends coreClient.ServiceClient { - host: string; - - /** - * Initializes a new instance of the CustomUrlPagingClientContext class. - * @param options The parameter options - */ - constructor(options?: CustomUrlPagingClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: CustomUrlPagingClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-custom-url-paging/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://{accountName}{host}" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.host = options.host || "host"; - } -} diff --git a/test/integration/generated/customUrlPaging/src/index.ts b/test/integration/generated/customUrlPaging/src/index.ts index 4a177cdd47..2e737de63e 100644 --- a/test/integration/generated/customUrlPaging/src/index.ts +++ b/test/integration/generated/customUrlPaging/src/index.ts @@ -9,5 +9,4 @@ /// export * from "./models"; export { CustomUrlPagingClient } from "./customUrlPagingClient"; -export { CustomUrlPagingClientContext } from "./customUrlPagingClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/customUrlPaging/src/operations/paging.ts b/test/integration/generated/customUrlPaging/src/operations/paging.ts index 57b917e37c..d18ef00bf2 100644 --- a/test/integration/generated/customUrlPaging/src/operations/paging.ts +++ b/test/integration/generated/customUrlPaging/src/operations/paging.ts @@ -11,7 +11,7 @@ import { Paging } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { CustomUrlPagingClientContext } from "../customUrlPagingClientContext"; +import { CustomUrlPagingClient } from "../customUrlPagingClient"; import { Product, PagingGetPagesPartialUrlNextOptionalParams, @@ -27,13 +27,13 @@ import { /// /** Class containing Paging operations. */ export class PagingImpl implements Paging { - private readonly client: CustomUrlPagingClientContext; + private readonly client: CustomUrlPagingClient; /** * Initialize a new instance of the class Paging class. * @param client Reference to the service client */ - constructor(client: CustomUrlPagingClientContext) { + constructor(client: CustomUrlPagingClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/package.json b/test/integration/generated/datafactory/package.json index 1b040a8a4b..1076614019 100644 --- a/test/integration/generated/datafactory/package.json +++ b/test/integration/generated/datafactory/package.json @@ -28,7 +28,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/datafactory/src/dataFactoryClient.ts b/test/integration/generated/datafactory/src/dataFactoryClient.ts index efb38b36d4..4b30663005 100644 --- a/test/integration/generated/datafactory/src/dataFactoryClient.ts +++ b/test/integration/generated/datafactory/src/dataFactoryClient.ts @@ -1,3 +1,4 @@ +import * as coreClient from "@azure/core-client"; import { OperationsImpl, FactoriesImpl, @@ -42,10 +43,13 @@ import { PrivateEndpointConnection, PrivateLinkResources } from "./operationsInterfaces"; -import { DataFactoryClientContext } from "./dataFactoryClientContext"; import { DataFactoryClientOptionalParams } from "./models"; -export class DataFactoryClient extends DataFactoryClientContext { +export class DataFactoryClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + /** * Initializes a new instance of the DataFactoryClient class. * @param subscriptionId The subscription identifier. @@ -55,7 +59,39 @@ export class DataFactoryClient extends DataFactoryClientContext { subscriptionId: string, options?: DataFactoryClientOptionalParams ) { - super(subscriptionId, options); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: DataFactoryClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-datafactory/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2018-06-01"; this.operations = new OperationsImpl(this); this.factories = new FactoriesImpl(this); this.exposureControl = new ExposureControlImpl(this); diff --git a/test/integration/generated/datafactory/src/dataFactoryClientContext.ts b/test/integration/generated/datafactory/src/dataFactoryClientContext.ts deleted file mode 100644 index 4847b359f0..0000000000 --- a/test/integration/generated/datafactory/src/dataFactoryClientContext.ts +++ /dev/null @@ -1,52 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { DataFactoryClientOptionalParams } from "./models"; - -export class DataFactoryClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - - /** - * Initializes a new instance of the DataFactoryClientContext class. - * @param subscriptionId The subscription identifier. - * @param options The parameter options - */ - constructor( - subscriptionId: string, - options?: DataFactoryClientOptionalParams - ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: DataFactoryClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-datafactory/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "https://management.azure.com" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2018-06-01"; - } -} diff --git a/test/integration/generated/datafactory/src/index.ts b/test/integration/generated/datafactory/src/index.ts index 5016490640..677f5d970d 100644 --- a/test/integration/generated/datafactory/src/index.ts +++ b/test/integration/generated/datafactory/src/index.ts @@ -1,5 +1,4 @@ /// export * from "./models"; export { DataFactoryClient } from "./dataFactoryClient"; -export { DataFactoryClientContext } from "./dataFactoryClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/datafactory/src/operations/activityRuns.ts b/test/integration/generated/datafactory/src/operations/activityRuns.ts index 39ebbe72f4..d5cd57009e 100644 --- a/test/integration/generated/datafactory/src/operations/activityRuns.ts +++ b/test/integration/generated/datafactory/src/operations/activityRuns.ts @@ -2,7 +2,7 @@ import { ActivityRuns } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { RunFilterParameters, ActivityRunsQueryByPipelineRunOptionalParams, @@ -11,13 +11,13 @@ import { /** Class containing ActivityRuns operations. */ export class ActivityRunsImpl implements ActivityRuns { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class ActivityRuns class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/dataFlowDebugSession.ts b/test/integration/generated/datafactory/src/operations/dataFlowDebugSession.ts index f35513567e..1c4766085b 100644 --- a/test/integration/generated/datafactory/src/operations/dataFlowDebugSession.ts +++ b/test/integration/generated/datafactory/src/operations/dataFlowDebugSession.ts @@ -3,7 +3,7 @@ import { DataFlowDebugSession } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -28,13 +28,13 @@ import { /// /** Class containing DataFlowDebugSession operations. */ export class DataFlowDebugSessionImpl implements DataFlowDebugSession { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class DataFlowDebugSession class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/dataFlows.ts b/test/integration/generated/datafactory/src/operations/dataFlows.ts index 10099134dc..6989ebd829 100644 --- a/test/integration/generated/datafactory/src/operations/dataFlows.ts +++ b/test/integration/generated/datafactory/src/operations/dataFlows.ts @@ -3,7 +3,7 @@ import { DataFlows } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { DataFlowResource, DataFlowsListByFactoryNextOptionalParams, @@ -20,13 +20,13 @@ import { /// /** Class containing DataFlows operations. */ export class DataFlowsImpl implements DataFlows { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class DataFlows class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/datasets.ts b/test/integration/generated/datafactory/src/operations/datasets.ts index 0e49745c88..c254687803 100644 --- a/test/integration/generated/datafactory/src/operations/datasets.ts +++ b/test/integration/generated/datafactory/src/operations/datasets.ts @@ -3,7 +3,7 @@ import { Datasets } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { DatasetResource, DatasetsListByFactoryNextOptionalParams, @@ -20,13 +20,13 @@ import { /// /** Class containing Datasets operations. */ export class DatasetsImpl implements Datasets { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class Datasets class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/exposureControl.ts b/test/integration/generated/datafactory/src/operations/exposureControl.ts index d331f72f6e..6594acc53e 100644 --- a/test/integration/generated/datafactory/src/operations/exposureControl.ts +++ b/test/integration/generated/datafactory/src/operations/exposureControl.ts @@ -2,7 +2,7 @@ import { ExposureControl } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { ExposureControlRequest, ExposureControlGetFeatureValueOptionalParams, @@ -16,13 +16,13 @@ import { /** Class containing ExposureControl operations. */ export class ExposureControlImpl implements ExposureControl { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class ExposureControl class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/factories.ts b/test/integration/generated/datafactory/src/operations/factories.ts index 3ea68fc3ee..e36641a208 100644 --- a/test/integration/generated/datafactory/src/operations/factories.ts +++ b/test/integration/generated/datafactory/src/operations/factories.ts @@ -3,7 +3,7 @@ import { Factories } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { Factory, FactoriesListNextOptionalParams, @@ -36,13 +36,13 @@ import { /// /** Class containing Factories operations. */ export class FactoriesImpl implements Factories { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class Factories class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/integrationRuntimeNodes.ts b/test/integration/generated/datafactory/src/operations/integrationRuntimeNodes.ts index 8525435ab1..0f9c356d55 100644 --- a/test/integration/generated/datafactory/src/operations/integrationRuntimeNodes.ts +++ b/test/integration/generated/datafactory/src/operations/integrationRuntimeNodes.ts @@ -2,7 +2,7 @@ import { IntegrationRuntimeNodes } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { IntegrationRuntimeNodesGetOptionalParams, IntegrationRuntimeNodesGetResponse, @@ -16,13 +16,13 @@ import { /** Class containing IntegrationRuntimeNodes operations. */ export class IntegrationRuntimeNodesImpl implements IntegrationRuntimeNodes { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class IntegrationRuntimeNodes class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/integrationRuntimeObjectMetadata.ts b/test/integration/generated/datafactory/src/operations/integrationRuntimeObjectMetadata.ts index afbc5f5a05..af9a23ef6d 100644 --- a/test/integration/generated/datafactory/src/operations/integrationRuntimeObjectMetadata.ts +++ b/test/integration/generated/datafactory/src/operations/integrationRuntimeObjectMetadata.ts @@ -2,7 +2,7 @@ import { IntegrationRuntimeObjectMetadata } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -15,13 +15,13 @@ import { /** Class containing IntegrationRuntimeObjectMetadata operations. */ export class IntegrationRuntimeObjectMetadataImpl implements IntegrationRuntimeObjectMetadata { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class IntegrationRuntimeObjectMetadata class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/integrationRuntimes.ts b/test/integration/generated/datafactory/src/operations/integrationRuntimes.ts index 2c3be4b489..b3e68462ea 100644 --- a/test/integration/generated/datafactory/src/operations/integrationRuntimes.ts +++ b/test/integration/generated/datafactory/src/operations/integrationRuntimes.ts @@ -3,7 +3,7 @@ import { IntegrationRuntimes } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -48,13 +48,13 @@ import { /// /** Class containing IntegrationRuntimes operations. */ export class IntegrationRuntimesImpl implements IntegrationRuntimes { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class IntegrationRuntimes class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/linkedServices.ts b/test/integration/generated/datafactory/src/operations/linkedServices.ts index d203e61414..c86c3899e1 100644 --- a/test/integration/generated/datafactory/src/operations/linkedServices.ts +++ b/test/integration/generated/datafactory/src/operations/linkedServices.ts @@ -3,7 +3,7 @@ import { LinkedServices } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { LinkedServiceResource, LinkedServicesListByFactoryNextOptionalParams, @@ -20,13 +20,13 @@ import { /// /** Class containing LinkedServices operations. */ export class LinkedServicesImpl implements LinkedServices { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class LinkedServices class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/managedPrivateEndpoints.ts b/test/integration/generated/datafactory/src/operations/managedPrivateEndpoints.ts index 822e169e07..2c491c1bd5 100644 --- a/test/integration/generated/datafactory/src/operations/managedPrivateEndpoints.ts +++ b/test/integration/generated/datafactory/src/operations/managedPrivateEndpoints.ts @@ -3,7 +3,7 @@ import { ManagedPrivateEndpoints } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { ManagedPrivateEndpointResource, ManagedPrivateEndpointsListByFactoryNextOptionalParams, @@ -20,13 +20,13 @@ import { /// /** Class containing ManagedPrivateEndpoints operations. */ export class ManagedPrivateEndpointsImpl implements ManagedPrivateEndpoints { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class ManagedPrivateEndpoints class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/managedVirtualNetworks.ts b/test/integration/generated/datafactory/src/operations/managedVirtualNetworks.ts index 5f6d33e118..63d2e3c021 100644 --- a/test/integration/generated/datafactory/src/operations/managedVirtualNetworks.ts +++ b/test/integration/generated/datafactory/src/operations/managedVirtualNetworks.ts @@ -3,7 +3,7 @@ import { ManagedVirtualNetworks } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { ManagedVirtualNetworkResource, ManagedVirtualNetworksListByFactoryNextOptionalParams, @@ -19,13 +19,13 @@ import { /// /** Class containing ManagedVirtualNetworks operations. */ export class ManagedVirtualNetworksImpl implements ManagedVirtualNetworks { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class ManagedVirtualNetworks class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/operations.ts b/test/integration/generated/datafactory/src/operations/operations.ts index 9290b3b17c..f0bf046971 100644 --- a/test/integration/generated/datafactory/src/operations/operations.ts +++ b/test/integration/generated/datafactory/src/operations/operations.ts @@ -3,7 +3,7 @@ import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { Operation, OperationsListNextOptionalParams, @@ -15,13 +15,13 @@ import { /// /** Class containing Operations operations. */ export class OperationsImpl implements Operations { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class Operations class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/pipelineRuns.ts b/test/integration/generated/datafactory/src/operations/pipelineRuns.ts index 9da7b12ca8..6f2c46e2cd 100644 --- a/test/integration/generated/datafactory/src/operations/pipelineRuns.ts +++ b/test/integration/generated/datafactory/src/operations/pipelineRuns.ts @@ -2,7 +2,7 @@ import { PipelineRuns } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { RunFilterParameters, PipelineRunsQueryByFactoryOptionalParams, @@ -14,13 +14,13 @@ import { /** Class containing PipelineRuns operations. */ export class PipelineRunsImpl implements PipelineRuns { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class PipelineRuns class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/pipelines.ts b/test/integration/generated/datafactory/src/operations/pipelines.ts index d72bded4d5..2c39f3fa27 100644 --- a/test/integration/generated/datafactory/src/operations/pipelines.ts +++ b/test/integration/generated/datafactory/src/operations/pipelines.ts @@ -3,7 +3,7 @@ import { Pipelines } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { PipelineResource, PipelinesListByFactoryNextOptionalParams, @@ -22,13 +22,13 @@ import { /// /** Class containing Pipelines operations. */ export class PipelinesImpl implements Pipelines { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class Pipelines class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/privateEndPointConnections.ts b/test/integration/generated/datafactory/src/operations/privateEndPointConnections.ts index 56a53beb0d..a0722c785c 100644 --- a/test/integration/generated/datafactory/src/operations/privateEndPointConnections.ts +++ b/test/integration/generated/datafactory/src/operations/privateEndPointConnections.ts @@ -3,7 +3,7 @@ import { PrivateEndPointConnections } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { PrivateEndpointConnectionResource, PrivateEndPointConnectionsListByFactoryNextOptionalParams, @@ -16,13 +16,13 @@ import { /** Class containing PrivateEndPointConnections operations. */ export class PrivateEndPointConnectionsImpl implements PrivateEndPointConnections { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class PrivateEndPointConnections class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/privateEndpointConnection.ts b/test/integration/generated/datafactory/src/operations/privateEndpointConnection.ts index 36fb15888f..08ab18c321 100644 --- a/test/integration/generated/datafactory/src/operations/privateEndpointConnection.ts +++ b/test/integration/generated/datafactory/src/operations/privateEndpointConnection.ts @@ -2,7 +2,7 @@ import { PrivateEndpointConnection } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { PrivateLinkConnectionApprovalRequestResource, PrivateEndpointConnectionCreateOrUpdateOptionalParams, @@ -15,13 +15,13 @@ import { /** Class containing PrivateEndpointConnection operations. */ export class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class PrivateEndpointConnection class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/privateLinkResources.ts b/test/integration/generated/datafactory/src/operations/privateLinkResources.ts index 856aa2bf80..bec49080bb 100644 --- a/test/integration/generated/datafactory/src/operations/privateLinkResources.ts +++ b/test/integration/generated/datafactory/src/operations/privateLinkResources.ts @@ -2,7 +2,7 @@ import { PrivateLinkResources } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { PrivateLinkResourcesGetOptionalParams, PrivateLinkResourcesGetResponse @@ -10,13 +10,13 @@ import { /** Class containing PrivateLinkResources operations. */ export class PrivateLinkResourcesImpl implements PrivateLinkResources { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class PrivateLinkResources class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/triggerRuns.ts b/test/integration/generated/datafactory/src/operations/triggerRuns.ts index 47a2e17947..1ef9078f7e 100644 --- a/test/integration/generated/datafactory/src/operations/triggerRuns.ts +++ b/test/integration/generated/datafactory/src/operations/triggerRuns.ts @@ -2,7 +2,7 @@ import { TriggerRuns } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { TriggerRunsRerunOptionalParams, TriggerRunsCancelOptionalParams, @@ -13,13 +13,13 @@ import { /** Class containing TriggerRuns operations. */ export class TriggerRunsImpl implements TriggerRuns { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class TriggerRuns class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datafactory/src/operations/triggers.ts b/test/integration/generated/datafactory/src/operations/triggers.ts index fa12875467..c1d3ef583b 100644 --- a/test/integration/generated/datafactory/src/operations/triggers.ts +++ b/test/integration/generated/datafactory/src/operations/triggers.ts @@ -3,7 +3,7 @@ import { Triggers } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataFactoryClientContext } from "../dataFactoryClientContext"; +import { DataFactoryClient } from "../dataFactoryClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -33,13 +33,13 @@ import { /// /** Class containing Triggers operations. */ export class TriggersImpl implements Triggers { - private readonly client: DataFactoryClientContext; + private readonly client: DataFactoryClient; /** * Initialize a new instance of the class Triggers class. * @param client Reference to the service client */ - constructor(client: DataFactoryClientContext) { + constructor(client: DataFactoryClient) { this.client = client; } diff --git a/test/integration/generated/datalakestorage/package.json b/test/integration/generated/datalakestorage/package.json index 81683460e6..a50faee751 100644 --- a/test/integration/generated/datalakestorage/package.json +++ b/test/integration/generated/datalakestorage/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/datalakestorage/src/dataLakeStorageClient.ts b/test/integration/generated/datalakestorage/src/dataLakeStorageClient.ts index a184c0d931..8c9d796331 100644 --- a/test/integration/generated/datalakestorage/src/dataLakeStorageClient.ts +++ b/test/integration/generated/datalakestorage/src/dataLakeStorageClient.ts @@ -6,12 +6,17 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { PathOperationsImpl } from "./operations"; import { PathOperations } from "./operationsInterfaces"; -import { DataLakeStorageClientContext } from "./dataLakeStorageClientContext"; import { DataLakeStorageClientOptionalParams } from "./models"; -export class DataLakeStorageClient extends DataLakeStorageClientContext { +export class DataLakeStorageClient extends coreClient.ServiceClient { + url: string; + fileSystem: string; + path: string; + version: string; + /** * Initializes a new instance of the DataLakeStorageClient class. * @param url The URL of the service account, container, or blob that is the target of the desired @@ -26,7 +31,46 @@ export class DataLakeStorageClient extends DataLakeStorageClientContext { path: string, options?: DataLakeStorageClientOptionalParams ) { - super(url, fileSystem, path, options); + if (url === undefined) { + throw new Error("'url' cannot be null"); + } + if (fileSystem === undefined) { + throw new Error("'fileSystem' cannot be null"); + } + if (path === undefined) { + throw new Error("'path' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: DataLakeStorageClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-datalakestorage/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{url}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.url = url; + this.fileSystem = fileSystem; + this.path = path; + + // Assigning values to Constant parameters + this.version = options.version || "2020-06-12"; this.pathOperations = new PathOperationsImpl(this); } diff --git a/test/integration/generated/datalakestorage/src/dataLakeStorageClientContext.ts b/test/integration/generated/datalakestorage/src/dataLakeStorageClientContext.ts deleted file mode 100644 index 14b4b5323f..0000000000 --- a/test/integration/generated/datalakestorage/src/dataLakeStorageClientContext.ts +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { DataLakeStorageClientOptionalParams } from "./models"; - -export class DataLakeStorageClientContext extends coreClient.ServiceClient { - url: string; - fileSystem: string; - path: string; - version: string; - - /** - * Initializes a new instance of the DataLakeStorageClientContext class. - * @param url The URL of the service account, container, or blob that is the target of the desired - * operation. - * @param fileSystem The filesystem identifier. - * @param path The file or directory path. - * @param options The parameter options - */ - constructor( - url: string, - fileSystem: string, - path: string, - options?: DataLakeStorageClientOptionalParams - ) { - if (url === undefined) { - throw new Error("'url' cannot be null"); - } - if (fileSystem === undefined) { - throw new Error("'fileSystem' cannot be null"); - } - if (path === undefined) { - throw new Error("'path' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: DataLakeStorageClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-datalakestorage/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{url}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.url = url; - this.fileSystem = fileSystem; - this.path = path; - - // Assigning values to Constant parameters - this.version = options.version || "2020-06-12"; - } -} diff --git a/test/integration/generated/datalakestorage/src/index.ts b/test/integration/generated/datalakestorage/src/index.ts index 07caa4aea1..86ed91eb8d 100644 --- a/test/integration/generated/datalakestorage/src/index.ts +++ b/test/integration/generated/datalakestorage/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { DataLakeStorageClient } from "./dataLakeStorageClient"; -export { DataLakeStorageClientContext } from "./dataLakeStorageClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/datalakestorage/src/operations/pathOperations.ts b/test/integration/generated/datalakestorage/src/operations/pathOperations.ts index 828b96d1b3..42ca61e490 100644 --- a/test/integration/generated/datalakestorage/src/operations/pathOperations.ts +++ b/test/integration/generated/datalakestorage/src/operations/pathOperations.ts @@ -11,7 +11,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DataLakeStorageClientContext } from "../dataLakeStorageClientContext"; +import { DataLakeStorageClient } from "../dataLakeStorageClient"; import { PathCreateOptionalParams, PathCreateResponse, @@ -32,13 +32,13 @@ import { /** Class containing PathOperations operations. */ export class PathOperationsImpl implements PathOperations { - private readonly client: DataLakeStorageClientContext; + private readonly client: DataLakeStorageClient; /** * Initialize a new instance of the class PathOperations class. * @param client Reference to the service client */ - constructor(client: DataLakeStorageClientContext) { + constructor(client: DataLakeStorageClient) { this.client = client; } diff --git a/test/integration/generated/deviceprovisioningservice/package.json b/test/integration/generated/deviceprovisioningservice/package.json index 8f9ad49eb5..ee28c2b8cb 100644 --- a/test/integration/generated/deviceprovisioningservice/package.json +++ b/test/integration/generated/deviceprovisioningservice/package.json @@ -28,7 +28,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClient.ts b/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClient.ts index 8cb7597144..27323a9fd9 100644 --- a/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClient.ts +++ b/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClient.ts @@ -1,3 +1,4 @@ +import * as coreClient from "@azure/core-client"; import { OperationsImpl, DpsCertificateImpl, @@ -8,10 +9,13 @@ import { DpsCertificate, IotDpsResource } from "./operationsInterfaces"; -import { DeviceProvisioningClientContext } from "./deviceProvisioningClientContext"; import { DeviceProvisioningClientOptionalParams } from "./models"; -export class DeviceProvisioningClient extends DeviceProvisioningClientContext { +export class DeviceProvisioningClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + /** * Initializes a new instance of the DeviceProvisioningClient class. * @param subscriptionId The subscription identifier. @@ -21,7 +25,39 @@ export class DeviceProvisioningClient extends DeviceProvisioningClientContext { subscriptionId: string, options?: DeviceProvisioningClientOptionalParams ) { - super(subscriptionId, options); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: DeviceProvisioningClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-deviceprovisioning/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2020-03-01"; this.operations = new OperationsImpl(this); this.dpsCertificate = new DpsCertificateImpl(this); this.iotDpsResource = new IotDpsResourceImpl(this); diff --git a/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClientContext.ts b/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClientContext.ts deleted file mode 100644 index 259062c40d..0000000000 --- a/test/integration/generated/deviceprovisioningservice/src/deviceProvisioningClientContext.ts +++ /dev/null @@ -1,52 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { DeviceProvisioningClientOptionalParams } from "./models"; - -export class DeviceProvisioningClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - - /** - * Initializes a new instance of the DeviceProvisioningClientContext class. - * @param subscriptionId The subscription identifier. - * @param options The parameter options - */ - constructor( - subscriptionId: string, - options?: DeviceProvisioningClientOptionalParams - ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: DeviceProvisioningClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-deviceprovisioning/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "https://management.azure.com" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2020-03-01"; - } -} diff --git a/test/integration/generated/deviceprovisioningservice/src/index.ts b/test/integration/generated/deviceprovisioningservice/src/index.ts index a929c661c4..f5f2b8298f 100644 --- a/test/integration/generated/deviceprovisioningservice/src/index.ts +++ b/test/integration/generated/deviceprovisioningservice/src/index.ts @@ -1,5 +1,4 @@ /// export * from "./models"; export { DeviceProvisioningClient } from "./deviceProvisioningClient"; -export { DeviceProvisioningClientContext } from "./deviceProvisioningClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/deviceprovisioningservice/src/operations/dpsCertificate.ts b/test/integration/generated/deviceprovisioningservice/src/operations/dpsCertificate.ts index ccc321a60f..7019560a01 100644 --- a/test/integration/generated/deviceprovisioningservice/src/operations/dpsCertificate.ts +++ b/test/integration/generated/deviceprovisioningservice/src/operations/dpsCertificate.ts @@ -2,7 +2,7 @@ import { DpsCertificate } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DeviceProvisioningClientContext } from "../deviceProvisioningClientContext"; +import { DeviceProvisioningClient } from "../deviceProvisioningClient"; import { DpsCertificateGetOptionalParams, DpsCertificateGetResponse, @@ -21,13 +21,13 @@ import { /** Class containing DpsCertificate operations. */ export class DpsCertificateImpl implements DpsCertificate { - private readonly client: DeviceProvisioningClientContext; + private readonly client: DeviceProvisioningClient; /** * Initialize a new instance of the class DpsCertificate class. * @param client Reference to the service client */ - constructor(client: DeviceProvisioningClientContext) { + constructor(client: DeviceProvisioningClient) { this.client = client; } diff --git a/test/integration/generated/deviceprovisioningservice/src/operations/iotDpsResource.ts b/test/integration/generated/deviceprovisioningservice/src/operations/iotDpsResource.ts index 5d745e2596..dd9eca6d7b 100644 --- a/test/integration/generated/deviceprovisioningservice/src/operations/iotDpsResource.ts +++ b/test/integration/generated/deviceprovisioningservice/src/operations/iotDpsResource.ts @@ -3,7 +3,7 @@ import { IotDpsResource } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DeviceProvisioningClientContext } from "../deviceProvisioningClientContext"; +import { DeviceProvisioningClient } from "../deviceProvisioningClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -59,13 +59,13 @@ import { /// /** Class containing IotDpsResource operations. */ export class IotDpsResourceImpl implements IotDpsResource { - private readonly client: DeviceProvisioningClientContext; + private readonly client: DeviceProvisioningClient; /** * Initialize a new instance of the class IotDpsResource class. * @param client Reference to the service client */ - constructor(client: DeviceProvisioningClientContext) { + constructor(client: DeviceProvisioningClient) { this.client = client; } diff --git a/test/integration/generated/deviceprovisioningservice/src/operations/operations.ts b/test/integration/generated/deviceprovisioningservice/src/operations/operations.ts index 72d0151c41..ceaf55b582 100644 --- a/test/integration/generated/deviceprovisioningservice/src/operations/operations.ts +++ b/test/integration/generated/deviceprovisioningservice/src/operations/operations.ts @@ -3,7 +3,7 @@ import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DeviceProvisioningClientContext } from "../deviceProvisioningClientContext"; +import { DeviceProvisioningClient } from "../deviceProvisioningClient"; import { Operation, OperationsListNextOptionalParams, @@ -15,13 +15,13 @@ import { /// /** Class containing Operations operations. */ export class OperationsImpl implements Operations { - private readonly client: DeviceProvisioningClientContext; + private readonly client: DeviceProvisioningClient; /** * Initialize a new instance of the class Operations class. * @param client Reference to the service client */ - constructor(client: DeviceProvisioningClientContext) { + constructor(client: DeviceProvisioningClient) { this.client = client; } diff --git a/test/integration/generated/domainservices/package.json b/test/integration/generated/domainservices/package.json index 81c6f15e69..ba2d3839f4 100644 --- a/test/integration/generated/domainservices/package.json +++ b/test/integration/generated/domainservices/package.json @@ -28,7 +28,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/domainservices/src/domainServicesClient.ts b/test/integration/generated/domainservices/src/domainServicesClient.ts index eee04e0d3c..6985cb7ad8 100644 --- a/test/integration/generated/domainservices/src/domainServicesClient.ts +++ b/test/integration/generated/domainservices/src/domainServicesClient.ts @@ -1,3 +1,4 @@ +import * as coreClient from "@azure/core-client"; import { DomainServiceOperationsImpl, DomainServicesImpl, @@ -10,10 +11,13 @@ import { OuContainerOperations, OuContainerOperationGrp } from "./operationsInterfaces"; -import { DomainServicesClientContext } from "./domainServicesClientContext"; import { DomainServicesClientOptionalParams } from "./models"; -export class DomainServicesClient extends DomainServicesClientContext { +export class DomainServicesClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + /** * Initializes a new instance of the DomainServicesClient class. * @param subscriptionId Gets subscription credentials which uniquely identify the Microsoft Azure @@ -24,7 +28,39 @@ export class DomainServicesClient extends DomainServicesClientContext { subscriptionId: string, options?: DomainServicesClientOptionalParams ) { - super(subscriptionId, options); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: DomainServicesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-domainservices/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-05-01"; this.domainServiceOperations = new DomainServiceOperationsImpl(this); this.domainServices = new DomainServicesImpl(this); this.ouContainerOperations = new OuContainerOperationsImpl(this); diff --git a/test/integration/generated/domainservices/src/domainServicesClientContext.ts b/test/integration/generated/domainservices/src/domainServicesClientContext.ts deleted file mode 100644 index daec055c22..0000000000 --- a/test/integration/generated/domainservices/src/domainServicesClientContext.ts +++ /dev/null @@ -1,53 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { DomainServicesClientOptionalParams } from "./models"; - -export class DomainServicesClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - - /** - * Initializes a new instance of the DomainServicesClientContext class. - * @param subscriptionId Gets subscription credentials which uniquely identify the Microsoft Azure - * subscription. The subscription ID forms part of the URI for every service call. - * @param options The parameter options - */ - constructor( - subscriptionId: string, - options?: DomainServicesClientOptionalParams - ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: DomainServicesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-domainservices/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "https://management.azure.com" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-05-01"; - } -} diff --git a/test/integration/generated/domainservices/src/index.ts b/test/integration/generated/domainservices/src/index.ts index 31102af5b9..e3344d212a 100644 --- a/test/integration/generated/domainservices/src/index.ts +++ b/test/integration/generated/domainservices/src/index.ts @@ -1,5 +1,4 @@ /// export * from "./models"; export { DomainServicesClient } from "./domainServicesClient"; -export { DomainServicesClientContext } from "./domainServicesClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/domainservices/src/operations/domainServiceOperations.ts b/test/integration/generated/domainservices/src/operations/domainServiceOperations.ts index 52c5e39a65..f25d89735d 100644 --- a/test/integration/generated/domainservices/src/operations/domainServiceOperations.ts +++ b/test/integration/generated/domainservices/src/operations/domainServiceOperations.ts @@ -3,7 +3,7 @@ import { DomainServiceOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DomainServicesClientContext } from "../domainServicesClientContext"; +import { DomainServicesClient } from "../domainServicesClient"; import { OperationEntity, DomainServiceOperationsListNextOptionalParams, @@ -15,13 +15,13 @@ import { /// /** Class containing DomainServiceOperations operations. */ export class DomainServiceOperationsImpl implements DomainServiceOperations { - private readonly client: DomainServicesClientContext; + private readonly client: DomainServicesClient; /** * Initialize a new instance of the class DomainServiceOperations class. * @param client Reference to the service client */ - constructor(client: DomainServicesClientContext) { + constructor(client: DomainServicesClient) { this.client = client; } diff --git a/test/integration/generated/domainservices/src/operations/domainServices.ts b/test/integration/generated/domainservices/src/operations/domainServices.ts index c910962f9d..79bd80bca7 100644 --- a/test/integration/generated/domainservices/src/operations/domainServices.ts +++ b/test/integration/generated/domainservices/src/operations/domainServices.ts @@ -3,7 +3,7 @@ import { DomainServices } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DomainServicesClientContext } from "../domainServicesClientContext"; +import { DomainServicesClient } from "../domainServicesClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -28,13 +28,13 @@ import { /// /** Class containing DomainServices operations. */ export class DomainServicesImpl implements DomainServices { - private readonly client: DomainServicesClientContext; + private readonly client: DomainServicesClient; /** * Initialize a new instance of the class DomainServices class. * @param client Reference to the service client */ - constructor(client: DomainServicesClientContext) { + constructor(client: DomainServicesClient) { this.client = client; } diff --git a/test/integration/generated/domainservices/src/operations/ouContainerOperationGrp.ts b/test/integration/generated/domainservices/src/operations/ouContainerOperationGrp.ts index 30bd2cbe4a..68fcc1eda3 100644 --- a/test/integration/generated/domainservices/src/operations/ouContainerOperationGrp.ts +++ b/test/integration/generated/domainservices/src/operations/ouContainerOperationGrp.ts @@ -3,7 +3,7 @@ import { OuContainerOperationGrp } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DomainServicesClientContext } from "../domainServicesClientContext"; +import { DomainServicesClient } from "../domainServicesClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -25,13 +25,13 @@ import { /// /** Class containing OuContainerOperationGrp operations. */ export class OuContainerOperationGrpImpl implements OuContainerOperationGrp { - private readonly client: DomainServicesClientContext; + private readonly client: DomainServicesClient; /** * Initialize a new instance of the class OuContainerOperationGrp class. * @param client Reference to the service client */ - constructor(client: DomainServicesClientContext) { + constructor(client: DomainServicesClient) { this.client = client; } diff --git a/test/integration/generated/domainservices/src/operations/ouContainerOperations.ts b/test/integration/generated/domainservices/src/operations/ouContainerOperations.ts index 19c20591c7..2d5f8e8c9e 100644 --- a/test/integration/generated/domainservices/src/operations/ouContainerOperations.ts +++ b/test/integration/generated/domainservices/src/operations/ouContainerOperations.ts @@ -3,7 +3,7 @@ import { OuContainerOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { DomainServicesClientContext } from "../domainServicesClientContext"; +import { DomainServicesClient } from "../domainServicesClient"; import { OperationEntity, OuContainerOperationsListNextOptionalParams, @@ -15,13 +15,13 @@ import { /// /** Class containing OuContainerOperations operations. */ export class OuContainerOperationsImpl implements OuContainerOperations { - private readonly client: DomainServicesClientContext; + private readonly client: DomainServicesClient; /** * Initialize a new instance of the class OuContainerOperations class. * @param client Reference to the service client */ - constructor(client: DomainServicesClientContext) { + constructor(client: DomainServicesClient) { this.client = client; } diff --git a/test/integration/generated/extensibleEnums/package.json b/test/integration/generated/extensibleEnums/package.json index 0e8c5cf64d..9e82c30418 100644 --- a/test/integration/generated/extensibleEnums/package.json +++ b/test/integration/generated/extensibleEnums/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/extensibleEnums/src/extensibleEnumsClient.ts b/test/integration/generated/extensibleEnums/src/extensibleEnumsClient.ts index e41c95b194..00ac9a1e71 100644 --- a/test/integration/generated/extensibleEnums/src/extensibleEnumsClient.ts +++ b/test/integration/generated/extensibleEnums/src/extensibleEnumsClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { PetImpl } from "./operations"; import { Pet } from "./operationsInterfaces"; -import { ExtensibleEnumsClientContext } from "./extensibleEnumsClientContext"; import { ExtensibleEnumsClientOptionalParams } from "./models"; -export class ExtensibleEnumsClient extends ExtensibleEnumsClientContext { +export class ExtensibleEnumsClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the ExtensibleEnumsClient class. * @param options The parameter options */ constructor(options?: ExtensibleEnumsClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ExtensibleEnumsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-extensible-enums/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.pet = new PetImpl(this); } diff --git a/test/integration/generated/extensibleEnums/src/extensibleEnumsClientContext.ts b/test/integration/generated/extensibleEnums/src/extensibleEnumsClientContext.ts deleted file mode 100644 index ba54981e06..0000000000 --- a/test/integration/generated/extensibleEnums/src/extensibleEnumsClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { ExtensibleEnumsClientOptionalParams } from "./models"; - -export class ExtensibleEnumsClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the ExtensibleEnumsClientContext class. - * @param options The parameter options - */ - constructor(options?: ExtensibleEnumsClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ExtensibleEnumsClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-extensible-enums/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/extensibleEnums/src/index.ts b/test/integration/generated/extensibleEnums/src/index.ts index f2c01f11e9..f83c5a384b 100644 --- a/test/integration/generated/extensibleEnums/src/index.ts +++ b/test/integration/generated/extensibleEnums/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { ExtensibleEnumsClient } from "./extensibleEnumsClient"; -export { ExtensibleEnumsClientContext } from "./extensibleEnumsClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/extensibleEnums/src/operations/pet.ts b/test/integration/generated/extensibleEnums/src/operations/pet.ts index 7532940efa..d7899adfe6 100644 --- a/test/integration/generated/extensibleEnums/src/operations/pet.ts +++ b/test/integration/generated/extensibleEnums/src/operations/pet.ts @@ -10,7 +10,7 @@ import { Pet } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ExtensibleEnumsClientContext } from "../extensibleEnumsClientContext"; +import { ExtensibleEnumsClient } from "../extensibleEnumsClient"; import { PetGetByPetIdOptionalParams, PetGetByPetIdResponse, @@ -20,13 +20,13 @@ import { /** Class containing Pet operations. */ export class PetImpl implements Pet { - private readonly client: ExtensibleEnumsClientContext; + private readonly client: ExtensibleEnumsClient; /** * Initialize a new instance of the class Pet class. * @param client Reference to the service client */ - constructor(client: ExtensibleEnumsClientContext) { + constructor(client: ExtensibleEnumsClient) { this.client = client; } diff --git a/test/integration/generated/header/package.json b/test/integration/generated/header/package.json index 6da966a730..088c06e90a 100644 --- a/test/integration/generated/header/package.json +++ b/test/integration/generated/header/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/header/src/headerClient.ts b/test/integration/generated/header/src/headerClient.ts index 4961d84ae6..a7c9539531 100644 --- a/test/integration/generated/header/src/headerClient.ts +++ b/test/integration/generated/header/src/headerClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { HeaderImpl } from "./operations"; import { Header } from "./operationsInterfaces"; -import { HeaderClientContext } from "./headerClientContext"; import { HeaderClientOptionalParams } from "./models"; -export class HeaderClient extends HeaderClientContext { +export class HeaderClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the HeaderClient class. * @param options The parameter options */ constructor(options?: HeaderClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: HeaderClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-header/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.header = new HeaderImpl(this); } diff --git a/test/integration/generated/header/src/headerClientContext.ts b/test/integration/generated/header/src/headerClientContext.ts deleted file mode 100644 index 006744976e..0000000000 --- a/test/integration/generated/header/src/headerClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { HeaderClientOptionalParams } from "./models"; - -export class HeaderClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the HeaderClientContext class. - * @param options The parameter options - */ - constructor(options?: HeaderClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: HeaderClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-header/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/header/src/index.ts b/test/integration/generated/header/src/index.ts index c2de3665b6..1b243561aa 100644 --- a/test/integration/generated/header/src/index.ts +++ b/test/integration/generated/header/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { HeaderClient } from "./headerClient"; -export { HeaderClientContext } from "./headerClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/header/src/operations/header.ts b/test/integration/generated/header/src/operations/header.ts index 95c99291bd..e2c1bc6f49 100644 --- a/test/integration/generated/header/src/operations/header.ts +++ b/test/integration/generated/header/src/operations/header.ts @@ -10,7 +10,7 @@ import { Header } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HeaderClientContext } from "../headerClientContext"; +import { HeaderClient } from "../headerClient"; import { HeaderParamExistingKeyOptionalParams, HeaderResponseExistingKeyOptionalParams, @@ -59,13 +59,13 @@ import { /** Class containing Header operations. */ export class HeaderImpl implements Header { - private readonly client: HeaderClientContext; + private readonly client: HeaderClient; /** * Initialize a new instance of the class Header class. * @param client Reference to the service client */ - constructor(client: HeaderClientContext) { + constructor(client: HeaderClient) { this.client = client; } diff --git a/test/integration/generated/headerRest/package.json b/test/integration/generated/headerRest/package.json index 3f41cd67aa..5178094b36 100644 --- a/test/integration/generated/headerRest/package.json +++ b/test/integration/generated/headerRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/headerRest/src/headerRestClient.ts b/test/integration/generated/headerRest/src/headerRestClient.ts index 2fc94280da..5a4a468891 100644 --- a/test/integration/generated/headerRest/src/headerRestClient.ts +++ b/test/integration/generated/headerRest/src/headerRestClient.ts @@ -378,9 +378,7 @@ export default function HeaderRestClient( ): HeaderRestClientRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - return getClient( - baseUrl, + const client = getClient(baseUrl, options) as HeaderRestClientRestClient; - options - ) as HeaderRestClientRestClient; + return client; } diff --git a/test/integration/generated/headerRest/tsconfig.json b/test/integration/generated/headerRest/tsconfig.json index 965341beea..0202cc6570 100644 --- a/test/integration/generated/headerRest/tsconfig.json +++ b/test/integration/generated/headerRest/tsconfig.json @@ -7,13 +7,5 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/test/integration/generated/headerprefix/package.json b/test/integration/generated/headerprefix/package.json index ce17373449..49a418981e 100644 --- a/test/integration/generated/headerprefix/package.json +++ b/test/integration/generated/headerprefix/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/headerprefix/src/headerPrefixClient.ts b/test/integration/generated/headerprefix/src/headerPrefixClient.ts index 4ada0be49c..7fbc8c420c 100644 --- a/test/integration/generated/headerprefix/src/headerPrefixClient.ts +++ b/test/integration/generated/headerprefix/src/headerPrefixClient.ts @@ -1,16 +1,46 @@ +import * as coreClient from "@azure/core-client"; import { QueueImpl } from "./operations"; import { Queue } from "./operationsInterfaces"; -import { HeaderPrefixClientContext } from "./headerPrefixClientContext"; import { HeaderPrefixClientOptionalParams } from "./models"; -export class HeaderPrefixClient extends HeaderPrefixClientContext { +export class HeaderPrefixClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the HeaderPrefixClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: HeaderPrefixClientOptionalParams) { - super($host, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: HeaderPrefixClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-headerprefix/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; this.queue = new QueueImpl(this); } diff --git a/test/integration/generated/headerprefix/src/headerPrefixClientContext.ts b/test/integration/generated/headerprefix/src/headerPrefixClientContext.ts deleted file mode 100644 index 56475ed25c..0000000000 --- a/test/integration/generated/headerprefix/src/headerPrefixClientContext.ts +++ /dev/null @@ -1,43 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { HeaderPrefixClientOptionalParams } from "./models"; - -export class HeaderPrefixClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the HeaderPrefixClientContext class. - * @param $host server parameter - * @param options The parameter options - */ - constructor($host: string, options?: HeaderPrefixClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: HeaderPrefixClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-headerprefix/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - } -} diff --git a/test/integration/generated/headerprefix/src/index.ts b/test/integration/generated/headerprefix/src/index.ts index 713356a81b..73dc28c465 100644 --- a/test/integration/generated/headerprefix/src/index.ts +++ b/test/integration/generated/headerprefix/src/index.ts @@ -1,4 +1,3 @@ export * from "./models"; export { HeaderPrefixClient } from "./headerPrefixClient"; -export { HeaderPrefixClientContext } from "./headerPrefixClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/headerprefix/src/operations/queue.ts b/test/integration/generated/headerprefix/src/operations/queue.ts index 7b628af63b..3e1b090d7b 100644 --- a/test/integration/generated/headerprefix/src/operations/queue.ts +++ b/test/integration/generated/headerprefix/src/operations/queue.ts @@ -2,7 +2,7 @@ import { Queue } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HeaderPrefixClientContext } from "../headerPrefixClientContext"; +import { HeaderPrefixClient } from "../headerPrefixClient"; import { QueueGetPropertiesOptionalParams, QueueGetPropertiesResponse @@ -10,13 +10,13 @@ import { /** Class containing Queue operations. */ export class QueueImpl implements Queue { - private readonly client: HeaderPrefixClientContext; + private readonly client: HeaderPrefixClient; /** * Initialize a new instance of the class Queue class. * @param client Reference to the service client */ - constructor(client: HeaderPrefixClientContext) { + constructor(client: HeaderPrefixClient) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/package.json b/test/integration/generated/healthcareapis/package.json index 1f7652f176..c962f9a8a8 100644 --- a/test/integration/generated/healthcareapis/package.json +++ b/test/integration/generated/healthcareapis/package.json @@ -28,7 +28,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/healthcareapis/src/healthCareApisClient.ts b/test/integration/generated/healthcareapis/src/healthCareApisClient.ts index 6bbd563001..6dabc217b5 100644 --- a/test/integration/generated/healthcareapis/src/healthCareApisClient.ts +++ b/test/integration/generated/healthcareapis/src/healthCareApisClient.ts @@ -1,3 +1,4 @@ +import * as coreClient from "@azure/core-client"; import { ServicesImpl, PrivateEndpointConnectionsImpl, @@ -24,10 +25,13 @@ import { Operations, OperationResults } from "./operationsInterfaces"; -import { HealthCareApisClientContext } from "./healthCareApisClientContext"; import { HealthCareApisClientOptionalParams } from "./models"; -export class HealthCareApisClient extends HealthCareApisClientContext { +export class HealthCareApisClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + /** * Initializes a new instance of the HealthCareApisClient class. * @param subscriptionId The subscription identifier. @@ -37,7 +41,42 @@ export class HealthCareApisClient extends HealthCareApisClientContext { subscriptionId: string, options?: HealthCareApisClientOptionalParams ) { - super(subscriptionId, options); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: HealthCareApisClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-healthcareapis/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + if (!options.credentialScopes) { + options.credentialScopes = ["https://management.azure.com/.default"]; + } + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2021-06-01-preview"; this.services = new ServicesImpl(this); this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this); this.privateLinkResources = new PrivateLinkResourcesImpl(this); diff --git a/test/integration/generated/healthcareapis/src/healthCareApisClientContext.ts b/test/integration/generated/healthcareapis/src/healthCareApisClientContext.ts deleted file mode 100644 index b5ebd85a40..0000000000 --- a/test/integration/generated/healthcareapis/src/healthCareApisClientContext.ts +++ /dev/null @@ -1,55 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { HealthCareApisClientOptionalParams } from "./models"; - -export class HealthCareApisClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - - /** - * Initializes a new instance of the HealthCareApisClientContext class. - * @param subscriptionId The subscription identifier. - * @param options The parameter options - */ - constructor( - subscriptionId: string, - options?: HealthCareApisClientOptionalParams - ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: HealthCareApisClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-healthcareapis/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - if (!options.credentialScopes) { - options.credentialScopes = ["https://management.azure.com/.default"]; - } - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "https://management.azure.com" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2021-06-01-preview"; - } -} diff --git a/test/integration/generated/healthcareapis/src/index.ts b/test/integration/generated/healthcareapis/src/index.ts index 39a782e8b3..687695883e 100644 --- a/test/integration/generated/healthcareapis/src/index.ts +++ b/test/integration/generated/healthcareapis/src/index.ts @@ -1,5 +1,4 @@ /// export * from "./models"; export { HealthCareApisClient } from "./healthCareApisClient"; -export { HealthCareApisClientContext } from "./healthCareApisClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/healthcareapis/src/operations/dicomServices.ts b/test/integration/generated/healthcareapis/src/operations/dicomServices.ts index a30ca4a0ec..44458f3f2a 100644 --- a/test/integration/generated/healthcareapis/src/operations/dicomServices.ts +++ b/test/integration/generated/healthcareapis/src/operations/dicomServices.ts @@ -3,7 +3,7 @@ import { DicomServices } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClientContext } from "../healthCareApisClientContext"; +import { HealthCareApisClient } from "../healthCareApisClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -25,13 +25,13 @@ import { /// /** Class containing DicomServices operations. */ export class DicomServicesImpl implements DicomServices { - private readonly client: HealthCareApisClientContext; + private readonly client: HealthCareApisClient; /** * Initialize a new instance of the class DicomServices class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClientContext) { + constructor(client: HealthCareApisClient) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/fhirDestinations.ts b/test/integration/generated/healthcareapis/src/operations/fhirDestinations.ts index d8b8a06c10..b475905401 100644 --- a/test/integration/generated/healthcareapis/src/operations/fhirDestinations.ts +++ b/test/integration/generated/healthcareapis/src/operations/fhirDestinations.ts @@ -3,7 +3,7 @@ import { FhirDestinations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClientContext } from "../healthCareApisClientContext"; +import { HealthCareApisClient } from "../healthCareApisClient"; import { IotFhirDestination, FhirDestinationsListByIotConnectorNextOptionalParams, @@ -15,13 +15,13 @@ import { /// /** Class containing FhirDestinations operations. */ export class FhirDestinationsImpl implements FhirDestinations { - private readonly client: HealthCareApisClientContext; + private readonly client: HealthCareApisClient; /** * Initialize a new instance of the class FhirDestinations class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClientContext) { + constructor(client: HealthCareApisClient) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/fhirServices.ts b/test/integration/generated/healthcareapis/src/operations/fhirServices.ts index a333394424..4e821f0a5d 100644 --- a/test/integration/generated/healthcareapis/src/operations/fhirServices.ts +++ b/test/integration/generated/healthcareapis/src/operations/fhirServices.ts @@ -3,7 +3,7 @@ import { FhirServices } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClientContext } from "../healthCareApisClientContext"; +import { HealthCareApisClient } from "../healthCareApisClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -25,13 +25,13 @@ import { /// /** Class containing FhirServices operations. */ export class FhirServicesImpl implements FhirServices { - private readonly client: HealthCareApisClientContext; + private readonly client: HealthCareApisClient; /** * Initialize a new instance of the class FhirServices class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClientContext) { + constructor(client: HealthCareApisClient) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/iotConnectorFhirDestination.ts b/test/integration/generated/healthcareapis/src/operations/iotConnectorFhirDestination.ts index 9f21f417b6..437a6fdfc2 100644 --- a/test/integration/generated/healthcareapis/src/operations/iotConnectorFhirDestination.ts +++ b/test/integration/generated/healthcareapis/src/operations/iotConnectorFhirDestination.ts @@ -2,7 +2,7 @@ import { IotConnectorFhirDestination } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClientContext } from "../healthCareApisClientContext"; +import { HealthCareApisClient } from "../healthCareApisClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -17,13 +17,13 @@ import { /** Class containing IotConnectorFhirDestination operations. */ export class IotConnectorFhirDestinationImpl implements IotConnectorFhirDestination { - private readonly client: HealthCareApisClientContext; + private readonly client: HealthCareApisClient; /** * Initialize a new instance of the class IotConnectorFhirDestination class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClientContext) { + constructor(client: HealthCareApisClient) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/iotConnectors.ts b/test/integration/generated/healthcareapis/src/operations/iotConnectors.ts index 140021b2fe..47a34b60e3 100644 --- a/test/integration/generated/healthcareapis/src/operations/iotConnectors.ts +++ b/test/integration/generated/healthcareapis/src/operations/iotConnectors.ts @@ -3,7 +3,7 @@ import { IotConnectors } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClientContext } from "../healthCareApisClientContext"; +import { HealthCareApisClient } from "../healthCareApisClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -25,13 +25,13 @@ import { /// /** Class containing IotConnectors operations. */ export class IotConnectorsImpl implements IotConnectors { - private readonly client: HealthCareApisClientContext; + private readonly client: HealthCareApisClient; /** * Initialize a new instance of the class IotConnectors class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClientContext) { + constructor(client: HealthCareApisClient) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/operationResults.ts b/test/integration/generated/healthcareapis/src/operations/operationResults.ts index 07eece35f8..b8d56faba1 100644 --- a/test/integration/generated/healthcareapis/src/operations/operationResults.ts +++ b/test/integration/generated/healthcareapis/src/operations/operationResults.ts @@ -2,7 +2,7 @@ import { OperationResults } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClientContext } from "../healthCareApisClientContext"; +import { HealthCareApisClient } from "../healthCareApisClient"; import { OperationResultsGetOptionalParams, OperationResultsGetResponse @@ -10,13 +10,13 @@ import { /** Class containing OperationResults operations. */ export class OperationResultsImpl implements OperationResults { - private readonly client: HealthCareApisClientContext; + private readonly client: HealthCareApisClient; /** * Initialize a new instance of the class OperationResults class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClientContext) { + constructor(client: HealthCareApisClient) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/operations.ts b/test/integration/generated/healthcareapis/src/operations/operations.ts index b15f4b69da..480af1aa3c 100644 --- a/test/integration/generated/healthcareapis/src/operations/operations.ts +++ b/test/integration/generated/healthcareapis/src/operations/operations.ts @@ -3,7 +3,7 @@ import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClientContext } from "../healthCareApisClientContext"; +import { HealthCareApisClient } from "../healthCareApisClient"; import { OperationDetail, OperationsListNextOptionalParams, @@ -15,13 +15,13 @@ import { /// /** Class containing Operations operations. */ export class OperationsImpl implements Operations { - private readonly client: HealthCareApisClientContext; + private readonly client: HealthCareApisClient; /** * Initialize a new instance of the class Operations class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClientContext) { + constructor(client: HealthCareApisClient) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/privateEndpointConnections.ts b/test/integration/generated/healthcareapis/src/operations/privateEndpointConnections.ts index e23dad8d5c..6eab9933ef 100644 --- a/test/integration/generated/healthcareapis/src/operations/privateEndpointConnections.ts +++ b/test/integration/generated/healthcareapis/src/operations/privateEndpointConnections.ts @@ -3,7 +3,7 @@ import { PrivateEndpointConnections } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClientContext } from "../healthCareApisClientContext"; +import { HealthCareApisClient } from "../healthCareApisClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -22,13 +22,13 @@ import { /** Class containing PrivateEndpointConnections operations. */ export class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections { - private readonly client: HealthCareApisClientContext; + private readonly client: HealthCareApisClient; /** * Initialize a new instance of the class PrivateEndpointConnections class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClientContext) { + constructor(client: HealthCareApisClient) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/privateLinkResources.ts b/test/integration/generated/healthcareapis/src/operations/privateLinkResources.ts index f1cf4dc882..5e1e584dce 100644 --- a/test/integration/generated/healthcareapis/src/operations/privateLinkResources.ts +++ b/test/integration/generated/healthcareapis/src/operations/privateLinkResources.ts @@ -2,7 +2,7 @@ import { PrivateLinkResources } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClientContext } from "../healthCareApisClientContext"; +import { HealthCareApisClient } from "../healthCareApisClient"; import { PrivateLinkResourcesListByServiceOptionalParams, PrivateLinkResourcesListByServiceResponse, @@ -12,13 +12,13 @@ import { /** Class containing PrivateLinkResources operations. */ export class PrivateLinkResourcesImpl implements PrivateLinkResources { - private readonly client: HealthCareApisClientContext; + private readonly client: HealthCareApisClient; /** * Initialize a new instance of the class PrivateLinkResources class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClientContext) { + constructor(client: HealthCareApisClient) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/services.ts b/test/integration/generated/healthcareapis/src/operations/services.ts index fcdbe389b4..e35932fd9b 100644 --- a/test/integration/generated/healthcareapis/src/operations/services.ts +++ b/test/integration/generated/healthcareapis/src/operations/services.ts @@ -3,7 +3,7 @@ import { Services } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClientContext } from "../healthCareApisClientContext"; +import { HealthCareApisClient } from "../healthCareApisClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -32,13 +32,13 @@ import { /// /** Class containing Services operations. */ export class ServicesImpl implements Services { - private readonly client: HealthCareApisClientContext; + private readonly client: HealthCareApisClient; /** * Initialize a new instance of the class Services class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClientContext) { + constructor(client: HealthCareApisClient) { this.client = client; } diff --git a/test/integration/generated/healthcareapis/src/operations/workspaces.ts b/test/integration/generated/healthcareapis/src/operations/workspaces.ts index b76ab962c7..7ebfa6c2e9 100644 --- a/test/integration/generated/healthcareapis/src/operations/workspaces.ts +++ b/test/integration/generated/healthcareapis/src/operations/workspaces.ts @@ -3,7 +3,7 @@ import { Workspaces } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HealthCareApisClientContext } from "../healthCareApisClientContext"; +import { HealthCareApisClient } from "../healthCareApisClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -29,13 +29,13 @@ import { /// /** Class containing Workspaces operations. */ export class WorkspacesImpl implements Workspaces { - private readonly client: HealthCareApisClientContext; + private readonly client: HealthCareApisClient; /** * Initialize a new instance of the class Workspaces class. * @param client Reference to the service client */ - constructor(client: HealthCareApisClientContext) { + constructor(client: HealthCareApisClient) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/package.json b/test/integration/generated/httpInfrastructure/package.json index 5a79cf3bd8..130d4bed7a 100644 --- a/test/integration/generated/httpInfrastructure/package.json +++ b/test/integration/generated/httpInfrastructure/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/httpInfrastructure/src/httpInfrastructureClient.ts b/test/integration/generated/httpInfrastructure/src/httpInfrastructureClient.ts index e5660a8ed5..a87b6480cd 100644 --- a/test/integration/generated/httpInfrastructure/src/httpInfrastructureClient.ts +++ b/test/integration/generated/httpInfrastructure/src/httpInfrastructureClient.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { HttpFailureImpl, HttpSuccessImpl, @@ -24,16 +25,42 @@ import { HttpRetry, MultipleResponses } from "./operationsInterfaces"; -import { HttpInfrastructureClientContext } from "./httpInfrastructureClientContext"; import { HttpInfrastructureClientOptionalParams } from "./models"; -export class HttpInfrastructureClient extends HttpInfrastructureClientContext { +export class HttpInfrastructureClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the HttpInfrastructureClient class. * @param options The parameter options */ constructor(options?: HttpInfrastructureClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: HttpInfrastructureClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-httpInfrastructure/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.httpFailure = new HttpFailureImpl(this); this.httpSuccess = new HttpSuccessImpl(this); this.httpRedirects = new HttpRedirectsImpl(this); diff --git a/test/integration/generated/httpInfrastructure/src/httpInfrastructureClientContext.ts b/test/integration/generated/httpInfrastructure/src/httpInfrastructureClientContext.ts deleted file mode 100644 index 21f5b6d0fe..0000000000 --- a/test/integration/generated/httpInfrastructure/src/httpInfrastructureClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { HttpInfrastructureClientOptionalParams } from "./models"; - -export class HttpInfrastructureClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the HttpInfrastructureClientContext class. - * @param options The parameter options - */ - constructor(options?: HttpInfrastructureClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: HttpInfrastructureClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-httpInfrastructure/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/httpInfrastructure/src/index.ts b/test/integration/generated/httpInfrastructure/src/index.ts index d263c8afe4..425fda045e 100644 --- a/test/integration/generated/httpInfrastructure/src/index.ts +++ b/test/integration/generated/httpInfrastructure/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { HttpInfrastructureClient } from "./httpInfrastructureClient"; -export { HttpInfrastructureClientContext } from "./httpInfrastructureClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/httpInfrastructure/src/operations/httpClientFailure.ts b/test/integration/generated/httpInfrastructure/src/operations/httpClientFailure.ts index 5d04c7ebf4..ce69c9b68c 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/httpClientFailure.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/httpClientFailure.ts @@ -10,7 +10,7 @@ import { HttpClientFailure } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; +import { HttpInfrastructureClient } from "../httpInfrastructureClient"; import { HttpClientFailureHead400OptionalParams, HttpClientFailureGet400OptionalParams, @@ -42,13 +42,13 @@ import { /** Class containing HttpClientFailure operations. */ export class HttpClientFailureImpl implements HttpClientFailure { - private readonly client: HttpInfrastructureClientContext; + private readonly client: HttpInfrastructureClient; /** * Initialize a new instance of the class HttpClientFailure class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClientContext) { + constructor(client: HttpInfrastructureClient) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/src/operations/httpFailure.ts b/test/integration/generated/httpInfrastructure/src/operations/httpFailure.ts index 98e85a9db9..fd7a75519d 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/httpFailure.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/httpFailure.ts @@ -10,7 +10,7 @@ import { HttpFailure } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; +import { HttpInfrastructureClient } from "../httpInfrastructureClient"; import { HttpFailureGetEmptyErrorOptionalParams, HttpFailureGetEmptyErrorResponse, @@ -22,13 +22,13 @@ import { /** Class containing HttpFailure operations. */ export class HttpFailureImpl implements HttpFailure { - private readonly client: HttpInfrastructureClientContext; + private readonly client: HttpInfrastructureClient; /** * Initialize a new instance of the class HttpFailure class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClientContext) { + constructor(client: HttpInfrastructureClient) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/src/operations/httpRedirects.ts b/test/integration/generated/httpInfrastructure/src/operations/httpRedirects.ts index ac8d3b7200..662281317f 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/httpRedirects.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/httpRedirects.ts @@ -10,7 +10,7 @@ import { HttpRedirects } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; +import { HttpInfrastructureClient } from "../httpInfrastructureClient"; import { HttpRedirectsHead300OptionalParams, HttpRedirectsHead300Response, @@ -48,13 +48,13 @@ import { /** Class containing HttpRedirects operations. */ export class HttpRedirectsImpl implements HttpRedirects { - private readonly client: HttpInfrastructureClientContext; + private readonly client: HttpInfrastructureClient; /** * Initialize a new instance of the class HttpRedirects class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClientContext) { + constructor(client: HttpInfrastructureClient) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/src/operations/httpRetry.ts b/test/integration/generated/httpInfrastructure/src/operations/httpRetry.ts index 1a848cbb4d..1d263597bb 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/httpRetry.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/httpRetry.ts @@ -10,7 +10,7 @@ import { HttpRetry } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; +import { HttpInfrastructureClient } from "../httpInfrastructureClient"; import { HttpRetryHead408OptionalParams, HttpRetryPut500OptionalParams, @@ -26,13 +26,13 @@ import { /** Class containing HttpRetry operations. */ export class HttpRetryImpl implements HttpRetry { - private readonly client: HttpInfrastructureClientContext; + private readonly client: HttpInfrastructureClient; /** * Initialize a new instance of the class HttpRetry class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClientContext) { + constructor(client: HttpInfrastructureClient) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/src/operations/httpServerFailure.ts b/test/integration/generated/httpInfrastructure/src/operations/httpServerFailure.ts index 3d9df38a76..aa1b7a3360 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/httpServerFailure.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/httpServerFailure.ts @@ -10,7 +10,7 @@ import { HttpServerFailure } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; +import { HttpInfrastructureClient } from "../httpInfrastructureClient"; import { HttpServerFailureHead501OptionalParams, HttpServerFailureGet501OptionalParams, @@ -20,13 +20,13 @@ import { /** Class containing HttpServerFailure operations. */ export class HttpServerFailureImpl implements HttpServerFailure { - private readonly client: HttpInfrastructureClientContext; + private readonly client: HttpInfrastructureClient; /** * Initialize a new instance of the class HttpServerFailure class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClientContext) { + constructor(client: HttpInfrastructureClient) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/src/operations/httpSuccess.ts b/test/integration/generated/httpInfrastructure/src/operations/httpSuccess.ts index be40a73b1a..79d424fb19 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/httpSuccess.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/httpSuccess.ts @@ -10,7 +10,7 @@ import { HttpSuccess } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; +import { HttpInfrastructureClient } from "../httpInfrastructureClient"; import { HttpSuccessHead200OptionalParams, HttpSuccessGet200OptionalParams, @@ -37,13 +37,13 @@ import { /** Class containing HttpSuccess operations. */ export class HttpSuccessImpl implements HttpSuccess { - private readonly client: HttpInfrastructureClientContext; + private readonly client: HttpInfrastructureClient; /** * Initialize a new instance of the class HttpSuccess class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClientContext) { + constructor(client: HttpInfrastructureClient) { this.client = client; } diff --git a/test/integration/generated/httpInfrastructure/src/operations/multipleResponses.ts b/test/integration/generated/httpInfrastructure/src/operations/multipleResponses.ts index 226a4d9767..19ff583cb8 100644 --- a/test/integration/generated/httpInfrastructure/src/operations/multipleResponses.ts +++ b/test/integration/generated/httpInfrastructure/src/operations/multipleResponses.ts @@ -10,7 +10,7 @@ import { MultipleResponses } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { HttpInfrastructureClientContext } from "../httpInfrastructureClientContext"; +import { HttpInfrastructureClient } from "../httpInfrastructureClient"; import { MultipleResponsesGet200Model204NoModelDefaultError200ValidOptionalParams, MultipleResponsesGet200Model204NoModelDefaultError200ValidResponse, @@ -71,13 +71,13 @@ import { /** Class containing MultipleResponses operations. */ export class MultipleResponsesImpl implements MultipleResponses { - private readonly client: HttpInfrastructureClientContext; + private readonly client: HttpInfrastructureClient; /** * Initialize a new instance of the class MultipleResponses class. * @param client Reference to the service client */ - constructor(client: HttpInfrastructureClientContext) { + constructor(client: HttpInfrastructureClient) { this.client = client; } diff --git a/test/integration/generated/iotspaces/package.json b/test/integration/generated/iotspaces/package.json index ed59983279..cb4d211f34 100644 --- a/test/integration/generated/iotspaces/package.json +++ b/test/integration/generated/iotspaces/package.json @@ -26,7 +26,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/iotspaces/src/index.ts b/test/integration/generated/iotspaces/src/index.ts index a02f095e88..32c8a83adc 100644 --- a/test/integration/generated/iotspaces/src/index.ts +++ b/test/integration/generated/iotspaces/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { IoTSpacesClient } from "./ioTSpacesClient"; -export { IoTSpacesClientContext } from "./ioTSpacesClientContext"; diff --git a/test/integration/generated/iotspaces/src/ioTSpacesClient.ts b/test/integration/generated/iotspaces/src/ioTSpacesClient.ts index 22d92e7a5c..3d0decd5d8 100644 --- a/test/integration/generated/iotspaces/src/ioTSpacesClient.ts +++ b/test/integration/generated/iotspaces/src/ioTSpacesClient.ts @@ -6,11 +6,11 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import * as coreAuth from "@azure/core-auth"; -import { IoTSpacesClientContext } from "./ioTSpacesClientContext"; import { IoTSpacesClientOptionalParams } from "./models"; -export class IoTSpacesClient extends IoTSpacesClientContext { +export class IoTSpacesClient extends coreClient.ServiceClient { /** * Initializes a new instance of the IoTSpacesClient class. * @param credentials Subscription credentials which uniquely identify client subscription. @@ -20,6 +20,33 @@ export class IoTSpacesClient extends IoTSpacesClientContext { credentials: coreAuth.TokenCredential, options?: IoTSpacesClientOptionalParams ) { - super(credentials, options); + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: IoTSpacesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-iotspaces/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint + }; + super(optionsWithDefaults); } } diff --git a/test/integration/generated/iotspaces/src/ioTSpacesClientContext.ts b/test/integration/generated/iotspaces/src/ioTSpacesClientContext.ts deleted file mode 100644 index 228bdb6c0c..0000000000 --- a/test/integration/generated/iotspaces/src/ioTSpacesClientContext.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import * as coreAuth from "@azure/core-auth"; -import { IoTSpacesClientOptionalParams } from "./models"; - -export class IoTSpacesClientContext extends coreClient.ServiceClient { - /** - * Initializes a new instance of the IoTSpacesClientContext class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param options The parameter options - */ - constructor( - credentials: coreAuth.TokenCredential, - options?: IoTSpacesClientOptionalParams - ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: IoTSpacesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials - }; - - const packageDetails = `azsdk-js-iotspaces/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint - }; - super(optionsWithDefaults); - } -} diff --git a/test/integration/generated/licenseHeader/package.json b/test/integration/generated/licenseHeader/package.json index 8f787ab82d..477a603c11 100644 --- a/test/integration/generated/licenseHeader/package.json +++ b/test/integration/generated/licenseHeader/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/licenseHeader/src/index.ts b/test/integration/generated/licenseHeader/src/index.ts index e6fa479580..181cd20786 100644 --- a/test/integration/generated/licenseHeader/src/index.ts +++ b/test/integration/generated/licenseHeader/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { LicenseHeaderClient } from "./licenseHeaderClient"; -export { LicenseHeaderClientContext } from "./licenseHeaderClientContext"; diff --git a/test/integration/generated/licenseHeader/src/licenseHeaderClient.ts b/test/integration/generated/licenseHeader/src/licenseHeaderClient.ts index ebb4afd0f7..e208ae03cf 100644 --- a/test/integration/generated/licenseHeader/src/licenseHeaderClient.ts +++ b/test/integration/generated/licenseHeader/src/licenseHeaderClient.ts @@ -8,15 +8,17 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; -import { LicenseHeaderClientContext } from "./licenseHeaderClientContext"; import { - LicenseHeaderClientOptionalParams, Enum0, + LicenseHeaderClientOptionalParams, ApiV1ValueGetOptionalParams, ApiV1ValueGetResponse } from "./models"; -export class LicenseHeaderClient extends LicenseHeaderClientContext { +export class LicenseHeaderClient extends coreClient.ServiceClient { + $host: string; + apiVersion: Enum0; + /** * Initializes a new instance of the LicenseHeaderClient class. * @param $host server parameter @@ -28,7 +30,39 @@ export class LicenseHeaderClient extends LicenseHeaderClientContext { apiVersion: Enum0, options?: LicenseHeaderClientOptionalParams ) { - super($host, apiVersion, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: LicenseHeaderClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-license-header/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + this.apiVersion = apiVersion; } /** @param options The options parameters. */ diff --git a/test/integration/generated/licenseHeader/src/licenseHeaderClientContext.ts b/test/integration/generated/licenseHeader/src/licenseHeaderClientContext.ts deleted file mode 100644 index 120d30bba8..0000000000 --- a/test/integration/generated/licenseHeader/src/licenseHeaderClientContext.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { Enum0, LicenseHeaderClientOptionalParams } from "./models"; - -export class LicenseHeaderClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: Enum0; - - /** - * Initializes a new instance of the LicenseHeaderClientContext class. - * @param $host server parameter - * @param apiVersion - * @param options The parameter options - */ - constructor( - $host: string, - apiVersion: Enum0, - options?: LicenseHeaderClientOptionalParams - ) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: LicenseHeaderClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-license-header/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - this.apiVersion = apiVersion; - } -} diff --git a/test/integration/generated/lro/package.json b/test/integration/generated/lro/package.json index ae8effe779..b5de598e86 100644 --- a/test/integration/generated/lro/package.json +++ b/test/integration/generated/lro/package.json @@ -27,7 +27,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/lro/src/index.ts b/test/integration/generated/lro/src/index.ts index 158aab4da2..b90ec9ab9c 100644 --- a/test/integration/generated/lro/src/index.ts +++ b/test/integration/generated/lro/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { LROClient } from "./lROClient"; -export { LROClientContext } from "./lROClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/lro/src/lROClient.ts b/test/integration/generated/lro/src/lROClient.ts index c1bad98f69..48543e5e78 100644 --- a/test/integration/generated/lro/src/lROClient.ts +++ b/test/integration/generated/lro/src/lROClient.ts @@ -6,6 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { LROsImpl, LRORetrysImpl, @@ -18,16 +19,42 @@ import { LrosaDs, LROsCustomHeader } from "./operationsInterfaces"; -import { LROClientContext } from "./lROClientContext"; import { LROClientOptionalParams } from "./models"; -export class LROClient extends LROClientContext { +export class LROClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the LROClient class. * @param options The parameter options */ constructor(options?: LROClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: LROClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-lro/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.lROs = new LROsImpl(this); this.lRORetrys = new LRORetrysImpl(this); this.lrosaDs = new LrosaDsImpl(this); diff --git a/test/integration/generated/lro/src/lROClientContext.ts b/test/integration/generated/lro/src/lROClientContext.ts deleted file mode 100644 index b4b1d5007e..0000000000 --- a/test/integration/generated/lro/src/lROClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { LROClientOptionalParams } from "./models"; - -export class LROClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the LROClientContext class. - * @param options The parameter options - */ - constructor(options?: LROClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: LROClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-lro/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/lro/src/operations/lRORetrys.ts b/test/integration/generated/lro/src/operations/lRORetrys.ts index b98e91bbe8..7d3c3716af 100644 --- a/test/integration/generated/lro/src/operations/lRORetrys.ts +++ b/test/integration/generated/lro/src/operations/lRORetrys.ts @@ -10,7 +10,7 @@ import { LRORetrys } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { LROClientContext } from "../lROClientContext"; +import { LROClient } from "../lROClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -32,13 +32,13 @@ import { /** Class containing LRORetrys operations. */ export class LRORetrysImpl implements LRORetrys { - private readonly client: LROClientContext; + private readonly client: LROClient; /** * Initialize a new instance of the class LRORetrys class. * @param client Reference to the service client */ - constructor(client: LROClientContext) { + constructor(client: LROClient) { this.client = client; } diff --git a/test/integration/generated/lro/src/operations/lROs.ts b/test/integration/generated/lro/src/operations/lROs.ts index 8c9c676ec0..ab935beb22 100644 --- a/test/integration/generated/lro/src/operations/lROs.ts +++ b/test/integration/generated/lro/src/operations/lROs.ts @@ -10,7 +10,7 @@ import { LROs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { LROClientContext } from "../lROClientContext"; +import { LROClient } from "../lROClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -101,13 +101,13 @@ import { /** Class containing LROs operations. */ export class LROsImpl implements LROs { - private readonly client: LROClientContext; + private readonly client: LROClient; /** * Initialize a new instance of the class LROs class. * @param client Reference to the service client */ - constructor(client: LROClientContext) { + constructor(client: LROClient) { this.client = client; } diff --git a/test/integration/generated/lro/src/operations/lROsCustomHeader.ts b/test/integration/generated/lro/src/operations/lROsCustomHeader.ts index 6b026fb006..0a6b7391f0 100644 --- a/test/integration/generated/lro/src/operations/lROsCustomHeader.ts +++ b/test/integration/generated/lro/src/operations/lROsCustomHeader.ts @@ -10,7 +10,7 @@ import { LROsCustomHeader } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { LROClientContext } from "../lROClientContext"; +import { LROClient } from "../lROClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -26,13 +26,13 @@ import { /** Class containing LROsCustomHeader operations. */ export class LROsCustomHeaderImpl implements LROsCustomHeader { - private readonly client: LROClientContext; + private readonly client: LROClient; /** * Initialize a new instance of the class LROsCustomHeader class. * @param client Reference to the service client */ - constructor(client: LROClientContext) { + constructor(client: LROClient) { this.client = client; } diff --git a/test/integration/generated/lro/src/operations/lrosaDs.ts b/test/integration/generated/lro/src/operations/lrosaDs.ts index 5d9b60a84a..394c629652 100644 --- a/test/integration/generated/lro/src/operations/lrosaDs.ts +++ b/test/integration/generated/lro/src/operations/lrosaDs.ts @@ -10,7 +10,7 @@ import { LrosaDs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { LROClientContext } from "../lROClientContext"; +import { LROClient } from "../lROClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -69,13 +69,13 @@ import { /** Class containing LrosaDs operations. */ export class LrosaDsImpl implements LrosaDs { - private readonly client: LROClientContext; + private readonly client: LROClient; /** * Initialize a new instance of the class LrosaDs class. * @param client Reference to the service client */ - constructor(client: LROClientContext) { + constructor(client: LROClient) { this.client = client; } diff --git a/test/integration/generated/lroParametrizedEndpoints/package.json b/test/integration/generated/lroParametrizedEndpoints/package.json index 8389a7a47b..2ceb813fcd 100644 --- a/test/integration/generated/lroParametrizedEndpoints/package.json +++ b/test/integration/generated/lroParametrizedEndpoints/package.json @@ -27,7 +27,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/lroParametrizedEndpoints/src/index.ts b/test/integration/generated/lroParametrizedEndpoints/src/index.ts index 1364a5cdbc..8d88f7023f 100644 --- a/test/integration/generated/lroParametrizedEndpoints/src/index.ts +++ b/test/integration/generated/lroParametrizedEndpoints/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { LroParametrizedEndpointsClient } from "./lroParametrizedEndpointsClient"; -export { LroParametrizedEndpointsClientContext } from "./lroParametrizedEndpointsClientContext"; diff --git a/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClient.ts b/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClient.ts index 6a545aafe3..dfc7cd8c8c 100644 --- a/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClient.ts +++ b/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClient.ts @@ -11,7 +11,6 @@ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "./lroImpl"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { LroParametrizedEndpointsClientContext } from "./lroParametrizedEndpointsClientContext"; import { LroParametrizedEndpointsClientOptionalParams, PollWithParameterizedEndpointsOptionalParams, @@ -20,13 +19,40 @@ import { PollWithConstantParameterizedEndpointsResponse } from "./models"; -export class LroParametrizedEndpointsClient extends LroParametrizedEndpointsClientContext { +export class LroParametrizedEndpointsClient extends coreClient.ServiceClient { + host: string; + /** * Initializes a new instance of the LroParametrizedEndpointsClient class. * @param options The parameter options */ constructor(options?: LroParametrizedEndpointsClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: LroParametrizedEndpointsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-lro-parameterized-endpoints/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://{accountName}{host}" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.host = options.host || "host"; } /** diff --git a/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClientContext.ts b/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClientContext.ts deleted file mode 100644 index e5d0bca840..0000000000 --- a/test/integration/generated/lroParametrizedEndpoints/src/lroParametrizedEndpointsClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { LroParametrizedEndpointsClientOptionalParams } from "./models"; - -export class LroParametrizedEndpointsClientContext extends coreClient.ServiceClient { - host: string; - - /** - * Initializes a new instance of the LroParametrizedEndpointsClientContext class. - * @param options The parameter options - */ - constructor(options?: LroParametrizedEndpointsClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: LroParametrizedEndpointsClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-lro-parameterized-endpoints/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://{accountName}{host}" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.host = options.host || "host"; - } -} diff --git a/test/integration/generated/lroRest/package.json b/test/integration/generated/lroRest/package.json index 5d8ab871ad..71ddd92753 100644 --- a/test/integration/generated/lroRest/package.json +++ b/test/integration/generated/lroRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/lroRest/src/lRORestClient.ts b/test/integration/generated/lroRest/src/lRORestClient.ts index 0b6645a364..2a01564480 100644 --- a/test/integration/generated/lroRest/src/lRORestClient.ts +++ b/test/integration/generated/lroRest/src/lRORestClient.ts @@ -1301,9 +1301,7 @@ export default function LRORestClient( ): LRORestClientRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - return getClient( - baseUrl, + const client = getClient(baseUrl, options) as LRORestClientRestClient; - options - ) as LRORestClientRestClient; + return client; } diff --git a/test/integration/generated/lroRest/tsconfig.json b/test/integration/generated/lroRest/tsconfig.json index 965341beea..0202cc6570 100644 --- a/test/integration/generated/lroRest/tsconfig.json +++ b/test/integration/generated/lroRest/tsconfig.json @@ -7,13 +7,5 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/test/integration/generated/mapperrequired/package.json b/test/integration/generated/mapperrequired/package.json index 2a4afc896d..af97f63073 100644 --- a/test/integration/generated/mapperrequired/package.json +++ b/test/integration/generated/mapperrequired/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/mapperrequired/src/index.ts b/test/integration/generated/mapperrequired/src/index.ts index 567b97f0e0..49ec4e4a76 100644 --- a/test/integration/generated/mapperrequired/src/index.ts +++ b/test/integration/generated/mapperrequired/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { MapperRequiredClient } from "./mapperRequiredClient"; -export { MapperRequiredClientContext } from "./mapperRequiredClientContext"; diff --git a/test/integration/generated/mapperrequired/src/mapperRequiredClient.ts b/test/integration/generated/mapperrequired/src/mapperRequiredClient.ts index a08f77ca5c..2b6abd4fdf 100644 --- a/test/integration/generated/mapperrequired/src/mapperRequiredClient.ts +++ b/test/integration/generated/mapperrequired/src/mapperRequiredClient.ts @@ -9,21 +9,50 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { MapperRequiredClientContext } from "./mapperRequiredClientContext"; import { MapperRequiredClientOptionalParams, UpdateCertificateIssuerOptionalParams, UpdateCertificateIssuerResponse } from "./models"; -export class MapperRequiredClient extends MapperRequiredClientContext { +export class MapperRequiredClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the MapperRequiredClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: MapperRequiredClientOptionalParams) { - super($host, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MapperRequiredClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-mapperrequired/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; } /** diff --git a/test/integration/generated/mapperrequired/src/mapperRequiredClientContext.ts b/test/integration/generated/mapperrequired/src/mapperRequiredClientContext.ts deleted file mode 100644 index 7b3618abd6..0000000000 --- a/test/integration/generated/mapperrequired/src/mapperRequiredClientContext.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { MapperRequiredClientOptionalParams } from "./models"; - -export class MapperRequiredClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the MapperRequiredClientContext class. - * @param $host server parameter - * @param options The parameter options - */ - constructor($host: string, options?: MapperRequiredClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MapperRequiredClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-mapperrequired/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - } -} diff --git a/test/integration/generated/mediaTypes/package.json b/test/integration/generated/mediaTypes/package.json index 4d11b2e16c..ec200d1d38 100644 --- a/test/integration/generated/mediaTypes/package.json +++ b/test/integration/generated/mediaTypes/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/mediaTypes/src/index.ts b/test/integration/generated/mediaTypes/src/index.ts index 8814cc1429..6e27ba5431 100644 --- a/test/integration/generated/mediaTypes/src/index.ts +++ b/test/integration/generated/mediaTypes/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { MediaTypesClient } from "./mediaTypesClient"; -export { MediaTypesClientContext } from "./mediaTypesClientContext"; diff --git a/test/integration/generated/mediaTypes/src/mediaTypesClient.ts b/test/integration/generated/mediaTypes/src/mediaTypesClient.ts index 492a758f6a..a52d54aa51 100644 --- a/test/integration/generated/mediaTypes/src/mediaTypesClient.ts +++ b/test/integration/generated/mediaTypes/src/mediaTypesClient.ts @@ -10,7 +10,6 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { MediaTypesClientContext } from "./mediaTypesClientContext"; import { MediaTypesClientOptionalParams, ContentType, @@ -32,13 +31,40 @@ import { PutTextAndJsonBodyResponse } from "./models"; -export class MediaTypesClient extends MediaTypesClientContext { +export class MediaTypesClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the MediaTypesClient class. * @param options The parameter options */ constructor(options?: MediaTypesClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MediaTypesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-media-types-service/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; } /** diff --git a/test/integration/generated/mediaTypes/src/mediaTypesClientContext.ts b/test/integration/generated/mediaTypes/src/mediaTypesClientContext.ts deleted file mode 100644 index 29a994dde4..0000000000 --- a/test/integration/generated/mediaTypes/src/mediaTypesClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { MediaTypesClientOptionalParams } from "./models"; - -export class MediaTypesClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the MediaTypesClientContext class. - * @param options The parameter options - */ - constructor(options?: MediaTypesClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MediaTypesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-media-types-service/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/mediaTypesRest/package.json b/test/integration/generated/mediaTypesRest/package.json index 837cf9c5a1..19ff93e415 100644 --- a/test/integration/generated/mediaTypesRest/package.json +++ b/test/integration/generated/mediaTypesRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/mediaTypesRest/src/mediaTypes.ts b/test/integration/generated/mediaTypesRest/src/mediaTypes.ts index c32db9821a..86472c0e8e 100644 --- a/test/integration/generated/mediaTypesRest/src/mediaTypes.ts +++ b/test/integration/generated/mediaTypesRest/src/mediaTypes.ts @@ -107,9 +107,7 @@ export default function MediaTypes( ): MediaTypesRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - return getClient( - baseUrl, + const client = getClient(baseUrl, options) as MediaTypesRestClient; - options - ) as MediaTypesRestClient; + return client; } diff --git a/test/integration/generated/mediaTypesRest/src/parameters.ts b/test/integration/generated/mediaTypesRest/src/parameters.ts index f26e12e2ff..5c04ff74ec 100644 --- a/test/integration/generated/mediaTypesRest/src/parameters.ts +++ b/test/integration/generated/mediaTypesRest/src/parameters.ts @@ -10,7 +10,7 @@ export interface AnalyzeBodyBodyParam { * * Value may contain any sequence of octets */ - body?: string; + body?: string | Uint8Array; } export interface AnalyzeBodyMediaTypesParam { @@ -45,7 +45,7 @@ export interface AnalyzeBodyNoAcceptHeaderBodyParam { * * Value may contain any sequence of octets */ - body?: string; + body?: string | Uint8Array; } export interface AnalyzeBodyNoAcceptHeaderMediaTypesParam { @@ -94,7 +94,7 @@ export interface BinaryBodyWithTwoContentTypesBodyParam { * * Value may contain any sequence of octets */ - body: string; + body: string | Uint8Array; } export interface BinaryBodyWithTwoContentTypesMediaTypesParam { @@ -112,7 +112,7 @@ export interface BinaryBodyWithThreeContentTypesBodyParam { * * Value may contain any sequence of octets */ - body: string; + body: string | Uint8Array; } export interface BinaryBodyWithThreeContentTypesMediaTypesParam { diff --git a/test/integration/generated/mediaTypesRest/tsconfig.json b/test/integration/generated/mediaTypesRest/tsconfig.json index 965341beea..0202cc6570 100644 --- a/test/integration/generated/mediaTypesRest/tsconfig.json +++ b/test/integration/generated/mediaTypesRest/tsconfig.json @@ -7,13 +7,5 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/test/integration/generated/mediaTypesV3/package.json b/test/integration/generated/mediaTypesV3/package.json index 131e272fb7..aa375de8c4 100644 --- a/test/integration/generated/mediaTypesV3/package.json +++ b/test/integration/generated/mediaTypesV3/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/mediaTypesV3/src/index.ts b/test/integration/generated/mediaTypesV3/src/index.ts index 34dfb083a9..d93916e81f 100644 --- a/test/integration/generated/mediaTypesV3/src/index.ts +++ b/test/integration/generated/mediaTypesV3/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { MediaTypesV3Client } from "./mediaTypesV3Client"; -export { MediaTypesV3ClientContext } from "./mediaTypesV3ClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/mediaTypesV3/src/mediaTypesV3Client.ts b/test/integration/generated/mediaTypesV3/src/mediaTypesV3Client.ts index 14b10f9dfc..adcb1d7ff4 100644 --- a/test/integration/generated/mediaTypesV3/src/mediaTypesV3Client.ts +++ b/test/integration/generated/mediaTypesV3/src/mediaTypesV3Client.ts @@ -6,19 +6,49 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { BarApiImpl, FooApiImpl } from "./operations"; import { BarApi, FooApi } from "./operationsInterfaces"; -import { MediaTypesV3ClientContext } from "./mediaTypesV3ClientContext"; import { MediaTypesV3ClientOptionalParams } from "./models"; -export class MediaTypesV3Client extends MediaTypesV3ClientContext { +export class MediaTypesV3Client extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the MediaTypesV3Client class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: MediaTypesV3ClientOptionalParams) { - super($host, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MediaTypesV3ClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-media-types-v3-client/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; this.barApi = new BarApiImpl(this); this.fooApi = new FooApiImpl(this); } diff --git a/test/integration/generated/mediaTypesV3/src/mediaTypesV3ClientContext.ts b/test/integration/generated/mediaTypesV3/src/mediaTypesV3ClientContext.ts deleted file mode 100644 index 2a2519d0e7..0000000000 --- a/test/integration/generated/mediaTypesV3/src/mediaTypesV3ClientContext.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { MediaTypesV3ClientOptionalParams } from "./models"; - -export class MediaTypesV3ClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the MediaTypesV3ClientContext class. - * @param $host server parameter - * @param options The parameter options - */ - constructor($host: string, options?: MediaTypesV3ClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MediaTypesV3ClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-media-types-v3-client/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - } -} diff --git a/test/integration/generated/mediaTypesV3/src/operations/barApi.ts b/test/integration/generated/mediaTypesV3/src/operations/barApi.ts index e88f4ba716..1bcf240425 100644 --- a/test/integration/generated/mediaTypesV3/src/operations/barApi.ts +++ b/test/integration/generated/mediaTypesV3/src/operations/barApi.ts @@ -9,7 +9,7 @@ import { BarApi } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Parameters from "../models/parameters"; -import { MediaTypesV3ClientContext } from "../mediaTypesV3ClientContext"; +import { MediaTypesV3Client } from "../mediaTypesV3Client"; import { BarApiPostSendOnDefaultOptionalParams, BarApiPostSendOnDefaultResponse @@ -17,13 +17,13 @@ import { /** Class containing BarApi operations. */ export class BarApiImpl implements BarApi { - private readonly client: MediaTypesV3ClientContext; + private readonly client: MediaTypesV3Client; /** * Initialize a new instance of the class BarApi class. * @param client Reference to the service client */ - constructor(client: MediaTypesV3ClientContext) { + constructor(client: MediaTypesV3Client) { this.client = client; } diff --git a/test/integration/generated/mediaTypesV3/src/operations/fooApi.ts b/test/integration/generated/mediaTypesV3/src/operations/fooApi.ts index 0d531f461b..6e8bb47061 100644 --- a/test/integration/generated/mediaTypesV3/src/operations/fooApi.ts +++ b/test/integration/generated/mediaTypesV3/src/operations/fooApi.ts @@ -10,7 +10,7 @@ import { FooApi } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Parameters from "../models/parameters"; -import { MediaTypesV3ClientContext } from "../mediaTypesV3ClientContext"; +import { MediaTypesV3Client } from "../mediaTypesV3Client"; import { FooApiPostSendOnDefault$binaryOptionalParams, FooApiPostSendOnDefault$textOptionalParams, @@ -22,13 +22,13 @@ import { /** Class containing FooApi operations. */ export class FooApiImpl implements FooApi { - private readonly client: MediaTypesV3ClientContext; + private readonly client: MediaTypesV3Client; /** * Initialize a new instance of the class FooApi class. * @param client Reference to the service client */ - constructor(client: MediaTypesV3ClientContext) { + constructor(client: MediaTypesV3Client) { this.client = client; } diff --git a/test/integration/generated/mediaTypesV3Lro/package.json b/test/integration/generated/mediaTypesV3Lro/package.json index 61d35f193c..b23901ee7d 100644 --- a/test/integration/generated/mediaTypesV3Lro/package.json +++ b/test/integration/generated/mediaTypesV3Lro/package.json @@ -27,7 +27,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/mediaTypesV3Lro/src/index.ts b/test/integration/generated/mediaTypesV3Lro/src/index.ts index bd0f0c747d..16606678d0 100644 --- a/test/integration/generated/mediaTypesV3Lro/src/index.ts +++ b/test/integration/generated/mediaTypesV3Lro/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { MediaTypesV3LROClient } from "./mediaTypesV3LROClient"; -export { MediaTypesV3LROClientContext } from "./mediaTypesV3LROClientContext"; diff --git a/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClient.ts b/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClient.ts index c5ab88bbb7..06c4a83f6d 100644 --- a/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClient.ts +++ b/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClient.ts @@ -11,7 +11,6 @@ import * as coreRestPipeline from "@azure/core-rest-pipeline"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "./lroImpl"; import * as Parameters from "./models/parameters"; -import { MediaTypesV3LROClientContext } from "./mediaTypesV3LROClientContext"; import { MediaTypesV3LROClientOptionalParams, SendOnDefault$binaryOptionalParams, @@ -21,14 +20,44 @@ import { SendResponse } from "./models"; -export class MediaTypesV3LROClient extends MediaTypesV3LROClientContext { +export class MediaTypesV3LROClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the MediaTypesV3LROClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: MediaTypesV3LROClientOptionalParams) { - super($host, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MediaTypesV3LROClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-media-types-v3-lro-client/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; } private getOperationOptions( diff --git a/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClientContext.ts b/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClientContext.ts deleted file mode 100644 index 26c813ce39..0000000000 --- a/test/integration/generated/mediaTypesV3Lro/src/mediaTypesV3LROClientContext.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { MediaTypesV3LROClientOptionalParams } from "./models"; - -export class MediaTypesV3LROClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the MediaTypesV3LROClientContext class. - * @param $host server parameter - * @param options The parameter options - */ - constructor($host: string, options?: MediaTypesV3LROClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MediaTypesV3LROClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-media-types-v3-lro-client/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - } -} diff --git a/test/integration/generated/mediaTypesWithTracing/package.json b/test/integration/generated/mediaTypesWithTracing/package.json index fef09bb6d6..eaa9e49bdf 100644 --- a/test/integration/generated/mediaTypesWithTracing/package.json +++ b/test/integration/generated/mediaTypesWithTracing/package.json @@ -27,7 +27,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/mediaTypesWithTracing/src/index.ts b/test/integration/generated/mediaTypesWithTracing/src/index.ts index 1df8b594c3..dca21c93a8 100644 --- a/test/integration/generated/mediaTypesWithTracing/src/index.ts +++ b/test/integration/generated/mediaTypesWithTracing/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { MediaTypesWithTracingClient } from "./mediaTypesWithTracingClient"; -export { MediaTypesWithTracingClientContext } from "./mediaTypesWithTracingClientContext"; diff --git a/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClient.ts b/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClient.ts index 767c489841..045fc47278 100644 --- a/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClient.ts +++ b/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClient.ts @@ -12,7 +12,6 @@ import * as coreTracing from "@azure/core-tracing"; import { createSpan } from "./tracing"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { MediaTypesWithTracingClientContext } from "./mediaTypesWithTracingClientContext"; import { MediaTypesWithTracingClientOptionalParams, ContentType, @@ -34,13 +33,40 @@ import { PutTextAndJsonBodyResponse } from "./models"; -export class MediaTypesWithTracingClient extends MediaTypesWithTracingClientContext { +export class MediaTypesWithTracingClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the MediaTypesWithTracingClient class. * @param options The parameter options */ constructor(options?: MediaTypesWithTracingClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MediaTypesWithTracingClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-media-types-service-tracing/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; } /** diff --git a/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClientContext.ts b/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClientContext.ts deleted file mode 100644 index a013a9c5a9..0000000000 --- a/test/integration/generated/mediaTypesWithTracing/src/mediaTypesWithTracingClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { MediaTypesWithTracingClientOptionalParams } from "./models"; - -export class MediaTypesWithTracingClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the MediaTypesWithTracingClientContext class. - * @param options The parameter options - */ - constructor(options?: MediaTypesWithTracingClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MediaTypesWithTracingClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-media-types-service-tracing/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/modelFlattening/package.json b/test/integration/generated/modelFlattening/package.json index 480e7bca5a..e2c457f6e2 100644 --- a/test/integration/generated/modelFlattening/package.json +++ b/test/integration/generated/modelFlattening/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/modelFlattening/src/index.ts b/test/integration/generated/modelFlattening/src/index.ts index 37ce269cb3..edadd18e75 100644 --- a/test/integration/generated/modelFlattening/src/index.ts +++ b/test/integration/generated/modelFlattening/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { ModelFlatteningClient } from "./modelFlatteningClient"; -export { ModelFlatteningClientContext } from "./modelFlatteningClientContext"; diff --git a/test/integration/generated/modelFlattening/src/modelFlatteningClient.ts b/test/integration/generated/modelFlattening/src/modelFlatteningClient.ts index 89f8d1ba94..f8f527e1d9 100644 --- a/test/integration/generated/modelFlattening/src/modelFlatteningClient.ts +++ b/test/integration/generated/modelFlattening/src/modelFlatteningClient.ts @@ -9,7 +9,6 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { ModelFlatteningClientContext } from "./modelFlatteningClientContext"; import { ModelFlatteningClientOptionalParams, PutArrayOptionalParams, @@ -33,13 +32,40 @@ import { PutSimpleProductWithGroupingResponse } from "./models"; -export class ModelFlatteningClient extends ModelFlatteningClientContext { +export class ModelFlatteningClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the ModelFlatteningClient class. * @param options The parameter options */ constructor(options?: ModelFlatteningClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ModelFlatteningClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-model-flattening/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; } /** diff --git a/test/integration/generated/modelFlattening/src/modelFlatteningClientContext.ts b/test/integration/generated/modelFlattening/src/modelFlatteningClientContext.ts deleted file mode 100644 index 043c8e4976..0000000000 --- a/test/integration/generated/modelFlattening/src/modelFlatteningClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { ModelFlatteningClientOptionalParams } from "./models"; - -export class ModelFlatteningClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the ModelFlatteningClientContext class. - * @param options The parameter options - */ - constructor(options?: ModelFlatteningClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ModelFlatteningClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-model-flattening/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/multipleInheritance/package.json b/test/integration/generated/multipleInheritance/package.json index 19cd7ab3de..abf4713536 100644 --- a/test/integration/generated/multipleInheritance/package.json +++ b/test/integration/generated/multipleInheritance/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/multipleInheritance/src/index.ts b/test/integration/generated/multipleInheritance/src/index.ts index 1a4473857e..d25e612f20 100644 --- a/test/integration/generated/multipleInheritance/src/index.ts +++ b/test/integration/generated/multipleInheritance/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { MultipleInheritanceClient } from "./multipleInheritanceClient"; -export { MultipleInheritanceClientContext } from "./multipleInheritanceClientContext"; diff --git a/test/integration/generated/multipleInheritance/src/multipleInheritanceClient.ts b/test/integration/generated/multipleInheritance/src/multipleInheritanceClient.ts index b88ff6e361..9f18111f35 100644 --- a/test/integration/generated/multipleInheritance/src/multipleInheritanceClient.ts +++ b/test/integration/generated/multipleInheritance/src/multipleInheritanceClient.ts @@ -9,7 +9,6 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { MultipleInheritanceClientContext } from "./multipleInheritanceClientContext"; import { MultipleInheritanceClientOptionalParams, GetHorseOptionalParams, @@ -39,13 +38,40 @@ import { PutKittenResponse } from "./models"; -export class MultipleInheritanceClient extends MultipleInheritanceClientContext { +export class MultipleInheritanceClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the MultipleInheritanceClient class. * @param options The parameter options */ constructor(options?: MultipleInheritanceClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MultipleInheritanceClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-multiple-inheritance/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; } /** diff --git a/test/integration/generated/multipleInheritance/src/multipleInheritanceClientContext.ts b/test/integration/generated/multipleInheritance/src/multipleInheritanceClientContext.ts deleted file mode 100644 index 78772db342..0000000000 --- a/test/integration/generated/multipleInheritance/src/multipleInheritanceClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { MultipleInheritanceClientOptionalParams } from "./models"; - -export class MultipleInheritanceClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the MultipleInheritanceClientContext class. - * @param options The parameter options - */ - constructor(options?: MultipleInheritanceClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MultipleInheritanceClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-multiple-inheritance/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/multipleInheritanceRest/package.json b/test/integration/generated/multipleInheritanceRest/package.json index f559332816..769c5a004d 100644 --- a/test/integration/generated/multipleInheritanceRest/package.json +++ b/test/integration/generated/multipleInheritanceRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/multipleInheritanceRest/src/multipleInheritanceRestClient.ts b/test/integration/generated/multipleInheritanceRest/src/multipleInheritanceRestClient.ts index 5b3cb7f55e..b9815dce40 100644 --- a/test/integration/generated/multipleInheritanceRest/src/multipleInheritanceRestClient.ts +++ b/test/integration/generated/multipleInheritanceRest/src/multipleInheritanceRestClient.ts @@ -33,6 +33,40 @@ import { import { getClient, ClientOptions, Client } from "@azure-rest/core-client"; import "@azure/core-auth"; +/** Contains operations for Client operations */ +export interface ClientOperations { + /** Get a horse with name 'Fred' and isAShowHorse true */ + getHorse( + options?: GetHorseParameters + ): Promise; + /** Put a horse with name 'General' and isAShowHorse false */ + putHorse(options: PutHorseParameters): Promise; + /** Get a pet with name 'Peanut' */ + getPet( + options?: GetPetParameters + ): Promise; + /** Put a pet with name 'Butter' */ + putPet(options: PutPetParameters): Promise; + /** Get a feline where meows and hisses are true */ + getFeline( + options?: GetFelineParameters + ): Promise; + /** Put a feline who hisses and doesn't meow */ + putFeline(options: PutFelineParameters): Promise; + /** Get a cat with name 'Whiskers' where likesMilk, meows, and hisses is true */ + getCat( + options?: GetCatParameters + ): Promise; + /** Put a cat with name 'Boots' where likesMilk and hisses is false, meows is true */ + putCat(options: PutCatParameters): Promise; + /** Get a kitten with name 'Gatito' where likesMilk and meows is true, and hisses and eatsMiceYet is false */ + getKitten( + options?: GetKittenParameters + ): Promise; + /** Put a kitten with name 'Kitty' where likesMilk and hisses is false, meows and eatsMiceYet is true */ + putKitten(options: PutKittenParameters): Promise; +} + export interface GetHorse { /** Get a horse with name 'Fred' and isAShowHorse true */ get( @@ -93,16 +127,51 @@ export interface Routes { export type MultipleInheritanceRestClientRestClient = Client & { path: Routes; -}; +} & ClientOperations; export default function MultipleInheritanceRestClient( options: ClientOptions = {} ): MultipleInheritanceRestClientRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - return getClient( + const client = getClient( baseUrl, - options ) as MultipleInheritanceRestClientRestClient; + + return { + ...client, + ...{ + getHorse: (options) => { + return client.path("/multipleInheritance/horse").get(options); + }, + putHorse: (options) => { + return client.path("/multipleInheritance/horse").put(options); + }, + getPet: (options) => { + return client.path("/multipleInheritance/pet").get(options); + }, + putPet: (options) => { + return client.path("/multipleInheritance/pet").put(options); + }, + getFeline: (options) => { + return client.path("/multipleInheritance/feline").get(options); + }, + putFeline: (options) => { + return client.path("/multipleInheritance/feline").put(options); + }, + getCat: (options) => { + return client.path("/multipleInheritance/cat").get(options); + }, + putCat: (options) => { + return client.path("/multipleInheritance/cat").put(options); + }, + getKitten: (options) => { + return client.path("/multipleInheritance/kitten").get(options); + }, + putKitten: (options) => { + return client.path("/multipleInheritance/kitten").put(options); + } + } + }; } diff --git a/test/integration/generated/multipleInheritanceRest/tsconfig.json b/test/integration/generated/multipleInheritanceRest/tsconfig.json index 965341beea..0202cc6570 100644 --- a/test/integration/generated/multipleInheritanceRest/tsconfig.json +++ b/test/integration/generated/multipleInheritanceRest/tsconfig.json @@ -7,13 +7,5 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/test/integration/generated/nameChecker/package.json b/test/integration/generated/nameChecker/package.json index 6ad202a6b4..a3cd03e43c 100644 --- a/test/integration/generated/nameChecker/package.json +++ b/test/integration/generated/nameChecker/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/nameChecker/src/index.ts b/test/integration/generated/nameChecker/src/index.ts index 88596163ee..82a0344909 100644 --- a/test/integration/generated/nameChecker/src/index.ts +++ b/test/integration/generated/nameChecker/src/index.ts @@ -1,4 +1,3 @@ export * from "./models"; export { SearchClient } from "./searchClient"; -export { SearchClientContext } from "./searchClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/nameChecker/src/operations/documents.ts b/test/integration/generated/nameChecker/src/operations/documents.ts index a34fe08a3d..5e3f90db77 100644 --- a/test/integration/generated/nameChecker/src/operations/documents.ts +++ b/test/integration/generated/nameChecker/src/operations/documents.ts @@ -2,7 +2,7 @@ import { Documents } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SearchClientContext } from "../searchClientContext"; +import { SearchClient } from "../searchClient"; import { DocumentsCountOptionalParams, DocumentsCountResponse, @@ -30,13 +30,13 @@ import { /** Class containing Documents operations. */ export class DocumentsImpl implements Documents { - private readonly client: SearchClientContext; + private readonly client: SearchClient; /** * Initialize a new instance of the class Documents class. * @param client Reference to the service client */ - constructor(client: SearchClientContext) { + constructor(client: SearchClient) { this.client = client; } diff --git a/test/integration/generated/nameChecker/src/searchClient.ts b/test/integration/generated/nameChecker/src/searchClient.ts index 0b1257ba2a..a8c93d207d 100644 --- a/test/integration/generated/nameChecker/src/searchClient.ts +++ b/test/integration/generated/nameChecker/src/searchClient.ts @@ -1,9 +1,13 @@ +import * as coreClient from "@azure/core-client"; import { DocumentsImpl } from "./operations"; import { Documents } from "./operationsInterfaces"; -import { SearchClientContext } from "./searchClientContext"; import { SearchClientOptionalParams } from "./models"; -export class SearchClient extends SearchClientContext { +export class SearchClient extends coreClient.ServiceClient { + endpoint: string; + indexName: string; + apiVersion: string; + /** * Initializes a new instance of the SearchClient class. * @param endpoint The endpoint URL of the search service. @@ -15,7 +19,42 @@ export class SearchClient extends SearchClientContext { indexName: string, options?: SearchClientOptionalParams ) { - super(endpoint, indexName, options); + if (endpoint === undefined) { + throw new Error("'endpoint' cannot be null"); + } + if (indexName === undefined) { + throw new Error("'indexName' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: SearchClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-search-documents/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{endpoint}/indexes('{indexName}')" + }; + super(optionsWithDefaults); + // Parameter assignments + this.endpoint = endpoint; + this.indexName = indexName; + + // Assigning values to Constant parameters + this.apiVersion = options.apiVersion || "2020-06-30-Preview"; this.documents = new DocumentsImpl(this); } diff --git a/test/integration/generated/nameChecker/src/searchClientContext.ts b/test/integration/generated/nameChecker/src/searchClientContext.ts deleted file mode 100644 index 9ff3e9dcd0..0000000000 --- a/test/integration/generated/nameChecker/src/searchClientContext.ts +++ /dev/null @@ -1,57 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { SearchClientOptionalParams } from "./models"; - -export class SearchClientContext extends coreClient.ServiceClient { - endpoint: string; - indexName: string; - apiVersion: string; - - /** - * Initializes a new instance of the SearchClientContext class. - * @param endpoint The endpoint URL of the search service. - * @param indexName The name of the index. - * @param options The parameter options - */ - constructor( - endpoint: string, - indexName: string, - options?: SearchClientOptionalParams - ) { - if (endpoint === undefined) { - throw new Error("'endpoint' cannot be null"); - } - if (indexName === undefined) { - throw new Error("'indexName' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: SearchClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-search-documents/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{endpoint}/indexes('{indexName}')" - }; - super(optionsWithDefaults); - // Parameter assignments - this.endpoint = endpoint; - this.indexName = indexName; - - // Assigning values to Constant parameters - this.apiVersion = options.apiVersion || "2020-06-30-Preview"; - } -} diff --git a/test/integration/generated/noLicenseHeader/package.json b/test/integration/generated/noLicenseHeader/package.json index e0757e7b19..6c911e6303 100644 --- a/test/integration/generated/noLicenseHeader/package.json +++ b/test/integration/generated/noLicenseHeader/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/noLicenseHeader/src/index.ts b/test/integration/generated/noLicenseHeader/src/index.ts index e2d9203d25..41f25081f6 100644 --- a/test/integration/generated/noLicenseHeader/src/index.ts +++ b/test/integration/generated/noLicenseHeader/src/index.ts @@ -1,3 +1,2 @@ export * from "./models"; export { NoLicenseHeaderClient } from "./noLicenseHeaderClient"; -export { NoLicenseHeaderClientContext } from "./noLicenseHeaderClientContext"; diff --git a/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClient.ts b/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClient.ts index 2843c5a913..3cd83ebea9 100644 --- a/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClient.ts +++ b/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClient.ts @@ -1,14 +1,16 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; -import { NoLicenseHeaderClientContext } from "./noLicenseHeaderClientContext"; import { - NoLicenseHeaderClientOptionalParams, Enum0, + NoLicenseHeaderClientOptionalParams, ApiV1ValueGetOptionalParams, ApiV1ValueGetResponse } from "./models"; -export class NoLicenseHeaderClient extends NoLicenseHeaderClientContext { +export class NoLicenseHeaderClient extends coreClient.ServiceClient { + $host: string; + apiVersion: Enum0; + /** * Initializes a new instance of the NoLicenseHeaderClient class. * @param $host server parameter @@ -20,7 +22,39 @@ export class NoLicenseHeaderClient extends NoLicenseHeaderClientContext { apiVersion: Enum0, options?: NoLicenseHeaderClientOptionalParams ) { - super($host, apiVersion, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: NoLicenseHeaderClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-nolicense-header/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + this.apiVersion = apiVersion; } /** @param options The options parameters. */ diff --git a/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClientContext.ts b/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClientContext.ts deleted file mode 100644 index 9123c2b6bc..0000000000 --- a/test/integration/generated/noLicenseHeader/src/noLicenseHeaderClientContext.ts +++ /dev/null @@ -1,53 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { Enum0, NoLicenseHeaderClientOptionalParams } from "./models"; - -export class NoLicenseHeaderClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: Enum0; - - /** - * Initializes a new instance of the NoLicenseHeaderClientContext class. - * @param $host server parameter - * @param apiVersion - * @param options The parameter options - */ - constructor( - $host: string, - apiVersion: Enum0, - options?: NoLicenseHeaderClientOptionalParams - ) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: NoLicenseHeaderClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-nolicense-header/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - this.apiVersion = apiVersion; - } -} diff --git a/test/integration/generated/noMappers/package.json b/test/integration/generated/noMappers/package.json index af0ace528e..a7ecea13ba 100644 --- a/test/integration/generated/noMappers/package.json +++ b/test/integration/generated/noMappers/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/noMappers/src/index.ts b/test/integration/generated/noMappers/src/index.ts index 4992eb40c4..64fa69b4e7 100644 --- a/test/integration/generated/noMappers/src/index.ts +++ b/test/integration/generated/noMappers/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { NoMappersClient } from "./noMappersClient"; -export { NoMappersClientContext } from "./noMappersClientContext"; diff --git a/test/integration/generated/noMappers/src/noMappersClient.ts b/test/integration/generated/noMappers/src/noMappersClient.ts index 3d91f6d9a2..e0c05c25be 100644 --- a/test/integration/generated/noMappers/src/noMappersClient.ts +++ b/test/integration/generated/noMappers/src/noMappersClient.ts @@ -8,15 +8,17 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; -import { NoMappersClientContext } from "./noMappersClientContext"; import { - NoMappersClientOptionalParams, Enum0, + NoMappersClientOptionalParams, ApiV1ValueGetOptionalParams, ApiV1ValueGetResponse } from "./models"; -export class NoMappersClient extends NoMappersClientContext { +export class NoMappersClient extends coreClient.ServiceClient { + $host: string; + apiVersion: Enum0; + /** * Initializes a new instance of the NoMappersClient class. * @param $host server parameter @@ -28,7 +30,39 @@ export class NoMappersClient extends NoMappersClientContext { apiVersion: Enum0, options?: NoMappersClientOptionalParams ) { - super($host, apiVersion, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: NoMappersClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-no-mappers/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + this.apiVersion = apiVersion; } /** @param options The options parameters. */ diff --git a/test/integration/generated/noMappers/src/noMappersClientContext.ts b/test/integration/generated/noMappers/src/noMappersClientContext.ts deleted file mode 100644 index 82ba65f777..0000000000 --- a/test/integration/generated/noMappers/src/noMappersClientContext.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { Enum0, NoMappersClientOptionalParams } from "./models"; - -export class NoMappersClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: Enum0; - - /** - * Initializes a new instance of the NoMappersClientContext class. - * @param $host server parameter - * @param apiVersion - * @param options The parameter options - */ - constructor( - $host: string, - apiVersion: Enum0, - options?: NoMappersClientOptionalParams - ) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: NoMappersClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-no-mappers/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - this.apiVersion = apiVersion; - } -} diff --git a/test/integration/generated/noOperation/package.json b/test/integration/generated/noOperation/package.json index 2ab8741dd4..2ec0578eb7 100644 --- a/test/integration/generated/noOperation/package.json +++ b/test/integration/generated/noOperation/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/noOperation/src/index.ts b/test/integration/generated/noOperation/src/index.ts index d6df9f4353..f715c2b19d 100644 --- a/test/integration/generated/noOperation/src/index.ts +++ b/test/integration/generated/noOperation/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { NoOperationsClient } from "./noOperationsClient"; -export { NoOperationsClientContext } from "./noOperationsClientContext"; diff --git a/test/integration/generated/noOperation/src/noOperationsClient.ts b/test/integration/generated/noOperation/src/noOperationsClient.ts index e4ba288bf9..cb798f93e1 100644 --- a/test/integration/generated/noOperation/src/noOperationsClient.ts +++ b/test/integration/generated/noOperation/src/noOperationsClient.ts @@ -6,15 +6,37 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { NoOperationsClientContext } from "./noOperationsClientContext"; +import * as coreClient from "@azure/core-client"; import { NoOperationsClientOptionalParams } from "./models"; -export class NoOperationsClient extends NoOperationsClientContext { +export class NoOperationsClient extends coreClient.ServiceClient { /** * Initializes a new instance of the NoOperationsClient class. * @param options The parameter options */ constructor(options?: NoOperationsClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: NoOperationsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-no-operation/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint + }; + super(optionsWithDefaults); } } diff --git a/test/integration/generated/noOperation/src/noOperationsClientContext.ts b/test/integration/generated/noOperation/src/noOperationsClientContext.ts deleted file mode 100644 index e8bb115cac..0000000000 --- a/test/integration/generated/noOperation/src/noOperationsClientContext.ts +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { NoOperationsClientOptionalParams } from "./models"; - -export class NoOperationsClientContext extends coreClient.ServiceClient { - /** - * Initializes a new instance of the NoOperationsClientContext class. - * @param options The parameter options - */ - constructor(options?: NoOperationsClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: NoOperationsClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-no-operation/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint - }; - super(optionsWithDefaults); - } -} diff --git a/test/integration/generated/nonStringEnum/package.json b/test/integration/generated/nonStringEnum/package.json index 3c7529ad26..d9daa93434 100644 --- a/test/integration/generated/nonStringEnum/package.json +++ b/test/integration/generated/nonStringEnum/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/nonStringEnum/src/index.ts b/test/integration/generated/nonStringEnum/src/index.ts index f3615dca4d..99af2fcec0 100644 --- a/test/integration/generated/nonStringEnum/src/index.ts +++ b/test/integration/generated/nonStringEnum/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { NonStringEnumClient } from "./nonStringEnumClient"; -export { NonStringEnumClientContext } from "./nonStringEnumClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/nonStringEnum/src/nonStringEnumClient.ts b/test/integration/generated/nonStringEnum/src/nonStringEnumClient.ts index 272b047f5b..6ef9dfa326 100644 --- a/test/integration/generated/nonStringEnum/src/nonStringEnumClient.ts +++ b/test/integration/generated/nonStringEnum/src/nonStringEnumClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { IntImpl, FloatImpl } from "./operations"; import { Int, Float } from "./operationsInterfaces"; -import { NonStringEnumClientContext } from "./nonStringEnumClientContext"; import { NonStringEnumClientOptionalParams } from "./models"; -export class NonStringEnumClient extends NonStringEnumClientContext { +export class NonStringEnumClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the NonStringEnumClient class. * @param options The parameter options */ constructor(options?: NonStringEnumClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: NonStringEnumClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-non-string-num/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.int = new IntImpl(this); this.float = new FloatImpl(this); } diff --git a/test/integration/generated/nonStringEnum/src/nonStringEnumClientContext.ts b/test/integration/generated/nonStringEnum/src/nonStringEnumClientContext.ts deleted file mode 100644 index 114a0aa6c2..0000000000 --- a/test/integration/generated/nonStringEnum/src/nonStringEnumClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { NonStringEnumClientOptionalParams } from "./models"; - -export class NonStringEnumClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the NonStringEnumClientContext class. - * @param options The parameter options - */ - constructor(options?: NonStringEnumClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: NonStringEnumClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-non-string-num/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/nonStringEnum/src/operations/float.ts b/test/integration/generated/nonStringEnum/src/operations/float.ts index 12b6cbfe3d..c0966523d9 100644 --- a/test/integration/generated/nonStringEnum/src/operations/float.ts +++ b/test/integration/generated/nonStringEnum/src/operations/float.ts @@ -9,7 +9,7 @@ import { Float } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Parameters from "../models/parameters"; -import { NonStringEnumClientContext } from "../nonStringEnumClientContext"; +import { NonStringEnumClient } from "../nonStringEnumClient"; import { FloatPutOptionalParams, FloatPutResponse, @@ -19,13 +19,13 @@ import { /** Class containing Float operations. */ export class FloatImpl implements Float { - private readonly client: NonStringEnumClientContext; + private readonly client: NonStringEnumClient; /** * Initialize a new instance of the class Float class. * @param client Reference to the service client */ - constructor(client: NonStringEnumClientContext) { + constructor(client: NonStringEnumClient) { this.client = client; } diff --git a/test/integration/generated/nonStringEnum/src/operations/int.ts b/test/integration/generated/nonStringEnum/src/operations/int.ts index 3687051648..0e1018fc41 100644 --- a/test/integration/generated/nonStringEnum/src/operations/int.ts +++ b/test/integration/generated/nonStringEnum/src/operations/int.ts @@ -9,7 +9,7 @@ import { Int } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Parameters from "../models/parameters"; -import { NonStringEnumClientContext } from "../nonStringEnumClientContext"; +import { NonStringEnumClient } from "../nonStringEnumClient"; import { IntPutOptionalParams, IntPutResponse, @@ -19,13 +19,13 @@ import { /** Class containing Int operations. */ export class IntImpl implements Int { - private readonly client: NonStringEnumClientContext; + private readonly client: NonStringEnumClient; /** * Initialize a new instance of the class Int class. * @param client Reference to the service client */ - constructor(client: NonStringEnumClientContext) { + constructor(client: NonStringEnumClient) { this.client = client; } diff --git a/test/integration/generated/objectType/package.json b/test/integration/generated/objectType/package.json index 5eff20fa0b..9b5fba7fef 100644 --- a/test/integration/generated/objectType/package.json +++ b/test/integration/generated/objectType/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/objectType/src/index.ts b/test/integration/generated/objectType/src/index.ts index 0570e3decb..c605d1084b 100644 --- a/test/integration/generated/objectType/src/index.ts +++ b/test/integration/generated/objectType/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { ObjectTypeClient } from "./objectTypeClient"; -export { ObjectTypeClientContext } from "./objectTypeClientContext"; diff --git a/test/integration/generated/objectType/src/objectTypeClient.ts b/test/integration/generated/objectType/src/objectTypeClient.ts index bb9c60498b..a4cee6e15b 100644 --- a/test/integration/generated/objectType/src/objectTypeClient.ts +++ b/test/integration/generated/objectType/src/objectTypeClient.ts @@ -8,7 +8,6 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; -import { ObjectTypeClientContext } from "./objectTypeClientContext"; import { ObjectTypeClientOptionalParams, GetOptionalParams, @@ -16,13 +15,40 @@ import { PutOptionalParams } from "./models"; -export class ObjectTypeClient extends ObjectTypeClientContext { +export class ObjectTypeClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the ObjectTypeClient class. * @param options The parameter options */ constructor(options?: ObjectTypeClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ObjectTypeClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-object-type/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; } /** diff --git a/test/integration/generated/objectType/src/objectTypeClientContext.ts b/test/integration/generated/objectType/src/objectTypeClientContext.ts deleted file mode 100644 index 47fb2dc260..0000000000 --- a/test/integration/generated/objectType/src/objectTypeClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { ObjectTypeClientOptionalParams } from "./models"; - -export class ObjectTypeClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the ObjectTypeClientContext class. - * @param options The parameter options - */ - constructor(options?: ObjectTypeClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ObjectTypeClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-object-type/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/odataDiscriminator/package.json b/test/integration/generated/odataDiscriminator/package.json index 7f75073bc9..07ecd4dfda 100644 --- a/test/integration/generated/odataDiscriminator/package.json +++ b/test/integration/generated/odataDiscriminator/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/odataDiscriminator/src/index.ts b/test/integration/generated/odataDiscriminator/src/index.ts index 72ab36378f..87c5e65f76 100644 --- a/test/integration/generated/odataDiscriminator/src/index.ts +++ b/test/integration/generated/odataDiscriminator/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { ODataDiscriminatorClient } from "./oDataDiscriminatorClient"; -export { ODataDiscriminatorClientContext } from "./oDataDiscriminatorClientContext"; diff --git a/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClient.ts b/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClient.ts index fd73bbba81..64e32be063 100644 --- a/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClient.ts +++ b/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClient.ts @@ -9,15 +9,17 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { ODataDiscriminatorClientContext } from "./oDataDiscriminatorClientContext"; import { - ODataDiscriminatorClientOptionalParams, Enum0, + ODataDiscriminatorClientOptionalParams, ApiV1ValueGetOptionalParams, ApiV1ValueGetResponse } from "./models"; -export class ODataDiscriminatorClient extends ODataDiscriminatorClientContext { +export class ODataDiscriminatorClient extends coreClient.ServiceClient { + $host: string; + apiVersion: Enum0; + /** * Initializes a new instance of the ODataDiscriminatorClient class. * @param $host server parameter @@ -29,7 +31,39 @@ export class ODataDiscriminatorClient extends ODataDiscriminatorClientContext { apiVersion: Enum0, options?: ODataDiscriminatorClientOptionalParams ) { - super($host, apiVersion, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ODataDiscriminatorClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-odata-discriminator/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + this.apiVersion = apiVersion; } /** @param options The options parameters. */ diff --git a/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClientContext.ts b/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClientContext.ts deleted file mode 100644 index b8d36043c6..0000000000 --- a/test/integration/generated/odataDiscriminator/src/oDataDiscriminatorClientContext.ts +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { Enum0, ODataDiscriminatorClientOptionalParams } from "./models"; - -export class ODataDiscriminatorClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: Enum0; - - /** - * Initializes a new instance of the ODataDiscriminatorClientContext class. - * @param $host server parameter - * @param apiVersion - * @param options The parameter options - */ - constructor( - $host: string, - apiVersion: Enum0, - options?: ODataDiscriminatorClientOptionalParams - ) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ODataDiscriminatorClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-odata-discriminator/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - this.apiVersion = apiVersion; - } -} diff --git a/test/integration/generated/operationgroupclash/package.json b/test/integration/generated/operationgroupclash/package.json index 283a9d27b1..55d34f9542 100644 --- a/test/integration/generated/operationgroupclash/package.json +++ b/test/integration/generated/operationgroupclash/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/operationgroupclash/src/index.ts b/test/integration/generated/operationgroupclash/src/index.ts index 611e4166c5..e12fc6902d 100644 --- a/test/integration/generated/operationgroupclash/src/index.ts +++ b/test/integration/generated/operationgroupclash/src/index.ts @@ -1,4 +1,3 @@ export * from "./models"; export { OperationGroupClashClient } from "./operationGroupClashClient"; -export { OperationGroupClashClientContext } from "./operationGroupClashClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/operationgroupclash/src/operationGroupClashClient.ts b/test/integration/generated/operationgroupclash/src/operationGroupClashClient.ts index e7025c89ab..e3b7c2179a 100644 --- a/test/integration/generated/operationgroupclash/src/operationGroupClashClient.ts +++ b/test/integration/generated/operationgroupclash/src/operationGroupClashClient.ts @@ -1,9 +1,12 @@ +import * as coreClient from "@azure/core-client"; import { ProductOperationsImpl, PipelineOperationsImpl } from "./operations"; import { ProductOperations, PipelineOperations } from "./operationsInterfaces"; -import { OperationGroupClashClientContext } from "./operationGroupClashClientContext"; -import { OperationGroupClashClientOptionalParams, Enum0 } from "./models"; +import { Enum0, OperationGroupClashClientOptionalParams } from "./models"; + +export class OperationGroupClashClient extends coreClient.ServiceClient { + $host: string; + apiVersion: Enum0; -export class OperationGroupClashClient extends OperationGroupClashClientContext { /** * Initializes a new instance of the OperationGroupClashClient class. * @param $host server parameter @@ -15,7 +18,39 @@ export class OperationGroupClashClient extends OperationGroupClashClientContext apiVersion: Enum0, options?: OperationGroupClashClientOptionalParams ) { - super($host, apiVersion, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: OperationGroupClashClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-operationgroupclash/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; + this.apiVersion = apiVersion; this.productOperations = new ProductOperationsImpl(this); this.pipelineOperations = new PipelineOperationsImpl(this); } diff --git a/test/integration/generated/operationgroupclash/src/operationGroupClashClientContext.ts b/test/integration/generated/operationgroupclash/src/operationGroupClashClientContext.ts deleted file mode 100644 index ff27a395ac..0000000000 --- a/test/integration/generated/operationgroupclash/src/operationGroupClashClientContext.ts +++ /dev/null @@ -1,53 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { Enum0, OperationGroupClashClientOptionalParams } from "./models"; - -export class OperationGroupClashClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: Enum0; - - /** - * Initializes a new instance of the OperationGroupClashClientContext class. - * @param $host server parameter - * @param apiVersion - * @param options The parameter options - */ - constructor( - $host: string, - apiVersion: Enum0, - options?: OperationGroupClashClientOptionalParams - ) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: OperationGroupClashClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-operationgroupclash/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - this.apiVersion = apiVersion; - } -} diff --git a/test/integration/generated/operationgroupclash/src/operations/pipelineOperations.ts b/test/integration/generated/operationgroupclash/src/operations/pipelineOperations.ts index 0e4c198d8f..f2bb8cf8a6 100644 --- a/test/integration/generated/operationgroupclash/src/operations/pipelineOperations.ts +++ b/test/integration/generated/operationgroupclash/src/operations/pipelineOperations.ts @@ -2,7 +2,7 @@ import { PipelineOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { OperationGroupClashClientContext } from "../operationGroupClashClientContext"; +import { OperationGroupClashClient } from "../operationGroupClashClient"; import { PipelineApiV1ValueGetOptionalParams, PipelineApiV1ValueGetResponse @@ -10,13 +10,13 @@ import { /** Class containing PipelineOperations operations. */ export class PipelineOperationsImpl implements PipelineOperations { - private readonly client: OperationGroupClashClientContext; + private readonly client: OperationGroupClashClient; /** * Initialize a new instance of the class PipelineOperations class. * @param client Reference to the service client */ - constructor(client: OperationGroupClashClientContext) { + constructor(client: OperationGroupClashClient) { this.client = client; } diff --git a/test/integration/generated/operationgroupclash/src/operations/productOperations.ts b/test/integration/generated/operationgroupclash/src/operations/productOperations.ts index ae4540184d..aa91ece2d8 100644 --- a/test/integration/generated/operationgroupclash/src/operations/productOperations.ts +++ b/test/integration/generated/operationgroupclash/src/operations/productOperations.ts @@ -2,7 +2,7 @@ import { ProductOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { OperationGroupClashClientContext } from "../operationGroupClashClientContext"; +import { OperationGroupClashClient } from "../operationGroupClashClient"; import { ProductApiV1ValueGetOptionalParams, ProductApiV1ValueGetResponse @@ -10,13 +10,13 @@ import { /** Class containing ProductOperations operations. */ export class ProductOperationsImpl implements ProductOperations { - private readonly client: OperationGroupClashClientContext; + private readonly client: OperationGroupClashClient; /** * Initialize a new instance of the class ProductOperations class. * @param client Reference to the service client */ - constructor(client: OperationGroupClashClientContext) { + constructor(client: OperationGroupClashClient) { this.client = client; } diff --git a/test/integration/generated/optionalnull/package.json b/test/integration/generated/optionalnull/package.json index 4b05a8773b..11f6f198ba 100644 --- a/test/integration/generated/optionalnull/package.json +++ b/test/integration/generated/optionalnull/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/optionalnull/src/index.ts b/test/integration/generated/optionalnull/src/index.ts index 1a855f89b5..6b88093303 100644 --- a/test/integration/generated/optionalnull/src/index.ts +++ b/test/integration/generated/optionalnull/src/index.ts @@ -1,4 +1,3 @@ export * from "./models"; export { OptionalNullClient } from "./optionalNullClient"; -export { OptionalNullClientContext } from "./optionalNullClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/optionalnull/src/operations/documents.ts b/test/integration/generated/optionalnull/src/operations/documents.ts index 7b73c1624d..10de8aace7 100644 --- a/test/integration/generated/optionalnull/src/operations/documents.ts +++ b/test/integration/generated/optionalnull/src/operations/documents.ts @@ -2,18 +2,18 @@ import { Documents } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { OptionalNullClientContext } from "../optionalNullClientContext"; +import { OptionalNullClient } from "../optionalNullClient"; import { DocumentsSearchGetOptionalParams } from "../models"; /** Class containing Documents operations. */ export class DocumentsImpl implements Documents { - private readonly client: OptionalNullClientContext; + private readonly client: OptionalNullClient; /** * Initialize a new instance of the class Documents class. * @param client Reference to the service client */ - constructor(client: OptionalNullClientContext) { + constructor(client: OptionalNullClient) { this.client = client; } diff --git a/test/integration/generated/optionalnull/src/optionalNullClient.ts b/test/integration/generated/optionalnull/src/optionalNullClient.ts index 53a48c5bd2..2ae086ff31 100644 --- a/test/integration/generated/optionalnull/src/optionalNullClient.ts +++ b/test/integration/generated/optionalnull/src/optionalNullClient.ts @@ -1,16 +1,46 @@ +import * as coreClient from "@azure/core-client"; import { DocumentsImpl } from "./operations"; import { Documents } from "./operationsInterfaces"; -import { OptionalNullClientContext } from "./optionalNullClientContext"; import { OptionalNullClientOptionalParams } from "./models"; -export class OptionalNullClient extends OptionalNullClientContext { +export class OptionalNullClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the OptionalNullClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: OptionalNullClientOptionalParams) { - super($host, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: OptionalNullClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-optionalnull/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; this.documents = new DocumentsImpl(this); } diff --git a/test/integration/generated/optionalnull/src/optionalNullClientContext.ts b/test/integration/generated/optionalnull/src/optionalNullClientContext.ts deleted file mode 100644 index 96a9f52f76..0000000000 --- a/test/integration/generated/optionalnull/src/optionalNullClientContext.ts +++ /dev/null @@ -1,43 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { OptionalNullClientOptionalParams } from "./models"; - -export class OptionalNullClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the OptionalNullClientContext class. - * @param $host server parameter - * @param options The parameter options - */ - constructor($host: string, options?: OptionalNullClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: OptionalNullClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-optionalnull/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - } -} diff --git a/test/integration/generated/paging/package.json b/test/integration/generated/paging/package.json index 9c9aa3be4a..33e5d94617 100644 --- a/test/integration/generated/paging/package.json +++ b/test/integration/generated/paging/package.json @@ -30,7 +30,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/paging/src/index.ts b/test/integration/generated/paging/src/index.ts index 93722e9555..8799083d71 100644 --- a/test/integration/generated/paging/src/index.ts +++ b/test/integration/generated/paging/src/index.ts @@ -9,5 +9,4 @@ /// export * from "./models"; export { PagingClient } from "./pagingClient"; -export { PagingClientContext } from "./pagingClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/paging/src/operations/paging.ts b/test/integration/generated/paging/src/operations/paging.ts index 49d8aaede5..4395db6b03 100644 --- a/test/integration/generated/paging/src/operations/paging.ts +++ b/test/integration/generated/paging/src/operations/paging.ts @@ -13,7 +13,7 @@ import * as coreClient from "@azure/core-client"; import * as coreTracing from "@azure/core-tracing"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { PagingClientContext } from "../pagingClientContext"; +import { PagingClient } from "../pagingClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -91,13 +91,13 @@ import { /// /** Class containing Paging operations. */ export class PagingImpl implements Paging { - private readonly client: PagingClientContext; + private readonly client: PagingClient; /** * Initialize a new instance of the class Paging class. * @param client Reference to the service client */ - constructor(client: PagingClientContext) { + constructor(client: PagingClient) { this.client = client; } diff --git a/test/integration/generated/paging/src/pagingClient.ts b/test/integration/generated/paging/src/pagingClient.ts index 3350be50e9..85041ba7a0 100644 --- a/test/integration/generated/paging/src/pagingClient.ts +++ b/test/integration/generated/paging/src/pagingClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { PagingImpl } from "./operations"; import { Paging } from "./operationsInterfaces"; -import { PagingClientContext } from "./pagingClientContext"; import { PagingClientOptionalParams } from "./models"; -export class PagingClient extends PagingClientContext { +export class PagingClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the PagingClient class. * @param options The parameter options */ constructor(options?: PagingClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: PagingClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-paging-service/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.paging = new PagingImpl(this); } diff --git a/test/integration/generated/paging/src/pagingClientContext.ts b/test/integration/generated/paging/src/pagingClientContext.ts deleted file mode 100644 index e2c274db9f..0000000000 --- a/test/integration/generated/paging/src/pagingClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { PagingClientOptionalParams } from "./models"; - -export class PagingClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the PagingClientContext class. - * @param options The parameter options - */ - constructor(options?: PagingClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: PagingClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-paging-service/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/pagingNoIterators/package.json b/test/integration/generated/pagingNoIterators/package.json index 9fc9fe22f4..3c9a8965ce 100644 --- a/test/integration/generated/pagingNoIterators/package.json +++ b/test/integration/generated/pagingNoIterators/package.json @@ -27,7 +27,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/pagingNoIterators/src/index.ts b/test/integration/generated/pagingNoIterators/src/index.ts index 97d71c43b9..961750bcbd 100644 --- a/test/integration/generated/pagingNoIterators/src/index.ts +++ b/test/integration/generated/pagingNoIterators/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { PagingNoIteratorsClient } from "./pagingNoIteratorsClient"; -export { PagingNoIteratorsClientContext } from "./pagingNoIteratorsClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/pagingNoIterators/src/operations/paging.ts b/test/integration/generated/pagingNoIterators/src/operations/paging.ts index 454ba1185b..26d9297b91 100644 --- a/test/integration/generated/pagingNoIterators/src/operations/paging.ts +++ b/test/integration/generated/pagingNoIterators/src/operations/paging.ts @@ -10,7 +10,7 @@ import { Paging } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { PagingNoIteratorsClientContext } from "../pagingNoIteratorsClientContext"; +import { PagingNoIteratorsClient } from "../pagingNoIteratorsClient"; import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro"; import { LroImpl } from "../lroImpl"; import { @@ -86,13 +86,13 @@ import { /** Class containing Paging operations. */ export class PagingImpl implements Paging { - private readonly client: PagingNoIteratorsClientContext; + private readonly client: PagingNoIteratorsClient; /** * Initialize a new instance of the class Paging class. * @param client Reference to the service client */ - constructor(client: PagingNoIteratorsClientContext) { + constructor(client: PagingNoIteratorsClient) { this.client = client; } diff --git a/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClient.ts b/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClient.ts index e78284d942..7e21ec2aca 100644 --- a/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClient.ts +++ b/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { PagingImpl } from "./operations"; import { Paging } from "./operationsInterfaces"; -import { PagingNoIteratorsClientContext } from "./pagingNoIteratorsClientContext"; import { PagingNoIteratorsClientOptionalParams } from "./models"; -export class PagingNoIteratorsClient extends PagingNoIteratorsClientContext { +export class PagingNoIteratorsClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the PagingNoIteratorsClient class. * @param options The parameter options */ constructor(options?: PagingNoIteratorsClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: PagingNoIteratorsClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-paging-no-iterators/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.paging = new PagingImpl(this); } diff --git a/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClientContext.ts b/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClientContext.ts deleted file mode 100644 index 0c1feaa0a8..0000000000 --- a/test/integration/generated/pagingNoIterators/src/pagingNoIteratorsClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { PagingNoIteratorsClientOptionalParams } from "./models"; - -export class PagingNoIteratorsClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the PagingNoIteratorsClientContext class. - * @param options The parameter options - */ - constructor(options?: PagingNoIteratorsClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: PagingNoIteratorsClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-paging-no-iterators/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/pagingRest/package.json b/test/integration/generated/pagingRest/package.json index 98077902bc..c81988f825 100644 --- a/test/integration/generated/pagingRest/package.json +++ b/test/integration/generated/pagingRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/pagingRest/src/paging.ts b/test/integration/generated/pagingRest/src/paging.ts index 21556dfa7a..7e784714f5 100644 --- a/test/integration/generated/pagingRest/src/paging.ts +++ b/test/integration/generated/pagingRest/src/paging.ts @@ -317,9 +317,7 @@ export type PagingRestClient = Client & { export default function Paging(options: ClientOptions = {}): PagingRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - return getClient( - baseUrl, + const client = getClient(baseUrl, options) as PagingRestClient; - options - ) as PagingRestClient; + return client; } diff --git a/test/integration/generated/pagingRest/tsconfig.json b/test/integration/generated/pagingRest/tsconfig.json index 965341beea..0202cc6570 100644 --- a/test/integration/generated/pagingRest/tsconfig.json +++ b/test/integration/generated/pagingRest/tsconfig.json @@ -7,13 +7,5 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/test/integration/generated/petstore/package.json b/test/integration/generated/petstore/package.json index b8f7dc1ce9..87a3266ac7 100644 --- a/test/integration/generated/petstore/package.json +++ b/test/integration/generated/petstore/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/petstore/src/index.ts b/test/integration/generated/petstore/src/index.ts index 1e212493f3..e7627063d3 100644 --- a/test/integration/generated/petstore/src/index.ts +++ b/test/integration/generated/petstore/src/index.ts @@ -1,3 +1,2 @@ export * from "./models"; export { PetStore } from "./petStore"; -export { PetStoreContext } from "./petStoreContext"; diff --git a/test/integration/generated/petstore/src/petStore.ts b/test/integration/generated/petstore/src/petStore.ts index 23ffa34c96..70f3dd789b 100644 --- a/test/integration/generated/petstore/src/petStore.ts +++ b/test/integration/generated/petstore/src/petStore.ts @@ -1,7 +1,6 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { PetStoreContext } from "./petStoreContext"; import { PetStoreOptionalParams, AddPetUsingByteArray$binaryOptionalParams, @@ -38,13 +37,40 @@ import { DeleteUserOptionalParams } from "./models"; -export class PetStore extends PetStoreContext { +export class PetStore extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the PetStore class. * @param options The parameter options */ constructor(options?: PetStoreOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: PetStoreOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-petstore/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://petstore.swagger.io/v2" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://petstore.swagger.io/v2"; } /** diff --git a/test/integration/generated/petstore/src/petStoreContext.ts b/test/integration/generated/petstore/src/petStoreContext.ts deleted file mode 100644 index 321604d804..0000000000 --- a/test/integration/generated/petstore/src/petStoreContext.ts +++ /dev/null @@ -1,39 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { PetStoreOptionalParams } from "./models"; - -export class PetStoreContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the PetStoreContext class. - * @param options The parameter options - */ - constructor(options?: PetStoreOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: PetStoreOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-petstore/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://petstore.swagger.io/v2" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://petstore.swagger.io/v2"; - } -} diff --git a/test/integration/generated/polymorphicSkipNormalize/src/generated/index.ts b/test/integration/generated/polymorphicSkipNormalize/src/generated/index.ts index 181c807cee..0512bd167b 100644 --- a/test/integration/generated/polymorphicSkipNormalize/src/generated/index.ts +++ b/test/integration/generated/polymorphicSkipNormalize/src/generated/index.ts @@ -1,3 +1,2 @@ export * from "./models"; export { MediaServicesClient } from "./mediaServicesClient"; -export { MediaServicesClientContext } from "./mediaServicesClientContext"; diff --git a/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClient.ts b/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClient.ts index a5ffc600b0..9818b762eb 100644 --- a/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClient.ts +++ b/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClient.ts @@ -1,12 +1,34 @@ -import { MediaServicesClientContext } from "./mediaServicesClientContext"; +import * as coreClient from "@azure/core-client"; import { MediaServicesClientOptionalParams } from "./models"; -export class MediaServicesClient extends MediaServicesClientContext { +export class MediaServicesClient extends coreClient.ServiceClient { /** * Initializes a new instance of the MediaServicesClient class. * @param options The parameter options */ constructor(options?: MediaServicesClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: MediaServicesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-media-services/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint + }; + super(optionsWithDefaults); } } diff --git a/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClientContext.ts b/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClientContext.ts deleted file mode 100644 index af078f9a47..0000000000 --- a/test/integration/generated/polymorphicSkipNormalize/src/generated/mediaServicesClientContext.ts +++ /dev/null @@ -1,34 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { MediaServicesClientOptionalParams } from "./models"; - -export class MediaServicesClientContext extends coreClient.ServiceClient { - /** - * Initializes a new instance of the MediaServicesClientContext class. - * @param options The parameter options - */ - constructor(options?: MediaServicesClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: MediaServicesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-media-services/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint - }; - super(optionsWithDefaults); - } -} diff --git a/test/integration/generated/readmeFileChecker/package.json b/test/integration/generated/readmeFileChecker/package.json index 651f1f4307..fc94536d53 100644 --- a/test/integration/generated/readmeFileChecker/package.json +++ b/test/integration/generated/readmeFileChecker/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/readmeFileChecker/src/index.ts b/test/integration/generated/readmeFileChecker/src/index.ts index 2d61ce0624..3bf5f73dcc 100644 --- a/test/integration/generated/readmeFileChecker/src/index.ts +++ b/test/integration/generated/readmeFileChecker/src/index.ts @@ -1,3 +1,2 @@ export * from "./models"; export { KeyVaultClient } from "./keyVaultClient"; -export { KeyVaultClientContext } from "./keyVaultClientContext"; diff --git a/test/integration/generated/readmeFileChecker/src/keyVaultClient.ts b/test/integration/generated/readmeFileChecker/src/keyVaultClient.ts index f2fca6d5aa..6d5404e636 100644 --- a/test/integration/generated/readmeFileChecker/src/keyVaultClient.ts +++ b/test/integration/generated/readmeFileChecker/src/keyVaultClient.ts @@ -1,10 +1,9 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { KeyVaultClientContext } from "./keyVaultClientContext"; import { - KeyVaultClientOptionalParams, ApiVersion72Preview, + KeyVaultClientOptionalParams, SetSecretOptionalParams, SetSecretResponse, DeleteSecretOptionalParams, @@ -37,7 +36,9 @@ import { } from "./models"; /** @internal */ -export class KeyVaultClient extends KeyVaultClientContext { +export class KeyVaultClient extends coreClient.ServiceClient { + apiVersion: ApiVersion72Preview; + /** * Initializes a new instance of the KeyVaultClient class. * @param apiVersion Api Version @@ -47,7 +48,35 @@ export class KeyVaultClient extends KeyVaultClientContext { apiVersion: ApiVersion72Preview, options?: KeyVaultClientOptionalParams ) { - super(apiVersion, options); + if (apiVersion === undefined) { + throw new Error("'apiVersion' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: KeyVaultClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-keyvault-secrets/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{vaultBaseUrl}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.apiVersion = apiVersion; } /** diff --git a/test/integration/generated/readmeFileChecker/src/keyVaultClientContext.ts b/test/integration/generated/readmeFileChecker/src/keyVaultClientContext.ts deleted file mode 100644 index feeb5d865b..0000000000 --- a/test/integration/generated/readmeFileChecker/src/keyVaultClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { ApiVersion72Preview, KeyVaultClientOptionalParams } from "./models"; - -/** @internal */ -export class KeyVaultClientContext extends coreClient.ServiceClient { - apiVersion: ApiVersion72Preview; - - /** - * Initializes a new instance of the KeyVaultClientContext class. - * @param apiVersion Api Version - * @param options The parameter options - */ - constructor( - apiVersion: ApiVersion72Preview, - options?: KeyVaultClientOptionalParams - ) { - if (apiVersion === undefined) { - throw new Error("'apiVersion' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: KeyVaultClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-keyvault-secrets/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{vaultBaseUrl}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.apiVersion = apiVersion; - } -} diff --git a/test/integration/generated/regexConstraint/package.json b/test/integration/generated/regexConstraint/package.json index cbc8154b22..1357defd88 100644 --- a/test/integration/generated/regexConstraint/package.json +++ b/test/integration/generated/regexConstraint/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/regexConstraint/src/index.ts b/test/integration/generated/regexConstraint/src/index.ts index 4faab7d293..14324e9d64 100644 --- a/test/integration/generated/regexConstraint/src/index.ts +++ b/test/integration/generated/regexConstraint/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { RegexConstraint } from "./regexConstraint"; -export { RegexConstraintContext } from "./regexConstraintContext"; diff --git a/test/integration/generated/regexConstraint/src/regexConstraint.ts b/test/integration/generated/regexConstraint/src/regexConstraint.ts index bfa657b6b4..a9d24c5ec2 100644 --- a/test/integration/generated/regexConstraint/src/regexConstraint.ts +++ b/test/integration/generated/regexConstraint/src/regexConstraint.ts @@ -8,21 +8,50 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; -import { RegexConstraintContext } from "./regexConstraintContext"; import { RegexConstraintOptionalParams, ApiV1ValueGetOptionalParams, ApiV1ValueGetResponse } from "./models"; -export class RegexConstraint extends RegexConstraintContext { +export class RegexConstraint extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the RegexConstraint class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: RegexConstraintOptionalParams) { - super($host, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: RegexConstraintOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-regex-constraint/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; } /** diff --git a/test/integration/generated/regexConstraint/src/regexConstraintContext.ts b/test/integration/generated/regexConstraint/src/regexConstraintContext.ts deleted file mode 100644 index 71ef72b6b0..0000000000 --- a/test/integration/generated/regexConstraint/src/regexConstraintContext.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { RegexConstraintOptionalParams } from "./models"; - -export class RegexConstraintContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the RegexConstraintContext class. - * @param $host server parameter - * @param options The parameter options - */ - constructor($host: string, options?: RegexConstraintOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: RegexConstraintOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-regex-constraint/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - } -} diff --git a/test/integration/generated/report/package.json b/test/integration/generated/report/package.json index a99ee8a7b0..e01430ce01 100644 --- a/test/integration/generated/report/package.json +++ b/test/integration/generated/report/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/report/src/index.ts b/test/integration/generated/report/src/index.ts index 5a2e464d52..597f974fe7 100644 --- a/test/integration/generated/report/src/index.ts +++ b/test/integration/generated/report/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { ReportClient } from "./reportClient"; -export { ReportClientContext } from "./reportClientContext"; diff --git a/test/integration/generated/report/src/reportClient.ts b/test/integration/generated/report/src/reportClient.ts index ef43d11cfb..41fdd6314e 100644 --- a/test/integration/generated/report/src/reportClient.ts +++ b/test/integration/generated/report/src/reportClient.ts @@ -9,7 +9,6 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { ReportClientContext } from "./reportClientContext"; import { ReportClientOptionalParams, GetReportOptionalParams, @@ -18,13 +17,40 @@ import { GetOptionalReportResponse } from "./models"; -export class ReportClient extends ReportClientContext { +export class ReportClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the ReportClient class. * @param options The parameter options */ constructor(options?: ReportClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ReportClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-zzzReport/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; } /** diff --git a/test/integration/generated/report/src/reportClientContext.ts b/test/integration/generated/report/src/reportClientContext.ts deleted file mode 100644 index 8313b2c37f..0000000000 --- a/test/integration/generated/report/src/reportClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { ReportClientOptionalParams } from "./models"; - -export class ReportClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the ReportClientContext class. - * @param options The parameter options - */ - constructor(options?: ReportClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ReportClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-zzzReport/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/requiredOptional/package.json b/test/integration/generated/requiredOptional/package.json index 901861026a..4e7c443317 100644 --- a/test/integration/generated/requiredOptional/package.json +++ b/test/integration/generated/requiredOptional/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/requiredOptional/src/index.ts b/test/integration/generated/requiredOptional/src/index.ts index ee04017c01..e6c355a1c6 100644 --- a/test/integration/generated/requiredOptional/src/index.ts +++ b/test/integration/generated/requiredOptional/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { RequiredOptionalClient } from "./requiredOptionalClient"; -export { RequiredOptionalClientContext } from "./requiredOptionalClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/requiredOptional/src/operations/explicit.ts b/test/integration/generated/requiredOptional/src/operations/explicit.ts index 3d9c19ba28..4eb1043f1d 100644 --- a/test/integration/generated/requiredOptional/src/operations/explicit.ts +++ b/test/integration/generated/requiredOptional/src/operations/explicit.ts @@ -11,7 +11,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RequiredOptionalClientContext } from "../requiredOptionalClientContext"; +import { RequiredOptionalClient } from "../requiredOptionalClient"; import { ExplicitPutOptionalBinaryBodyOptionalParams, ExplicitPutRequiredBinaryBodyOptionalParams, @@ -46,13 +46,13 @@ import { /** Class containing Explicit operations. */ export class ExplicitImpl implements Explicit { - private readonly client: RequiredOptionalClientContext; + private readonly client: RequiredOptionalClient; /** * Initialize a new instance of the class Explicit class. * @param client Reference to the service client */ - constructor(client: RequiredOptionalClientContext) { + constructor(client: RequiredOptionalClient) { this.client = client; } diff --git a/test/integration/generated/requiredOptional/src/operations/implicit.ts b/test/integration/generated/requiredOptional/src/operations/implicit.ts index 43805eda03..53fb37fb8a 100644 --- a/test/integration/generated/requiredOptional/src/operations/implicit.ts +++ b/test/integration/generated/requiredOptional/src/operations/implicit.ts @@ -10,7 +10,7 @@ import { Implicit } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { RequiredOptionalClientContext } from "../requiredOptionalClientContext"; +import { RequiredOptionalClient } from "../requiredOptionalClient"; import { ImplicitGetRequiredPathOptionalParams, ImplicitPutOptionalQueryOptionalParams, @@ -24,13 +24,13 @@ import { /** Class containing Implicit operations. */ export class ImplicitImpl implements Implicit { - private readonly client: RequiredOptionalClientContext; + private readonly client: RequiredOptionalClient; /** * Initialize a new instance of the class Implicit class. * @param client Reference to the service client */ - constructor(client: RequiredOptionalClientContext) { + constructor(client: RequiredOptionalClient) { this.client = client; } diff --git a/test/integration/generated/requiredOptional/src/requiredOptionalClient.ts b/test/integration/generated/requiredOptional/src/requiredOptionalClient.ts index 0095eedb42..35403e7a93 100644 --- a/test/integration/generated/requiredOptional/src/requiredOptionalClient.ts +++ b/test/integration/generated/requiredOptional/src/requiredOptionalClient.ts @@ -6,12 +6,17 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { ImplicitImpl, ExplicitImpl } from "./operations"; import { Implicit, Explicit } from "./operationsInterfaces"; -import { RequiredOptionalClientContext } from "./requiredOptionalClientContext"; import { RequiredOptionalClientOptionalParams } from "./models"; -export class RequiredOptionalClient extends RequiredOptionalClientContext { +export class RequiredOptionalClient extends coreClient.ServiceClient { + $host: string; + requiredGlobalPath: string; + requiredGlobalQuery: string; + optionalGlobalQuery?: number; + /** * Initializes a new instance of the RequiredOptionalClient class. * @param requiredGlobalPath number of items to skip @@ -23,7 +28,42 @@ export class RequiredOptionalClient extends RequiredOptionalClientContext { requiredGlobalQuery: string, options?: RequiredOptionalClientOptionalParams ) { - super(requiredGlobalPath, requiredGlobalQuery, options); + if (requiredGlobalPath === undefined) { + throw new Error("'requiredGlobalPath' cannot be null"); + } + if (requiredGlobalQuery === undefined) { + throw new Error("'requiredGlobalQuery' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: RequiredOptionalClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-required-optional/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + // Parameter assignments + this.requiredGlobalPath = requiredGlobalPath; + this.requiredGlobalQuery = requiredGlobalQuery; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.implicit = new ImplicitImpl(this); this.explicit = new ExplicitImpl(this); } diff --git a/test/integration/generated/requiredOptional/src/requiredOptionalClientContext.ts b/test/integration/generated/requiredOptional/src/requiredOptionalClientContext.ts deleted file mode 100644 index 96b712bc0b..0000000000 --- a/test/integration/generated/requiredOptional/src/requiredOptionalClientContext.ts +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { RequiredOptionalClientOptionalParams } from "./models"; - -export class RequiredOptionalClientContext extends coreClient.ServiceClient { - $host: string; - requiredGlobalPath: string; - requiredGlobalQuery: string; - optionalGlobalQuery?: number; - - /** - * Initializes a new instance of the RequiredOptionalClientContext class. - * @param requiredGlobalPath number of items to skip - * @param requiredGlobalQuery number of items to skip - * @param options The parameter options - */ - constructor( - requiredGlobalPath: string, - requiredGlobalQuery: string, - options?: RequiredOptionalClientOptionalParams - ) { - if (requiredGlobalPath === undefined) { - throw new Error("'requiredGlobalPath' cannot be null"); - } - if (requiredGlobalQuery === undefined) { - throw new Error("'requiredGlobalQuery' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: RequiredOptionalClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-required-optional/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - // Parameter assignments - this.requiredGlobalPath = requiredGlobalPath; - this.requiredGlobalQuery = requiredGlobalQuery; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/resources/package.json b/test/integration/generated/resources/package.json index 68d3396693..e0c4a3c08d 100644 --- a/test/integration/generated/resources/package.json +++ b/test/integration/generated/resources/package.json @@ -26,7 +26,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/resources/src/index.ts b/test/integration/generated/resources/src/index.ts index 33fe3d93b2..535f6d990a 100644 --- a/test/integration/generated/resources/src/index.ts +++ b/test/integration/generated/resources/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { ResourcesClient } from "./resourcesClient"; -export { ResourcesClientContext } from "./resourcesClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/resources/src/operations/resourceGroups.ts b/test/integration/generated/resources/src/operations/resourceGroups.ts index d3326d6626..9523e02489 100644 --- a/test/integration/generated/resources/src/operations/resourceGroups.ts +++ b/test/integration/generated/resources/src/operations/resourceGroups.ts @@ -10,7 +10,7 @@ import { ResourceGroups } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { ResourcesClientContext } from "../resourcesClientContext"; +import { ResourcesClient } from "../resourcesClient"; import { ResourceGroupsCheckExistenceOptionalParams, ResourceGroupsCheckExistenceResponse @@ -18,13 +18,13 @@ import { /** Class containing ResourceGroups operations. */ export class ResourceGroupsImpl implements ResourceGroups { - private readonly client: ResourcesClientContext; + private readonly client: ResourcesClient; /** * Initialize a new instance of the class ResourceGroups class. * @param client Reference to the service client */ - constructor(client: ResourcesClientContext) { + constructor(client: ResourcesClient) { this.client = client; } diff --git a/test/integration/generated/resources/src/resourcesClient.ts b/test/integration/generated/resources/src/resourcesClient.ts index cda4095a55..93ceefdb62 100644 --- a/test/integration/generated/resources/src/resourcesClient.ts +++ b/test/integration/generated/resources/src/resourcesClient.ts @@ -6,13 +6,17 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import * as coreAuth from "@azure/core-auth"; import { ResourceGroupsImpl } from "./operations"; import { ResourceGroups } from "./operationsInterfaces"; -import { ResourcesClientContext } from "./resourcesClientContext"; import { ResourcesClientOptionalParams } from "./models"; -export class ResourcesClient extends ResourcesClientContext { +export class ResourcesClient extends coreClient.ServiceClient { + $host: string; + apiVersion: string; + subscriptionId: string; + /** * Initializes a new instance of the ResourcesClient class. * @param credentials Subscription credentials which uniquely identify client subscription. @@ -24,7 +28,43 @@ export class ResourcesClient extends ResourcesClientContext { subscriptionId: string, options?: ResourcesClientOptionalParams ) { - super(credentials, subscriptionId, options); + if (credentials === undefined) { + throw new Error("'credentials' cannot be null"); + } + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ResourcesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8", + credential: credentials + }; + + const packageDetails = `azsdk-js-resources/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "https://management.azure.com" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "https://management.azure.com"; + this.apiVersion = options.apiVersion || "2020-10-01"; this.resourceGroups = new ResourceGroupsImpl(this); } diff --git a/test/integration/generated/resources/src/resourcesClientContext.ts b/test/integration/generated/resources/src/resourcesClientContext.ts deleted file mode 100644 index 61cbd4cb57..0000000000 --- a/test/integration/generated/resources/src/resourcesClientContext.ts +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import * as coreAuth from "@azure/core-auth"; -import { ResourcesClientOptionalParams } from "./models"; - -export class ResourcesClientContext extends coreClient.ServiceClient { - $host: string; - apiVersion: string; - subscriptionId: string; - - /** - * Initializes a new instance of the ResourcesClientContext class. - * @param credentials Subscription credentials which uniquely identify client subscription. - * @param subscriptionId The ID of the target subscription. - * @param options The parameter options - */ - constructor( - credentials: coreAuth.TokenCredential, - subscriptionId: string, - options?: ResourcesClientOptionalParams - ) { - if (credentials === undefined) { - throw new Error("'credentials' cannot be null"); - } - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ResourcesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8", - credential: credentials - }; - - const packageDetails = `azsdk-js-resources/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "https://management.azure.com" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2020-10-01"; - } -} diff --git a/test/integration/generated/sealedchoice/package.json b/test/integration/generated/sealedchoice/package.json index 11e7ef2f35..bb80e079a1 100644 --- a/test/integration/generated/sealedchoice/package.json +++ b/test/integration/generated/sealedchoice/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/sealedchoice/src/index.ts b/test/integration/generated/sealedchoice/src/index.ts index 91c343f2ec..74e9a8df24 100644 --- a/test/integration/generated/sealedchoice/src/index.ts +++ b/test/integration/generated/sealedchoice/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { SealedChoiceClient } from "./sealedChoiceClient"; -export { SealedChoiceClientContext } from "./sealedChoiceClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/sealedchoice/src/operations/authentication.ts b/test/integration/generated/sealedchoice/src/operations/authentication.ts index cf2892c7ca..4422b2654c 100644 --- a/test/integration/generated/sealedchoice/src/operations/authentication.ts +++ b/test/integration/generated/sealedchoice/src/operations/authentication.ts @@ -10,7 +10,7 @@ import { Authentication } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SealedChoiceClientContext } from "../sealedChoiceClientContext"; +import { SealedChoiceClient } from "../sealedChoiceClient"; import { TokenGrantType, AuthenticationExchangeAcrRefreshTokenForAcrAccessTokenOptionalParams @@ -18,13 +18,13 @@ import { /** Class containing Authentication operations. */ export class AuthenticationImpl implements Authentication { - private readonly client: SealedChoiceClientContext; + private readonly client: SealedChoiceClient; /** * Initialize a new instance of the class Authentication class. * @param client Reference to the service client */ - constructor(client: SealedChoiceClientContext) { + constructor(client: SealedChoiceClient) { this.client = client; } diff --git a/test/integration/generated/sealedchoice/src/sealedChoiceClient.ts b/test/integration/generated/sealedchoice/src/sealedChoiceClient.ts index ef6a75f9cf..207a936166 100644 --- a/test/integration/generated/sealedchoice/src/sealedChoiceClient.ts +++ b/test/integration/generated/sealedchoice/src/sealedChoiceClient.ts @@ -6,19 +6,49 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { AuthenticationImpl } from "./operations"; import { Authentication } from "./operationsInterfaces"; -import { SealedChoiceClientContext } from "./sealedChoiceClientContext"; import { SealedChoiceClientOptionalParams } from "./models"; -export class SealedChoiceClient extends SealedChoiceClientContext { +export class SealedChoiceClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the SealedChoiceClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: SealedChoiceClientOptionalParams) { - super($host, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: SealedChoiceClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-sealedchoice/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; this.authentication = new AuthenticationImpl(this); } diff --git a/test/integration/generated/sealedchoice/src/sealedChoiceClientContext.ts b/test/integration/generated/sealedchoice/src/sealedChoiceClientContext.ts deleted file mode 100644 index 48672b0efe..0000000000 --- a/test/integration/generated/sealedchoice/src/sealedChoiceClientContext.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { SealedChoiceClientOptionalParams } from "./models"; - -export class SealedChoiceClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the SealedChoiceClientContext class. - * @param $host server parameter - * @param options The parameter options - */ - constructor($host: string, options?: SealedChoiceClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: SealedChoiceClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-sealedchoice/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - } -} diff --git a/test/integration/generated/storageblob/package.json b/test/integration/generated/storageblob/package.json index 1d39e32e72..4eece87a10 100644 --- a/test/integration/generated/storageblob/package.json +++ b/test/integration/generated/storageblob/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/storageblob/src/index.ts b/test/integration/generated/storageblob/src/index.ts index 5c1aa22efd..74a2462cea 100644 --- a/test/integration/generated/storageblob/src/index.ts +++ b/test/integration/generated/storageblob/src/index.ts @@ -1,4 +1,3 @@ export * from "./models"; export { StorageBlobClient } from "./storageBlobClient"; -export { StorageBlobClientContext } from "./storageBlobClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/storageblob/src/operations/appendBlob.ts b/test/integration/generated/storageblob/src/operations/appendBlob.ts index e2d1fe4f9f..e257ecd798 100644 --- a/test/integration/generated/storageblob/src/operations/appendBlob.ts +++ b/test/integration/generated/storageblob/src/operations/appendBlob.ts @@ -3,7 +3,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageBlobClientContext } from "../storageBlobClientContext"; +import { StorageBlobClient } from "../storageBlobClient"; import { AppendBlobAppendBlockOptionalParams, AppendBlobAppendBlockResponse @@ -11,13 +11,13 @@ import { /** Class containing AppendBlob operations. */ export class AppendBlobImpl implements AppendBlob { - private readonly client: StorageBlobClientContext; + private readonly client: StorageBlobClient; /** * Initialize a new instance of the class AppendBlob class. * @param client Reference to the service client */ - constructor(client: StorageBlobClientContext) { + constructor(client: StorageBlobClient) { this.client = client; } diff --git a/test/integration/generated/storageblob/src/operations/blockBlob.ts b/test/integration/generated/storageblob/src/operations/blockBlob.ts index 9e1355d7ce..2b1f8905ce 100644 --- a/test/integration/generated/storageblob/src/operations/blockBlob.ts +++ b/test/integration/generated/storageblob/src/operations/blockBlob.ts @@ -3,7 +3,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageBlobClientContext } from "../storageBlobClientContext"; +import { StorageBlobClient } from "../storageBlobClient"; import { BlockBlobStageBlockOptionalParams, BlockBlobStageBlockResponse, @@ -15,13 +15,13 @@ import { /** Class containing BlockBlob operations. */ export class BlockBlobImpl implements BlockBlob { - private readonly client: StorageBlobClientContext; + private readonly client: StorageBlobClient; /** * Initialize a new instance of the class BlockBlob class. * @param client Reference to the service client */ - constructor(client: StorageBlobClientContext) { + constructor(client: StorageBlobClient) { this.client = client; } diff --git a/test/integration/generated/storageblob/src/operations/pageBlob.ts b/test/integration/generated/storageblob/src/operations/pageBlob.ts index 322d95b72f..c0b71e1a2a 100644 --- a/test/integration/generated/storageblob/src/operations/pageBlob.ts +++ b/test/integration/generated/storageblob/src/operations/pageBlob.ts @@ -3,7 +3,7 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageBlobClientContext } from "../storageBlobClientContext"; +import { StorageBlobClient } from "../storageBlobClient"; import { PageBlobUploadPagesOptionalParams, PageBlobUploadPagesResponse @@ -11,13 +11,13 @@ import { /** Class containing PageBlob operations. */ export class PageBlobImpl implements PageBlob { - private readonly client: StorageBlobClientContext; + private readonly client: StorageBlobClient; /** * Initialize a new instance of the class PageBlob class. * @param client Reference to the service client */ - constructor(client: StorageBlobClientContext) { + constructor(client: StorageBlobClient) { this.client = client; } diff --git a/test/integration/generated/storageblob/src/storageBlobClient.ts b/test/integration/generated/storageblob/src/storageBlobClient.ts index 83876fc888..58e4f9da7e 100644 --- a/test/integration/generated/storageblob/src/storageBlobClient.ts +++ b/test/integration/generated/storageblob/src/storageBlobClient.ts @@ -1,9 +1,12 @@ +import * as coreClient from "@azure/core-client"; import { PageBlobImpl, BlockBlobImpl, AppendBlobImpl } from "./operations"; import { PageBlob, BlockBlob, AppendBlob } from "./operationsInterfaces"; -import { StorageBlobClientContext } from "./storageBlobClientContext"; import { StorageBlobClientOptionalParams } from "./models"; -export class StorageBlobClient extends StorageBlobClientContext { +export class StorageBlobClient extends coreClient.ServiceClient { + url: string; + version: string; + /** * Initializes a new instance of the StorageBlobClient class. * @param url The URL of the service account, container, or blob that is the targe of the desired @@ -11,7 +14,38 @@ export class StorageBlobClient extends StorageBlobClientContext { * @param options The parameter options */ constructor(url: string, options?: StorageBlobClientOptionalParams) { - super(url, options); + if (url === undefined) { + throw new Error("'url' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: StorageBlobClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-storageblob/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{url}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.url = url; + + // Assigning values to Constant parameters + this.version = options.version || "2020-06-12"; this.pageBlob = new PageBlobImpl(this); this.blockBlob = new BlockBlobImpl(this); this.appendBlob = new AppendBlobImpl(this); diff --git a/test/integration/generated/storageblob/src/storageBlobClientContext.ts b/test/integration/generated/storageblob/src/storageBlobClientContext.ts deleted file mode 100644 index 8e52ea3a49..0000000000 --- a/test/integration/generated/storageblob/src/storageBlobClientContext.ts +++ /dev/null @@ -1,48 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { StorageBlobClientOptionalParams } from "./models"; - -export class StorageBlobClientContext extends coreClient.ServiceClient { - url: string; - version: string; - - /** - * Initializes a new instance of the StorageBlobClientContext class. - * @param url The URL of the service account, container, or blob that is the targe of the desired - * operation. - * @param options The parameter options - */ - constructor(url: string, options?: StorageBlobClientOptionalParams) { - if (url === undefined) { - throw new Error("'url' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: StorageBlobClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-storageblob/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{url}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.url = url; - - // Assigning values to Constant parameters - this.version = options.version || "2020-06-12"; - } -} diff --git a/test/integration/generated/storagefileshare/package.json b/test/integration/generated/storagefileshare/package.json index a7b34560cb..1985c037c9 100644 --- a/test/integration/generated/storagefileshare/package.json +++ b/test/integration/generated/storagefileshare/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/storagefileshare/src/index.ts b/test/integration/generated/storagefileshare/src/index.ts index 94b40f6f2c..69e726bc75 100644 --- a/test/integration/generated/storagefileshare/src/index.ts +++ b/test/integration/generated/storagefileshare/src/index.ts @@ -1,4 +1,3 @@ export * from "./models"; export { StorageFileShareClient } from "./storageFileShareClient"; -export { StorageFileShareClientContext } from "./storageFileShareClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/storagefileshare/src/operations/file.ts b/test/integration/generated/storagefileshare/src/operations/file.ts index 7be858f606..3af508a0d6 100644 --- a/test/integration/generated/storagefileshare/src/operations/file.ts +++ b/test/integration/generated/storagefileshare/src/operations/file.ts @@ -2,7 +2,7 @@ import { File } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { StorageFileShareClientContext } from "../storageFileShareClientContext"; +import { StorageFileShareClient } from "../storageFileShareClient"; import { FileUploadRangeFromURLOptionalParams, FileUploadRangeFromURLResponse @@ -10,13 +10,13 @@ import { /** Class containing File operations. */ export class FileImpl implements File { - private readonly client: StorageFileShareClientContext; + private readonly client: StorageFileShareClient; /** * Initialize a new instance of the class File class. * @param client Reference to the service client */ - constructor(client: StorageFileShareClientContext) { + constructor(client: StorageFileShareClient) { this.client = client; } diff --git a/test/integration/generated/storagefileshare/src/storageFileShareClient.ts b/test/integration/generated/storagefileshare/src/storageFileShareClient.ts index f22dcff604..14c86def16 100644 --- a/test/integration/generated/storagefileshare/src/storageFileShareClient.ts +++ b/test/integration/generated/storagefileshare/src/storageFileShareClient.ts @@ -1,9 +1,13 @@ +import * as coreClient from "@azure/core-client"; import { FileImpl } from "./operations"; import { File } from "./operationsInterfaces"; -import { StorageFileShareClientContext } from "./storageFileShareClientContext"; import { StorageFileShareClientOptionalParams } from "./models"; -export class StorageFileShareClient extends StorageFileShareClientContext { +export class StorageFileShareClient extends coreClient.ServiceClient { + url: string; + fileRangeWriteFromUrl: string; + version: string; + /** * Initializes a new instance of the StorageFileShareClient class. * @param url The URL of the service account, share, directory or file that is the target of the @@ -11,7 +15,39 @@ export class StorageFileShareClient extends StorageFileShareClientContext { * @param options The parameter options */ constructor(url: string, options?: StorageFileShareClientOptionalParams) { - super(url, options); + if (url === undefined) { + throw new Error("'url' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: StorageFileShareClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-storagefileshare/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{url}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.url = url; + + // Assigning values to Constant parameters + this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update"; + this.version = options.version || "2020-04-08"; this.file = new FileImpl(this); } diff --git a/test/integration/generated/storagefileshare/src/storageFileShareClientContext.ts b/test/integration/generated/storagefileshare/src/storageFileShareClientContext.ts deleted file mode 100644 index 0a2010b1ce..0000000000 --- a/test/integration/generated/storagefileshare/src/storageFileShareClientContext.ts +++ /dev/null @@ -1,50 +0,0 @@ -import * as coreClient from "@azure/core-client"; -import { StorageFileShareClientOptionalParams } from "./models"; - -export class StorageFileShareClientContext extends coreClient.ServiceClient { - url: string; - fileRangeWriteFromUrl: string; - version: string; - - /** - * Initializes a new instance of the StorageFileShareClientContext class. - * @param url The URL of the service account, share, directory or file that is the target of the - * desired operation. - * @param options The parameter options - */ - constructor(url: string, options?: StorageFileShareClientOptionalParams) { - if (url === undefined) { - throw new Error("'url' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: StorageFileShareClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-storagefileshare/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{url}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.url = url; - - // Assigning values to Constant parameters - this.fileRangeWriteFromUrl = options.fileRangeWriteFromUrl || "update"; - this.version = options.version || "2020-04-08"; - } -} diff --git a/test/integration/generated/subscriptionIdApiVersion/package.json b/test/integration/generated/subscriptionIdApiVersion/package.json index 78b55da2ed..9112210fe3 100644 --- a/test/integration/generated/subscriptionIdApiVersion/package.json +++ b/test/integration/generated/subscriptionIdApiVersion/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/subscriptionIdApiVersion/src/index.ts b/test/integration/generated/subscriptionIdApiVersion/src/index.ts index 9a12c4595d..84314295c4 100644 --- a/test/integration/generated/subscriptionIdApiVersion/src/index.ts +++ b/test/integration/generated/subscriptionIdApiVersion/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { SubscriptionIdApiVersionClient } from "./subscriptionIdApiVersionClient"; -export { SubscriptionIdApiVersionClientContext } from "./subscriptionIdApiVersionClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/subscriptionIdApiVersion/src/operations/group.ts b/test/integration/generated/subscriptionIdApiVersion/src/operations/group.ts index af41c3be01..1566d3c8cb 100644 --- a/test/integration/generated/subscriptionIdApiVersion/src/operations/group.ts +++ b/test/integration/generated/subscriptionIdApiVersion/src/operations/group.ts @@ -10,7 +10,7 @@ import { Group } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { SubscriptionIdApiVersionClientContext } from "../subscriptionIdApiVersionClientContext"; +import { SubscriptionIdApiVersionClient } from "../subscriptionIdApiVersionClient"; import { GroupGetSampleResourceGroupOptionalParams, GroupGetSampleResourceGroupResponse @@ -18,13 +18,13 @@ import { /** Class containing Group operations. */ export class GroupImpl implements Group { - private readonly client: SubscriptionIdApiVersionClientContext; + private readonly client: SubscriptionIdApiVersionClient; /** * Initialize a new instance of the class Group class. * @param client Reference to the service client */ - constructor(client: SubscriptionIdApiVersionClientContext) { + constructor(client: SubscriptionIdApiVersionClient) { this.client = client; } diff --git a/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClient.ts b/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClient.ts index 5181264149..c2010bce20 100644 --- a/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClient.ts +++ b/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClient.ts @@ -6,12 +6,16 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { GroupImpl } from "./operations"; import { Group } from "./operationsInterfaces"; -import { SubscriptionIdApiVersionClientContext } from "./subscriptionIdApiVersionClientContext"; import { SubscriptionIdApiVersionClientOptionalParams } from "./models"; -export class SubscriptionIdApiVersionClient extends SubscriptionIdApiVersionClientContext { +export class SubscriptionIdApiVersionClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + /** * Initializes a new instance of the SubscriptionIdApiVersionClient class. * @param subscriptionId Subscription Id. @@ -21,7 +25,39 @@ export class SubscriptionIdApiVersionClient extends SubscriptionIdApiVersionClie subscriptionId: string, options?: SubscriptionIdApiVersionClientOptionalParams ) { - super(subscriptionId, options); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: SubscriptionIdApiVersionClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-subscriptionid-apiversion/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "2014-04-01-preview"; this.group = new GroupImpl(this); } diff --git a/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClientContext.ts b/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClientContext.ts deleted file mode 100644 index dc7d3d7aca..0000000000 --- a/test/integration/generated/subscriptionIdApiVersion/src/subscriptionIdApiVersionClientContext.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { SubscriptionIdApiVersionClientOptionalParams } from "./models"; - -export class SubscriptionIdApiVersionClientContext extends coreClient.ServiceClient { - $host: string; - subscriptionId: string; - apiVersion: string; - - /** - * Initializes a new instance of the SubscriptionIdApiVersionClientContext class. - * @param subscriptionId Subscription Id. - * @param options The parameter options - */ - constructor( - subscriptionId: string, - options?: SubscriptionIdApiVersionClientOptionalParams - ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: SubscriptionIdApiVersionClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-subscriptionid-apiversion/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "2014-04-01-preview"; - } -} diff --git a/test/integration/generated/textanalytics/package.json b/test/integration/generated/textanalytics/package.json index e688c4f8e6..579e3e73ed 100644 --- a/test/integration/generated/textanalytics/package.json +++ b/test/integration/generated/textanalytics/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/textanalytics/src/generatedClient.ts b/test/integration/generated/textanalytics/src/generatedClient.ts index d67f5bc228..3e35781635 100644 --- a/test/integration/generated/textanalytics/src/generatedClient.ts +++ b/test/integration/generated/textanalytics/src/generatedClient.ts @@ -9,7 +9,6 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { GeneratedClientContext } from "./generatedClientContext"; import { GeneratedClientOptionalParams, AnalyzeOptionalParams, @@ -39,7 +38,9 @@ import { } from "./models"; /** @internal */ -export class GeneratedClient extends GeneratedClientContext { +export class GeneratedClient extends coreClient.ServiceClient { + endpoint: string; + /** * Initializes a new instance of the GeneratedClient class. * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: @@ -47,7 +48,35 @@ export class GeneratedClient extends GeneratedClientContext { * @param options The parameter options */ constructor(endpoint: string, options?: GeneratedClientOptionalParams) { - super(endpoint, options); + if (endpoint === undefined) { + throw new Error("'endpoint' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: GeneratedClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-textanalytics/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{Endpoint}/text/analytics/v3.1-preview.4" + }; + super(optionsWithDefaults); + // Parameter assignments + this.endpoint = endpoint; } /** diff --git a/test/integration/generated/textanalytics/src/generatedClientContext.ts b/test/integration/generated/textanalytics/src/generatedClientContext.ts deleted file mode 100644 index 8d6dd24c73..0000000000 --- a/test/integration/generated/textanalytics/src/generatedClientContext.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { GeneratedClientOptionalParams } from "./models"; - -/** @internal */ -export class GeneratedClientContext extends coreClient.ServiceClient { - endpoint: string; - - /** - * Initializes a new instance of the GeneratedClientContext class. - * @param endpoint Supported Cognitive Services endpoints (protocol and hostname, for example: - * https://westus.api.cognitive.microsoft.com). - * @param options The parameter options - */ - constructor(endpoint: string, options?: GeneratedClientOptionalParams) { - if (endpoint === undefined) { - throw new Error("'endpoint' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: GeneratedClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-textanalytics/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{Endpoint}/text/analytics/v3.1-preview.4" - }; - super(optionsWithDefaults); - // Parameter assignments - this.endpoint = endpoint; - } -} diff --git a/test/integration/generated/textanalytics/src/index.ts b/test/integration/generated/textanalytics/src/index.ts index 3aebf3c9a5..657fb6d642 100644 --- a/test/integration/generated/textanalytics/src/index.ts +++ b/test/integration/generated/textanalytics/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { GeneratedClient } from "./generatedClient"; -export { GeneratedClientContext } from "./generatedClientContext"; diff --git a/test/integration/generated/url/package.json b/test/integration/generated/url/package.json index 4e00c5f94e..1b76589909 100644 --- a/test/integration/generated/url/package.json +++ b/test/integration/generated/url/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/url/src/index.ts b/test/integration/generated/url/src/index.ts index e20342e593..16bc9dbd78 100644 --- a/test/integration/generated/url/src/index.ts +++ b/test/integration/generated/url/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { UrlClient } from "./urlClient"; -export { UrlClientContext } from "./urlClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/url/src/operations/pathItems.ts b/test/integration/generated/url/src/operations/pathItems.ts index 84fd4cee14..a69f72e3d6 100644 --- a/test/integration/generated/url/src/operations/pathItems.ts +++ b/test/integration/generated/url/src/operations/pathItems.ts @@ -10,7 +10,7 @@ import { PathItems } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { UrlClientContext } from "../urlClientContext"; +import { UrlClient } from "../urlClient"; import { PathItemsGetAllWithValuesOptionalParams, PathItemsGetGlobalQueryNullOptionalParams, @@ -20,13 +20,13 @@ import { /** Class containing PathItems operations. */ export class PathItemsImpl implements PathItems { - private readonly client: UrlClientContext; + private readonly client: UrlClient; /** * Initialize a new instance of the class PathItems class. * @param client Reference to the service client */ - constructor(client: UrlClientContext) { + constructor(client: UrlClient) { this.client = client; } diff --git a/test/integration/generated/url/src/operations/paths.ts b/test/integration/generated/url/src/operations/paths.ts index aa7d81056b..8af1157c11 100644 --- a/test/integration/generated/url/src/operations/paths.ts +++ b/test/integration/generated/url/src/operations/paths.ts @@ -10,7 +10,7 @@ import { Paths } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { UrlClientContext } from "../urlClientContext"; +import { UrlClient } from "../urlClient"; import { PathsGetBooleanTrueOptionalParams, PathsGetBooleanFalseOptionalParams, @@ -44,13 +44,13 @@ import { /** Class containing Paths operations. */ export class PathsImpl implements Paths { - private readonly client: UrlClientContext; + private readonly client: UrlClient; /** * Initialize a new instance of the class Paths class. * @param client Reference to the service client */ - constructor(client: UrlClientContext) { + constructor(client: UrlClient) { this.client = client; } diff --git a/test/integration/generated/url/src/operations/queries.ts b/test/integration/generated/url/src/operations/queries.ts index 15df402b64..1bfa356e60 100644 --- a/test/integration/generated/url/src/operations/queries.ts +++ b/test/integration/generated/url/src/operations/queries.ts @@ -10,7 +10,7 @@ import { Queries } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { UrlClientContext } from "../urlClientContext"; +import { UrlClient } from "../urlClient"; import { QueriesGetBooleanTrueOptionalParams, QueriesGetBooleanFalseOptionalParams, @@ -51,13 +51,13 @@ import { /** Class containing Queries operations. */ export class QueriesImpl implements Queries { - private readonly client: UrlClientContext; + private readonly client: UrlClient; /** * Initialize a new instance of the class Queries class. * @param client Reference to the service client */ - constructor(client: UrlClientContext) { + constructor(client: UrlClient) { this.client = client; } diff --git a/test/integration/generated/url/src/urlClient.ts b/test/integration/generated/url/src/urlClient.ts index b83046f6f1..736c18a7e4 100644 --- a/test/integration/generated/url/src/urlClient.ts +++ b/test/integration/generated/url/src/urlClient.ts @@ -6,19 +6,54 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { PathsImpl, QueriesImpl, PathItemsImpl } from "./operations"; import { Paths, Queries, PathItems } from "./operationsInterfaces"; -import { UrlClientContext } from "./urlClientContext"; import { UrlClientOptionalParams } from "./models"; -export class UrlClient extends UrlClientContext { +export class UrlClient extends coreClient.ServiceClient { + $host: string; + globalStringPath: string; + globalStringQuery?: string; + /** * Initializes a new instance of the UrlClient class. * @param globalStringPath A string value 'globalItemStringPath' that appears in the path * @param options The parameter options */ constructor(globalStringPath: string, options?: UrlClientOptionalParams) { - super(globalStringPath, options); + if (globalStringPath === undefined) { + throw new Error("'globalStringPath' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: UrlClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-url/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + // Parameter assignments + this.globalStringPath = globalStringPath; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.paths = new PathsImpl(this); this.queries = new QueriesImpl(this); this.pathItems = new PathItemsImpl(this); diff --git a/test/integration/generated/url/src/urlClientContext.ts b/test/integration/generated/url/src/urlClientContext.ts deleted file mode 100644 index 6071da34a2..0000000000 --- a/test/integration/generated/url/src/urlClientContext.ts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { UrlClientOptionalParams } from "./models"; - -export class UrlClientContext extends coreClient.ServiceClient { - $host: string; - globalStringPath: string; - globalStringQuery?: string; - - /** - * Initializes a new instance of the UrlClientContext class. - * @param globalStringPath A string value 'globalItemStringPath' that appears in the path - * @param options The parameter options - */ - constructor(globalStringPath: string, options?: UrlClientOptionalParams) { - if (globalStringPath === undefined) { - throw new Error("'globalStringPath' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: UrlClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-url/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - // Parameter assignments - this.globalStringPath = globalStringPath; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/url2/package.json b/test/integration/generated/url2/package.json index 4e00c5f94e..1b76589909 100644 --- a/test/integration/generated/url2/package.json +++ b/test/integration/generated/url2/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/url2/src/index.ts b/test/integration/generated/url2/src/index.ts index e20342e593..16bc9dbd78 100644 --- a/test/integration/generated/url2/src/index.ts +++ b/test/integration/generated/url2/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { UrlClient } from "./urlClient"; -export { UrlClientContext } from "./urlClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/url2/src/operations/get.ts b/test/integration/generated/url2/src/operations/get.ts index 608c2ccac9..d14dae3cf0 100644 --- a/test/integration/generated/url2/src/operations/get.ts +++ b/test/integration/generated/url2/src/operations/get.ts @@ -9,18 +9,18 @@ import { Get } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Parameters from "../models/parameters"; -import { UrlClientContext } from "../urlClientContext"; +import { UrlClient } from "../urlClient"; import { GetUrlOptionalParams, GetUrlResponse } from "../models"; /** Class containing Get operations. */ export class GetImpl implements Get { - private readonly client: UrlClientContext; + private readonly client: UrlClient; /** * Initialize a new instance of the class Get class. * @param client Reference to the service client */ - constructor(client: UrlClientContext) { + constructor(client: UrlClient) { this.client = client; } diff --git a/test/integration/generated/url2/src/urlClient.ts b/test/integration/generated/url2/src/urlClient.ts index 07725ee6a4..953d273ba4 100644 --- a/test/integration/generated/url2/src/urlClient.ts +++ b/test/integration/generated/url2/src/urlClient.ts @@ -6,19 +6,49 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { GetImpl } from "./operations"; import { Get } from "./operationsInterfaces"; -import { UrlClientContext } from "./urlClientContext"; import { UrlClientOptionalParams } from "./models"; -export class UrlClient extends UrlClientContext { +export class UrlClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the UrlClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: UrlClientOptionalParams) { - super($host, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: UrlClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-url/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; this.get = new GetImpl(this); } diff --git a/test/integration/generated/url2/src/urlClientContext.ts b/test/integration/generated/url2/src/urlClientContext.ts deleted file mode 100644 index 00fe829509..0000000000 --- a/test/integration/generated/url2/src/urlClientContext.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { UrlClientOptionalParams } from "./models"; - -export class UrlClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the UrlClientContext class. - * @param $host server parameter - * @param options The parameter options - */ - constructor($host: string, options?: UrlClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: UrlClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-url/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - } -} diff --git a/test/integration/generated/urlMulti/package.json b/test/integration/generated/urlMulti/package.json index 2b5564962e..bbeb31e2b1 100644 --- a/test/integration/generated/urlMulti/package.json +++ b/test/integration/generated/urlMulti/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/urlMulti/src/index.ts b/test/integration/generated/urlMulti/src/index.ts index 6410dfe50b..323d550fed 100644 --- a/test/integration/generated/urlMulti/src/index.ts +++ b/test/integration/generated/urlMulti/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { UrlMultiClient } from "./urlMultiClient"; -export { UrlMultiClientContext } from "./urlMultiClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/urlMulti/src/operations/queries.ts b/test/integration/generated/urlMulti/src/operations/queries.ts index 681edf9807..e3bbf14d7c 100644 --- a/test/integration/generated/urlMulti/src/operations/queries.ts +++ b/test/integration/generated/urlMulti/src/operations/queries.ts @@ -10,7 +10,7 @@ import { Queries } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { UrlMultiClientContext } from "../urlMultiClientContext"; +import { UrlMultiClient } from "../urlMultiClient"; import { QueriesArrayStringMultiNullOptionalParams, QueriesArrayStringMultiEmptyOptionalParams, @@ -19,13 +19,13 @@ import { /** Class containing Queries operations. */ export class QueriesImpl implements Queries { - private readonly client: UrlMultiClientContext; + private readonly client: UrlMultiClient; /** * Initialize a new instance of the class Queries class. * @param client Reference to the service client */ - constructor(client: UrlMultiClientContext) { + constructor(client: UrlMultiClient) { this.client = client; } diff --git a/test/integration/generated/urlMulti/src/urlMultiClient.ts b/test/integration/generated/urlMulti/src/urlMultiClient.ts index 8aab277c0e..6699a49a0c 100644 --- a/test/integration/generated/urlMulti/src/urlMultiClient.ts +++ b/test/integration/generated/urlMulti/src/urlMultiClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { QueriesImpl } from "./operations"; import { Queries } from "./operationsInterfaces"; -import { UrlMultiClientContext } from "./urlMultiClientContext"; import { UrlMultiClientOptionalParams } from "./models"; -export class UrlMultiClient extends UrlMultiClientContext { +export class UrlMultiClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the UrlMultiClient class. * @param options The parameter options */ constructor(options?: UrlMultiClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: UrlMultiClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-url-multi/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.queries = new QueriesImpl(this); } diff --git a/test/integration/generated/urlMulti/src/urlMultiClientContext.ts b/test/integration/generated/urlMulti/src/urlMultiClientContext.ts deleted file mode 100644 index bfd2b05ce3..0000000000 --- a/test/integration/generated/urlMulti/src/urlMultiClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { UrlMultiClientOptionalParams } from "./models"; - -export class UrlMultiClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the UrlMultiClientContext class. - * @param options The parameter options - */ - constructor(options?: UrlMultiClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: UrlMultiClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-url-multi/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/urlRest/package.json b/test/integration/generated/urlRest/package.json index 72582d221f..7c332f5a21 100644 --- a/test/integration/generated/urlRest/package.json +++ b/test/integration/generated/urlRest/package.json @@ -32,7 +32,7 @@ }, "keywords": [], "author": "", - "license": "ISC", + "license": "MIT", "engines": { "node": ">=12.0.0" }, "dependencies": { "@azure-rest/core-client": "1.0.0-beta.8", diff --git a/test/integration/generated/urlRest/src/urlRestClient.ts b/test/integration/generated/urlRest/src/urlRestClient.ts index 02a9de7879..ad7f8dd493 100644 --- a/test/integration/generated/urlRest/src/urlRestClient.ts +++ b/test/integration/generated/urlRest/src/urlRestClient.ts @@ -206,6 +206,423 @@ import { import { getClient, ClientOptions, Client } from "@azure-rest/core-client"; import "@azure/core-auth"; +/** Contains operations for Paths operations */ +export interface PathsOperations { + /** Get true Boolean value on path */ + getBooleanTrue( + boolPath: true, + options?: PathsGetBooleanTrueParameters + ): Promise< + PathsGetBooleanTrue200Response | PathsGetBooleanTruedefaultResponse + >; + /** Get false Boolean value on path */ + getBooleanFalse( + boolPath: false, + options?: PathsGetBooleanFalseParameters + ): Promise< + PathsGetBooleanFalse200Response | PathsGetBooleanFalsedefaultResponse + >; + /** Get '1000000' integer value */ + getIntOneMillion( + intPath: 1000000, + options?: PathsGetIntOneMillionParameters + ): Promise< + PathsGetIntOneMillion200Response | PathsGetIntOneMilliondefaultResponse + >; + /** Get '-1000000' integer value */ + getIntNegativeOneMillion( + intPath: -1000000, + options?: PathsGetIntNegativeOneMillionParameters + ): Promise< + | PathsGetIntNegativeOneMillion200Response + | PathsGetIntNegativeOneMilliondefaultResponse + >; + /** Get '10000000000' 64 bit integer value */ + getTenBillion( + longPath: 10000000000, + options?: PathsGetTenBillionParameters + ): Promise; + /** Get '-10000000000' 64 bit integer value */ + getNegativeTenBillion( + longPath: -10000000000, + options?: PathsGetNegativeTenBillionParameters + ): Promise< + | PathsGetNegativeTenBillion200Response + | PathsGetNegativeTenBilliondefaultResponse + >; + /** Get '1.034E+20' numeric value */ + floatScientificPositive( + floatPath: 103400000000000000000, + options?: PathsFloatScientificPositiveParameters + ): Promise< + | PathsFloatScientificPositive200Response + | PathsFloatScientificPositivedefaultResponse + >; + /** Get '-1.034E-20' numeric value */ + floatScientificNegative( + floatPath: -1.034e-20, + options?: PathsFloatScientificNegativeParameters + ): Promise< + | PathsFloatScientificNegative200Response + | PathsFloatScientificNegativedefaultResponse + >; + /** Get '9999999.999' numeric value */ + doubleDecimalPositive( + doublePath: 9999999.999, + options?: PathsDoubleDecimalPositiveParameters + ): Promise< + | PathsDoubleDecimalPositive200Response + | PathsDoubleDecimalPositivedefaultResponse + >; + /** Get '-9999999.999' numeric value */ + doubleDecimalNegative( + doublePath: -9999999.999, + options?: PathsDoubleDecimalNegativeParameters + ): Promise< + | PathsDoubleDecimalNegative200Response + | PathsDoubleDecimalNegativedefaultResponse + >; + /** Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value */ + stringUnicode( + stringPath: "啊齄丂狛狜隣郎隣兀﨩", + options?: PathsStringUnicodeParameters + ): Promise; + /** Get 'begin!*'();:@ &=+$,/?#[]end */ + stringUrlEncoded( + stringPath: "begin!*'();:@ &=+$,/?#[]end", + options?: PathsStringUrlEncodedParameters + ): Promise< + PathsStringUrlEncoded200Response | PathsStringUrlEncodeddefaultResponse + >; + /** https://tools.ietf.org/html/rfc3986#appendix-A 'path' accept any 'pchar' not encoded */ + stringUrlNonEncoded( + stringPath: "begin!*'();:@&=+$,end", + options?: PathsStringUrlNonEncodedParameters + ): Promise< + | PathsStringUrlNonEncoded200Response + | PathsStringUrlNonEncodeddefaultResponse + >; + /** Get '' */ + stringEmpty( + stringPath: "", + options?: PathsStringEmptyParameters + ): Promise; + /** Get null (should throw) */ + stringNull( + stringPath: string, + options?: PathsStringNullParameters + ): Promise; + /** Get using uri with 'green color' in path parameter */ + enumValid( + enumPath: "red color" | "green color" | "blue color", + options?: PathsEnumValidParameters + ): Promise; + /** Get null (should throw on the client before the request is sent on wire) */ + enumNull( + enumPath: "red color" | "green color" | "blue color", + options?: PathsEnumNullParameters + ): Promise; + /** Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array */ + byteMultiByte( + bytePath: string, + options?: PathsByteMultiByteParameters + ): Promise; + /** Get '' as byte array */ + byteEmpty( + bytePath: "", + options?: PathsByteEmptyParameters + ): Promise; + /** Get null as byte array (should throw) */ + byteNull( + bytePath: string, + options?: PathsByteNullParameters + ): Promise; + /** Get '2012-01-01' as date */ + dateValid( + datePath: "2012-01-01", + options?: PathsDateValidParameters + ): Promise; + /** Get null as date - this should throw or be unusable on the client side, depending on date representation */ + dateNull( + datePath: Date | string, + options?: PathsDateNullParameters + ): Promise; + /** Get '2012-01-01T01:01:01Z' as date-time */ + dateTimeValid( + dateTimePath: "2012-01-01T01:01:01Z", + options?: PathsDateTimeValidParameters + ): Promise; + /** Get null as date-time, should be disallowed or throw depending on representation of date-time */ + dateTimeNull( + dateTimePath: Date | string, + options?: PathsDateTimeNullParameters + ): Promise; + /** Get 'lorem' encoded value as 'bG9yZW0' (base64url) */ + base64Url( + base64UrlPath: string, + options?: PathsBase64UrlParameters + ): Promise; + /** Get an array of string ['ArrayPath1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format */ + arrayCsvInPath( + arrayPath: Array, + options?: PathsArrayCsvInPathParameters + ): Promise< + PathsArrayCsvInPath200Response | PathsArrayCsvInPathdefaultResponse + >; + /** Get the date 2016-04-13 encoded value as '1460505600' (Unix time) */ + unixTimeUrl( + unixTimeUrlPath: string, + options?: PathsUnixTimeUrlParameters + ): Promise; +} + +/** Contains operations for Queries operations */ +export interface QueriesOperations { + /** Get true Boolean value on path */ + getBooleanTrue( + options: QueriesGetBooleanTrueParameters + ): Promise< + QueriesGetBooleanTrue200Response | QueriesGetBooleanTruedefaultResponse + >; + /** Get false Boolean value on path */ + getBooleanFalse( + options: QueriesGetBooleanFalseParameters + ): Promise< + QueriesGetBooleanFalse200Response | QueriesGetBooleanFalsedefaultResponse + >; + /** Get null Boolean value on query (query string should be absent) */ + getBooleanNull( + options?: QueriesGetBooleanNullParameters + ): Promise< + QueriesGetBooleanNull200Response | QueriesGetBooleanNulldefaultResponse + >; + /** Get '1000000' integer value */ + getIntOneMillion( + options: QueriesGetIntOneMillionParameters + ): Promise< + QueriesGetIntOneMillion200Response | QueriesGetIntOneMilliondefaultResponse + >; + /** Get '-1000000' integer value */ + getIntNegativeOneMillion( + options: QueriesGetIntNegativeOneMillionParameters + ): Promise< + | QueriesGetIntNegativeOneMillion200Response + | QueriesGetIntNegativeOneMilliondefaultResponse + >; + /** Get null integer value (no query parameter) */ + getIntNull( + options?: QueriesGetIntNullParameters + ): Promise; + /** Get '10000000000' 64 bit integer value */ + getTenBillion( + options: QueriesGetTenBillionParameters + ): Promise< + QueriesGetTenBillion200Response | QueriesGetTenBilliondefaultResponse + >; + /** Get '-10000000000' 64 bit integer value */ + getNegativeTenBillion( + options: QueriesGetNegativeTenBillionParameters + ): Promise< + | QueriesGetNegativeTenBillion200Response + | QueriesGetNegativeTenBilliondefaultResponse + >; + /** Get 'null 64 bit integer value (no query param in uri) */ + getLongNull( + options?: QueriesGetLongNullParameters + ): Promise; + /** Get '1.034E+20' numeric value */ + floatScientificPositive( + options: QueriesFloatScientificPositiveParameters + ): Promise< + | QueriesFloatScientificPositive200Response + | QueriesFloatScientificPositivedefaultResponse + >; + /** Get '-1.034E-20' numeric value */ + floatScientificNegative( + options: QueriesFloatScientificNegativeParameters + ): Promise< + | QueriesFloatScientificNegative200Response + | QueriesFloatScientificNegativedefaultResponse + >; + /** Get null numeric value (no query parameter) */ + floatNull( + options?: QueriesFloatNullParameters + ): Promise; + /** Get '9999999.999' numeric value */ + doubleDecimalPositive( + options: QueriesDoubleDecimalPositiveParameters + ): Promise< + | QueriesDoubleDecimalPositive200Response + | QueriesDoubleDecimalPositivedefaultResponse + >; + /** Get '-9999999.999' numeric value */ + doubleDecimalNegative( + options: QueriesDoubleDecimalNegativeParameters + ): Promise< + | QueriesDoubleDecimalNegative200Response + | QueriesDoubleDecimalNegativedefaultResponse + >; + /** Get null numeric value (no query parameter) */ + doubleNull( + options?: QueriesDoubleNullParameters + ): Promise; + /** Get '啊齄丂狛狜隣郎隣兀﨩' multi-byte string value */ + stringUnicode( + options: QueriesStringUnicodeParameters + ): Promise< + QueriesStringUnicode200Response | QueriesStringUnicodedefaultResponse + >; + /** Get 'begin!*'();:@ &=+$,/?#[]end */ + stringUrlEncoded( + options: QueriesStringUrlEncodedParameters + ): Promise< + QueriesStringUrlEncoded200Response | QueriesStringUrlEncodeddefaultResponse + >; + /** Get '' */ + stringEmpty( + options: QueriesStringEmptyParameters + ): Promise; + /** Get null (no query parameter in url) */ + stringNull( + options?: QueriesStringNullParameters + ): Promise; + /** Get using uri with query parameter 'green color' */ + enumValid( + options?: QueriesEnumValidParameters + ): Promise; + /** Get null (no query parameter in url) */ + enumNull( + options?: QueriesEnumNullParameters + ): Promise; + /** Get '啊齄丂狛狜隣郎隣兀﨩' multibyte value as utf-8 encoded byte array */ + byteMultiByte( + options?: QueriesByteMultiByteParameters + ): Promise< + QueriesByteMultiByte200Response | QueriesByteMultiBytedefaultResponse + >; + /** Get '' as byte array */ + byteEmpty( + options: QueriesByteEmptyParameters + ): Promise; + /** Get null as byte array (no query parameters in uri) */ + byteNull( + options?: QueriesByteNullParameters + ): Promise; + /** Get '2012-01-01' as date */ + dateValid( + options: QueriesDateValidParameters + ): Promise; + /** Get null as date - this should result in no query parameters in uri */ + dateNull( + options?: QueriesDateNullParameters + ): Promise; + /** Get '2012-01-01T01:01:01Z' as date-time */ + dateTimeValid( + options: QueriesDateTimeValidParameters + ): Promise< + QueriesDateTimeValid200Response | QueriesDateTimeValiddefaultResponse + >; + /** Get null as date-time, should result in no query parameters in uri */ + dateTimeNull( + options?: QueriesDateTimeNullParameters + ): Promise< + QueriesDateTimeNull200Response | QueriesDateTimeNulldefaultResponse + >; + /** Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the csv-array format */ + arrayStringCsvValid( + options?: QueriesArrayStringCsvValidParameters + ): Promise< + | QueriesArrayStringCsvValid200Response + | QueriesArrayStringCsvValiddefaultResponse + >; + /** Get a null array of string using the csv-array format */ + arrayStringCsvNull( + options?: QueriesArrayStringCsvNullParameters + ): Promise< + | QueriesArrayStringCsvNull200Response + | QueriesArrayStringCsvNulldefaultResponse + >; + /** Get an empty array [] of string using the csv-array format */ + arrayStringCsvEmpty( + options?: QueriesArrayStringCsvEmptyParameters + ): Promise< + | QueriesArrayStringCsvEmpty200Response + | QueriesArrayStringCsvEmptydefaultResponse + >; + /** Array query has no defined collection format, should default to csv. Pass in ['hello', 'nihao', 'bonjour'] for the 'arrayQuery' parameter to the service */ + arrayStringNoCollectionFormatEmpty( + options?: QueriesArrayStringNoCollectionFormatEmptyParameters + ): Promise< + | QueriesArrayStringNoCollectionFormatEmpty200Response + | QueriesArrayStringNoCollectionFormatEmptydefaultResponse + >; + /** Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the ssv-array format */ + arrayStringSsvValid( + options?: QueriesArrayStringSsvValidParameters + ): Promise< + | QueriesArrayStringSsvValid200Response + | QueriesArrayStringSsvValiddefaultResponse + >; + /** Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the tsv-array format */ + arrayStringTsvValid( + options?: QueriesArrayStringTsvValidParameters + ): Promise< + | QueriesArrayStringTsvValid200Response + | QueriesArrayStringTsvValiddefaultResponse + >; + /** Get an array of string ['ArrayQuery1', 'begin!*'();:@ &=+$,/?#[]end' , null, ''] using the pipes-array format */ + arrayStringPipesValid( + options?: QueriesArrayStringPipesValidParameters + ): Promise< + | QueriesArrayStringPipesValid200Response + | QueriesArrayStringPipesValiddefaultResponse + >; +} + +/** Contains operations for PathItems operations */ +export interface PathItemsOperations { + /** send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery' */ + getAllWithValues( + globalStringPath: string, + pathItemStringPath: string, + localStringPath: string, + options?: PathItemsGetAllWithValuesParameters + ): Promise< + | PathItemsGetAllWithValues200Response + | PathItemsGetAllWithValuesdefaultResponse + >; + /** send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery='localStringQuery' */ + getGlobalQueryNull( + globalStringPath: string, + pathItemStringPath: string, + localStringPath: string, + options?: PathItemsGetGlobalQueryNullParameters + ): Promise< + | PathItemsGetGlobalQueryNull200Response + | PathItemsGetGlobalQueryNulldefaultResponse + >; + /** send globalStringPath=globalStringPath, pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery=null, pathItemStringQuery='pathItemStringQuery', localStringQuery=null */ + getGlobalAndLocalQueryNull( + globalStringPath: string, + pathItemStringPath: string, + localStringPath: string, + options?: PathItemsGetGlobalAndLocalQueryNullParameters + ): Promise< + | PathItemsGetGlobalAndLocalQueryNull200Response + | PathItemsGetGlobalAndLocalQueryNulldefaultResponse + >; + /** send globalStringPath='globalStringPath', pathItemStringPath='pathItemStringPath', localStringPath='localStringPath', globalStringQuery='globalStringQuery', pathItemStringQuery=null, localStringQuery=null */ + getLocalPathItemQueryNull( + globalStringPath: string, + pathItemStringPath: string, + localStringPath: string, + options?: PathItemsGetLocalPathItemQueryNullParameters + ): Promise< + | PathItemsGetLocalPathItemQueryNull200Response + | PathItemsGetLocalPathItemQueryNulldefaultResponse + >; +} + export interface PathsGetBooleanTrue { /** Get true Boolean value on path */ get( @@ -994,6 +1411,9 @@ export interface Routes { export type UrlRestClientRestClient = Client & { path: Routes; + paths: PathsOperations; + queries: QueriesOperations; + pathItems: PathItemsOperations; }; export default function UrlRestClient( @@ -1001,9 +1421,330 @@ export default function UrlRestClient( ): UrlRestClientRestClient { const baseUrl = options.baseUrl ?? "http://localhost:3000"; - return getClient( - baseUrl, - - options - ) as UrlRestClientRestClient; + const client = getClient(baseUrl, options) as UrlRestClientRestClient; + + return { + ...client, + paths: { + getBooleanTrue: (boolPath, options) => { + return client + .path("/paths/bool/true/{boolPath}", boolPath) + .get(options); + }, + getBooleanFalse: (boolPath, options) => { + return client + .path("/paths/bool/false/{boolPath}", boolPath) + .get(options); + }, + getIntOneMillion: (intPath, options) => { + return client + .path("/paths/int/1000000/{intPath}", intPath) + .get(options); + }, + getIntNegativeOneMillion: (intPath, options) => { + return client + .path("/paths/int/-1000000/{intPath}", intPath) + .get(options); + }, + getTenBillion: (longPath, options) => { + return client + .path("/paths/long/10000000000/{longPath}", longPath) + .get(options); + }, + getNegativeTenBillion: (longPath, options) => { + return client + .path("/paths/long/-10000000000/{longPath}", longPath) + .get(options); + }, + floatScientificPositive: (floatPath, options) => { + return client + .path("/paths/float/1.034E+20/{floatPath}", floatPath) + .get(options); + }, + floatScientificNegative: (floatPath, options) => { + return client + .path("/paths/float/-1.034E-20/{floatPath}", floatPath) + .get(options); + }, + doubleDecimalPositive: (doublePath, options) => { + return client + .path("/paths/double/9999999.999/{doublePath}", doublePath) + .get(options); + }, + doubleDecimalNegative: (doublePath, options) => { + return client + .path("/paths/double/-9999999.999/{doublePath}", doublePath) + .get(options); + }, + stringUnicode: (stringPath, options) => { + return client + .path("/paths/string/unicode/{stringPath}", stringPath) + .get(options); + }, + stringUrlEncoded: (stringPath, options) => { + return client + .path( + "/paths/string/begin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend/{stringPath}", + stringPath + ) + .get(options); + }, + stringUrlNonEncoded: (stringPath, options) => { + return client + .path("/paths/string/begin!*'();:@&=+$,end/{stringPath}", stringPath) + .get(options); + }, + stringEmpty: (stringPath, options) => { + return client + .path("/paths/string/empty/{stringPath}", stringPath) + .get(options); + }, + stringNull: (stringPath, options) => { + return client + .path("/paths/string/null/{stringPath}", stringPath) + .get(options); + }, + enumValid: (enumPath, options) => { + return client + .path("/paths/enum/green%20color/{enumPath}", enumPath) + .get(options); + }, + enumNull: (enumPath, options) => { + return client + .path("/paths/string/null/{enumPath}", enumPath) + .get(options); + }, + byteMultiByte: (bytePath, options) => { + return client + .path("/paths/byte/multibyte/{bytePath}", bytePath) + .get(options); + }, + byteEmpty: (bytePath, options) => { + return client + .path("/paths/byte/empty/{bytePath}", bytePath) + .get(options); + }, + byteNull: (bytePath, options) => { + return client + .path("/paths/byte/null/{bytePath}", bytePath) + .get(options); + }, + dateValid: (datePath, options) => { + return client + .path("/paths/date/2012-01-01/{datePath}", datePath) + .get(options); + }, + dateNull: (datePath, options) => { + return client + .path("/paths/date/null/{datePath}", datePath) + .get(options); + }, + dateTimeValid: (dateTimePath, options) => { + return client + .path( + "/paths/datetime/2012-01-01T01%3A01%3A01Z/{dateTimePath}", + dateTimePath + ) + .get(options); + }, + dateTimeNull: (dateTimePath, options) => { + return client + .path("/paths/datetime/null/{dateTimePath}", dateTimePath) + .get(options); + }, + base64Url: (base64UrlPath, options) => { + return client + .path("/paths/string/bG9yZW0/{base64UrlPath}", base64UrlPath) + .get(options); + }, + arrayCsvInPath: (arrayPath, options) => { + return client + .path( + "/paths/array/ArrayPath1%2cbegin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend%2c%2c/{arrayPath}", + arrayPath + ) + .get(options); + }, + unixTimeUrl: (unixTimeUrlPath, options) => { + return client + .path("/paths/int/1460505600/{unixTimeUrlPath}", unixTimeUrlPath) + .get(options); + } + }, + queries: { + getBooleanTrue: (options) => { + return client.path("/queries/bool/true").get(options); + }, + getBooleanFalse: (options) => { + return client.path("/queries/bool/false").get(options); + }, + getBooleanNull: (options) => { + return client.path("/queries/bool/null").get(options); + }, + getIntOneMillion: (options) => { + return client.path("/queries/int/1000000").get(options); + }, + getIntNegativeOneMillion: (options) => { + return client.path("/queries/int/-1000000").get(options); + }, + getIntNull: (options) => { + return client.path("/queries/int/null").get(options); + }, + getTenBillion: (options) => { + return client.path("/queries/long/10000000000").get(options); + }, + getNegativeTenBillion: (options) => { + return client.path("/queries/long/-10000000000").get(options); + }, + getLongNull: (options) => { + return client.path("/queries/long/null").get(options); + }, + floatScientificPositive: (options) => { + return client.path("/queries/float/1.034E+20").get(options); + }, + floatScientificNegative: (options) => { + return client.path("/queries/float/-1.034E-20").get(options); + }, + floatNull: (options) => { + return client.path("/queries/float/null").get(options); + }, + doubleDecimalPositive: (options) => { + return client.path("/queries/double/9999999.999").get(options); + }, + doubleDecimalNegative: (options) => { + return client.path("/queries/double/-9999999.999").get(options); + }, + doubleNull: (options) => { + return client.path("/queries/double/null").get(options); + }, + stringUnicode: (options) => { + return client.path("/queries/string/unicode/").get(options); + }, + stringUrlEncoded: (options) => { + return client + .path( + "/queries/string/begin%21%2A%27%28%29%3B%3A%40%20%26%3D%2B%24%2C%2F%3F%23%5B%5Dend" + ) + .get(options); + }, + stringEmpty: (options) => { + return client.path("/queries/string/empty").get(options); + }, + stringNull: (options) => { + return client.path("/queries/string/null").get(options); + }, + enumValid: (options) => { + return client.path("/queries/enum/green%20color").get(options); + }, + enumNull: (options) => { + return client.path("/queries/enum/null").get(options); + }, + byteMultiByte: (options) => { + return client.path("/queries/byte/multibyte").get(options); + }, + byteEmpty: (options) => { + return client.path("/queries/byte/empty").get(options); + }, + byteNull: (options) => { + return client.path("/queries/byte/null").get(options); + }, + dateValid: (options) => { + return client.path("/queries/date/2012-01-01").get(options); + }, + dateNull: (options) => { + return client.path("/queries/date/null").get(options); + }, + dateTimeValid: (options) => { + return client + .path("/queries/datetime/2012-01-01T01%3A01%3A01Z") + .get(options); + }, + dateTimeNull: (options) => { + return client.path("/queries/datetime/null").get(options); + }, + arrayStringCsvValid: (options) => { + return client.path("/queries/array/csv/string/valid").get(options); + }, + arrayStringCsvNull: (options) => { + return client.path("/queries/array/csv/string/null").get(options); + }, + arrayStringCsvEmpty: (options) => { + return client.path("/queries/array/csv/string/empty").get(options); + }, + arrayStringNoCollectionFormatEmpty: (options) => { + return client.path("/queries/array/none/string/empty").get(options); + }, + arrayStringSsvValid: (options) => { + return client.path("/queries/array/ssv/string/valid").get(options); + }, + arrayStringTsvValid: (options) => { + return client.path("/queries/array/tsv/string/valid").get(options); + }, + arrayStringPipesValid: (options) => { + return client.path("/queries/array/pipes/string/valid").get(options); + } + }, + pathItems: { + getAllWithValues: ( + globalStringPath, + pathItemStringPath, + localStringPath, + options + ) => { + return client + .path( + "/pathitem/nullable/globalStringPath/{globalStringPath}/pathItemStringPath/{pathItemStringPath}/localStringPath/{localStringPath}/globalStringQuery/pathItemStringQuery/localStringQuery", + globalStringPath, + pathItemStringPath, + localStringPath + ) + .get(options); + }, + getGlobalQueryNull: ( + globalStringPath, + pathItemStringPath, + localStringPath, + options + ) => { + return client + .path( + "/pathitem/nullable/globalStringPath/{globalStringPath}/pathItemStringPath/{pathItemStringPath}/localStringPath/{localStringPath}/null/pathItemStringQuery/localStringQuery", + globalStringPath, + pathItemStringPath, + localStringPath + ) + .get(options); + }, + getGlobalAndLocalQueryNull: ( + globalStringPath, + pathItemStringPath, + localStringPath, + options + ) => { + return client + .path( + "/pathitem/nullable/globalStringPath/{globalStringPath}/pathItemStringPath/{pathItemStringPath}/localStringPath/{localStringPath}/null/pathItemStringQuery/null", + globalStringPath, + pathItemStringPath, + localStringPath + ) + .get(options); + }, + getLocalPathItemQueryNull: ( + globalStringPath, + pathItemStringPath, + localStringPath, + options + ) => { + return client + .path( + "/pathitem/nullable/globalStringPath/{globalStringPath}/pathItemStringPath/{pathItemStringPath}/localStringPath/{localStringPath}/globalStringQuery/null/null", + globalStringPath, + pathItemStringPath, + localStringPath + ) + .get(options); + } + } + }; } diff --git a/test/integration/generated/urlRest/tsconfig.json b/test/integration/generated/urlRest/tsconfig.json index 965341beea..0202cc6570 100644 --- a/test/integration/generated/urlRest/tsconfig.json +++ b/test/integration/generated/urlRest/tsconfig.json @@ -7,13 +7,5 @@ "declarationMap": true, "outDir": "./dist-esm" }, - "exclude": [ - "node_modules", - "types", - "temp", - "browser", - "dist", - "dist-esm", - "./samples/**/*.ts" - ] + "include": ["src/**/*.ts"] } diff --git a/test/integration/generated/useragentcorev1/package.json b/test/integration/generated/useragentcorev1/package.json index 0991895822..c99cf97989 100644 --- a/test/integration/generated/useragentcorev1/package.json +++ b/test/integration/generated/useragentcorev1/package.json @@ -21,7 +21,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/useragentcorev1/src/index.ts b/test/integration/generated/useragentcorev1/src/index.ts index fa5409e3dd..93fea1e1df 100644 --- a/test/integration/generated/useragentcorev1/src/index.ts +++ b/test/integration/generated/useragentcorev1/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { UserAgentCoreV1Client } from "./userAgentCoreV1Client"; -export { UserAgentCoreV1ClientContext } from "./userAgentCoreV1ClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/useragentcorev1/src/operations/group.ts b/test/integration/generated/useragentcorev1/src/operations/group.ts index 6ffe3c7b98..405796f207 100644 --- a/test/integration/generated/useragentcorev1/src/operations/group.ts +++ b/test/integration/generated/useragentcorev1/src/operations/group.ts @@ -10,7 +10,7 @@ import { Group } from "../operationsInterfaces"; import * as coreHttp from "@azure/core-http"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { UserAgentCoreV1ClientContext } from "../userAgentCoreV1ClientContext"; +import { UserAgentCoreV1Client } from "../userAgentCoreV1Client"; import { GroupGetSampleResourceGroupOptionalParams, GroupGetSampleResourceGroupResponse @@ -18,13 +18,13 @@ import { /** Class containing Group operations. */ export class GroupImpl implements Group { - private readonly client: UserAgentCoreV1ClientContext; + private readonly client: UserAgentCoreV1Client; /** * Initialize a new instance of the class Group class. * @param client Reference to the service client */ - constructor(client: UserAgentCoreV1ClientContext) { + constructor(client: UserAgentCoreV1Client) { this.client = client; } diff --git a/test/integration/generated/useragentcorev1/src/userAgentCoreV1Client.ts b/test/integration/generated/useragentcorev1/src/userAgentCoreV1Client.ts index 0b98e48b01..eb0d71e85d 100644 --- a/test/integration/generated/useragentcorev1/src/userAgentCoreV1Client.ts +++ b/test/integration/generated/useragentcorev1/src/userAgentCoreV1Client.ts @@ -6,12 +6,19 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreHttp from "@azure/core-http"; import { GroupImpl } from "./operations"; import { Group } from "./operationsInterfaces"; -import { UserAgentCoreV1ClientContext } from "./userAgentCoreV1ClientContext"; import { UserAgentCoreV1ClientOptionalParams } from "./models"; -export class UserAgentCoreV1Client extends UserAgentCoreV1ClientContext { +const packageName = "@msinternal/useragent-corev1"; +const packageVersion = "1.0.0-preview1"; + +export class UserAgentCoreV1Client extends coreHttp.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + /** * Initializes a new instance of the UserAgentCoreV1Client class. * @param subscriptionId Subscription Id. @@ -21,7 +28,35 @@ export class UserAgentCoreV1Client extends UserAgentCoreV1ClientContext { subscriptionId: string, options?: UserAgentCoreV1ClientOptionalParams ) { - super(subscriptionId, options); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + + const defaultUserAgent = `azsdk-js-${packageName.replace( + /@.*\//, + "" + )}/${packageVersion} ${coreHttp.getDefaultUserAgentValue()}`; + + super(undefined, { + ...options, + userAgent: options.userAgent + ? `${options.userAgent} ${defaultUserAgent}` + : `${defaultUserAgent}` + }); + + this.requestContentType = "application/json; charset=utf-8"; + this.baseUri = options.endpoint || "http://localhost:3000"; + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "2014-04-01-preview"; this.group = new GroupImpl(this); } diff --git a/test/integration/generated/useragentcorev1/src/userAgentCoreV1ClientContext.ts b/test/integration/generated/useragentcorev1/src/userAgentCoreV1ClientContext.ts deleted file mode 100644 index 98f03ee4bf..0000000000 --- a/test/integration/generated/useragentcorev1/src/userAgentCoreV1ClientContext.ts +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreHttp from "@azure/core-http"; -import { UserAgentCoreV1ClientOptionalParams } from "./models"; - -const packageName = "@msinternal/useragent-corev1"; -const packageVersion = "1.0.0-preview1"; - -export class UserAgentCoreV1ClientContext extends coreHttp.ServiceClient { - $host: string; - subscriptionId: string; - apiVersion: string; - - /** - * Initializes a new instance of the UserAgentCoreV1ClientContext class. - * @param subscriptionId Subscription Id. - * @param options The parameter options - */ - constructor( - subscriptionId: string, - options?: UserAgentCoreV1ClientOptionalParams - ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - - const defaultUserAgent = `azsdk-js-${packageName.replace( - /@.*\//, - "" - )}/${packageVersion} ${coreHttp.getDefaultUserAgentValue()}`; - - super(undefined, { - ...options, - userAgent: options.userAgent - ? `${options.userAgent} ${defaultUserAgent}` - : `${defaultUserAgent}` - }); - - this.requestContentType = "application/json; charset=utf-8"; - this.baseUri = options.endpoint || "http://localhost:3000"; - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "2014-04-01-preview"; - } -} diff --git a/test/integration/generated/useragentcorev2/package.json b/test/integration/generated/useragentcorev2/package.json index 21d3ac88ac..2fffbdf3cc 100644 --- a/test/integration/generated/useragentcorev2/package.json +++ b/test/integration/generated/useragentcorev2/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/useragentcorev2/src/index.ts b/test/integration/generated/useragentcorev2/src/index.ts index 0ad57cb7a8..542d1e958f 100644 --- a/test/integration/generated/useragentcorev2/src/index.ts +++ b/test/integration/generated/useragentcorev2/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { UserAgentCoreV2Client } from "./userAgentCoreV2Client"; -export { UserAgentCoreV2ClientContext } from "./userAgentCoreV2ClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/useragentcorev2/src/operations/group.ts b/test/integration/generated/useragentcorev2/src/operations/group.ts index 330e56d33d..5914eb2870 100644 --- a/test/integration/generated/useragentcorev2/src/operations/group.ts +++ b/test/integration/generated/useragentcorev2/src/operations/group.ts @@ -10,7 +10,7 @@ import { Group } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { UserAgentCoreV2ClientContext } from "../userAgentCoreV2ClientContext"; +import { UserAgentCoreV2Client } from "../userAgentCoreV2Client"; import { GroupGetSampleResourceGroupOptionalParams, GroupGetSampleResourceGroupResponse @@ -18,13 +18,13 @@ import { /** Class containing Group operations. */ export class GroupImpl implements Group { - private readonly client: UserAgentCoreV2ClientContext; + private readonly client: UserAgentCoreV2Client; /** * Initialize a new instance of the class Group class. * @param client Reference to the service client */ - constructor(client: UserAgentCoreV2ClientContext) { + constructor(client: UserAgentCoreV2Client) { this.client = client; } diff --git a/test/integration/generated/useragentcorev2/src/userAgentCoreV2Client.ts b/test/integration/generated/useragentcorev2/src/userAgentCoreV2Client.ts index d1509fad1d..8b0758bc51 100644 --- a/test/integration/generated/useragentcorev2/src/userAgentCoreV2Client.ts +++ b/test/integration/generated/useragentcorev2/src/userAgentCoreV2Client.ts @@ -6,12 +6,16 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { GroupImpl } from "./operations"; import { Group } from "./operationsInterfaces"; -import { UserAgentCoreV2ClientContext } from "./userAgentCoreV2ClientContext"; import { UserAgentCoreV2ClientOptionalParams } from "./models"; -export class UserAgentCoreV2Client extends UserAgentCoreV2ClientContext { +export class UserAgentCoreV2Client extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + /** * Initializes a new instance of the UserAgentCoreV2Client class. * @param subscriptionId Subscription Id. @@ -21,7 +25,39 @@ export class UserAgentCoreV2Client extends UserAgentCoreV2ClientContext { subscriptionId: string, options?: UserAgentCoreV2ClientOptionalParams ) { - super(subscriptionId, options); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: UserAgentCoreV2ClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-useragent-corev2/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "2014-04-01-preview"; this.group = new GroupImpl(this); } diff --git a/test/integration/generated/useragentcorev2/src/userAgentCoreV2ClientContext.ts b/test/integration/generated/useragentcorev2/src/userAgentCoreV2ClientContext.ts deleted file mode 100644 index 114864e2ad..0000000000 --- a/test/integration/generated/useragentcorev2/src/userAgentCoreV2ClientContext.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { UserAgentCoreV2ClientOptionalParams } from "./models"; - -export class UserAgentCoreV2ClientContext extends coreClient.ServiceClient { - $host: string; - subscriptionId: string; - apiVersion: string; - - /** - * Initializes a new instance of the UserAgentCoreV2ClientContext class. - * @param subscriptionId Subscription Id. - * @param options The parameter options - */ - constructor( - subscriptionId: string, - options?: UserAgentCoreV2ClientOptionalParams - ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: UserAgentCoreV2ClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-useragent-corev2/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "2014-04-01-preview"; - } -} diff --git a/test/integration/generated/uuid/package.json b/test/integration/generated/uuid/package.json index c892662916..8883f088fa 100644 --- a/test/integration/generated/uuid/package.json +++ b/test/integration/generated/uuid/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/uuid/src/index.ts b/test/integration/generated/uuid/src/index.ts index a9c86214b9..145f796645 100644 --- a/test/integration/generated/uuid/src/index.ts +++ b/test/integration/generated/uuid/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { UuidClient } from "./uuidClient"; -export { UuidClientContext } from "./uuidClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/uuid/src/operations/get.ts b/test/integration/generated/uuid/src/operations/get.ts index 3c3f11d54d..f5bc9d342e 100644 --- a/test/integration/generated/uuid/src/operations/get.ts +++ b/test/integration/generated/uuid/src/operations/get.ts @@ -9,18 +9,18 @@ import { Get } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Parameters from "../models/parameters"; -import { UuidClientContext } from "../uuidClientContext"; +import { UuidClient } from "../uuidClient"; import { GetUuidOptionalParams, GetUuidResponse } from "../models"; /** Class containing Get operations. */ export class GetImpl implements Get { - private readonly client: UuidClientContext; + private readonly client: UuidClient; /** * Initialize a new instance of the class Get class. * @param client Reference to the service client */ - constructor(client: UuidClientContext) { + constructor(client: UuidClient) { this.client = client; } diff --git a/test/integration/generated/uuid/src/uuidClient.ts b/test/integration/generated/uuid/src/uuidClient.ts index 7ca7a0c2f1..e9f223ea2b 100644 --- a/test/integration/generated/uuid/src/uuidClient.ts +++ b/test/integration/generated/uuid/src/uuidClient.ts @@ -6,19 +6,49 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { GetImpl } from "./operations"; import { Get } from "./operationsInterfaces"; -import { UuidClientContext } from "./uuidClientContext"; import { UuidClientOptionalParams } from "./models"; -export class UuidClient extends UuidClientContext { +export class UuidClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the UuidClient class. * @param $host server parameter * @param options The parameter options */ constructor($host: string, options?: UuidClientOptionalParams) { - super($host, options); + if ($host === undefined) { + throw new Error("'$host' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: UuidClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-uuid/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "{$host}" + }; + super(optionsWithDefaults); + // Parameter assignments + this.$host = $host; this.get = new GetImpl(this); } diff --git a/test/integration/generated/uuid/src/uuidClientContext.ts b/test/integration/generated/uuid/src/uuidClientContext.ts deleted file mode 100644 index d484458855..0000000000 --- a/test/integration/generated/uuid/src/uuidClientContext.ts +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { UuidClientOptionalParams } from "./models"; - -export class UuidClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the UuidClientContext class. - * @param $host server parameter - * @param options The parameter options - */ - constructor($host: string, options?: UuidClientOptionalParams) { - if ($host === undefined) { - throw new Error("'$host' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: UuidClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-uuid/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "{$host}" - }; - super(optionsWithDefaults); - // Parameter assignments - this.$host = $host; - } -} diff --git a/test/integration/generated/validation/package.json b/test/integration/generated/validation/package.json index 5be6aec330..7c3cf41f92 100644 --- a/test/integration/generated/validation/package.json +++ b/test/integration/generated/validation/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/validation/src/index.ts b/test/integration/generated/validation/src/index.ts index 4fcb6fa545..758a222c7f 100644 --- a/test/integration/generated/validation/src/index.ts +++ b/test/integration/generated/validation/src/index.ts @@ -8,4 +8,3 @@ export * from "./models"; export { ValidationClient } from "./validationClient"; -export { ValidationClientContext } from "./validationClientContext"; diff --git a/test/integration/generated/validation/src/validationClient.ts b/test/integration/generated/validation/src/validationClient.ts index d2de02e962..307ab0082b 100644 --- a/test/integration/generated/validation/src/validationClient.ts +++ b/test/integration/generated/validation/src/validationClient.ts @@ -9,7 +9,6 @@ import * as coreClient from "@azure/core-client"; import * as Parameters from "./models/parameters"; import * as Mappers from "./models/mappers"; -import { ValidationClientContext } from "./validationClientContext"; import { ValidationClientOptionalParams, ValidationOfMethodParametersOptionalParams, @@ -21,7 +20,11 @@ import { PostWithConstantInBodyResponse } from "./models"; -export class ValidationClient extends ValidationClientContext { +export class ValidationClient extends coreClient.ServiceClient { + $host: string; + subscriptionId: string; + apiVersion: string; + /** * Initializes a new instance of the ValidationClient class. * @param subscriptionId Subscription ID. @@ -31,7 +34,39 @@ export class ValidationClient extends ValidationClientContext { subscriptionId: string, options?: ValidationClientOptionalParams ) { - super(subscriptionId, options); + if (subscriptionId === undefined) { + throw new Error("'subscriptionId' cannot be null"); + } + + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: ValidationClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-validation/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + // Parameter assignments + this.subscriptionId = subscriptionId; + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; + this.apiVersion = options.apiVersion || "1.0.0"; } /** diff --git a/test/integration/generated/validation/src/validationClientContext.ts b/test/integration/generated/validation/src/validationClientContext.ts deleted file mode 100644 index ca09149eb5..0000000000 --- a/test/integration/generated/validation/src/validationClientContext.ts +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { ValidationClientOptionalParams } from "./models"; - -export class ValidationClientContext extends coreClient.ServiceClient { - $host: string; - subscriptionId: string; - apiVersion: string; - - /** - * Initializes a new instance of the ValidationClientContext class. - * @param subscriptionId Subscription ID. - * @param options The parameter options - */ - constructor( - subscriptionId: string, - options?: ValidationClientOptionalParams - ) { - if (subscriptionId === undefined) { - throw new Error("'subscriptionId' cannot be null"); - } - - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: ValidationClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-validation/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - // Parameter assignments - this.subscriptionId = subscriptionId; - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - this.apiVersion = options.apiVersion || "1.0.0"; - } -} diff --git a/test/integration/generated/xmlservice/package.json b/test/integration/generated/xmlservice/package.json index d095822126..014b142c95 100644 --- a/test/integration/generated/xmlservice/package.json +++ b/test/integration/generated/xmlservice/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/xmlservice/src/index.ts b/test/integration/generated/xmlservice/src/index.ts index e19ad03f12..807b7026da 100644 --- a/test/integration/generated/xmlservice/src/index.ts +++ b/test/integration/generated/xmlservice/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { XmlServiceClient } from "./xmlServiceClient"; -export { XmlServiceClientContext } from "./xmlServiceClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/xmlservice/src/operations/xml.ts b/test/integration/generated/xmlservice/src/operations/xml.ts index f6e9c0f2b1..81bbb7c31d 100644 --- a/test/integration/generated/xmlservice/src/operations/xml.ts +++ b/test/integration/generated/xmlservice/src/operations/xml.ts @@ -10,7 +10,7 @@ import { Xml } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { XmlServiceClientContext } from "../xmlServiceClientContext"; +import { XmlServiceClient } from "../xmlServiceClient"; import { XmlGetComplexTypeRefNoMetaOptionalParams, XmlGetComplexTypeRefNoMetaResponse, @@ -79,13 +79,13 @@ import { /** Class containing Xml operations. */ export class XmlImpl implements Xml { - private readonly client: XmlServiceClientContext; + private readonly client: XmlServiceClient; /** * Initialize a new instance of the class Xml class. * @param client Reference to the service client */ - constructor(client: XmlServiceClientContext) { + constructor(client: XmlServiceClient) { this.client = client; } diff --git a/test/integration/generated/xmlservice/src/xmlServiceClient.ts b/test/integration/generated/xmlservice/src/xmlServiceClient.ts index d52fc49cc1..eb0e620f8f 100644 --- a/test/integration/generated/xmlservice/src/xmlServiceClient.ts +++ b/test/integration/generated/xmlservice/src/xmlServiceClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { XmlImpl } from "./operations"; import { Xml } from "./operationsInterfaces"; -import { XmlServiceClientContext } from "./xmlServiceClientContext"; import { XmlServiceClientOptionalParams } from "./models"; -export class XmlServiceClient extends XmlServiceClientContext { +export class XmlServiceClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the XmlServiceClient class. * @param options The parameter options */ constructor(options?: XmlServiceClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: XmlServiceClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-xml-service/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost:3000" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost:3000"; this.xml = new XmlImpl(this); } diff --git a/test/integration/generated/xmlservice/src/xmlServiceClientContext.ts b/test/integration/generated/xmlservice/src/xmlServiceClientContext.ts deleted file mode 100644 index 4c22ec1f53..0000000000 --- a/test/integration/generated/xmlservice/src/xmlServiceClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { XmlServiceClientOptionalParams } from "./models"; - -export class XmlServiceClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the XmlServiceClientContext class. - * @param options The parameter options - */ - constructor(options?: XmlServiceClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: XmlServiceClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-xml-service/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost:3000" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost:3000"; - } -} diff --git a/test/integration/generated/xmsErrorResponses/package.json b/test/integration/generated/xmsErrorResponses/package.json index 05094b8019..181744c005 100644 --- a/test/integration/generated/xmsErrorResponses/package.json +++ b/test/integration/generated/xmsErrorResponses/package.json @@ -25,7 +25,8 @@ "rollup": "^1.16.3", "rollup-plugin-sourcemaps": "^0.4.2", "typescript": "~4.2.0", - "uglify-js": "^3.4.9" + "uglify-js": "^3.4.9", + "rimraf": "^3.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/undefined", "repository": { diff --git a/test/integration/generated/xmsErrorResponses/src/index.ts b/test/integration/generated/xmsErrorResponses/src/index.ts index 141cb3ce5a..9322e6f442 100644 --- a/test/integration/generated/xmsErrorResponses/src/index.ts +++ b/test/integration/generated/xmsErrorResponses/src/index.ts @@ -8,5 +8,4 @@ export * from "./models"; export { XmsErrorResponsesClient } from "./xmsErrorResponsesClient"; -export { XmsErrorResponsesClientContext } from "./xmsErrorResponsesClientContext"; export * from "./operationsInterfaces"; diff --git a/test/integration/generated/xmsErrorResponses/src/operations/pet.ts b/test/integration/generated/xmsErrorResponses/src/operations/pet.ts index 89de9d197f..b013912d7b 100644 --- a/test/integration/generated/xmsErrorResponses/src/operations/pet.ts +++ b/test/integration/generated/xmsErrorResponses/src/operations/pet.ts @@ -10,7 +10,7 @@ import { Pet } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; -import { XmsErrorResponsesClientContext } from "../xmsErrorResponsesClientContext"; +import { XmsErrorResponsesClient } from "../xmsErrorResponsesClient"; import { PetGetPetByIdOptionalParams, PetGetPetByIdResponse, @@ -21,13 +21,13 @@ import { /** Class containing Pet operations. */ export class PetImpl implements Pet { - private readonly client: XmsErrorResponsesClientContext; + private readonly client: XmsErrorResponsesClient; /** * Initialize a new instance of the class Pet class. * @param client Reference to the service client */ - constructor(client: XmsErrorResponsesClientContext) { + constructor(client: XmsErrorResponsesClient) { this.client = client; } diff --git a/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClient.ts b/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClient.ts index 29fdd87282..e0dfbbc741 100644 --- a/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClient.ts +++ b/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClient.ts @@ -6,18 +6,45 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ +import * as coreClient from "@azure/core-client"; import { PetImpl } from "./operations"; import { Pet } from "./operationsInterfaces"; -import { XmsErrorResponsesClientContext } from "./xmsErrorResponsesClientContext"; import { XmsErrorResponsesClientOptionalParams } from "./models"; -export class XmsErrorResponsesClient extends XmsErrorResponsesClientContext { +export class XmsErrorResponsesClient extends coreClient.ServiceClient { + $host: string; + /** * Initializes a new instance of the XmsErrorResponsesClient class. * @param options The parameter options */ constructor(options?: XmsErrorResponsesClientOptionalParams) { - super(options); + // Initializing default values for options + if (!options) { + options = {}; + } + const defaults: XmsErrorResponsesClientOptionalParams = { + requestContentType: "application/json; charset=utf-8" + }; + + const packageDetails = `azsdk-js-xms-error-responses/1.0.0-preview1`; + const userAgentPrefix = + options.userAgentOptions && options.userAgentOptions.userAgentPrefix + ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` + : `${packageDetails}`; + + const optionsWithDefaults = { + ...defaults, + ...options, + userAgentOptions: { + userAgentPrefix + }, + baseUri: options.endpoint || "http://localhost" + }; + super(optionsWithDefaults); + + // Assigning values to Constant parameters + this.$host = options.$host || "http://localhost"; this.pet = new PetImpl(this); } diff --git a/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClientContext.ts b/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClientContext.ts deleted file mode 100644 index d9974777ad..0000000000 --- a/test/integration/generated/xmsErrorResponses/src/xmsErrorResponsesClientContext.ts +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. - * Licensed under the MIT License. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is regenerated. - */ - -import * as coreClient from "@azure/core-client"; -import { XmsErrorResponsesClientOptionalParams } from "./models"; - -export class XmsErrorResponsesClientContext extends coreClient.ServiceClient { - $host: string; - - /** - * Initializes a new instance of the XmsErrorResponsesClientContext class. - * @param options The parameter options - */ - constructor(options?: XmsErrorResponsesClientOptionalParams) { - // Initializing default values for options - if (!options) { - options = {}; - } - const defaults: XmsErrorResponsesClientOptionalParams = { - requestContentType: "application/json; charset=utf-8" - }; - - const packageDetails = `azsdk-js-xms-error-responses/1.0.0-preview1`; - const userAgentPrefix = - options.userAgentOptions && options.userAgentOptions.userAgentPrefix - ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` - : `${packageDetails}`; - - const optionsWithDefaults = { - ...defaults, - ...options, - userAgentOptions: { - userAgentPrefix - }, - baseUri: options.endpoint || "http://localhost" - }; - super(optionsWithDefaults); - - // Assigning values to Constant parameters - this.$host = options.$host || "http://localhost"; - } -}