This pull request introduces a new feature to set the access modifier for generated types in the Kiota code generator. The changes span multiple files to incorporate this new option, including modifications to configuration classes, options interfaces, and the command-line interface.
Feature Addition: Type Access Modifier
Command Line Interface:
src/CLI/ApiClientCodeGen.CLI/Commands/CSharp/KiotaCommand.cs: Added a new option type-access-modifier to set the access modifier for generated types. ([src/CLI/ApiClientCodeGen.CLI/Commands/CSharp/KiotaCommand.csR41-R46](diffhunk://#diff-efaa25b6f99e148545de4b8ce508e9adc655a9f045ee3d2be809eb6e77b5cc5aR41-R46))
Core Generator Logic:
src/Core/ApiClientCodeGen.Core/Generators/Kiota/KiotaCodeGenerator.cs: Updated the code generation command to include the --type-access-modifier argument. ([src/Core/ApiClientCodeGen.Core/Generators/Kiota/KiotaCodeGenerator.csL95-R101](diffhunk://#diff-7fc30463106e95ed84a45cd810c37e2eca28d11e43188b04cd7a198d38d46aecL95-R101))
src/Core/ApiClientCodeGen.Core/Generators/Kiota/KiotaConfiguration.cs: Added a new property TypeAccessModifier to the KiotaConfiguration class. ([src/Core/ApiClientCodeGen.Core/Generators/Kiota/KiotaConfiguration.csR23-R25](diffhunk://#diff-7feace2d70b95ce310ee50c9fb636a4b8d9a4796b920a9a4596a66ecc2464d66R23-R25))
src/Core/ApiClientCodeGen.Core/Generators/Kiota/TypeAccessModifier.cs: Introduced a new enum TypeAccessModifier with possible values Public, Internal, Private, and Protected. ([src/Core/ApiClientCodeGen.Core/Generators/Kiota/TypeAccessModifier.csR1-R12](diffhunk://#diff-1bf78588b25554a1e8a3251bc00e001faae9089409d3bd460e5dfaf71f2ff59cR1-R12))
Options and Configuration:
src/Core/ApiClientCodeGen.Core/Options/Kiota/DefaultKiotaOptions.cs: Set the default value for TypeAccessModifier to Public. ([src/Core/ApiClientCodeGen.Core/Options/Kiota/DefaultKiotaOptions.csL1-R8](diffhunk://#diff-2bbe5956a3cbbef79b4698ae8d3981694a7626799e8c311d4f86c1efbcb5de0bL1-R8))
src/Core/ApiClientCodeGen.Core/Options/Kiota/IKiotaOptions.cs: Added the TypeAccessModifier property to the IKiotaOptions interface. ([src/Core/ApiClientCodeGen.Core/Options/Kiota/IKiotaOptions.csL1-R9](diffhunk://#diff-1e6e43a207cfe718769053fafba20f0cbd6b720fa1b34d7b7ac095a72cee77b6L1-R9))
src/VSIX/ApiClientCodeGen.VSIX.Shared/Options/Kiota/KiotaOptions.cs: Updated the KiotaOptions class to include the TypeAccessModifier property. ([[1]](diffhunk://#diff-e25a54913797e8b56e49a9d709c5ac22e95be8aa76bc66b3b7fecf707a9a31f2R2), [[2]](diffhunk://#diff-e25a54913797e8b56e49a9d709c5ac22e95be8aa76bc66b3b7fecf707a9a31f2R17), [[3]](diffhunk://#diff-e25a54913797e8b56e49a9d709c5ac22e95be8aa76bc66b3b7fecf707a9a31f2R28-R33))
src/VSIX/ApiClientCodeGen.VSIX.Shared/Options/Kiota/KiotaOptionsPage.cs: Added UI elements for TypeAccessModifier in the options page. ([[1]](diffhunk://#diff-9b233eaadd335f56d9e862d7624a5f0014be876c2f58a91f9da78518a019cddaR6), [[2]](diffhunk://#diff-9b233eaadd335f56d9e862d7624a5f0014be876c2f58a91f9da78518a019cddaR20-R24))
This pull request introduces a new feature to set the access modifier for generated types in the Kiota code generator. The changes span multiple files to incorporate this new option, including modifications to configuration classes, options interfaces, and the command-line interface.
Feature Addition: Type Access Modifier
Command Line Interface:
src/CLI/ApiClientCodeGen.CLI/Commands/CSharp/KiotaCommand.cs
: Added a new optiontype-access-modifier
to set the access modifier for generated types. ([src/CLI/ApiClientCodeGen.CLI/Commands/CSharp/KiotaCommand.csR41-R46](diffhunk://#diff-efaa25b6f99e148545de4b8ce508e9adc655a9f045ee3d2be809eb6e77b5cc5aR41-R46)
)Core Generator Logic:
src/Core/ApiClientCodeGen.Core/Generators/Kiota/KiotaCodeGenerator.cs
: Updated the code generation command to include the--type-access-modifier
argument. ([src/Core/ApiClientCodeGen.Core/Generators/Kiota/KiotaCodeGenerator.csL95-R101](diffhunk://#diff-7fc30463106e95ed84a45cd810c37e2eca28d11e43188b04cd7a198d38d46aecL95-R101)
)src/Core/ApiClientCodeGen.Core/Generators/Kiota/KiotaConfiguration.cs
: Added a new propertyTypeAccessModifier
to theKiotaConfiguration
class. ([src/Core/ApiClientCodeGen.Core/Generators/Kiota/KiotaConfiguration.csR23-R25](diffhunk://#diff-7feace2d70b95ce310ee50c9fb636a4b8d9a4796b920a9a4596a66ecc2464d66R23-R25)
)src/Core/ApiClientCodeGen.Core/Generators/Kiota/TypeAccessModifier.cs
: Introduced a new enumTypeAccessModifier
with possible valuesPublic
,Internal
,Private
, andProtected
. ([src/Core/ApiClientCodeGen.Core/Generators/Kiota/TypeAccessModifier.csR1-R12](diffhunk://#diff-1bf78588b25554a1e8a3251bc00e001faae9089409d3bd460e5dfaf71f2ff59cR1-R12)
)Options and Configuration:
src/Core/ApiClientCodeGen.Core/Options/Kiota/DefaultKiotaOptions.cs
: Set the default value forTypeAccessModifier
toPublic
. ([src/Core/ApiClientCodeGen.Core/Options/Kiota/DefaultKiotaOptions.csL1-R8](diffhunk://#diff-2bbe5956a3cbbef79b4698ae8d3981694a7626799e8c311d4f86c1efbcb5de0bL1-R8)
)src/Core/ApiClientCodeGen.Core/Options/Kiota/IKiotaOptions.cs
: Added theTypeAccessModifier
property to theIKiotaOptions
interface. ([src/Core/ApiClientCodeGen.Core/Options/Kiota/IKiotaOptions.csL1-R9](diffhunk://#diff-1e6e43a207cfe718769053fafba20f0cbd6b720fa1b34d7b7ac095a72cee77b6L1-R9)
)src/VSIX/ApiClientCodeGen.VSIX.Shared/Options/Kiota/KiotaOptions.cs
: Updated theKiotaOptions
class to include theTypeAccessModifier
property. ([[1]](diffhunk://#diff-e25a54913797e8b56e49a9d709c5ac22e95be8aa76bc66b3b7fecf707a9a31f2R2)
,[[2]](diffhunk://#diff-e25a54913797e8b56e49a9d709c5ac22e95be8aa76bc66b3b7fecf707a9a31f2R17)
,[[3]](diffhunk://#diff-e25a54913797e8b56e49a9d709c5ac22e95be8aa76bc66b3b7fecf707a9a31f2R28-R33)
)src/VSIX/ApiClientCodeGen.VSIX.Shared/Options/Kiota/KiotaOptionsPage.cs
: Added UI elements forTypeAccessModifier
in the options page. ([[1]](diffhunk://#diff-9b233eaadd335f56d9e862d7624a5f0014be876c2f58a91f9da78518a019cddaR6)
,[[2]](diffhunk://#diff-9b233eaadd335f56d9e862d7624a5f0014be876c2f58a91f9da78518a019cddaR20-R24)
)Screenshot