-
Notifications
You must be signed in to change notification settings - Fork 302
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
Python guideline reorg/MQ2020 #2177
Merged
Merged
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
653d3e3
Initial draft of guideline reorg/MQ2020
johanste f878910
Merge branch 'master' into dec2020mq
johanste fcfaae8
Fixed half the todos
johanste 7a7f1ec
Addressed review feedback, improved example.
johanste 383adcc
Python: moved intro into design, restructured
johanste 45d33c7
Added guidance on cancellation
johanste d450569
Added guidance on client immutability
johanste 0cc5299
Some updates from feedback
annatisch c9d9a8b
python: fix broken link in refs.md
johanste e541565
Merge pull request #1 from annatisch/anna-dec2020mq
johanste 6e4de86
Fix typo in python.md directive
johanste ed0e642
Python: added documentation section
johanste 4aa0229
Python: removed serialization implementation section
johanste 0999e40
Python: fixed up title levels
johanste 378b830
Update docs/python/design.md
johanste e03557e
Update docs/python/design.md
johanste 1fdb143
Update docs/python/implementation.md
johanste 24550d2
Python guidelines: review feedback
johanste b81bb1a
Merge branch 'dec2020mq' of github.com:johanste/azure-sdk into dec2020mq
johanste 7489df2
Python design: CR feedb ack
johanste 5a22f73
Python: fixed duplicate ids
johanste File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
"""Example client signatures | ||
""" | ||
class ExampleClient(object): | ||
|
||
def __init__(self, endpoint, credential, **kwargs): | ||
# type: (str, azure.core.credential.TokenCredential, **Any) -> None | ||
"""Create a new example client instance | ||
|
||
:param endpoint: Endpoint to connect to. | ||
:type endpoint str: | ||
:param credential: Credentials to use when connecting to the service. | ||
:type credential: ~azure.core.credentials.TokenCredential | ||
:keyword apiversion: API version to use when talking to the service. Default is '2020-12-31' | ||
:type apiversion: str | ||
:keyword transport: HttpTransport to use. Default is azure.core.transport.RequestsHttpTransport. | ||
:type transport: ~azure.core.pipeline.transport.HttpTransport | ||
""" | ||
api_version = kwargs.pop('api_version', '2020-12-31') | ||
transport = kwargs.pop('transport', None) or azure.core.pipeline.transport.RequestsTransport(**kwargs) | ||
|
||
# continue to build up your client... | ||
johanste marked this conversation as resolved.
Show resolved
Hide resolved
|
||
pipeline = ... | ||
|
||
@classmethod | ||
def from_connection_string(cls, connection_string, **kwargs): | ||
# type: (str, **Any) -> None | ||
"""Optional factory method if the service supports connection strings | ||
|
||
:param connection_string: Connection string containing endpoint and credentials | ||
:type connection_string: str | ||
:returns: The newly created client. | ||
:rtype: ExampleClient | ||
""" | ||
endpoint, credential = _parse(connection_string) | ||
return cls(endpoint, credential, **kwargs) | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
small nit:
apiversion
in docstring doesn't matchapi_version
naming below