async def get_issuer(self, name: str, **kwargs: "**Any") -> Issuer: """Gets the specified certificate issuer. Returns the specified certificate issuer resources in the key vault. This operation requires the certificates/manageissuers/getissuers permission. :param str name: The name of the issuer. :return: The specified certificate issuer. :rtype: ~azure.keyvault.certificates.models.Issuer :raises: :class:`~azure.core.exceptions.ResourceNotFoundError` if the issuer doesn't exist, :class:`~azure.core.exceptions.HttpResponseError` for other errors Example: .. literalinclude:: ../tests/test_examples_certificates_async.py :start-after: [START get_issuer] :end-before: [END get_issuer] :language: python :caption: Get an issuer :dedent: 8 """ issuer_bundle = await self._client.get_certificate_issuer( vault_base_url=self.vault_endpoint, issuer_name=name, error_map=_error_map, **kwargs) return Issuer._from_issuer_bundle(issuer_bundle=issuer_bundle)
async def delete_issuer(self, name: str, **kwargs: "**Any") -> Issuer: """Deletes the specified certificate issuer. Permanently removes the specified certificate issuer from the vault. This operation requires the certificates/manageissuers/deleteissuers permission. :param str name: The name of the issuer. :return: Issuer :rtype: ~azure.keyvault.certificates.models.Issuer :raises: :class:`~azure.core.exceptions.HttpResponseError` Example: .. literalinclude:: ../tests/test_examples_certificates_async.py :start-after: [START delete_issuer] :end-before: [END delete_issuer] :language: python :caption: Delete an issuer :dedent: 8 """ issuer_bundle = await self._client.delete_certificate_issuer( vault_base_url=self.vault_url, issuer_name=name, **kwargs ) return Issuer._from_issuer_bundle(issuer_bundle=issuer_bundle)
async def update_issuer(self, name: str, provider: Optional[str] = None, account_id: Optional[str] = None, password: Optional[str] = None, organization_id: Optional[str] = None, admin_details: Optional[ List[AdministratorDetails]] = None, **kwargs: "**Any") -> Issuer: """Updates the specified certificate issuer. Performs an update on the specified certificate issuer entity. 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: list[~azure.keyvault.certificates.models.AdministratorDetails] :return: The updated issuer :rtype: ~azure.keyvault.certificates.models.Issuer :raises: :class:`~azure.core.exceptions.HttpResponseError` Keyword arguments - *enabled (bool)* - Determines whether the object is enabled. """ enabled = kwargs.pop("enabled", None) if account_id or password: issuer_credentials = self._client.models.IssuerCredentials( account_id=account_id, password=password) else: issuer_credentials = None if admin_details and admin_details[0]: admin_details_to_pass = list( self._client.models.AdministratorDetails( first_name=admin_detail.first_name, last_name=admin_detail.last_name, email_address=admin_detail.email, phone=admin_detail.phone, ) for admin_detail in admin_details) else: admin_details_to_pass = admin_details if organization_id or admin_details: organization_details = self._client.models.OrganizationDetails( id=organization_id, admin_details=admin_details_to_pass) else: organization_details = None if enabled is not None: issuer_attributes = self._client.models.IssuerAttributes( enabled=enabled) else: issuer_attributes = None issuer_bundle = await self._client.update_certificate_issuer( vault_base_url=self.vault_endpoint, issuer_name=name, provider=provider, credentials=issuer_credentials, organization_details=organization_details, attributes=issuer_attributes, **kwargs) return Issuer._from_issuer_bundle(issuer_bundle=issuer_bundle)
async def create_issuer(self, name: str, provider: str, account_id: Optional[str] = None, password: Optional[str] = None, organization_id: Optional[str] = None, admin_details: Optional[ List[AdministratorDetails]] = None, **kwargs: "**Any") -> Issuer: """Sets the specified certificate issuer. The SetCertificateIssuer operation adds or updates the specified certificate issuer. 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 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: list[~azure.keyvault.certificates.models.AdministratorDetails] :returns: The created Issuer :rtype: ~azure.keyvault.certificates.models.Issuer :raises: :class:`~azure.core.exceptions.HttpResponseError` Keyword arguments - *enabled (bool)* - Determines whether the object is enabled. Example: .. literalinclude:: ../tests/test_examples_certificates_async.py :start-after: [START create_issuer] :end-before: [END create_issuer] :language: python :caption: Create an issuer :dedent: 8 """ enabled = kwargs.pop("enabled", None) if account_id or password: issuer_credentials = self._client.models.IssuerCredentials( account_id=account_id, password=password) else: issuer_credentials = None if admin_details and admin_details[0]: admin_details_to_pass = list( self._client.models.AdministratorDetails( first_name=admin_detail.first_name, last_name=admin_detail.last_name, email_address=admin_detail.email, phone=admin_detail.phone, ) for admin_detail in admin_details) else: admin_details_to_pass = admin_details if organization_id or admin_details: organization_details = self._client.models.OrganizationDetails( id=organization_id, admin_details=admin_details_to_pass) else: organization_details = None if enabled is not None: issuer_attributes = self._client.models.IssuerAttributes( enabled=enabled) else: issuer_attributes = None issuer_bundle = await self._client.set_certificate_issuer( vault_base_url=self.vault_endpoint, issuer_name=name, provider=provider, credentials=issuer_credentials, organization_details=organization_details, attributes=issuer_attributes, **kwargs) return Issuer._from_issuer_bundle(issuer_bundle=issuer_bundle)