Skip to content
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

Consolidate API version policy options #19489

Merged
merged 4 commits into from
Nov 4, 2022

Conversation

chlowell
Copy link
Member

@chlowell chlowell commented Nov 3, 2022

Following from Joel's comment that it's awkward for PipelineOptions to have two fields for APIVersionPolicy options, and what if we later want to add a third, this PR consolidates them in a new type. The result is easier to extend but still awkward because although it seems best for the policy constructor to take this new type, its values are logically required. That is to say, it doesn't make sense to construct APIVersionPolicy without telling it where on to set the version on requests. Functionally speaking though, these values are optional because the policy is a no-op when they aren't set. (That's a workaround for NewPipeline() being unable to return an error.) So, please look it over and share your thoughts--maybe there's a tidier third way here.

Copy link
Member

@jhendrixMSFT jhendrixMSFT left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add some doc comments but looks good otherwise.

@chlowell chlowell enabled auto-merge (squash) November 4, 2022 16:21
@chlowell chlowell merged commit 96096fe into Azure:main Nov 4, 2022
@chlowell chlowell deleted the api-version-refactor-2 branch March 8, 2023 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants