Skip to content

Commit 99ff09f

Browse files
authored
Key Vault: refactored kwarg docstrings for certificates (#8320)
* refactored kwarg docstrings * fixed keyword documentation * fixed linting issue * implemented Charles' comments
1 parent 9a05c74 commit 99ff09f

File tree

3 files changed

+84
-108
lines changed

3 files changed

+84
-108
lines changed

sdk/keyvault/azure-keyvault-certificates/azure/keyvault/certificates/aio/client.py

+39-52
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,10 @@ class CertificateClient(AsyncKeyVaultClientBase):
3232
:param str vault_url: URL of the vault the client will access
3333
:param credential: An object which can provide an access token for the vault, such as a credential from
3434
:mod:`azure.identity.aio`
35-
36-
Keyword arguments
37-
- **api_version**: version of the Key Vault API to use. Defaults to the most recent.
38-
- **transport**: :class:`~azure.core.pipeline.transport.AsyncHttpTransport` to use. Defaults to
39-
:class:`~azure.core.pipeline.transport.AioHttpTransport`.
35+
:keyword str api_version: version of the Key Vault API to use. Defaults to the most recent.
36+
:keyword transport: transport to use. Defaults to
37+
:class:`~azure.core.pipeline.transport.AioHttpTransport`.
38+
:paramtype transport: ~azure.core.pipeline.transport.AsyncHttpTransport
4039
4140
Example:
4241
.. literalinclude:: ../tests/test_examples_certificates_async.py
@@ -61,16 +60,15 @@ async def create_certificate(
6160
:param policy: The management policy for the certificate.
6261
:type policy:
6362
~azure.keyvault.certificates.models.CertificatePolicy
63+
:keyword bool enabled: Whether the certificate is enabled for use.
64+
:keyword tags: Application specific metadata in the form of key-value pairs.
65+
:paramtype tags: dict[str, str]
6466
:returns: A coroutine for the creation of the certificate. Awaiting the coroutine
6567
returns the created KeyVaultCertificate if creation is successful, the CertificateOperation if not.
6668
:rtype: ~azure.keyvault.certificates.models.KeyVaultCertificate or
6769
~azure.keyvault.certificates.models.CertificateOperation
6870
:raises: :class:`~azure.core.exceptions.HttpResponseError`
6971
70-
Keyword arguments
71-
- *enabled (bool)* - Determines whether the object is enabled.
72-
- *tags (dict[str, str])* - Application specific metadata in the form of key-value pairs.
73-
7472
Example:
7573
.. literalinclude:: ../tests/test_examples_certificates_async.py
7674
:start-after: [START create_certificate]
@@ -251,7 +249,7 @@ async def recover_deleted_certificate(self, name: str, **kwargs: "**Any") -> Key
251249
"""Recovers the deleted certificate back to its current version under
252250
/certificates.
253251
254-
Performs the reversal of the Delete operation. THe operation is applicable
252+
Performs the reversal of the Delete operation. The operation is applicable
255253
in vaults enabled for soft-delete, and must be issued during the retention
256254
interval (available in the deleted certificate's attributes). This operation
257255
requires the certificates/recover permission.
@@ -289,17 +287,16 @@ async def import_certificate(
289287
:param str name: The name of the certificate.
290288
:param bytes certificate_bytes: Bytes of the certificate object to import.
291289
This certificate needs to contain the private key.
290+
:keyword bool enabled: Whether the certificate is enabled for use.
291+
:keyword tags: Application specific metadata in the form of key-value pairs.
292+
:paramtype tags: dict[str, str]
293+
:keyword str password: If the private key in the passed in certificate is encrypted, it
294+
is the password used for encryption.
295+
:keyword policy: The management policy for the certificate
296+
:paramtype policy: ~azure.keyvault.certificates.models.CertificatePolicy
292297
:returns: The imported KeyVaultCertificate
293298
:rtype: ~azure.keyvault.certificates.models.KeyVaultCertificate
294299
:raises: :class:`~azure.core.exceptions.HttpResponseError`
295-
296-
Keyword arguments
297-
- *enabled (bool)* - Determines whether the object is enabled.
298-
- *tags (dict[str, str])* - Application specific metadata in the form of key-value pairs.
299-
- *password (str)* - If the private key in the passed in certificate is encrypted,
300-
it is the password used for encryption.
301-
- *policy (~azure.keyvault.certificates.models.CertificatePolicy)* - The management policy
302-
for the certificate.
303300
"""
304301

305302
enabled = kwargs.pop("enabled", None)
@@ -375,14 +372,13 @@ async def update_certificate_properties(
375372
376373
:param str name: The name of the certificate in the given key vault.
377374
:param str version: The version of the certificate.
375+
:keyword bool enabled: Whether the certificate is enabled for use.
376+
:keyword tags: Application specific metadata in the form of key-value pairs.
377+
:paramtype tags: dict[str, str]
378378
:returns: The updated KeyVaultCertificate
379379
:rtype: ~azure.keyvault.certificates.models.KeyVaultCertificate
380380
:raises: :class:`~azure.core.exceptions.HttpResponseError`
381381
382-
Keyword arguments
383-
- *enabled (bool)* - Determines whether the object is enabled.
384-
- *tags (dict[str, str])* - Application specific metadata in the form of key-value pairs.
385-
386382
Example:
387383
.. literalinclude:: ../tests/test_examples_certificates_async.py
388384
:start-after: [START update_certificate]
@@ -471,15 +467,13 @@ def list_deleted_certificates(self, **kwargs: "**Any") -> AsyncIterable[DeletedC
471467
deletion-specific information. This operation requires the certificates/get/list
472468
permission. This operation can only be enabled on soft-delete enabled vaults.
473469
470+
:keyword bool include_pending: Specifies whether to include certificates which are
471+
not completely deleted.
474472
:return: An iterator like instance of DeletedCertificate
475473
:rtype:
476474
~azure.core.paging.ItemPaged[~azure.keyvault.certificates.models.DeletedCertificate]
477475
:raises: :class:`~azure.core.exceptions.HttpResponseError`
478476
479-
Keyword arguments
480-
- *include_pending (bool)* - Specifies whether to include certificates which are
481-
not completely deleted.
482-
483477
Example:
484478
.. literalinclude:: ../tests/test_examples_certificates_async.py
485479
:start-after: [START list_deleted_certificates]
@@ -505,15 +499,13 @@ def list_certificates(self, **kwargs: "**Any") -> AsyncIterable[CertificatePrope
505499
in the key vault. This operation requires the
506500
certificates/list permission.
507501
502+
:keyword bool include_pending: Specifies whether to include certificates which are not
503+
completely provisioned.
508504
:returns: An iterator like instance of CertificateProperties
509505
:rtype:
510506
~azure.core.paging.ItemPaged[~azure.keyvault.certificates.models.CertificateProperties]
511507
:raises: :class:`~azure.core.exceptions.HttpResponseError`
512508
513-
Keyword arguments
514-
- *include_pending (bool)* - Specifies whether to include certificates which are
515-
not completely provisioned.
516-
517509
Example:
518510
.. literalinclude:: ../tests/test_examples_certificates_async.py
519511
:start-after: [START list_certificates]
@@ -721,13 +713,12 @@ async def merge_certificate(
721713
:param str name: The name of the certificate
722714
:param x509_certificates: The certificate or the certificate chain to merge.
723715
:type x509_certificates: list[bytearray]
716+
:keyword bool enabled: Whether the certificate is enabled for use.
717+
:keyword tags: Application specific metadata in the form of key-value pairs.
718+
:paramtype tags: dict[str, str]
724719
:return: The merged certificate operation
725720
:rtype: ~azure.keyvault.certificates.models.CertificateOperation
726721
:raises: :class:`~azure.core.exceptions.HttpResponseError`
727-
728-
Keyword arguments
729-
- *enabled (bool)* - Determines whether the object is enabled.
730-
- *tags (dict[str, str])* - Application specific metadata in the form of key-value pairs.
731722
"""
732723

733724
enabled = kwargs.pop("enabled", None)
@@ -784,18 +775,17 @@ async def create_issuer(
784775
785776
:param str name: The name of the issuer.
786777
:param str provider: The issuer provider.
778+
:keyword bool enabled: Whether the issuer is enabled for use.
779+
:keyword str account_id: The user name/account name/account id.
780+
:keyword str password: The password/secret/account key.
781+
:keyword str organization_id: Id of the organization
782+
:keyword admin_details: Details of the organization administrators of the
783+
certificate issuer.
784+
:paramtype admin_details: list[~azure.keyvault.certificates.models.AdministratorDetails]
787785
:returns: The created CertificateIssuer
788786
:rtype: ~azure.keyvault.certificates.models.CertificateIssuer
789787
:raises: :class:`~azure.core.exceptions.HttpResponseError`
790788
791-
Keyword arguments
792-
- *enabled (bool)* - Determines whether the object is enabled.
793-
- *account_id (str)* - The user name/account name/account id.
794-
- *password (str)* - The password/secret/account key.
795-
- *organization_id (str)* - Id of the organization.
796-
- *admin_details (list[~azure.keyvault.certificates.models.AdministratorDetails])*
797-
- Details of the organization administrators of the certificate issuer.
798-
799789
Example:
800790
.. literalinclude:: ../tests/test_examples_certificates_async.py
801791
:start-after: [START create_issuer]
@@ -856,19 +846,16 @@ async def update_issuer(self, name: str, **kwargs: "**Any") -> CertificateIssuer
856846
This operation requires the certificates/setissuers permission.
857847
858848
:param str name: The name of the issuer.
859-
:param str provider: The issuer provider.
849+
:keyword bool enabled: Whether the issuer is enabled for use.
850+
:keyword str provider: The issuer provider
851+
:keyword str account_id: The user name/account name/account id.
852+
:keyword str password: The password/secret/account key.
853+
:keyword str organization_id: Id of the organization
854+
:keyword admin_details: Details of the organization administrators of the certificate issuer
855+
:paramtype admin_details: list[~azure.keyvault.certificates.models.AdministratorDetails]
860856
:return: The updated issuer
861857
:rtype: ~azure.keyvault.certificates.models.CertificateIssuer
862858
:raises: :class:`~azure.core.exceptions.HttpResponseError`
863-
864-
Keyword arguments
865-
- *enabled (bool)* - Determines whether the object is enabled.
866-
- *provider (str)* - The issuer provider.
867-
- *account_id (str)* - The user name/account name/account id.
868-
- *password (str)* - The password/secret/account key.
869-
- *organization_id (str)* - Id of the organization.
870-
- *admin_details (list[~azure.keyvault.certificates.models.AdministratorDetails])*
871-
- Details of the organization administrators of the certificate issuer.
872859
"""
873860

874861
enabled = kwargs.pop("enabled", None)

0 commit comments

Comments
 (0)