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 4 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 @@ -58,13 +58,11 @@ async def create_certificate(
If this is the first version, the certificate resource is created. This
operation requires the certificates/create permission.

:param name: The name of the certificate.
:type name: str
:param str name: The name of the certificate.
: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 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)
:returns: The created CertificateOperation
Expand Down Expand Up @@ -147,9 +145,7 @@ async def get_certificate_with_policy(
version of the certificate as a parameter. If you wish to specify version, use
the get_certificate function and specify version.

:param name: The name of the certificate in the given
vault.
:type name: str
:param str name: The name of the certificate in the given vault.
:returns: An instance of Certificate
:rtype: ~azure.keyvault.certificates.models.Certificate
:raises: ~azure.core.exceptions.HttpResponseError
Expand Down Expand Up @@ -182,11 +178,8 @@ async def get_certificate(
If you wish to not specify a version or to get the certificate's policy as well,
use the get_certificate_with_policy function.

:param name: The name of the certificate in the given
vault.
:type name: str
:param version: The version of the certificate.
:type version: str
:param str name: The name of the certificate in the given vault.
:param str version: The version of the certificate.
:returns: An instance of Certificate
:rtype: ~azure.keyvault.certificates.models.Certificate
:raises: ~azure.core.exceptions.HttpResponseError
Expand Down Expand Up @@ -216,8 +209,7 @@ async def delete_certificate(self, name: str, **kwargs: "**Any") -> DeletedCerti
of a certificate object. This operation requires the
certificates/delete permission.

:param name: The name of the certificate.
:type name: str
:param str name: The name of the certificate.
:returns: The deleted certificate
:rtype: ~azure.keyvault.certificates.models.DeletedCertificate
:raises: ~azure.core.exceptions.HttpResponseError
Expand Down Expand Up @@ -246,8 +238,7 @@ async def get_deleted_certificate(self, name: str, **kwargs: "**Any") -> Deleted
current deletion recovery level. This operaiton requires the certificates/
get permission.

:param name: The name of the certificate.
:type name: str
:param str name: The name of the certificate.
:return: The deleted certificate
:rtype: ~azure.keyvault.certificates.models.DeletedCertificate
:raises: ~azure.core.exceptions.HttpResponseError
Expand Down Expand Up @@ -276,8 +267,7 @@ async def purge_deleted_certificate(self, name: str, **kwargs: "**Any") -> None:
level does not specified 'Purgeable'. This operation requires the
certificate/purge permission.

:param name: The name of the certificate
:type name: str
:param str name: The name of the certificate
:return: None
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
Expand All @@ -298,10 +288,9 @@ async def recover_deleted_certificate(self, name: str, **kwargs: "**Any") -> Cer
interval (available in the deleted certificate's attributes). This operation
requires the certificates/recover permission.

:param name: The name of the deleted certificate
:type name: str
:param str name: The name of the deleted certificate
: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 @@ -338,21 +327,17 @@ async def import_certificate(
contain the key as well as x509 certificates. This operation requires
the certificates/import permission.

: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.
:type certificate_bytes: str
:param password: If the private key in base64EncodedCertificate is
:param str name: The name of the certificate.
:param bytes certificate_bytes: Bytes of the ertificate object to import.
iscai-msft marked this conversation as resolved.
Show resolved Hide resolved
This certificate needs to contain the private key.
:param str password: If the private key in base64EncodedCertificate is
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 bool enabled: Determines whether the object is enabled.
: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 @@ -384,10 +369,9 @@ async def get_policy(self, name: str, **kwargs: "**Any") -> CertificatePolicy:
Returns the specified certificate policy resources in the key
vault. This operation requires the certificates/get permission.

:param name: The name of the certificate in a given key vault.
:type name: str
:param str name: The name of the certificate in a given key vault.
: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 All @@ -409,8 +393,7 @@ async def update_policy(
Set specified members in the certificate policy. Leaves others as null.
This operation requries the certificates/update permission.

:param name: The name of the certificate in the given vault.
:type name: str
:param str name: The name of the certificate in the given vault.
:param policy: The policy for the certificate.
:type policy: ~azure.keyvault.certificates.models.CertificatePolicy
:return: The certificate policy
Expand Down Expand Up @@ -440,13 +423,9 @@ async def update_certificate(
given certificate; the only elements updated are the certificate's
attributes. This operation requires the certificates/update permission.

:param name: The name of the certificate in the given key
vault.
:type name: str
:param version: The version of the certificate.
:type version: str
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param str name: The name of the certificate in the given key vault.
:param str version: The version of the certificate.
: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)
:returns: The updated Certificate
Expand Down Expand Up @@ -486,8 +465,7 @@ async def backup_certificate(self, name: str, **kwargs: "**Any") -> bytes:
to the client. All versions of the certificate will be downloaded.
This operation requires the certificates/backup permission.

:param name: The name of the certificate.
:type name: str
:param str name: The name of the certificate.
:return: the backup blob containing the backed up certificate.
:rtype: bytes
:raises: ~azure.core.exceptions.HttpResponseError
Expand All @@ -514,8 +492,7 @@ async def restore_certificate(self, backup: bytes, **kwargs: "**Any") -> Certifi
Restores a backed up certificate, and all its versions, to a vault.
this operation requires the certificates/restore permission.

:param backup: The backup blob associated with a certificate bundle.
:type backup bytes
:param bytes backup: The backup blob associated with a certificate bundle.
:return: The restored Certificate
:rtype: ~azure.keyvault.certificates.models.Certificate
:raises: ~azure.core.exceptions.HttpResponseError
Expand Down Expand Up @@ -549,12 +526,11 @@ def list_deleted_certificates(
deletion-specific information. This operation requires the certificates/get/list
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.
:type include_pending: bool
:param bool include_pending: Specifies whether to include certificates which are not
completely provisioned.
:return: An iterator like instance of DeletedCertificate
:rtype:
typing.Generator[~azure.keyvault.certificates.models.DeletedCertificate]
ItemPaged[~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 @@ -586,12 +562,11 @@ def list_certificates(
in the key vault. This operation requires the
certificates/list permission.

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

Example:
Expand Down Expand Up @@ -619,11 +594,10 @@ def list_certificate_versions(self, name: str, **kwargs: "**Any") -> AsyncIterab
certificate in the key vault. This operation requires the
certificates/list permission.

:param name: The name of the certificate.
:type name: str
:param str name: The name of the certificate.
:returns: An iterator like instance of CertificateBase
:rtype:
typing.Generator[~azure.keyvault.certificates.models.CertificateBase]
ItemPaged[~azure.keyvault.certificates.models.CertificateBase]
:raises: ~azure.core.exceptions.HttpResponseError

Example:
Expand Down Expand Up @@ -713,7 +687,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 @@ -734,10 +708,9 @@ async def get_certificate_operation(self, name: str, **kwargs: "**Any") -> Certi
Gets the creation operation associated with a specified certificate.
This operation requires the certificates/get permission.

:param name: The name of the certificate.
:type name: str
:param str name: The name of the certificate.
:returns: The created CertificateOperation
:rtype: ~azure.security.keyvault.certificates.models.CertificateOperation
:rtype: ~azure.keyvault.certificates.models.CertificateOperation
:raises: ~azure.core.exceptions.HttpResponseError
"""

Expand All @@ -756,8 +729,7 @@ async def delete_certificate_operation(self, name: str, **kwargs: "**Any") -> Ce
the process of being created. The certificate is no longer created.
This operation requires the certificates/update permission.

:param name: The name of the certificate.
:type name: str
:param str name: The name of the certificate.
:return: The deleted CertificateOperation
:rtype: ~azure.keyvault.certificates.models.CertificateOperation
:raises: ~azure.core.exceptions.HttpResponseError
Expand All @@ -771,14 +743,13 @@ 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
:param str name: The name of the certificate.
:returns: The cancelled certificate operation
:rtype: ~azure.keyvault.certificates.models.CertificateOperation
:raises: ~azure.core.exceptions.HttpResponseError
"""
Expand All @@ -797,10 +768,10 @@ 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 str name: The name of the certificate
:param custom_headers: headers that will be added to the request
:type custom_headers: dict
:type custom_headers: dict[str, str]
:return: Base64 encoded pending certificate signing request (PKCS-10).
:rtype: str
:raises: ~azure.core.exceptions.HttpResponseError
Expand Down Expand Up @@ -864,13 +835,14 @@ async def merge_certificate(

Performs the merging of a certificate or certificate chain with a key pair currently
available in the service. This operation requires the certificates/create permission.
Make sure when creating the certificate to merge using create_certificate that you set
it's issuer to 'Unknown'. This way Key Vault knows that the certificate will not be signed
by an issuer known to it.

:param name: The name of the certificate
:type name: str
:param str name: The name of the certificate
:param x509_certificates: The certificate or the certificate chain to merge.
:type x509_certificates: list[bytearray]
:param enabled: Determines whether the object is enabled.
:type enabled: bool
: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]
:return: The merged certificate operation
Expand Down Expand Up @@ -900,8 +872,7 @@ async def get_issuer(self, name: str, **kwargs: "**Any") -> Issuer:
Returns the specified certificate issuer resources in the key vault.
This operation requires the certificates/manageissuers/getissuers permission.

:param name: The name of the issuer.
:type name: str
:param str name: The name of the issuer.
:return: The specified certificate issuer.
:rtype: ~azure.keyvault.certificates.models.Issuer
:raises: ~azure.core.exceptions.HttpResponseError
Expand Down Expand Up @@ -939,20 +910,14 @@ async def create_issuer(
certificate issuer. This operation requires the certificates/setissuers
permission.

:param name: The name of the issuer.
:type name: str
:param provider: The issuer provider.
:type provider: str
:param account_id: The user name/account name/account id.
:type account_id: str
:param password: The password/secret/account key.
:type password: str
:param organization_id: Id of the organization.
:type organization_id: str
:param str name: The name of the issuer.
:param str provider: The issuer provider.
:param str account_id: The user name/account name/account id.
:param str password: The password/secret/account key.
:param str organization_id: Id of the organization.
:param admin_details: Details of the organization administrators of the certificate issuer.
:type admin_details: ~azure.keyvault.certificates.models.AdministratorDetails
:param enabled: Determines whether the object is enabled.
:type enabled: bool
:param bool enabled: Determines whether the object is enabled.
:returns: The created Issuer
:rtype: ~azure.keyvault.certificates.models.Issuer
:raises: ~azure.core.exceptions.HttpResponseError
Expand Down Expand Up @@ -1015,33 +980,19 @@ 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.

:param name: The name of the issuer.
:type name: str
:param provider: The issuer provider.
:type provider: str
:param account_id: The username / account name / account key.
:type account_id: str
:param password: The password / secret / account key.
:type password: str
:param organization_id: Id of the organization
:type organization_id: str
This operation requires the certificates/setissuers permission.

:param str name: The name of the issuer.
:param str provider: The issuer provider.
:param str account_id: The username / account name / account key.
:param str password: The password / secret / account key.
:param str organization_id: Id of the organization
:param admin_details: Details of the organization administrators of the certificate issuer.
:type admin_details: ~azure.keyvault.certificates.models.AdministratorDetails
:param enabled: Determines whether the issuer is enabled.
:type enabled: bool
:param bool enabled: Determines whether the issuer is enabled.
: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 Expand Up @@ -1085,8 +1036,7 @@ async def delete_issuer(self, name: str, **kwargs: "**Any") -> Issuer:
Permanently removes the specified certificate issuer from the vault.
This operation requires the certificates/manageissuers/deleteissuers permission.

:param name: The name of the issuer.
:type name: str
:param str name: The name of the issuer.
:return: Issuer
:rtype: ~azure.keyvault.certificates.models.Issuer
:raises: ~azure.core.exceptions.HttpResponseError
Expand Down
Loading