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

Key Vault: fixed certificate docstring errors #7132

Merged
merged 5 commits into from
Sep 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -148,7 +148,7 @@ async def get_certificate_with_policy(
the get_certificate function and specify version.

:param name: The name of the certificate in the given
vault.
vault.
iscai-msft marked this conversation as resolved.
Show resolved Hide resolved
:type name: str
:returns: An instance of Certificate
:rtype: ~azure.keyvault.certificates.models.Certificate
Expand Down Expand Up @@ -183,7 +183,7 @@ async def get_certificate(
use the get_certificate_with_policy function.

:param name: The name of the certificate in the given
vault.
vault.
:type name: str
:param version: The version of the certificate.
:type version: str
Expand Down Expand Up @@ -301,7 +301,7 @@ async def recover_deleted_certificate(self, name: str, **kwargs: "**Any") -> Cer
:param name: The name of the deleted certificate
:type name: str
:return: The recovered certificate
:rtype ~azure.keyvault.certificates.models.Certificate
:rtype: ~azure.keyvault.certificates.models.Certificate
:raises: ~azure.core.exceptions.HttpResponseError

Example:
Expand Down Expand Up @@ -341,7 +341,7 @@ async def import_certificate(
:param name: The name of the certificate.
:type name: str
:param certificate_bytes: Bytes of the ertificate object to import.
This certificate needs to contain the private key.
This certificate needs to contain the private key.
:type certificate_bytes: str
:param password: If the private key in base64EncodedCertificate is
encrypted, the password used for encryption.
Expand All @@ -352,7 +352,7 @@ async def import_certificate(
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param tags: Application specific metadata in the form of key-value
pairs.
pairs.
iscai-msft marked this conversation as resolved.
Show resolved Hide resolved
:type tags: dict[str, str]
:returns: The imported Certificate
:rtype: ~azure.keyvault.certificates.models.Certificate
Expand Down Expand Up @@ -387,7 +387,7 @@ async def get_policy(self, name: str, **kwargs: "**Any") -> CertificatePolicy:
:param name: The name of the certificate in a given key vault.
:type name: str
:return: The certificate policy
:rtype ~azure.keyvault.certificates.models.CertificatePolicy
:rtype: ~azure.keyvault.certificates.models.CertificatePolicy
:raises: ~azure.core.exceptions.HttpResponseError
"""
bundle = await self._client.get_certificate_policy(
Expand Down Expand Up @@ -441,7 +441,7 @@ async def update_certificate(
attributes. This operation requires the certificates/update permission.

:param name: The name of the certificate in the given key
vault.
vault.
:type name: str
:param version: The version of the certificate.
:type version: str
Expand Down Expand Up @@ -515,7 +515,7 @@ async def restore_certificate(self, backup: bytes, **kwargs: "**Any") -> Certifi
this operation requires the certificates/restore permission.

:param backup: The backup blob associated with a certificate bundle.
:type backup bytes
:type backup: bytes
iscai-msft marked this conversation as resolved.
Show resolved Hide resolved
:return: The restored Certificate
:rtype: ~azure.keyvault.certificates.models.Certificate
:raises: ~azure.core.exceptions.HttpResponseError
Expand Down Expand Up @@ -550,11 +550,11 @@ def list_deleted_certificates(
permission. This operation can only be enabled on soft-delete enabled vaults.

:param include_pending: Specifies whether to include certificates which are not
completely provisioned.
completely provisioned.
:type include_pending: bool
:return: An iterator like instance of DeletedCertificate
:rtype:
typing.Generator[~azure.keyvault.certificates.models.DeletedCertificate]
Generator[~azure.keyvault.certificates.models.DeletedCertificate]
:raises: ~azure.core.exceptions.HttpResponseError

Example:
Expand Down Expand Up @@ -591,7 +591,7 @@ def list_certificates(
:type include_pending: bool
:returns: An iterator like instance of CertificateBase
:rtype:
typing.Generator[~azure.keyvault.certificates.models.CertificateBase]
Generator[~azure.keyvault.certificates.models.CertificateBase]
:raises: ~azure.core.exceptions.HttpResponseError

Example:
Expand Down Expand Up @@ -623,7 +623,7 @@ def list_certificate_versions(self, name: str, **kwargs: "**Any") -> AsyncIterab
:type name: str
:returns: An iterator like instance of CertificateBase
:rtype:
typing.Generator[~azure.keyvault.certificates.models.CertificateBase]
Generator[~azure.keyvault.certificates.models.CertificateBase]
iscai-msft marked this conversation as resolved.
Show resolved Hide resolved
:raises: ~azure.core.exceptions.HttpResponseError

Example:
Expand Down Expand Up @@ -713,7 +713,7 @@ async def delete_contacts(self, **kwargs: "**Any") -> List[Contact]:
This operation requires the certificates/managecontacts permission.

:return: Contacts
:rtype: Iterator[~azure.security.certificates._models.Contact]
:rtype: Iterator[~azure.keyvault.certificates.models.Contact]
iscai-msft marked this conversation as resolved.
Show resolved Hide resolved
:raises: ~azure.core.exceptions.HttpResponseError

Example:
Expand All @@ -737,7 +737,7 @@ async def get_certificate_operation(self, name: str, **kwargs: "**Any") -> Certi
:param name: The name of the certificate.
:type name: str
:returns: The created CertificateOperation
:rtype: ~azure.security.keyvault.certificates.models.CertificateOperation
:rtype: ~azure.keyvault.certificates.models.CertificateOperation
:raises: ~azure.core.exceptions.HttpResponseError
"""

Expand Down Expand Up @@ -771,14 +771,14 @@ async def delete_certificate_operation(self, name: str, **kwargs: "**Any") -> Ce

@distributed_trace_async
async def cancel_certificate_operation(self, name: str, **kwargs: "**Any") -> CertificateOperation:
"""Updates a certificate operation.
"""Cancels a certificate operation.

Updates a certificate creation operation that is already in progress.
Cancels a certificate creation operation that is already in progress.
This operation requires the certificates/update permission.

:param name: The name of the certificate.
:type name: str
:returns: The updated certificate operation
:returns: The cancelled certificate operation
:rtype: ~azure.keyvault.certificates.models.CertificateOperation
:raises: ~azure.core.exceptions.HttpResponseError
"""
Expand All @@ -797,6 +797,7 @@ async def get_pending_certificate_signing_request(
custom_headers: Optional[Dict[str, str]] = None,
**kwargs: "**Any") -> str:
"""Gets the Base64 pending certificate signing request (PKCS-10).

:param name: The name of the certificate
:type name: str
:param custom_headers: headers that will be added to the request
Expand Down Expand Up @@ -1015,7 +1016,7 @@ async def update_issuer(
"""Updates the specified certificate issuer.

Performs an update on the specified certificate issuer entity.
THis operation requires the certificates/setissuers permission.
This operation requires the certificates/setissuers permission.

:param name: The name of the issuer.
:type name: str
Expand All @@ -1034,14 +1035,6 @@ async def update_issuer(
:return: The updated issuer
:rtype: ~azure.keyvault.certificates.models.Issuer
:raises: ~azure.core.exceptions.HttpResponseError

Example:
.. literalinclude:: ../tests/test_examples_certificates_async.py
:start-after: [START update_issuer]
:end-before: [END update_issuer]
:language: python
:caption: Update an issuer
:dedent: 8
"""
if account_id or password:
issuer_credentials = self._client.models.IssuerCredentials(account_id=account_id, password=password)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def create_certificate(
:type name: str
:param policy: The management policy for the certificate.
:type policy:
~azure.security.keyvault.certificates._models.CertificatePolicy
~azure.keyvault.certificates.models.CertificatePolicy
:param bool enabled: Determines whether the object is enabled.
:param tags: Application specific metadata in the form of key-value pairs.
:type tags: dict(str, str)
Expand Down Expand Up @@ -153,7 +153,7 @@ def get_certificate_with_policy(self, name, **kwargs):
the get_certificate function and specify version.

:param name: The name of the certificate in the given
vault.
vault.
:type name: str
:returns: An instance of Certificate
:rtype: ~azure.keyvault.certificates.models.Certificate
Expand Down Expand Up @@ -184,7 +184,7 @@ def get_certificate(self, name, version, **kwargs):
use the get_certificate_with_policy function.

:param name: The name of the certificate in the given
vault.
vault.
:type name: str
:param version: The version of the certificate.
:type version: str
Expand Down Expand Up @@ -306,11 +306,11 @@ def recover_deleted_certificate(self, name, **kwargs):
:param name: The name of the deleted certificate
:type name: str
:return: The recovered certificate
:rtype ~azure.keyvault.certificates.models.Certificate
:rtype: ~azure.keyvault.certificates.models.Certificate
:raises: ~azure.core.exceptions.HttpResponseError

Example:
.. literalinclude:: ../tests/test_samples_keys.py
.. literalinclude:: ../tests/test_examples_certificates.py
:start-after: [START recover_deleted_certificate]
:end-before: [END recover_deleted_certificate]
:language: python
Expand Down Expand Up @@ -346,19 +346,19 @@ def import_certificate(

:param name: The name of the certificate.
:type name: str
:param certificate_bytes: Bytes of the ertificate object to import.
This certificate needs to contain the private key.
:param certificate_bytes: Bytes of the certificate object to import. This certificate
needs to contain the private key.
:type certificate_bytes: str
:param password: If the private key in base64EncodedCertificate is
encrypted, the password used for encryption.
encrypted, the password used for encryption.
:type password: str
:param policy: The management policy for the certificate.
:type policy:
~azure.keyvault.certificates.models.CertificatePolicy
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param tags: Application specific metadata in the form of key-value
pairs.
pairs.
:type tags: dict[str, str]
:returns: The imported Certificate
:rtype: ~azure.keyvault.certificates.models.Certificate
Expand Down Expand Up @@ -394,7 +394,7 @@ def get_policy(self, name, **kwargs):
:param name: The name of the certificate in a given key vault.
:type name: str
:return: The certificate policy
:rtype ~azure.keyvault.certificates.models.CertificatePolicy
:rtype: ~azure.keyvault.certificates.models.CertificatePolicy
:raises: ~azure.core.exceptions.HttpResponseError
"""
bundle = self._client.get_certificate_policy(
Expand Down Expand Up @@ -445,7 +445,7 @@ def update_certificate(
attributes. This operation requires the certificates/update permission.

:param name: The name of the certificate in the given key
vault.
vault.
:type name: str
:param version: The version of the certificate.
:type version: str
Expand Down Expand Up @@ -521,7 +521,7 @@ def restore_certificate(self, backup, **kwargs):
this operation requires the certificates/restore permission.

:param backup: The backup blob associated with a certificate bundle.
:type backup bytes
:type backup: bytes
:return: The restored Certificate
:rtype: ~azure.keyvault.certificates.models.Certificate
:raises: ~azure.core.exceptions.HttpResponseError
Expand Down Expand Up @@ -553,11 +553,11 @@ def list_deleted_certificates(self, include_pending=None, **kwargs):
permission. This operation can only be enabled on soft-delete enabled vaults.

:param include_pending: Specifies whether to include certificates which are not
completely provisioned.
completely provisioned.
:type include_pending: bool
:return: An iterator like instance of DeletedCertificate
:rtype:
typing.Generator[~azure.keyvault.certificates.models.DeletedCertificate]
Generator[~azure.keyvault.certificates.models.DeletedCertificate]
iscai-msft marked this conversation as resolved.
Show resolved Hide resolved
:raises: ~azure.core.exceptions.HttpResponseError

Example:
Expand Down Expand Up @@ -590,11 +590,11 @@ def list_certificates(self, include_pending=None, **kwargs):
certificates/list permission.

:param include_pending: Specifies whether to include certificates
which are not completely provisioned.
which are not completely provisioned.
:type include_pending: bool
:returns: An iterator like instance of CertificateBase
:rtype:
typing.Generator[~azure.keyvault.certificates.models.CertificateBase]
Generator[~azure.keyvault.certificates.models.CertificateBase]
:raises: ~azure.core.exceptions.HttpResponseError

Example:
Expand Down Expand Up @@ -627,7 +627,7 @@ def list_certificate_versions(self, name, **kwargs):
:type name: str
:returns: An iterator like instance of CertificateBase
:rtype:
typing.Generator[~azure.keyvault.certificates.models.CertificateBase]
Generator[~azure.keyvault.certificates.models.CertificateBase]
:raises: ~azure.core.exceptions.HttpResponseError

Example:
Expand Down Expand Up @@ -685,7 +685,7 @@ def get_contacts(self, **kwargs):
permission.

:return: The certificate contacts for the key vault.
:rtype: Iterator[azure.keyvault.certificates._models.Contact]
:rtype: Iterator[~azure.keyvault.certificates.models.Contact]
:raises: ~azure.core.exceptions.HttpResponseError

Example:
Expand All @@ -708,7 +708,7 @@ def delete_contacts(self, **kwargs):
This operation requires the certificates/managecontacts permission.

:return: Contacts
:rtype: Iterator[~azure.certificates._models.Contact]
:rtype: Iterator[~azure.keyvault.certificates.models.Contact]
:raises: ~azure.core.exceptions.HttpResponseError

Example:
Expand Down Expand Up @@ -769,14 +769,14 @@ def delete_certificate_operation(self, name, **kwargs):
@distributed_trace
def cancel_certificate_operation(self, name, **kwargs):
# type: (str, **Any) -> CertificateOperation
"""Updates a certificate operation.
"""Cancels a certificate operation.

Updates a certificate creation operation that is already in progress.
Cancels a certificate creation operation that is already in progress.
This operation requires the certificates/update permission.

:param name: The name of the certificate.
:type name: str
:returns: The updated certificate operation
:returns: The cancelled certificate operation
:rtype: ~azure.keyvault.certificates.models.CertificateOperation
:raises: ~azure.core.exceptions.HttpResponseError
"""
Expand Down Expand Up @@ -839,6 +839,7 @@ def get_pending_certificate_signing_request(
):
# type: (...) -> str
"""Gets the Base64 pending certificate signing request (PKCS-10).

:param name: The name of the certificate
:type name: str
:param custom_headers: headers that will be added to the request
Expand Down Expand Up @@ -950,7 +951,7 @@ def create_issuer(
:param organization_id: Id of the organization.
:type organization_id: str
:param admin_details: Details of the organization administrators of the certificate issuer.
:type admin_details: Iterable[AdministratorDetails]
:type admin_details: Iterable[~azure.keyvault.certificates.models.AdministratorDetails]
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:returns: The created Issuer
Expand Down Expand Up @@ -1016,7 +1017,7 @@ def update_issuer(
"""Updates the specified certificate issuer.

Performs an update on the specified certificate issuer entity.
THis operation requires the certificates/setissuers permission.
This operation requires the certificates/setissuers permission.

:param name: The name of the issuer.
:type name: str
Expand All @@ -1029,20 +1030,12 @@ def update_issuer(
:param organization_id: Id of the organization
:type organization_id: str
:param admin_details: Details of the organization administrators of the certificate issuer.
:type admin_details: Iterable[AdministratorDetails]
:type admin_details: Iterable[~azure.keyvault.certificates.models.AdministratorDetails]
:param enabled: Determines whether the issuer is enabled.
:type enabled: bool
:return: The updated issuer
:rtype: ~azure.keyvault.certificates.models.Issuer
:raises: ~azure.core.exceptions.HttpResponseError

Example:
.. literalinclude:: ../tests/test_examples_certificates.py
:start-after: [START update_issuer]
:end-before: [END update_issuer]
:language: python
:caption: Update an issuer
:dedent: 8
"""
if account_id or password:
issuer_credentials = self._client.models.IssuerCredentials(account_id=account_id, password=password)
Expand Down
Loading