Skip to content

Key Vault: refactored kwarg docstrings for certificates #8320

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

Merged
merged 6 commits into from
Nov 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,10 @@ class CertificateClient(AsyncKeyVaultClientBase):
:param str vault_url: URL of the vault the client will access
:param credential: An object which can provide an access token for the vault, such as a credential from
:mod:`azure.identity.aio`

Keyword arguments
- **api_version**: version of the Key Vault API to use. Defaults to the most recent.
- **transport**: :class:`~azure.core.pipeline.transport.AsyncHttpTransport` to use. Defaults to
:class:`~azure.core.pipeline.transport.AioHttpTransport`.
:keyword str api_version: version of the Key Vault API to use. Defaults to the most recent.
:keyword transport: transport to use. Defaults to
:class:`~azure.core.pipeline.transport.AioHttpTransport`.
:paramtype transport: ~azure.core.pipeline.transport.AsyncHttpTransport

Example:
.. literalinclude:: ../tests/test_examples_certificates_async.py
Expand All @@ -61,16 +60,15 @@ async def create_certificate(
:param policy: The management policy for the certificate.
:type policy:
~azure.keyvault.certificates.models.CertificatePolicy
:keyword bool enabled: Whether the certificate is enabled for use.
:keyword tags: Application specific metadata in the form of key-value pairs.
:paramtype tags: dict[str, str]
:returns: A coroutine for the creation of the certificate. Awaiting the coroutine
returns the created KeyVaultCertificate if creation is successful, the CertificateOperation if not.
:rtype: ~azure.keyvault.certificates.models.KeyVaultCertificate or
~azure.keyvault.certificates.models.CertificateOperation
:raises: :class:`~azure.core.exceptions.HttpResponseError`

Keyword arguments
- *enabled (bool)* - Determines whether the object is enabled.
- *tags (dict[str, str])* - Application specific metadata in the form of key-value pairs.

Example:
.. literalinclude:: ../tests/test_examples_certificates_async.py
:start-after: [START create_certificate]
Expand Down Expand Up @@ -251,7 +249,7 @@ async def recover_deleted_certificate(self, name: str, **kwargs: "**Any") -> Key
"""Recovers the deleted certificate back to its current version under
/certificates.

Performs the reversal of the Delete operation. THe operation is applicable
Performs the reversal of the Delete operation. The operation is applicable
in vaults enabled for soft-delete, and must be issued during the retention
interval (available in the deleted certificate's attributes). This operation
requires the certificates/recover permission.
Expand Down Expand Up @@ -289,17 +287,16 @@ async def import_certificate(
:param str name: The name of the certificate.
:param bytes certificate_bytes: Bytes of the certificate object to import.
This certificate needs to contain the private key.
:keyword bool enabled: Whether the certificate is enabled for use.
:keyword tags: Application specific metadata in the form of key-value pairs.
:paramtype tags: dict[str, str]
:keyword str password: If the private key in the passed in certificate is encrypted, it
is the password used for encryption.
:keyword policy: The management policy for the certificate
:paramtype policy: ~azure.keyvault.certificates.models.CertificatePolicy
:returns: The imported KeyVaultCertificate
:rtype: ~azure.keyvault.certificates.models.KeyVaultCertificate
:raises: :class:`~azure.core.exceptions.HttpResponseError`

Keyword arguments
- *enabled (bool)* - Determines whether the object is enabled.
- *tags (dict[str, str])* - Application specific metadata in the form of key-value pairs.
- *password (str)* - If the private key in the passed in certificate is encrypted,
it is the password used for encryption.
- *policy (~azure.keyvault.certificates.models.CertificatePolicy)* - The management policy
for the certificate.
"""

enabled = kwargs.pop("enabled", None)
Expand Down Expand Up @@ -375,14 +372,13 @@ async def update_certificate_properties(

:param str name: The name of the certificate in the given key vault.
:param str version: The version of the certificate.
:keyword bool enabled: Whether the certificate is enabled for use.
:keyword tags: Application specific metadata in the form of key-value pairs.
:paramtype tags: dict[str, str]
:returns: The updated KeyVaultCertificate
:rtype: ~azure.keyvault.certificates.models.KeyVaultCertificate
:raises: :class:`~azure.core.exceptions.HttpResponseError`

Keyword arguments
- *enabled (bool)* - Determines whether the object is enabled.
- *tags (dict[str, str])* - Application specific metadata in the form of key-value pairs.

Example:
.. literalinclude:: ../tests/test_examples_certificates_async.py
:start-after: [START update_certificate]
Expand Down Expand Up @@ -471,15 +467,13 @@ def list_deleted_certificates(self, **kwargs: "**Any") -> AsyncIterable[DeletedC
deletion-specific information. This operation requires the certificates/get/list
permission. This operation can only be enabled on soft-delete enabled vaults.

:keyword bool include_pending: Specifies whether to include certificates which are
not completely deleted.
:return: An iterator like instance of DeletedCertificate
:rtype:
~azure.core.paging.ItemPaged[~azure.keyvault.certificates.models.DeletedCertificate]
:raises: :class:`~azure.core.exceptions.HttpResponseError`

Keyword arguments
- *include_pending (bool)* - Specifies whether to include certificates which are
not completely deleted.

Example:
.. literalinclude:: ../tests/test_examples_certificates_async.py
:start-after: [START list_deleted_certificates]
Expand All @@ -505,15 +499,13 @@ def list_certificates(self, **kwargs: "**Any") -> AsyncIterable[CertificatePrope
in the key vault. This operation requires the
certificates/list permission.

:keyword bool include_pending: Specifies whether to include certificates which are not
completely provisioned.
:returns: An iterator like instance of CertificateProperties
:rtype:
~azure.core.paging.ItemPaged[~azure.keyvault.certificates.models.CertificateProperties]
:raises: :class:`~azure.core.exceptions.HttpResponseError`

Keyword arguments
- *include_pending (bool)* - Specifies whether to include certificates which are
not completely provisioned.

Example:
.. literalinclude:: ../tests/test_examples_certificates_async.py
:start-after: [START list_certificates]
Expand Down Expand Up @@ -721,13 +713,12 @@ async def merge_certificate(
:param str name: The name of the certificate
:param x509_certificates: The certificate or the certificate chain to merge.
:type x509_certificates: list[bytearray]
:keyword bool enabled: Whether the certificate is enabled for use.
:keyword tags: Application specific metadata in the form of key-value pairs.
:paramtype tags: dict[str, str]
:return: The merged certificate operation
:rtype: ~azure.keyvault.certificates.models.CertificateOperation
:raises: :class:`~azure.core.exceptions.HttpResponseError`

Keyword arguments
- *enabled (bool)* - Determines whether the object is enabled.
- *tags (dict[str, str])* - Application specific metadata in the form of key-value pairs.
"""

enabled = kwargs.pop("enabled", None)
Expand Down Expand Up @@ -784,18 +775,17 @@ async def create_issuer(

:param str name: The name of the issuer.
:param str provider: The issuer provider.
:keyword bool enabled: Whether the issuer is enabled for use.
:keyword str account_id: The user name/account name/account id.
:keyword str password: The password/secret/account key.
:keyword str organization_id: Id of the organization
:keyword admin_details: Details of the organization administrators of the
certificate issuer.
:paramtype admin_details: list[~azure.keyvault.certificates.models.AdministratorDetails]
:returns: The created CertificateIssuer
:rtype: ~azure.keyvault.certificates.models.CertificateIssuer
:raises: :class:`~azure.core.exceptions.HttpResponseError`

Keyword arguments
- *enabled (bool)* - Determines whether the object is enabled.
- *account_id (str)* - The user name/account name/account id.
- *password (str)* - The password/secret/account key.
- *organization_id (str)* - Id of the organization.
- *admin_details (list[~azure.keyvault.certificates.models.AdministratorDetails])*
- Details of the organization administrators of the certificate issuer.

Example:
.. literalinclude:: ../tests/test_examples_certificates_async.py
:start-after: [START create_issuer]
Expand Down Expand Up @@ -856,19 +846,16 @@ async def update_issuer(self, name: str, **kwargs: "**Any") -> CertificateIssuer
This operation requires the certificates/setissuers permission.

:param str name: The name of the issuer.
:param str provider: The issuer provider.
:keyword bool enabled: Whether the issuer is enabled for use.
:keyword str provider: The issuer provider
:keyword str account_id: The user name/account name/account id.
:keyword str password: The password/secret/account key.
:keyword str organization_id: Id of the organization
:keyword admin_details: Details of the organization administrators of the certificate issuer
:paramtype admin_details: list[~azure.keyvault.certificates.models.AdministratorDetails]
:return: The updated issuer
:rtype: ~azure.keyvault.certificates.models.CertificateIssuer
:raises: :class:`~azure.core.exceptions.HttpResponseError`

Keyword arguments
- *enabled (bool)* - Determines whether the object is enabled.
- *provider (str)* - The issuer provider.
- *account_id (str)* - The user name/account name/account id.
- *password (str)* - The password/secret/account key.
- *organization_id (str)* - Id of the organization.
- *admin_details (list[~azure.keyvault.certificates.models.AdministratorDetails])*
- Details of the organization administrators of the certificate issuer.
"""

enabled = kwargs.pop("enabled", None)
Expand Down
Loading