- 
                Notifications
    You must be signed in to change notification settings 
- Fork 317
Exposed type for scm method provider #8811
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
| No changes needing a change description found. | 
        
          
                ...csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProvider.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProvider.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                ...csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProvider.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for contributing! It's looking good. I do see several build errors in CI that will also need to be addressed.
        
          
                ...csharp/generator/Microsoft.TypeSpec.Generator.ClientModel/src/Providers/ScmMethodProvider.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                .../Microsoft.TypeSpec.Generator.ClientModel/test/Providers/ScmMethodProviderCollectionTests.cs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      | namespace Microsoft.TypeSpec.Generator.ClientModel.Providers | ||
| { | ||
| /// <summary> | ||
| /// Defines the different types of methods that can be generated by the SCM (Service Client Model) generator. | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| /// Defines the different types of methods that can be generated by the SCM (Service Client Model) generator. | |
| /// Defines the different types of methods that can be generated by the SCM (System Client Model) generator. | 
This pull request refactors how method types are defined and used throughout the client model generator codebase. The main change is the introduction of a centralized
MethodTypeenum withinScmMethodProvider, replacing the previous scattered and internal definitions. This improves code clarity, maintainability, and consistency when handling different method types (CreateRequest, Protocol, Convenience) in both implementation and tests.Core Refactoring:
MethodTypeenum inScmMethodProvider, with clear documentation for each type. Added convenience properties for checking method type.Codebase-wide Adoption:
RestClientProvider,ScmMethodProviderCollection, and related classes to useScmMethodProvider.MethodTypeinstead of the old internal enum.Removal of Duplicated Enum:
MethodTypeenum fromRestClientProvider, ensuring there is a single source of truth for method types.Test Updates:
RestClientProviderTeststo use the newScmMethodProvider.MethodTypeenum for parameterized testing and assertionsThese changes collectively improve code consistency, reduce duplication, and make the handling of client method types more robust and maintainable.#8037